/* ============================================
   TÖKI — Márton Bence | Fine Art Portfolio
   White-cube gallery aesthetic
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #ffffff;
  --color-bg-warm: #faf8f5;
  --color-text: #1a1a1a;
  --color-text-light: #6b6b6b;
  --color-accent: #f5b731;
  --color-border: #e8e4df;
  --font-serif: 'Cormorant Garamond', 'Georgia', serif;
  --font-sans: 'DM Sans', 'Helvetica Neue', sans-serif;
  --container-max: 1200px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;
  --space-2xl: 12rem;
  --nav-height: 72px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-accent);
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}


/* --- Section shared --- */
.section {
  padding: var(--space-xl) 0;
}

.section__label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
}

.section__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}


/* --- Reveal animation --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.nav--scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--color-border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 100%;
}

.nav__logo-img {
  height: 35px;
  width: auto;
  transition: opacity 0.3s ease;
}

.nav:not(.nav--scrolled) .nav__logo-img {
  filter: none; /* Removed invert because the logo is already white */
}

.nav.nav--scrolled .nav__logo-img {
  filter: brightness(0); /* Make it black when scrolled on white background */
}

.nav__links {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.nav__links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text);
  position: relative;
  padding: 4px 0;
}

.nav:not(.nav--scrolled) .nav__links a {
  color: #ffffff;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-accent);
  transition: width 0.3s ease;
}

.nav__links a:hover::after {
  width: 100%;
}

/* Mobile toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background-color: var(--color-text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav:not(.nav--scrolled) .nav__toggle span {
  background-color: #ffffff;
}

.nav__toggle.is-active span:first-child {
  transform: rotate(45deg) translate(3px, 3px);
}

.nav__toggle.is-active span:last-child {
  transform: rotate(-45deg) translate(3px, -3px);
}

@media (max-width: 768px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100dvh;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-lg);
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav__links.is-open {
    transform: translateX(0);
  }

  .nav__links a {
    font-size: 1.2rem;
    color: var(--color-text) !important;
  }
}


/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #111;
}

.hero__video-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.15) 40%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #ffffff;
}

.hero__logo {
  width: min(750px, 90vw);
  height: auto;
  margin-bottom: -1.5rem;
  animation: heroFadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.hero__subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.15em;
  opacity: 0.85;
  animation: heroFadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__scroll {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255, 255, 255, 0.6);
  animation: scrollBounce 2s ease-in-out infinite;
  transition: color 0.3s ease;
}

.hero__scroll:hover {
  color: var(--color-accent);
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}


/* ============================================
   ABOUT
   ============================================ */
.about {
  background-color: var(--color-bg);
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.about__bio {
  font-size: 1.05rem;
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
  max-width: 520px;
}

.about__bio em {
  color: var(--color-text);
  font-style: italic;
}

.about__portrait {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* CV blocks */
.about__cv {
  margin-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.about__cv-block {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-sm);
}

.about__cv-title {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: var(--space-xs);
}

.about__cv-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.about__cv-list li {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.6;
}

.about__cv-list li strong {
  color: var(--color-text);
  font-weight: 400;
}

@media (max-width: 768px) {
  .about__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .about__image {
    order: -1;
  }
}


/* ============================================
   HÉT FŐBŰN SERIES
   ============================================ */
.series {
  background-color: var(--color-bg-warm);
}

.series__header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-xl);
}

.series__latin-title {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 300;
  font-style: italic;
  color: var(--color-text-light);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.series__intro {
  font-size: 1.05rem;
  color: var(--color-text-light);
  line-height: 1.8;
  margin-bottom: var(--space-sm);
}

.series__intro:last-child {
  margin-bottom: 0;
}

.series__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}

/* Sin card */
.sin-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background-color: var(--color-bg);
}

.sin-card__image {
  overflow: hidden;
  aspect-ratio: 3 / 4;
}

.sin-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sin-card:hover .sin-card__image img {
  transform: scale(1.04);
}

.sin-card__info {
  padding: var(--space-sm) var(--space-sm) var(--space-md);
}

.sin-card__numeral {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--color-accent);
  letter-spacing: 0.1em;
}

.sin-card__name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: var(--space-xs) 0 2px;
}

.sin-card__translation {
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-style: italic;
  margin-bottom: 4px;
}

.sin-card__subject {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

@media (max-width: 480px) {
  .series__grid {
    grid-template-columns: 1fr;
  }
}


/* ============================================
   GALLERY
   ============================================ */
.gallery {
  background-color: var(--color-bg);
}

.gallery__header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}

.gallery__item {
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
}

.gallery__item--tall {
  grid-row: span 2;
  aspect-ratio: auto;
}

.gallery__item--wide {
  grid-column: span 2;
  aspect-ratio: auto;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.6s ease;
}

.gallery__item:hover img {
  transform: scale(1.03);
}

@media (max-width: 640px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery__item--tall,
  .gallery__item--wide {
    grid-row: span 1;
    grid-column: span 1;
    aspect-ratio: 1;
  }
}


/* ============================================
   CONTACT
   ============================================ */
.contact {
  background-color: var(--color-bg-warm);
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.contact__text {
  font-size: 1.05rem;
  color: var(--color-text-light);
  margin-bottom: var(--space-lg);
  max-width: 420px;
}

.contact__details {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact__details li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact__label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

.contact__details a {
  font-size: 1.1rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, color 0.3s ease;
  width: fit-content;
}

.contact__details a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.contact__form-wrap {
  width: 100%;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-form__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-form__label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

.contact-form__input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0;
  outline: none;
  transition: border-color 0.3s ease;
  -webkit-appearance: none;
}

.contact-form__input::placeholder {
  color: #b5b0a8;
}

.contact-form__input:focus {
  border-color: var(--color-accent);
}

.contact-form__textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form__submit {
  align-self: flex-start;
  padding: 14px 40px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text);
  background-color: transparent;
  border: 1px solid var(--color-text);
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.contact-form__submit:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.contact-form__success {
  font-size: 0.95rem;
  color: #2d8a4e;
  font-style: italic;
}

.contact-form__error {
  font-size: 0.95rem;
  color: #c0392b;
  font-style: italic;
}

@media (max-width: 768px) {
  .contact__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .contact__text {
    max-width: none;
  }

  .contact__details {
    align-items: center;
  }

  .contact__details li {
    align-items: center;
    text-align: center;
  }

  .contact-form__submit {
    align-self: stretch;
  }
}


/* ============================================
   CTA BANNER
   ============================================ */
.cta {
  padding: var(--space-2xl) 0;
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.cta__inner {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta__title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

.cta__text {
  font-size: 1.05rem;
  color: var(--color-text-light);
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.cta__button {
  display: inline-block;
  padding: 16px 48px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text);
  border: 1px solid var(--color-text);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.cta__button:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}


/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__copy,
.footer__note {
  font-size: 0.75rem;
  color: var(--color-text-light);
  letter-spacing: 0.05em;
}

@media (max-width: 640px) {
  .footer__inner {
    flex-direction: column;
    gap: var(--space-xs);
    text-align: center;
  }
}


/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.lightbox.is-active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.is-active .lightbox__img {
  transform: scale(1);
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 2rem;
  padding: 16px;
  transition: color 0.3s ease;
  z-index: 10;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  color: #ffffff;
}

.lightbox__close {
  top: var(--space-sm);
  right: var(--space-sm);
  font-size: 2.5rem;
  line-height: 1;
}

.lightbox__prev {
  left: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
}


/* ============================================
   SELECTION & SCROLLBAR
   ============================================ */
/* ============================================
   IMAGE LOADING
   ============================================ */
.sin-card__image img,
.gallery__item img,
.galeria-grid__item img {
  filter: blur(8px);
  transition: filter 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sin-card__image img.is-loaded,
.gallery__item img.is-loaded,
.galeria-grid__item img.is-loaded {
  filter: blur(0);
}


/* ============================================
   PAGE HEADER (subpages)
   ============================================ */
.page-header {
  padding-top: calc(var(--nav-height) + var(--space-xl));
  padding-bottom: var(--space-lg);
  background-color: var(--color-bg-warm);
  text-align: center;
}


/* ============================================
   GALÉRIA PAGE
   ============================================ */
.galeria-section {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--color-border);
}

.galeria-section:last-of-type {
  border-bottom: none;
}

.galeria-section:nth-child(even) {
  background-color: var(--color-bg-warm);
}

.galeria-section__header {
  margin-bottom: var(--space-md);
}

.galeria-section__title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 300;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.galeria-section__subtitle {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--color-text-light);
}

.galeria-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}

.galeria-grid__item {
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
}

.galeria-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.6s ease;
}

.galeria-grid__item:hover img {
  transform: scale(1.03);
}

/* Active nav link */
.nav__links a.is-active {
  color: var(--color-accent);
}

.nav__links a.is-active::after {
  width: 100%;
}

@media (max-width: 640px) {
  .galeria-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 380px) {
  .galeria-grid {
    grid-template-columns: 1fr;
  }
}


::selection {
  background-color: var(--color-accent);
  color: var(--color-text);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-light);
}
