/* =========================================================
   Generous Hand Organization — base styles
   Tokens, reset, typography, buttons, nav, overlays
   Layout idea: deep-indigo night bands carry a fixed 3D particle
   sculpture in the brand violet, teal and gold; paper bands carry
   the photos and the story.
   ========================================================= */

:root {
  --night: #120E25;
  --night-2: #1A1534;
  --glass: rgba(30, 24, 60, .66);
  --paper: #F6F4FA;
  --paper-2: #ECE8F5;
  --ink: #1D1838;
  --ink-soft: #5A5474;
  --cream: #F3F0FA;
  --muted: #ABA5C8;
  --line: rgba(243, 240, 250, .12);
  --line-strong: rgba(243, 240, 250, .26);
  --line-ink: rgba(29, 24, 56, .12);
  --violet: #7B4FD0;
  --violet-deep: #5B3A9A;
  --teal: #14A9A4;
  --gold: #F4B12E;
  --coral: #F0766A;
  --lilac: #B48AF0;
  --wa: #25D366;

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gut-l: max(20px, env(safe-area-inset-left, 0px));
  --gut-r: max(20px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--gold); color: var(--night); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100;
  font-weight: 600;
  text-wrap: balance;
  margin: 0;
}
em { font-style: italic; font-weight: 500; }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  padding-left: var(--gut-l);
  padding-right: var(--gut-r);
}
.wrap-any { word-break: break-word; }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--ink); padding: 10px 16px; border-radius: 10px;
  font-weight: 700; text-decoration: none; transition: top .3s;
}
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

/* ---------- Fixed layers ---------- */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.atmo {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(55% 45% at 80% 15%, rgba(123, 79, 208, .30), transparent 70%),
    radial-gradient(45% 40% at 5% 85%, rgba(20, 169, 164, .18), transparent 70%);
}
main, footer, header.nav { position: relative; z-index: 2; }
.progress {
  position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 40;
  transform-origin: left; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--violet), var(--teal), var(--gold));
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 90; background: var(--night);
  display: grid; place-items: center;
  transition: opacity .9s var(--ease), visibility .9s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader img { width: 96px; height: auto; animation: beat 1.2s var(--ease) both; }
@keyframes beat { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }

/* ---------- Buttons ---------- */
.btn {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: .95rem; line-height: 1.2; text-align: center;
  padding: 13px 22px; border-radius: 999px;
  transition: transform .4s var(--ease), background .25s, color .25s, border-color .25s, box-shadow .3s;
}
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 10px 30px -12px rgba(244, 177, 46, .7); }
.btn-gold:hover { background: #FFC14A; }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--cream); }
.btn-ghost:hover { border-color: var(--cream); }
.btn-ink { background: var(--ink); color: var(--cream); }
.btn-ink:hover { background: var(--violet-deep); }
.btn .arr { display: inline-block; transition: transform .35s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

.icon-btn {
  all: unset; cursor: pointer; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--line-strong);
  transition: background .25s, color .25s, border-color .25s;
}
@media (hover: hover) { .icon-btn:hover { background: var(--cream); color: var(--night); } }
.icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.icon-btn svg { width: 18px; height: 18px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .74rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.light .eyebrow { color: var(--violet-deep); }
.eyebrow.on-color { color: #fff; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .84rem; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--cream);
}
.chip svg { width: 14px; height: 14px; }

/* ---------- Nav ---------- */
header.nav { position: fixed; left: 0; right: 0; top: 0; z-index: 30; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.bar {
  display: flex; align-items: center; gap: 22px;
  padding: 8px 8px 8px 12px; border-radius: 999px; border: 1px solid transparent;
  transition: background .4s, border-color .4s;
}
.nav.solid .bar, .menu-open .bar {
  background: rgba(18, 14, 37, .74);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-color: var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; min-width: 0; }
.brand img { width: 38px; height: 38px; object-fit: contain; flex: none; }
.brand b { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: 1.18rem; line-height: 1; white-space: nowrap; }
.brand b span { color: var(--gold); font-weight: 500; }
.nav nav { display: flex; gap: 24px; font-size: .9rem; color: var(--muted); }
.nav nav a { text-decoration: none; transition: color .2s; position: relative; }
.nav nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav nav a:hover, .nav nav a.active { color: var(--cream); }
.nav nav a:hover::after, .nav nav a.active::after { transform: scaleX(1); }
.nav-cta { padding: 10px 18px; font-size: .88rem; }

.menu-btn {
  all: unset; cursor: pointer; display: none; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-strong); position: relative; flex: none;
}
.menu-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.menu-btn span {
  position: absolute; left: 13px; right: 13px; height: 1.6px; background: var(--cream); border-radius: 2px;
  transition: transform .4s var(--ease), top .4s var(--ease);
}
.menu-btn span:nth-child(1) { top: 18px; }
.menu-btn span:nth-child(2) { top: 25px; }
.menu-open .menu-btn span:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { top: 21.5px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 25; background: var(--night);
  padding: calc(100px + env(safe-area-inset-top, 0px)) var(--gut-r) calc(30px + env(safe-area-inset-bottom, 0px)) var(--gut-l);
  display: flex; flex-direction: column; justify-content: space-between; gap: 30px;
  opacity: 0; transition: opacity .4s var(--ease);
}
.menu.on { opacity: 1; }
.menu nav { display: grid; gap: 6px; }
.menu nav a {
  font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 600;
  font-size: clamp(2rem, 9vw, 3rem); line-height: 1.15; text-decoration: none;
  opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .5s var(--ease), color .2s;
}
.menu.on nav a { opacity: 1; transform: none; }
.menu nav a:hover { color: var(--gold); }
.menu-open .fabs { opacity: 0; pointer-events: none; }
.fabs { transition: opacity .3s; }
.menu-foot { display: grid; gap: 12px; color: var(--muted); font-size: .9rem; word-break: break-word; }

/* ---------- Floating buttons & toast ---------- */
.fabs {
  position: fixed; z-index: 35; display: grid; gap: 12px; justify-items: center;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}
.fab {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: var(--wa); color: #fff; box-shadow: 0 14px 30px -10px rgba(37, 211, 102, .7);
  transition: transform .4s var(--ease);
}
.fab:hover { transform: scale(1.08); }
.fab svg { width: 28px; height: 28px; }
.fab::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--wa);
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping { from { transform: scale(1); opacity: .8; } to { transform: scale(1.7); opacity: 0; } }
.totop {
  all: unset; cursor: pointer; width: 48px; height: 48px; border-radius: 50%; position: relative;
  display: grid; place-items: center; background: rgba(18, 14, 37, .8); color: var(--cream);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.totop.on { opacity: 1; transform: none; pointer-events: auto; }
.totop:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.totop > svg:last-child { width: 18px; height: 18px; }
.totop .ring { position: absolute; inset: 0; width: 48px; height: 48px; transform: rotate(-90deg); }
.totop .ring circle { fill: none; stroke: var(--line-strong); stroke-width: 2.5; }
.totop .ring circle#ring { stroke: var(--gold); stroke-dasharray: 132; stroke-dashoffset: 132; stroke-linecap: round; }

.toast {
  position: fixed; left: 50%; z-index: 95; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--cream); color: var(--ink); font-weight: 600; font-size: .92rem;
  padding: 12px 18px; border-radius: 999px; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .6);
  transition: opacity .35s var(--ease), transform .35s var(--ease); max-width: calc(100% - 40px); text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 85; background: rgba(10, 8, 22, .95);
  display: grid; grid-template-rows: 1fr auto;
  padding: calc(20px + env(safe-area-inset-top, 0px)) var(--gut-r) calc(20px + env(safe-area-inset-bottom, 0px)) var(--gut-l);
  opacity: 0; transition: opacity .4s var(--ease);
}
.lb.on { opacity: 1; }
.lb .stage-img { display: grid; place-items: center; min-height: 0; position: relative; touch-action: pan-y; }
.lb img {
  max-height: calc(100vh - 140px); max-height: calc(100svh - 140px); max-width: 100%;
  border-radius: 14px; object-fit: contain; transform: scale(.96); transition: transform .5s var(--ease), opacity .3s;
}
.lb.on img { transform: none; }
.lb .bar2 { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 14px; color: var(--cream); }
.lb .bar2 p { margin: 0; font-size: .95rem; color: var(--muted); min-width: 0; }
.lb .ctrl { display: flex; gap: 8px; flex: none; }
.lb .icon-btn { color: var(--cream); }

/* ---------- Cursor ---------- */
.cursor {
  position: fixed; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  border: 1.5px solid var(--gold); z-index: 99; pointer-events: none; opacity: 0;
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background .3s, opacity .3s;
}
.cursor.big { width: 72px; height: 72px; margin: -36px 0 0 -36px; background: rgba(244, 177, 46, .14); }
.cursor.view { width: 86px; height: 86px; margin: -43px 0 0 -43px; background: var(--gold); }
.cursor.view::after {
  content: "View"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: .8rem; font-weight: 700; color: var(--ink);
}
@media (pointer: fine) { .cursor { opacity: 1; } }

/* ---------- Reveal & images ----------
   Uses the separate `translate` property so it never fights
   the 3D tilt `transform` on cards. Resting floor stays visible. */
.rv { opacity: .18; translate: 0 36px; transition: opacity 1.1s var(--ease), translate 1.1s var(--ease); }
.rv.in { opacity: 1; translate: none; }
img.lz { opacity: 0; transition: opacity .7s var(--ease); }
img.lz.ok { opacity: 1; }
