/* ============================================================
   DriskellWritten — shared styles
   Dark, literary, minimal. "For people who don't read."
   ============================================================ */

:root{
  --bg:#060606;
  --bg-2:#0c0c0c;
  --bg-3:#121212;
  --ink:#ece9e2;
  --muted:#8b8880;
  --accent:#722F37;
  --line:rgba(236,233,226,.13);
  /* client spec: display = Aguafina Script, everything else = Inter */
  --serif:"Aguafina Script","Snell Roundhand","Brush Script MT",cursive;
  --sans:"Inter",system-ui,-apple-system,sans-serif;
  /* left safe-zone so content clears the always-visible floating nav labels */
  --rail:188px;
  --ease:cubic-bezier(.2,.7,.2,1);
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  background:var(--bg);color:var(--ink);
  font-family:var(--sans);font-size:17px;line-height:1.65;
  -webkit-font-smoothing:antialiased;overflow-x:hidden;
}
a{color:inherit;text-decoration:none}
img,video{max-width:100%;display:block}
::selection{background:var(--accent);color:#fff}

/* Aguafina Script is a flowing display face with tall ascenders + long
   descenders — give it real line-height and vertical padding so its glyphs
   never collide with the eyebrow above or the copy below. */
h1,h2,h3{font-family:var(--serif);font-weight:400;line-height:1.24;letter-spacing:0;
  padding:.26em 0 .14em}
.eyebrow{
  font-size:11px;letter-spacing:.3em;text-transform:uppercase;
  color:var(--muted);font-weight:500;
}
.serif-italic{font-family:var(--serif);font-style:italic}

/* film grain + vignette ------------------------------------ */
.grain{
  position:fixed;inset:0;pointer-events:none;z-index:60;opacity:.035;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   1. LOADER — logo draws itself in (SVG stroke animation)
   ============================================================ */
#loader{
  position:fixed;inset:0;z-index:200;background:var(--bg);
  display:grid;place-items:center;transition:opacity .8s var(--ease),visibility .8s;
}
#loader.done{opacity:0;visibility:hidden}
#loader .mark{width:170px;height:170px}
#loader .mark path,#loader .mark circle{
  fill:none;stroke:var(--ink);stroke-width:3.2;
  stroke-linecap:round;stroke-linejoin:round;
  stroke-dasharray:var(--len);stroke-dashoffset:var(--len);
  animation:draw 2.1s var(--ease) forwards;
}
#loader .mark .c{--len:560;stroke-width:2.6}
#loader .mark .p1{--len:200;animation-delay:.35s}
#loader .mark .p2{--len:200;animation-delay:.45s}
#loader .mark .p3{--len:150;animation-delay:.75s}
#loader .mark .p4{--len:150;animation-delay:.85s}
#loader .mark .p5{--len:120;animation-delay:1.1s}
#loader .mark .p6{--len:150;animation-delay:1.3s}
@keyframes draw{to{stroke-dashoffset:0}}
#loader .lo-word{
  margin-top:26px;text-align:center;
  font-size:11px;letter-spacing:.42em;text-transform:uppercase;color:var(--muted);
  opacity:0;animation:fadeUp .9s var(--ease) 1.6s forwards;
}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ============================================================
   2. CUSTOM CURSOR — the emblem
   ============================================================ */
#cursor{
  position:fixed;top:0;left:0;width:38px;height:38px;
  /* above every overlay that can appear while it's active (modals,
     bookmark, sound toggle, rail) — otherwise it renders invisibly
     *behind* them once something with a higher z-index and a dark/
     blurred background is on screen, since cursor:none hides the real
     OS pointer and this is the only visual stand-in for it. Still
     below #loader (200), which is gone long before any modal opens. */
  z-index:195;
  pointer-events:none;opacity:0;
  transform:translate(-50%,-50%);
  transition:opacity .3s,width .25s var(--ease),height .25s var(--ease);
}
/* emblem-white.png now carries real alpha transparency (baked from its
   own luminance) instead of relying on mix-blend-mode:screen against a
   black background — that trick was inconsistent on mobile and showed
   as a visible black square behind the logo. */
#cursor img{width:100%;height:100%;border-radius:50%}
body.cursor-on #cursor{opacity:.95}
body.cursor-on{cursor:none}
body.cursor-on a,body.cursor-on button{cursor:none}
#cursor.grow{width:70px;height:70px}
@media(hover:none),(max-width:900px){#cursor{display:none}body.cursor-on{cursor:auto}}

/* ============================================================
   3. SIDE NAVIGATION — minimal chainzoku-style: a thin bracket
   rail with tick marks + always-visible labels, active in orange
   ============================================================ */
#rail{
  position:fixed;left:0;top:0;bottom:0;z-index:100;
  /* desktop: a soft frosted wash behind the labels so they stay legible
     over bright footage, without reading as a solid opaque bar — fades
     out toward the right so there's no hard panel edge. Mobile's top-bar
     override below still resets this to fully transparent. */
  background:linear-gradient(90deg,rgba(6,6,6,.5) 0%,rgba(6,6,6,.22) 65%,transparent 100%);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  border:none;
  display:flex;flex-direction:column;justify-content:center;
  padding:0 0 0 clamp(20px,3vw,40px);pointer-events:none;
}
#rail .rail-logo{display:none}          /* minimal: no logo in the rail */
/* CLEANER: no bracket line — just the labels; only the active item shows a
   short accent dash. Transparent on desktop + tablet (client request). */
#rail nav{
  position:relative;display:flex;flex-direction:column;gap:clamp(16px,2.2vh,26px);
  padding-left:20px;pointer-events:auto;
}
.rail-item{
  position:relative;display:flex;align-items:center;
  color:var(--muted);font-size:11.5px;letter-spacing:.02em;line-height:1.1;
  transition:color .25s var(--ease);
}
.rail-item::before{                      /* accent dash — only on the active item */
  content:"";position:absolute;left:-20px;top:50%;transform:translateY(-50%);
  width:0;height:1px;background:var(--accent);
  transition:width .28s var(--ease);
}
.rail-item .dot{display:none}
.rail-item .lbl{white-space:nowrap;font-family:var(--sans);font-weight:500}
.rail-item:hover{color:var(--ink)}
.rail-item.active{color:var(--accent)}
.rail-item.active::before{width:12px}

/* language + bottom-left, as in the mockup. Desktop shows every option
   inline in a column (.lang-menu) with no toggle; mobile collapses it
   behind a tap-to-open "EN" pill — see the @media block below. */
#rail .rail-lang{
  position:absolute;left:clamp(20px,3vw,40px);bottom:28px;
  pointer-events:auto;
}
.lang-menu{display:flex;flex-direction:column;gap:4px;align-items:flex-start}
.lang-toggle{display:none} /* desktop: no collapsed pill, .lang-menu is always open */
.lang-btn{
  background:none;border:none;color:var(--muted);font-family:var(--sans);
  font-size:11px;letter-spacing:.14em;cursor:pointer;padding:2px 0;
  transition:color .25s;
}
.lang-btn.active{color:var(--accent)}
#rail .rail-rule{display:none}

/* ---------- animated director's clapperboard, links to The Pause ----
   shown on every screen size, fixed top-right ---------- */
#burger{
  display:grid;place-items:center;position:fixed;top:14px;right:14px;z-index:120;
  width:44px;height:44px;border-radius:50%;
  background:rgba(6,6,6,.72);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  border:1px solid var(--line);cursor:pointer;padding:6px;
}
#burger .clap{width:30px;height:26px;display:block;overflow:visible}
/* desktop only — mobile keeps 14px so it lines up with the EN pill row */
@media(min-width:901px){#burger{top:34px}}
.clap-body{fill:none;stroke:var(--ink);stroke-width:2}
.clap-row{stroke:var(--muted);stroke-width:1.7;stroke-linecap:round}
.clap-stick{fill:var(--ink)}
.clap-stripe{stroke:var(--bg);stroke-width:2.5}
/* the hinged top "sticks" pivot at the left corner and clap */
.clap-top{transform-origin:5px 12px;transition:transform .3s var(--ease);
  animation:clapHint 5.5s ease-in-out infinite}
@keyframes clapHint{0%,84%,100%{transform:rotate(0)}88%{transform:rotate(-24deg)}94%{transform:rotate(0)}}
#burger:hover .clap-top{transform:rotate(-24deg);animation:none}
#rail.open .clap-top{transform:rotate(-26deg);animation:none}
@media(prefers-reduced-motion:reduce){.clap-top{animation:none}}

@media(max-width:900px){
  /* client request: the nav links themselves are gone on mobile —
     .mobile-nav (below) replaces them with two small out-of-the-way
     buttons on every non-home page. The clapperboard is pulled out to
     its own fixed button (it now links straight to The Pause, not a
     menu toggle). The language switcher stays, top-left, collapsed to
     a single "EN" pill that drops the other options down on tap — it
     sits on the same 14px row as the clapperboard so the two line up,
     with the Back-to-home/Explore row (where present) pushed below it. */
  :root{--rail:0px}
  #rail{background:none;backdrop-filter:none;-webkit-backdrop-filter:none;pointer-events:none}
  #rail nav{display:none}
  #rail .rail-lang{
    position:fixed;left:14px;top:14px;bottom:auto;z-index:119;
    pointer-events:auto;
  }
  .lang-toggle{
    display:block;background:rgba(6,6,6,.72);color:var(--muted);
    font-family:var(--sans);font-size:11px;letter-spacing:.14em;cursor:pointer;
    border:1px solid var(--line);border-radius:999px;padding:9px 15px;
    backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
    transition:color .2s,border-color .2s;
  }
  .rail-lang.open .lang-toggle{color:var(--ink);border-color:var(--accent)}
  .lang-menu{
    display:none;flex-direction:column;gap:2px;align-items:stretch;
    position:absolute;left:0;top:calc(100% + 8px);min-width:84px;
    background:rgba(6,6,6,.88);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
    border:1px solid var(--line);border-radius:14px;padding:8px 6px;
  }
  .rail-lang.open .lang-menu{display:flex}
  .lang-menu .lang-btn{padding:7px 9px;border-radius:8px}
  .lang-menu .lang-btn.active{background:rgba(255,255,255,.06)}
}

/* ============================================================
   Layout
   ============================================================ */
main{margin-left:var(--rail)}
@media(max-width:900px){main{margin-left:0;padding-top:0}}
section{padding:clamp(84px,13vh,150px) clamp(22px,5vw,72px);position:relative}

/* ============================================================
   Mobile fallback nav — small "Back to home / Explore work" pair,
   bottom-right, only on pages other than the homepage, only on mobile.
   Injected by site.js so every page gets it for free.
   ============================================================ */
.mobile-nav{
  display:none;
}
@media(max-width:900px){
  /* top-left — top-right is reserved for the clapperboard link to
     The Pause, and bottom placement got missed at a glance scrolling
     past it. Sits just under the language pill, which claims the 14px
     row so it lines up with the clapperboard opposite it. */
  .mobile-nav{
    display:flex;gap:8px;position:fixed;left:14px;top:64px;z-index:120;
  }
  .mobile-nav a{
    font-size:11px;letter-spacing:.08em;color:var(--muted);
    background:rgba(6,6,6,.72);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
    border:1px solid var(--line);border-radius:999px;padding:8px 13px;
    transition:color .2s,border-color .2s;
  }
  .mobile-nav a:active{color:var(--ink);border-color:var(--accent)}
}

/* soft fade at every section seam — the first section of a page has
   nothing above it to blend from, so it skips the top fade; #home and
   .story-hero already paint their own ::after (vignette / video gradient),
   so their bottom fade is merged into those rules instead of duplicated
   here to avoid clobbering them. */
section:not(:first-child)::before{
  content:"";position:absolute;top:0;left:0;right:0;z-index:1;pointer-events:none;
  height:clamp(28px,5vh,56px);
  background:linear-gradient(180deg,var(--bg),transparent);
}
section:not(#home):not(.story-hero)::after{
  content:"";position:absolute;bottom:0;left:0;right:0;z-index:1;pointer-events:none;
  height:clamp(28px,5vh,56px);
  background:linear-gradient(0deg,var(--bg),transparent);
}

/* full-screen scroll-snap (client ref: ysl.com) — sections snap into place
   and each fills the screen. Scoped to .snap-scroll so long sub-pages (story,
   with its comment feed) keep normal scrolling. */
.snap-scroll{
  height:100vh;height:100dvh;overflow-y:scroll;overflow-x:hidden;
  scroll-snap-type:y mandatory;scroll-behavior:smooth;
  scrollbar-width:none;
}
.snap-scroll::-webkit-scrollbar{display:none}
.snap-scroll > section.full{
  scroll-snap-align:start;scroll-snap-stop:always;
}
.snap-scroll > footer{scroll-snap-align:start;margin-left:0}
section.full{
  min-height:100vh;min-height:100dvh;
  display:flex;flex-direction:column;justify-content:center;
  padding-block:clamp(80px,12vh,120px);
}
@media(max-width:900px){
  /* client request: no snapping at all on mobile, plain smooth scroll —
     desktop keeps the mandatory section-to-section snap untouched */
  .snap-scroll{scroll-snap-type:none}
  .snap-scroll > section.full,.snap-scroll > footer{scroll-snap-align:none;scroll-snap-stop:normal}
}
@media(prefers-reduced-motion:reduce){
  .snap-scroll{scroll-snap-type:none;scroll-behavior:auto}
}
.wrap{max-width:1180px;margin:0 auto;width:100%}

.reveal{opacity:0;transform:translateY(24px);
  transition:opacity .9s var(--ease),transform .9s var(--ease)}
.reveal.in{opacity:1;transform:none}

/* buttons --------------------------------------------------- */
.btn{
  display:inline-flex;align-items:center;gap:11px;
  padding:15px 30px;border-radius:999px;
  border:1px solid var(--accent);background:var(--accent);color:#fff;
  font-size:14px;font-weight:500;letter-spacing:.02em;cursor:pointer;
  transition:transform .22s var(--ease),box-shadow .3s,background .3s;
}
.btn:hover{transform:translateY(-3px);box-shadow:0 12px 40px -10px rgba(114,47,55,.65)}
.btn.ghost{background:none;color:var(--ink);border-color:var(--line)}
.btn.ghost:hover{border-color:var(--accent);box-shadow:none}
.btn svg{width:16px;height:16px}

/* ============================================================
   Footer
   ============================================================ */
footer{
  margin-left:var(--rail);border-top:1px solid var(--line);
  background:linear-gradient(180deg,var(--bg),#0a0a0a);
  padding:clamp(56px,9vh,90px) clamp(22px,5vw,72px) 34px;
}
@media(max-width:900px){footer{margin-left:0}}
.foot-grid{
  max-width:1180px;margin:0 auto;display:grid;
  grid-template-columns:1.5fr .8fr .8fr;gap:44px;align-items:start;
}
.foot-mark{width:min(300px,72vw);margin-bottom:16px}
.foot-tag{color:#c4c1ba;font-family:var(--sans);font-style:normal;font-size:.98rem;
  line-height:1.55;max-width:34ch}
/* Explore reveals the two works on hover (always shown on touch) */
.foot-reveal{overflow:hidden;max-height:0;opacity:0;
  transition:max-height .4s var(--ease),opacity .3s var(--ease)}
.foot-explore:hover .foot-reveal,.foot-explore:focus-within .foot-reveal{max-height:160px;opacity:1}
@media(hover:none),(max-width:900px){.foot-reveal{max-height:none;opacity:1}}
.foot-col h4{
  font-family:var(--sans);font-size:11px;letter-spacing:.26em;text-transform:uppercase;
  color:var(--muted);margin-bottom:16px;font-weight:600;
}
.foot-col a{display:block;color:var(--ink);padding:5px 0;font-size:14.5px;
  transition:color .22s,padding-left .22s}
.foot-col a:hover{color:var(--accent);padding-left:6px}
.foot-bottom{
  max-width:1180px;margin:44px auto 0;padding-top:22px;border-top:1px solid var(--line);
  display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;
  font-size:12px;letter-spacing:.06em;color:var(--muted);
}
@media(max-width:820px){.foot-grid{grid-template-columns:1fr;gap:32px}}
/* social icon row (footer/contact) */
.social-row{display:flex;gap:14px;flex-wrap:wrap;align-items:center}
.social-row a{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;
  border:1px solid var(--line);color:var(--muted);transition:.25s var(--ease)}
.social-row a:hover{color:var(--ink);border-color:var(--accent);transform:translateY(-2px)}
.social-row svg{width:19px;height:19px;display:block}

/* ============================================================
   Teleport transition (page → story)
   ============================================================ */
#teleport{
  position:fixed;inset:0;z-index:180;pointer-events:none;
  display:grid;place-items:center;opacity:0;visibility:hidden;
}
#teleport.on{opacity:1;visibility:visible;pointer-events:all}
#teleport .iris{
  position:absolute;border-radius:50%;background:var(--bg);
  width:10px;height:10px;transform:scale(0);
  transition:transform 1.05s var(--ease);
}
#teleport.on .iris{transform:scale(260)}
#teleport .tp-word{
  position:relative;z-index:2;text-align:center;opacity:0;
  font-family:var(--serif);font-style:italic;
  font-size:clamp(1.2rem,3.4vw,2.2rem);color:var(--ink);
  transition:opacity .5s .45s var(--ease);
}
#teleport.on .tp-word{opacity:1}

/* arriving on a story page */
.story-enter{animation:storyIn 1.1s var(--ease) both}
@keyframes storyIn{
  from{opacity:0;transform:scale(1.06)}
  to{opacity:1;transform:none}
}

@media(prefers-reduced-motion:reduce){
  *{animation-duration:.01s!important;transition-duration:.01s!important}
  #loader .mark path,#loader .mark circle{stroke-dashoffset:0}
}
