/* ============================================================
   EDITORIAL · DARK · SHADER PORTFOLIO
   Theming is driven by [data-dir] on <html>; each direction
   re-points --display, --accent and the type/letterspacing.
   ============================================================ */

:root {
  /* neutral dark base — warmth tuned per direction */
  --bg: #07080a;
  --ink: #ece9e3;
  --ink-soft: #a7a39b;
  --ink-faint: #8c8b98; /* lifted from #6c6962 for AA contrast on the blue field */
  --line: rgba(236, 233, 227, 0.12);
  --line-soft: rgba(236, 233, 227, 0.07);

  --display: "Instrument Serif", Georgia, serif;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --accent: oklch(0.64 0.20 272);

  --maxw: 1320px;
  --pad: clamp(20px, 5vw, 76px);

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

/* ---- Direction themes — GBE purple family -------------------- */
/* Electric: brand #472AFE blue-violet (default) */
html[data-dir="electric"] {
  --bg: #07060e;
  --display: "Instrument Serif", Georgia, serif;
  --accent: oklch(0.64 0.21 272);
  --ink: #ece9f0;
}
/* Violet: warmer purple→magenta */
html[data-dir="violet"] {
  --bg: #0a0610;
  --display: "Newsreader", Georgia, serif;
  --accent: oklch(0.70 0.17 318);
  --ink: #efe8ef;
}
/* Noir (default): near-black field carrying the GBE brand blue (#1800ac), Instrument Serif */
html[data-dir="noir"] {
  --bg: #050509;
  --display: "Instrument Serif", Georgia, serif;
  --accent: oklch(0.58 0.24 273);
  --ink: #e9e9ee;
}

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

html { background: var(--bg); }

body {
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* The body becomes a tall spacer; #scroll-content is fixed and
   transformed by the smooth-scroll engine. */
#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
}
#bg::after { content: ""; }

#scroll-content {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1;
  will-change: transform;
}

/* grain / texture veil over everything for editorial depth */
.veil {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, transparent 40%, rgba(0,0,0,0.35) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.28) 0%, transparent 18%, transparent 82%, rgba(0,0,0,0.55) 100%);
  mix-blend-mode: multiply;
}

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

/* ---- Type ---------------------------------------------------- */
.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
  opacity: 0.8;
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 0.98; letter-spacing: -0.01em; }
.display {
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.015em;
}

/* ---- Layout shell -------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
section { position: relative; }

/* ---- Top nav ------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--pad);
  mix-blend-mode: difference;
}
.nav .brand {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: #fff;
}
.nav .links { display: flex; gap: 30px; }
.nav .links a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.75;
  transition: opacity 0.3s var(--ease);
}
.nav .links a:hover { opacity: 1; }
@media (max-width: 720px) { .nav .links a:not(.nav-contact) { display: none; } }

/* ---- Hero ---------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--pad) 60px;
}
.hero .hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 4vh;
}
.hero h1 {
  font-size: clamp(58px, 15.5vw, 250px);
  line-height: 0.82;
  letter-spacing: -0.02em;
}
.hero h1 .it { font-style: italic; color: var(--accent); }
.hero .sub {
  margin-top: 5vh;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
}
.hero .lede {
  max-width: 40ch;
  font-size: clamp(17px, 1.5vw, 21px);
  color: var(--ink-soft);
  line-height: 1.5;
}
.hero .lede strong { color: var(--ink); font-weight: 500; }

/* newsletter CTA */
.hero .sub-left { display: flex; flex-direction: column; align-items: flex-start; }
.btn-news {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
  font-family: var(--mono), monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--bg);
  padding: 15px 26px;
  border: 1px solid var(--ink);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn-news:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.scroll-cue .bar {
  position: relative;
  width: 1px; height: 46px;
  background: var(--line);
  overflow: hidden;
}
.scroll-cue .bar::after {
  content: "";
  position: absolute;
  top: -50%; left: 0;
  width: 100%; height: 50%;
  background: var(--accent);
  animation: cue 2.4s var(--ease) infinite;
}
@keyframes cue { 0%{transform:translateY(0)} 100%{transform:translateY(300%)} }

/* ---- Section header ------------------------------------------ */
.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
  margin-bottom: clamp(40px, 7vw, 96px);
}
.sec-head h2 { font-size: clamp(30px, 4.4vw, 64px); }
.sec-head .idx { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; color: var(--ink-faint); }

.block { padding: clamp(80px, 13vh, 180px) 0; }

/* ---- About --------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 96px);
  align-items: start;
}
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; } }
.about-lede { font-family: var(--display); font-size: clamp(28px, 3.6vw, 50px); line-height: 1.12; }
.about-lede em { font-style: italic; color: var(--accent); }
.about-body { color: var(--ink-soft); max-width: 46ch; }
.about-body p + p { margin-top: 1.1em; }
.about-meta { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.about-meta .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.about-meta .v { color: var(--ink); font-size: 15px; }

/* ---- Work ---------------------------------------------------- */
.work-list { display: flex; flex-direction: column; }
.work-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  column-gap: 28px;
  row-gap: 0;
  align-items: center;
  padding: clamp(22px, 3vw, 40px) 0;
  border-top: 1px solid var(--line);
  position: relative;
  transition: padding-left 0.55s var(--ease);
}
.work-item:last-child { border-bottom: 1px solid var(--line); }
.work-item .w-idx { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.work-item .w-title { font-family: var(--display); font-size: clamp(30px, 5.2vw, 76px); line-height: 0.95; transition: color 0.4s var(--ease), transform 0.55s var(--ease); }
.work-item .w-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.work-item .w-cat { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.work-item .w-year { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.work-item:hover { padding-left: 22px; }
.work-item:hover .w-title { color: var(--accent); }

/* work description — expands smoothly under the title on hover */
.work-item .w-desc {
  grid-column: 2 / -1;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.5;
  max-width: 62ch;
  transition: max-height 0.55s var(--ease), opacity 0.45s var(--ease), margin-top 0.55s var(--ease);
}
.work-item:hover .w-desc,
.work-item:focus-visible .w-desc { max-height: 7em; opacity: 1; margin-top: 14px; }

/* on touch / small screens (no hover) show descriptions inline */
@media (hover: none), (max-width: 640px) {
  .work-item .w-desc { max-height: 7em; opacity: 1; margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .work-item .w-desc { transition: none; }
}

/* ---- Experience ---------------------------------------------- */
.exp-row {
  display: grid;
  grid-template-columns: 130px 1fr 1fr;
  gap: 28px;
  align-items: baseline;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.exp-row:last-child { border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .exp-row { grid-template-columns: 90px 1fr; } .exp-row .e-co { grid-column: 2; } }
.exp-row .e-year { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.exp-row .e-role { font-family: var(--display); font-size: clamp(20px, 2.4vw, 30px); }
.exp-row .e-co { color: var(--ink-soft); font-size: 15px; }
.exp-row .e-co .place { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; }

/* ---- Services ------------------------------------------------ */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 880px) { .svc-grid { grid-template-columns: 1fr; } }
.svc {
  background: var(--bg);
  padding: clamp(28px, 3vw, 44px);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background 0.4s var(--ease);
}
.svc:hover { background: rgba(255,255,255,0.02); }
.svc .s-no { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.svc h3 { font-size: clamp(24px, 2.6vw, 34px); margin: 28px 0 14px; }
.svc p { color: var(--ink-soft); font-size: 15px; max-width: 30ch; }

/* ---- Contact ------------------------------------------------- */
.contact { padding: clamp(90px, 16vh, 220px) 0 clamp(40px, 8vh, 90px); }
.contact .big {
  font-family: var(--display);
  font-size: clamp(46px, 11vw, 180px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  display: inline-block;
}
.contact .big .it { font-style: italic; color: var(--accent); }
.contact .mailto { display: inline-block; transition: transform 0.5s var(--ease); }
.contact .row {
  margin-top: clamp(40px, 7vh, 90px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.socials { display: flex; gap: 26px; }
.socials a { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); position: relative; transition: color 0.3s var(--ease); }
.socials a::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px; background: var(--accent); transition: width 0.4s var(--ease); }
.socials a:hover { color: var(--ink); }
.socials a:hover::after { width: 100%; }
.foot-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.1em; text-align: right; }

/* ---- Reveal animation --------------------------------------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }

/* line-by-line hero reveal */
.line-mask { overflow: hidden; display: block; }
.line-inner { display: block; transform: translateY(105%); transition: transform 1.1s var(--ease); }
.is-in .line-inner, .line-mask.is-in .line-inner { transform: none; }

/* ---- Custom cursor ------------------------------------------- */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 60;
  pointer-events: none;
  border-radius: 50%;
  mix-blend-mode: difference;
  will-change: transform;
}
.cursor-dot { width: 6px; height: 6px; background: #fff; transform: translate(-50%, -50%); }
.cursor-ring {
  width: 38px; height: 38px;
  border: 1px solid rgba(255,255,255,0.7);
  transform: translate(-50%, -50%);
  transition: width 0.32s var(--ease), height 0.32s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.cursor-ring.hover { width: 74px; height: 74px; border-color: transparent; background: rgba(255,255,255,0.14); }
.cursor-label {
  position: fixed; z-index: 61; top: 0; left: 0;
  pointer-events: none;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: #fff; mix-blend-mode: difference;
  transform: translate(-50%, -50%); opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.cursor-label.show { opacity: 1; }
@media (pointer: coarse) { .cursor-dot, .cursor-ring, .cursor-label { display: none; } }

/* ---- Direction switcher -------------------------------------- */
.dir-switch {
  position: fixed;
  right: var(--pad);
  bottom: 26px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(10,10,12,0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.dir-switch .ds-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-faint); padding: 0 10px 0 8px;
}
.dir-switch button {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  padding: 8px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}
.dir-switch button:hover { color: var(--ink); }
.dir-switch button.active { color: #0a0a0a; background: var(--accent); }
@media (max-width: 600px) { .dir-switch .ds-label { display: none; } .dir-switch button { padding: 8px 11px; } }

/* ---- Reduced motion ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .reveal, .line-inner { transition: none !important; opacity: 1 !important; transform: none !important; }
  .scroll-cue .bar::after { animation: none; }
}
