/* =====================================================================
   base.css — SHZ portfolio foundation
   Concept: "Structured systems, expressed through movement."
   Near-black foundation · warm paper type · one acid accent ·
   fine grid lines · film grain · editorial spacing. No glass cards.
   ===================================================================== */

/* ------------------------------- Reset ------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; line-height: 1.5; -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility; overflow-x: hidden; }
img, svg, canvas, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 4px; }

/* ------------------------------- Tokens ------------------------------ */
:root {
  /* world */
  --ink:       #0B0B0C;
  --ink-2:     #111113;
  --paper:     #F2EFE7;
  --paper-dim: rgba(242, 239, 231, 0.6);
  --paper-ghost: rgba(242, 239, 231, 0.28);
  --acid:      #D9FF3F;
  --line:      rgba(242, 239, 231, 0.14);
  --line-soft: rgba(242, 239, 231, 0.08);

  /* project worlds */
  --w1: #5FD9FF; --w1-ink: #08141A;
  --w2: #FF7A29; --w2-ink: #170E06;
  --w3: #7ED98A; --w3-ink: #0A130C;
  --w4: #FFB38A; --w4-ink: #170C08;

  /* type */
  --f-display: "Syne", sans-serif;
  --f-body: "Space Grotesk", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --t-hero: clamp(3.4rem, 12.5vw, 12rem);
  --t-huge: clamp(2.6rem, 7.5vw, 7rem);
  --t-h2:   clamp(2rem, 5vw, 4.4rem);
  --t-h3:   clamp(1.2rem, 2vw, 1.7rem);
  --t-body: clamp(1rem, 0.95rem + 0.3vw, 1.12rem);
  --t-sm:   0.9rem;
  --t-label: 0.68rem;

  /* rhythm */
  --gut: clamp(1.2rem, 4vw, 4rem);
  --sec: clamp(6rem, 12vw, 14rem);
  --maxw: 1520px;

  /* motion */
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-io: cubic-bezier(0.83, 0, 0.17, 1);
  --dur: 0.5s;
}

html { background: var(--ink); }
body { font-family: var(--f-body); font-size: var(--t-body); background: var(--ink);
  color: var(--paper); }
::selection { background: var(--acid); color: var(--ink); }
html { scrollbar-color: rgba(242,239,231,0.3) var(--ink); scrollbar-width: thin; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: rgba(242,239,231,0.22); border-radius: 4px; }

/* ---------------------------- Utilities ------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.mono { font-family: var(--f-mono); font-size: var(--t-label); letter-spacing: 0.16em;
  text-transform: uppercase; }
.dim { color: var(--paper-dim); }

/* index number chip used across chapters */
.idx { font-family: var(--f-mono); font-size: var(--t-label); letter-spacing: 0.2em;
  color: var(--paper-dim); display: inline-flex; align-items: center; gap: 0.7rem; }
.idx::before { content: ""; width: 34px; height: 1px; background: currentColor; opacity: 0.6; }

/* fine structural rules */
.rule { height: 1px; background: var(--line); border: 0; }

/* skip link */
.skip-link { position: fixed; top: -60px; left: 1rem; z-index: 10000; background: var(--acid);
  color: var(--ink); padding: 0.6rem 1rem; font-family: var(--f-mono); font-size: 0.8rem;
  transition: top 0.3s var(--ease); }
.skip-link:focus { top: 1rem; }

/* ------------------------ Atmosphere layers -------------------------- */
/* film grain — one fixed layer, whole site */
.grain { position: fixed; inset: -60px; z-index: 2000; pointer-events: none; opacity: 0.07;
  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='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.9s steps(2) infinite; }
@keyframes grainShift { 50% { transform: translate(18px, -12px); } }

/* fine page grid — vertical hairlines */
.pagegrid { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.pagegrid i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-soft); }
.pagegrid i:nth-child(1) { left: 25%; }
.pagegrid i:nth-child(2) { left: 50%; }
.pagegrid i:nth-child(3) { left: 75%; }

/* scroll progress hairline */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 900;
  pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; transform: scaleX(0);
  transform-origin: 0 50%; background: var(--acid); }

/* ------------------------------ Cursor ------------------------------- */
/* Custom cursor: dot + ring + contextual label. Desktop fine-pointer only;
   app.js enables it and hides the native cursor only after init succeeds. */
.cursor { position: fixed; top: 0; left: 0; z-index: 9500; pointer-events: none;
  opacity: 0; transform: translate(-100px, -100px); will-change: transform; }
.cursor.is-on { opacity: 1; }
.cursor__dot { position: absolute; top: -4px; left: -4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--acid); mix-blend-mode: difference;
  transition: transform 0.25s var(--ease), opacity 0.25s; }
.cursor__ring { position: absolute; top: -22px; left: -22px; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid rgba(242,239,231,0.5); mix-blend-mode: difference;
  transition: transform 0.35s var(--ease), opacity 0.35s, border-color 0.35s; }
.cursor__label { position: absolute; top: -19px; left: -19px; min-width: 38px; height: 38px;
  padding: 0 0.4rem; border-radius: 100px; background: var(--acid); color: var(--ink);
  font-family: var(--f-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase;
  display: grid; place-items: center; white-space: nowrap; transform: scale(0);
  transition: transform 0.3s var(--ease); }
.cursor.is-hover .cursor__ring { transform: scale(1.5); }
.cursor.has-label .cursor__dot,
.cursor.has-label .cursor__ring { opacity: 0; }
.cursor.has-label .cursor__label { transform: scale(1); }
body.cursor-on, body.cursor-on a, body.cursor-on button,
body.cursor-on [data-case], body.cursor-on label { cursor: none; }

/* ------------------------------ Loader ------------------------------- */
/* "Loading ideas into structure." — line scan → SHZ mask → split reveal */
.boot { position: fixed; inset: 0; z-index: 9000; background: var(--ink);
  display: grid; place-items: center; overflow: hidden; }
.no-js .boot { display: none; }
.boot__half { position: absolute; left: 0; right: 0; height: 50.5%; background: var(--ink); }
.boot__half--top { top: 0; }
.boot__half--btm { bottom: 0; }
.boot__scan { position: absolute; top: 50%; left: 0; right: 0; height: 1px;
  background: var(--acid); transform: scaleX(0); transform-origin: 0 50%; z-index: 2;
  box-shadow: 0 0 24px rgba(217,255,63,0.5); }
.boot__center { position: relative; z-index: 3; text-align: center; }
.boot__initials { font-family: var(--f-display); font-weight: 800; line-height: 0.9;
  font-size: clamp(4rem, 16vw, 12rem); letter-spacing: -0.02em; color: var(--paper);
  overflow: hidden; }
.boot__initials span { display: inline-block; transform: translateY(110%); }
.boot__phrase { margin-top: 1.4rem; font-family: var(--f-mono); font-size: 0.72rem;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--paper-dim); opacity: 0; }
.boot__skip { position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%);
  z-index: 4; font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--paper-ghost); padding: 0.6rem 1rem; }
.boot__skip:hover { color: var(--paper); }
.boot.is-done { pointer-events: none; }

/* ------------------------------- Nav --------------------------------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 800; mix-blend-mode: difference; }
.nav__inner { display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--gut); }
.nav__mark { font-family: var(--f-display); font-weight: 800; font-size: 1.05rem;
  letter-spacing: 0.04em; color: #fff; }
.nav__mark i { font-style: normal; color: #fff; opacity: 0.55; font-weight: 600; }
.nav__state { font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.26em;
  text-transform: uppercase; color: #fff; opacity: 0.7; }
.nav__side { display: flex; align-items: center; gap: 1.4rem; }
.nav__cv { font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.4);
  padding-bottom: 2px; }
.nav__menu { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff;
  font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase; }
.nav__menu i { display: flex; flex-direction: column; gap: 4px; }
.nav__menu i span { width: 26px; height: 1.5px; background: #fff;
  transition: transform 0.35s var(--ease), opacity 0.35s; }
html.menu-open .nav__menu i span:nth-child(1) { transform: translateY(2.75px) rotate(45deg); }
html.menu-open .nav__menu i span:nth-child(2) { transform: translateY(-2.75px) rotate(-45deg); }

/* full menu overlay */
.menu { position: fixed; inset: 0; z-index: 700; background: var(--ink);
  display: flex; align-items: center; visibility: hidden; opacity: 0;
  transition: opacity 0.45s var(--ease), visibility 0.45s; }
.menu.is-open { visibility: visible; opacity: 1; }
.menu::before { content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 80% 20%, rgba(217,255,63,0.06), transparent 65%); }
.menu__links { position: relative; display: flex; flex-direction: column; gap: 0.1em;
  padding-inline: var(--gut); }
.menu__link { display: flex; align-items: baseline; gap: 1.2rem;
  font-family: var(--f-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(2rem, 7vw, 4.6rem); line-height: 1.14; color: var(--paper-dim);
  transition: color 0.3s var(--ease), transform 0.4s var(--ease);
  opacity: 0; transform: translateY(26px); }
.menu.is-open .menu__link { opacity: 1; transform: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), color 0.3s; }
.menu.is-open .menu__link:nth-child(1) { transition-delay: 0.05s; }
.menu.is-open .menu__link:nth-child(2) { transition-delay: 0.1s; }
.menu.is-open .menu__link:nth-child(3) { transition-delay: 0.15s; }
.menu.is-open .menu__link:nth-child(4) { transition-delay: 0.2s; }
.menu.is-open .menu__link:nth-child(5) { transition-delay: 0.25s; }
.menu.is-open .menu__link:nth-child(6) { transition-delay: 0.3s; }
.menu.is-open .menu__link:nth-child(7) { transition-delay: 0.35s; }
.menu__link i { font-family: var(--f-mono); font-style: normal; font-size: 0.7rem;
  letter-spacing: 0.2em; color: var(--paper-ghost); }
.menu__link:hover, .menu__link.is-active { color: var(--paper); }
.menu__link:hover i { color: var(--acid); }
.menu__meta { position: absolute; bottom: 1.6rem; left: var(--gut); right: var(--gut);
  display: flex; flex-wrap: wrap; gap: 0.6rem 2.4rem; font-family: var(--f-mono);
  font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--paper-ghost); }
.menu__meta a { color: var(--paper-dim); }
.menu__meta a:hover { color: var(--acid); }

/* --------------------------- Reveal system --------------------------- */
/* Generic one-shot reveals (IO-driven). Content is fully visible without JS. */
.js [data-reveal] { opacity: 0; transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--rd, 0ms); }
.js [data-reveal="left"] { transform: translateX(-34px); }
.js [data-reveal="right"] { transform: translateX(34px); }
.js [data-reveal="mask"] { transform: none; clip-path: inset(0 100% 0 0);
  transition: clip-path 1.1s var(--ease); transition-delay: var(--rd, 0ms); }
.js [data-reveal].in { opacity: 1; transform: none; }
.js [data-reveal="mask"].in { clip-path: inset(0 0 0 0); }

/* split-line typography reveal (motion.js wraps lines) */
.js [data-lines] .line { display: block; overflow: hidden; }
.js [data-lines] .line > span { display: block; transform: translateY(112%);
  transition: transform 1s var(--ease); transition-delay: var(--rd, 0ms); }
.js [data-lines].in .line > span { transform: none; }

/* ------------------------------ Ticker ------------------------------- */
.ticker { overflow: hidden; border-block: 1px solid var(--line); padding-block: 0.9rem;
  position: relative; }
.ticker__track { display: flex; gap: 2.6rem; width: max-content; align-items: center;
  animation: tick 36s linear infinite; }
.ticker__track span { font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--paper-dim); white-space: nowrap; }
.ticker__track b { font-weight: 400; color: var(--acid); font-size: 0.6rem; }
@keyframes tick { to { transform: translateX(-50%); } }

/* --------------------------- Big interactions ------------------------ */
/* oversized text link */
.biglink { display: inline-flex; align-items: center; gap: 1rem;
  font-family: var(--f-display); font-weight: 700; letter-spacing: -0.01em;
  font-size: clamp(1.3rem, 2.6vw, 2.1rem); color: var(--paper); position: relative; }
.biglink::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--acid); transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s var(--ease); }
.biglink:hover::after { transform: scaleX(1); }
.biglink em { font-style: normal; transition: transform 0.4s var(--ease); }
.biglink:hover em { transform: translateX(8px); }

/* outlined utility chip */
.chiplink { display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--paper); padding: 0.75rem 1.3rem;
  border: 1px solid var(--line); border-radius: 100px;
  transition: border-color 0.3s, background 0.3s, color 0.3s; }
.chiplink:hover { border-color: var(--acid); color: var(--acid); }

/* magnetic circle */
.orb { position: relative; display: inline-grid; place-items: center;
  width: 108px; height: 108px; border-radius: 50%; border: 1px solid var(--line);
  font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--paper); overflow: hidden;
  transition: color 0.35s var(--ease), border-color 0.35s; }
.orb::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--acid); transform: scale(0); transition: transform 0.45s var(--ease); }
.orb span { position: relative; z-index: 1; }
.orb:hover { color: var(--ink); border-color: var(--acid); }
.orb:hover::before { transform: scale(1.05); }

/* ------------------------------ Footer ------------------------------- */
.footer { border-top: 1px solid var(--line); padding: 2.2rem 0 2.6rem; position: relative; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 3rem;
  align-items: baseline; justify-content: space-between; }
.footer__name { font-family: var(--f-display); font-weight: 700; font-size: 1rem; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 1.4rem; font-family: var(--f-mono);
  font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--paper-dim); }
.footer__nav a:hover { color: var(--acid); }
.footer__meta { font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--paper-ghost); }

/* --------------------------- Responsive base ------------------------- */
@media (max-width: 900px) {
  .pagegrid i:nth-child(1) { left: 50%; }
  .pagegrid i:nth-child(2), .pagegrid i:nth-child(3) { display: none; }
  .nav__state { display: none; }
  .orb { width: 88px; height: 88px; }
}

/* --------------------------- Reduced motion -------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .grain { animation: none; }
  .ticker__track { animation: none; transform: none; }
  .js [data-reveal], .js [data-lines] .line > span { opacity: 1 !important;
    transform: none !important; clip-path: none !important; }
}
