/* ============================================================
   Cecelia Margules — main.css
   Dark, colorful editorial portfolio. Warm terracotta + teal.
   ============================================================ */

:root {
  --bg:         #100e0a;   /* deep warm black */
  --bg-2:       #1a1712;   /* panels / cards */
  --bg-3:       #231e16;   /* inputs / thumbs */
  --text:       #f3ead8;   /* cream */
  --text-soft:  rgba(243,234,216,.74);
  --muted:      rgba(243,234,216,.5);
  --line:       rgba(243,234,216,.13);
  --line-2:     rgba(243,234,216,.24);

  --terra:      #e3894a;   /* terracotta */
  --terra-deep: #b4541f;
  --teal:       #46b5a4;   /* teal */
  --gold:       #d8af5e;   /* gold */

  /* aliases kept for shared components */
  --ink:        #100e0a;
  --paper:      #f3ead8;
  --accent:       #e3894a;
  --accent-light: #f0a368;
  --accent-2:     #46b5a4;

  --max:        1200px;
  --gutter:     clamp(1.25rem, 5vw, 5rem);

  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;

  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Animated ambient background (behind every section) ---------- */
body::before {
  content: ""; position: fixed; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 38% at 16% 26%, rgba(227,137,74,.22), transparent 60%),
    radial-gradient(36% 36% at 84% 16%, rgba(70,181,164,.18), transparent 60%),
    radial-gradient(44% 44% at 68% 84%, rgba(216,175,94,.14), transparent 62%),
    radial-gradient(34% 34% at 38% 64%, rgba(180,84,31,.18), transparent 62%);
  animation: bgDrift 28s ease-in-out infinite alternate;
}
@keyframes bgDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(3%, -2.5%, 0) scale(1.12) rotate(2deg); }
  100% { transform: translate3d(-2.5%, 3%, 0) scale(1.06) rotate(-2deg); }
}

/* Film grain over the whole site */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Animated divider between sections ---------- */
.divider {
  position: relative; height: 1px; max-width: var(--max); margin: 0 auto; overflow: visible;
  background: linear-gradient(90deg, transparent, var(--line-2) 22%, var(--terra) 50%, var(--line-2) 78%, transparent);
}
.divider::after {
  content: ""; position: absolute; top: -1.5px; left: 0; width: 96px; height: 4px; border-radius: 4px;
  background: radial-gradient(closest-side, var(--gold), transparent 80%); filter: blur(1px);
  animation: dividerGlow 7s linear infinite;
}
@keyframes dividerGlow {
  0%   { left: -96px; opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 200;
  background: linear-gradient(90deg, var(--terra), var(--gold)); transition: width .1s linear;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--gutter);
  transition: background .4s var(--ease), padding .4s var(--ease), box-shadow .4s var(--ease);
}
.nav.is-scrolled {
  background: rgba(16, 14, 10, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding-top: .8rem; padding-bottom: .8rem;
  box-shadow: 0 1px 0 var(--line);
}
/* While the mobile menu is open, remove the nav's backdrop-filter. A filtered
   ancestor becomes the containing block for its fixed children, which clipped
   the full-screen overlay to the nav bar on reopen (cut off at top, no bg). */
.nav.is-open {
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}
/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: baseline; gap: .26rem; font-family: var(--font-display); white-space: nowrap; line-height: 1; }
.logo__first { font-weight: 400; font-size: 1.42rem; letter-spacing: -0.02em; color: var(--text); transition: color .35s var(--ease); }
.logo__last  { font-weight: 400; font-style: italic; font-size: 1.42rem; letter-spacing: -0.02em; color: var(--terra); transition: color .35s var(--ease); }
.logo:hover .logo__last { color: var(--gold); }

.nav__links { display: flex; gap: 2rem; }
.nav__links a {
  font-size: .9rem; font-weight: 500; position: relative; padding: .2rem 0; color: var(--text-soft);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--terra); transition: width .3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }
.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: .4rem; }
.nav__toggle span { width: 24px; height: 2px; background: var(--text); transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav.is-open .nav__toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav.is-open .nav__toggle span:last-child  { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: .95rem; padding: .85rem 1.6rem;
  border-radius: 100px; transition: transform .25s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, var(--terra), var(--gold)); transform: translateY(102%);
  transition: transform .45s var(--ease);
}
.btn:hover { transform: translateY(-2px); color: #1a1208; }
.btn:hover::before { transform: translateY(0); }
.btn--solid { background: var(--text); color: var(--bg); }
.btn--ghost { border: 1px solid rgba(243,234,216,.45); color: var(--text); background: transparent; }

/* ---------- Sections ---------- */
.section { padding: clamp(4.5rem, 12vw, 9rem) var(--gutter); max-width: var(--max); margin: 0 auto; }
.section__head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); position: relative; }
.section__index {
  font-family: var(--font-body); font-size: .78rem; font-weight: 600;
  letter-spacing: .25em; color: var(--terra); display: inline-flex; align-items: center; gap: .7rem;
  margin-bottom: .8rem; position: relative; z-index: 1;
}
.section__index::before { content: ""; width: 30px; height: 1px; background: linear-gradient(90deg, var(--terra), transparent); }
.section__title, .section__sub { position: relative; z-index: 1; }
/* Oversized outlined number watermark */
.section__num {
  position: absolute; top: -.35em; right: 0; z-index: 0; pointer-events: none;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(5rem, 13vw, 10rem);
  line-height: .8; color: transparent; -webkit-text-stroke: 1px var(--line-2); opacity: .7;
}
@media (max-width: 640px) { .section__num { display: none; } }
.section__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.05; letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--text) 38%, var(--terra) 68%, var(--gold) 96%);
  background-size: 220% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: titleSheen 9s ease-in-out infinite alternate; width: fit-content;
}
@keyframes titleSheen { from { background-position: 0% center; } to { background-position: 100% center; } }
.section__sub { color: var(--muted); margin-top: .9rem; max-width: 42ch; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding: 7rem var(--gutter) 3rem; position: relative; overflow: hidden; background: #0c0b08;
}
.hero__inner { position: relative; z-index: 2; width: 100%; max-width: var(--max); margin: 0 auto; }
.hero__bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #0c0b08; }
.hero__montage { position: absolute; inset: 0; z-index: 0; }
.hero__video {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.2s var(--ease);
  filter: blur(7px) saturate(1.05) brightness(.9); transform: scale(1.08); pointer-events: none;
}
.hero__video.is-ready { opacity: 1; }
.hero__bg-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; will-change: opacity, transform; animation: heroMontage 42s infinite;
}
.hero__bg-slide:nth-child(1) { animation-delay: 0s; }
.hero__bg-slide:nth-child(2) { animation-delay: 7s; }
.hero__bg-slide:nth-child(3) { animation-delay: 14s; }
.hero__bg-slide:nth-child(4) { animation-delay: 21s; }
.hero__bg-slide:nth-child(5) { animation-delay: 28s; }
.hero__bg-slide:nth-child(6) { animation-delay: 35s; }
@keyframes heroMontage {
  0%   { opacity: 0; transform: scale(1.08); }
  3%   { opacity: 1; }
  14%  { opacity: 1; transform: scale(1.16); }
  18%  { opacity: 0; transform: scale(1.18); }
  100% { opacity: 0; transform: scale(1.08); }
}
.hero__scrim {
  position: absolute; inset: 0; z-index: 3;
  background:
    linear-gradient(180deg, rgba(12,11,8,.55) 0%, rgba(12,11,8,.30) 38%, rgba(16,14,10,.85) 100%),
    radial-gradient(90% 70% at 50% 38%, transparent 42%, rgba(12,11,8,.55));
}
@media (prefers-reduced-motion: reduce) {
  .hero__bg-slide { animation: none; opacity: 0; }
  .hero__bg-slide:first-child { opacity: 1; }
}
.hero__eyebrow {
  font-size: .85rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-light); margin-bottom: 1.4rem;
}
.hero__title {
  font-family: var(--font-display); font-weight: 300; color: var(--paper);
  font-size: clamp(3.2rem, 15vw, 11rem); line-height: .92; letter-spacing: -0.03em;
  display: flex; flex-direction: column; text-shadow: 0 2px 30px rgba(0,0,0,.35);
}
.hero__title--accent { font-style: italic; font-weight: 400; color: var(--accent-light); }
.hero__lede {
  margin-top: 1.8rem; font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  max-width: 32ch; color: rgba(243,234,216,.92); line-height: 1.45;
}
.hero__actions { margin-top: 2.4rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.hero__scroll {
  position: absolute; bottom: 2rem; left: var(--gutter); z-index: 2;
  display: flex; align-items: center; gap: .8rem; color: rgba(243,234,216,.7); font-size: .8rem;
  letter-spacing: .15em; text-transform: uppercase;
}
.hero__scroll-line { width: 48px; height: 1px; background: rgba(243,234,216,.4); position: relative; overflow: hidden; }
.hero__scroll-line::after {
  content: ""; position: absolute; inset: 0; background: var(--terra);
  transform: translateX(-100%); animation: scrollLine 2.4s var(--ease) infinite;
}
@keyframes scrollLine { 0% { transform: translateX(-100%);} 60%,100% { transform: translateX(100%);} }

/* ---------- About ---------- */
.about__grid {
  display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 6vw, 5rem); align-items: start;
}
.about__portrait {
  position: sticky; top: 6rem; aspect-ratio: 4/5; border-radius: 10px; background: transparent;
  animation: floatY 7s ease-in-out infinite;
}
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.about__portrait::before {
  content: ""; position: absolute; inset: -18%; z-index: 0; pointer-events: none; border-radius: 50%;
  background:
    radial-gradient(52% 52% at 44% 34%, rgba(227,137,74,.45), transparent 70%),
    radial-gradient(55% 55% at 68% 86%, rgba(70,181,164,.34), transparent 72%);
  filter: blur(30px); animation: bgDrift 20s ease-in-out infinite alternate;
}
.about__portrait img {
  position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: 72% center;
  border-radius: 10px;
  -webkit-mask-image: radial-gradient(140% 120% at 55% 40%, #000 72%, transparent 100%);
  mask-image: radial-gradient(140% 120% at 55% 40%, #000 72%, transparent 100%);
}
.about__portrait-fallback {
  position: absolute; inset: 0; z-index: 1; display: none; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 4rem; color: var(--line-2);
}
.about__portrait--empty img { display: none; }
.about__portrait--empty .about__portrait-fallback { display: flex; }
.about__lead {
  font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.25; font-weight: 400; margin-bottom: 1.5rem; letter-spacing: -0.01em; color: var(--text);
}
.about__body p { color: var(--text-soft); margin-bottom: 1.1rem; max-width: 56ch; }
.about__facts {
  list-style: none; margin-top: 2.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  border-top: 1px solid var(--line); padding-top: 2rem;
}
.about__facts li { display: flex; flex-direction: column; gap: .2rem; }
.about__facts strong { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; color: var(--text); }
.about__facts span { color: var(--muted); font-size: .9rem; }

/* ---------- Work gallery (masonry via columns) ---------- */
.gallery { columns: 3 240px; column-gap: 1rem; }
.gallery__item {
  break-inside: avoid; margin-bottom: 1rem; border-radius: 6px; overflow: hidden;
  background: var(--bg-2); cursor: pointer; position: relative; display: block;
}
.gallery__item img {
  width: 100%; height: auto; display: block;
  filter: saturate(.92) brightness(.92);
  transition: transform .7s var(--ease), filter .5s var(--ease);
}
.gallery__item::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .35s var(--ease);
  background: linear-gradient(120deg, rgba(180,84,31,.32), rgba(31,90,82,.32));
}
.gallery__item:hover img { transform: scale(1.07); filter: saturate(1.1) brightness(1.04); }
.gallery__item:hover::after { opacity: 1; }
.gallery__zoom {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.7);
  width: 48px; height: 48px; border-radius: 50%; background: rgba(243,234,216,.95);
  z-index: 2; pointer-events: none; opacity: 0;
  transition: opacity .35s var(--ease), transform .4s var(--ease);
}
.gallery__zoom::before, .gallery__zoom::after {
  content: ""; position: absolute; top: 50%; left: 50%; background: var(--bg); border-radius: 1px;
}
.gallery__zoom::before { width: 16px; height: 2px; transform: translate(-50%, -50%); }
.gallery__zoom::after  { width: 2px; height: 16px; transform: translate(-50%, -50%); }
.gallery__item:hover .gallery__zoom { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.gallery__caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem; z-index: 1;
  color: #fff; font-size: .85rem; font-weight: 500;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  opacity: 0; transform: translateY(8px); transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.gallery__item:hover .gallery__caption { opacity: 1; transform: translateY(0); }

/* ---------- Video (filterable) ---------- */
.video__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-bottom: 1.2rem; }
.video__search {
  flex: 0 0 auto; min-width: 220px; font-family: var(--font-body); font-size: .95rem;
  padding: .6rem 1rem; border: 1px solid var(--line-2); border-radius: 100px; background: var(--bg-3);
  color: var(--text); transition: border-color .25s var(--ease);
}
.video__search::placeholder { color: var(--muted); }
.video__search:focus { outline: none; border-color: var(--terra); }
.video__filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.vchip {
  font-family: var(--font-body); font-size: .82rem; font-weight: 500; cursor: pointer;
  padding: .42rem .9rem; border-radius: 100px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text-soft);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.vchip:hover { border-color: var(--terra); color: var(--text); }
.vchip.is-active { background: linear-gradient(100deg, var(--terra), var(--gold)); color: #1a1208; border-color: transparent; }
.video__count { color: var(--muted); font-size: .85rem; margin-bottom: 1.4rem; }
.vempty { color: var(--muted); font-style: italic; grid-column: 1 / -1; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }

.vcard {
  cursor: pointer; border-radius: 8px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.vcard:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(227,137,74,.20); border-color: var(--line-2); }
.vcard:focus-visible { outline: 2px solid var(--terra); outline-offset: 3px; }
.vcard__thumb { display: block; position: relative; aspect-ratio: 16/9; background-size: cover; background-position: center; background-color: var(--bg-3); }
.vcard__thumb::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s var(--ease);
  background: linear-gradient(120deg, rgba(180,84,31,.30), rgba(31,90,82,.30));
}
.vcard:hover .vcard__thumb::after { opacity: 1; }
.vcard__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 54px; height: 54px; border-radius: 50%; background: rgba(16,14,10,.6);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  display: grid; place-items: center; transition: background .3s var(--ease), transform .3s var(--ease);
}
.vcard__play::before {
  content: ""; border-style: solid; border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff; margin-left: 3px;
}
.vcard:hover .vcard__play { background: var(--terra); transform: translate(-50%, -50%) scale(1.08); }
.vcard__meta { display: flex; flex-direction: column; gap: .2rem; padding: .85rem 1rem 1rem; }
.vcard__row { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; }
.vcard__title { font-weight: 500; font-size: .95rem; line-height: 1.3; color: var(--text); }
.vcard__year { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.vcard__artist { color: var(--terra); font-size: .8rem; font-weight: 500; }
.vcard__frame { display: block; position: relative; aspect-ratio: 16/9; }
.vcard__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Contact ---------- */
.contact {
  max-width: none; position: relative; overflow: hidden; color: var(--text);
  background: radial-gradient(120% 90% at 50% 0%, #1e160d 0%, var(--bg) 72%);
  border-top: 1px solid var(--line);
  padding-top: clamp(3.5rem, 8vw, 6rem); padding-bottom: clamp(3.5rem, 8vw, 6rem);
}
.contact::before {
  content: ""; position: absolute; inset: -30%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 40% at 26% 28%, rgba(227,137,74,.28), transparent 60%),
    radial-gradient(38% 38% at 78% 74%, rgba(70,181,164,.24), transparent 60%);
  animation: bgDrift 24s ease-in-out infinite alternate;
}
.contact__inner {
  position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; text-align: left;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 6vw, 5rem); align-items: center;
}
.contact__head { display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; }
.contact .section__index { margin: 0; justify-content: flex-start; }
.contact__title {
  font-family: var(--font-display); font-weight: 300; margin: 0;
  font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--text) 40%, var(--terra) 75%, var(--gold) 100%);
  background-size: 220% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: titleSheen 9s ease-in-out infinite alternate; display: inline-block;
}
.contact__sub { color: var(--text-soft); font-size: 1.05rem; margin: 0 0 1.5rem; max-width: 42ch; }
.contact__email {
  font-family: var(--font-display); font-style: italic; font-size: clamp(1.3rem, 4vw, 2.2rem);
  color: var(--text); border-bottom: 1px solid rgba(243,234,216,.35); padding-bottom: .2rem;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.contact__email:hover { color: var(--terra); border-color: var(--terra); }

/* ---------- Footer ---------- */
.footer { background: #0b0a07; color: rgba(243,234,216,.6); border-top: 1px solid var(--line); }
.footer__inner {
  max-width: var(--max); margin: 0 auto; padding: 2.4rem var(--gutter);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.4rem 2rem; font-size: .85rem;
}
.footer__copy { justify-self: start; }
.footer__credit {
  justify-self: center; display: inline-flex; flex-direction: column; align-items: center; gap: .45rem; text-align: center;
  color: rgba(243,234,216,.45); font-size: .65rem; letter-spacing: .18em; text-transform: uppercase; transition: color .3s var(--ease);
}
.footer__credit img { height: 30px; width: auto; opacity: .85; transition: opacity .3s var(--ease); }
.footer__credit:hover { color: rgba(243,234,216,.75); }
.footer__credit:hover img { opacity: 1; }
.footer__top { justify-self: end; color: rgba(243,234,216,.6); transition: color .3s var(--ease); }
.footer__top:hover { color: var(--terra); }
@media (max-width: 640px) {
  .footer__inner { grid-template-columns: 1fr; justify-items: center; gap: 1.4rem; text-align: center; }
  .footer__copy, .footer__top { justify-self: center; }
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); z-index: 90;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--text); color: var(--bg); display: grid; place-items: center;
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
  transition: opacity .35s var(--ease), transform .35s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--terra); color: #fff; transform: translateY(-3px); }
.to-top::before {
  content: ""; width: 10px; height: 10px; margin-top: 3px;
  border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(-45deg);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(10,9,6,.95);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility .35s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__img { max-width: 90vw; max-height: 85vh; border-radius: 4px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lightbox__close, .lightbox__nav {
  position: absolute; background: rgba(255,255,255,.08); color: #fff; border: 0; cursor: pointer;
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background .25s var(--ease);
}
.lightbox__close:hover, .lightbox__nav:hover { background: var(--terra); }
.lightbox__close { top: 1.5rem; right: 1.5rem; }
.lightbox__nav--prev { left: 1.5rem; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 1.5rem; top: 50%; transform: translateY(-50%); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  /* Frosted-glass full-screen menu (centered, with divider lines) */
  .nav__links {
    position: fixed; inset: 0; z-index: 100;
    display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 0;
    padding: 6rem clamp(1.5rem, 9vw, 3.5rem) 4rem;
    background: rgba(16, 14, 11, 0.82);
    -webkit-backdrop-filter: blur(22px) saturate(125%); backdrop-filter: blur(22px) saturate(125%);
    opacity: 0; pointer-events: none; transform: translateY(-10px);
    transition: opacity .4s var(--ease), transform .5s var(--ease);
  }
  .nav.is-open .nav__links { opacity: 1; pointer-events: auto; transform: none; }
  .nav__links a {
    font-family: var(--font-display); font-weight: 300; letter-spacing: -0.01em;
    font-size: clamp(1.9rem, 8.5vw, 2.7rem); color: var(--text);
    text-align: center; width: 100%; padding: 1.15rem 0;
    border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(14px);
    transition: opacity .5s var(--ease), transform .5s var(--ease), color .3s var(--ease);
  }
  .nav__links a:first-child { border-top: 1px solid var(--line); }
  .nav__links a::after { display: none; }
  .nav__links a:hover, .nav__links a:active { color: var(--terra); }
  .nav.is-open .nav__links a { opacity: 1; transform: none; }
  .nav.is-open .nav__links a:nth-child(1) { transition-delay: .06s; }
  .nav.is-open .nav__links a:nth-child(2) { transition-delay: .11s; }
  .nav.is-open .nav__links a:nth-child(3) { transition-delay: .16s; }
  .nav.is-open .nav__links a:nth-child(4) { transition-delay: .21s; }
  .nav.is-open .nav__links a:nth-child(5) { transition-delay: .26s; }
  .nav__toggle { display: flex; z-index: 101; }

  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { position: relative; top: 0; max-width: 340px; }
  .gallery { columns: 2 160px; }
  .contact__inner { grid-template-columns: 1fr; gap: 1.8rem; }
}
@media (max-width: 480px) {
  .about__facts { grid-template-columns: 1fr; }
  .hero__scroll { display: none; }
}
