/* ========================================
   NECTR LANE — Shared Styles
   ======================================== */

:root {
  /* Palette — warm espresso with nectarine */
  --bg: #0a0807;
  --bg-elev: #14100e;
  --ink: #f6efe5;
  --ink-dim: #a89c8e;
  --ink-faint: #5a4f46;
  --line: rgba(246, 239, 229, 0.10);
  --line-strong: rgba(246, 239, 229, 0.22);

  /* Nectarine — juicy graded accent */
  --nectr-1: #ffd29a;   /* highlight (yellow flesh) */
  --nectr-2: #ff9d5a;   /* mid (warm orange) */
  --nectr-3: #ff6b3d;   /* core (nectarine) */
  --nectr-4: #d83a2a;   /* deep blush */
  --nectr-5: #8c1f1a;   /* shadow */
  --accent: var(--nectr-3);

  /* Type */
  --f-display: "Instrument Serif", "Times New Roman", serif;
  --f-sans: "Geist", "Inter", -apple-system, system-ui, sans-serif;
  --f-mono: "JetBrains Mono", "Courier New", monospace;

  /* Layout */
  --container: 1440px;
  --pad-x: clamp(20px, 4vw, 56px);
  --section: clamp(80px, 12vw, 160px);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light theme override */
[data-theme="light"] {
  --bg: #f5efe6;
  --bg-elev: #ebe3d6;
  --ink: #1a1410;
  --ink-dim: #6a5d50;
  --ink-faint: #b5a896;
  --line: rgba(26, 20, 16, 0.12);
  --line-strong: rgba(26, 20, 16, 0.24);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  overflow-x: hidden;
  transition: background 0.6s var(--ease), color 0.6s var(--ease);
  opacity: 0;
}
body.is-ready {
  opacity: 1;
  transition: opacity 0.65s var(--ease-out), background 0.6s var(--ease), color 0.6s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  body { opacity: 1; }
}

/* Tabular numerals globally so the 01/02/03 numbering aligns perfectly */
.mono, .eyebrow, .nav-links, .num, [class*="-num"], .footer-bottom {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: inherit; text-decoration: none; }
img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ========================================
   Typography
   ======================================== */

.display {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.9;
  text-wrap: balance;
  font-style: normal;
}
.display em { font-style: italic; color: var(--accent); font-weight: 400; }

.mono {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

h1, h2, h3, h4 { font-weight: 400; }

/* ========================================
   Layout primitives
   ======================================== */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.section { padding: var(--section) 0; }

.rule {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* ========================================
   Navigation
   ======================================== */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad-x);
  color: var(--ink);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), padding 0.3s var(--ease);
}
.nav.scrolled {
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  border-bottom-color: var(--line);
  padding-top: 14px;
  padding-bottom: 14px;
}

.nav-brand {
  font-family: var(--f-display);
  font-size: 22px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex: 1;
}

.nav-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}
@media (max-width: 720px) {
  .nav-right { gap: 8px; }
}
.nav-brand-mark {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--nectr-1), var(--nectr-3) 55%, var(--nectr-5));
  box-shadow: 0 0 22px rgba(255, 107, 61, 0.45);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav-links a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  opacity: 0.75;
  transition: opacity 0.25s var(--ease);
  position: relative;
}
.nav-links a:hover, .nav-links a.is-active { opacity: 1; }
.nav-links a.is-active::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: currentColor;
}
.nav-links .num { color: var(--accent); opacity: 0.9; }

.nav-cta {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ========================================
   Buttons / links
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: all 0.3s var(--ease);
  background: transparent;
  color: var(--ink);
}
.btn:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary {
  background: var(--accent);
  color: #1a0a05;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--nectr-1);
  border-color: var(--nectr-1);
  color: #1a0a05;
}
.btn .arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}
.btn:hover .arrow { transform: translate(3px, -3px); }
.btn:active { transform: scale(0.97); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-bottom: 6px;
  position: relative;
  transition: color 0.3s var(--ease);
}
.link-arrow::before,
.link-arrow::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
}
.link-arrow::before { background: var(--line-strong); }
.link-arrow::after {
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.5s var(--ease-out);
}
.link-arrow:hover { color: var(--accent); }
.link-arrow:hover::after { transform: scaleX(1); }
.link-arrow .arrow { transition: transform 0.3s var(--ease); }
.link-arrow:hover .arrow { transform: translate(3px, -3px); }

/* ========================================
   Reveal on scroll
   ======================================== */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
.reveal[data-delay="4"] { transition-delay: 320ms; }
.reveal[data-delay="5"] { transition-delay: 400ms; }

/* Section-level subtle settle — much lighter than before, no opacity gate.
   The page is always painted; sections only nudge up on first paint. */
section:not(.hero),
footer.footer {
  transform: translateY(14px);
  transition: transform 0.9s var(--ease-out);
  will-change: transform;
}
section.in-view,
footer.footer.in-view {
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  section, footer.footer { transform: none !important; transition: none !important; }
}

/* ========================================
   Footer
   ======================================== */

.footer {
  border-top: 1px solid var(--line);
  padding: 80px var(--pad-x) 40px;
}
.footer-cta {
  font-family: var(--f-display);
  font-size: clamp(72px, 14vw, 220px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin-bottom: 80px;
  text-wrap: balance;
}
.footer-cta a { display: inline-flex; align-items: flex-start; gap: 0.1em; }
.footer-cta em { font-style: italic; color: var(--accent); }
.footer-cta .arrow {
  font-size: 0.4em;
  display: inline-block;
  margin-top: 0.2em;
  transition: transform 0.4s var(--ease);
}
.footer-cta a:hover .arrow { transform: translate(0.15em, -0.15em); }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.footer-col h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 16px;
  font-weight: 400;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--ink); opacity: 0.8; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; color: var(--accent); }
.footer-col p { color: var(--ink-dim); font-size: 14px; line-height: 1.6; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  margin-top: 56px;
  border-top: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ========================================
   Custom cursor (optional)
   ======================================== */

.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), opacity 0.3s;
  mix-blend-mode: difference;
  opacity: 0;
}
.cursor-dot.active { opacity: 1; }
.cursor-dot.hover { width: 36px; height: 36px; background: transparent; border: 1px solid var(--accent); }

@media (hover: none) { .cursor-dot { display: none; } }


/* ========================================
   Scroll progress bar
   ======================================== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--nectr-4), var(--nectr-2), var(--nectr-1));
  z-index: 200;
  pointer-events: none;
  transition: width 0.12s linear, opacity 0.4s var(--ease);
  opacity: 0.85;
}
.scroll-progress.is-idle { opacity: 0.35; }

/* ========================================
   Magnetic CTA wrapper (subtle pull on hover)
   ======================================== */
[data-magnetic] {
  display: inline-block;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
[data-magnetic] > * {
  display: inline-block;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================
   Work list focus-dim
   When hovering one project row, dim siblings.
   ======================================== */
.work-list:hover .project { opacity: 0.45; transition: opacity 0.4s var(--ease); }
.work-list .project:hover { opacity: 1; }

/* ========================================
   Stat counter — keep stable width while counting
   ======================================== */
.stat-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.stat-num em { display: inline-block; min-width: 1ch; }

/* ========================================
   Theme toggle
   ======================================== */
.nav-theme {
  font-size: 16px;
  font-family: system-ui, sans-serif;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.45s var(--ease);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.nav-theme:hover { opacity: 1; transform: rotate(180deg); }

/* ========================================
   Mobile hamburger button
   ======================================== */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease), opacity 0.2s;
  transform-origin: center;
}
.nav-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}
.nav.menu-open {
  background: var(--bg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom-color: transparent;
}

@media (max-width: 720px) {
  .nav-burger { display: flex; }
  .nav-cta { display: none; }
}

/* ========================================
   Mobile nav overlay
   ======================================== */
.nav-mobile {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 100px var(--pad-x) 52px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
  overflow-y: auto;
}
.nav-mobile.is-open {
  opacity: 1;
  pointer-events: all;
}
.nav-mobile-links {
  list-style: none;
  margin-bottom: 40px;
}
.nav-mobile-links a {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--f-display);
  font-size: clamp(40px, 10vw, 68px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), color 0.2s;
}
.nav-mobile-links li:first-child a { border-top: 1px solid var(--line); }
.nav-mobile.is-open .nav-mobile-links a {
  opacity: 1;
  transform: translateY(0);
}
.nav-mobile.is-open .nav-mobile-links li:nth-child(1) a { transition-delay: 50ms; }
.nav-mobile.is-open .nav-mobile-links li:nth-child(2) a { transition-delay: 100ms; }
.nav-mobile.is-open .nav-mobile-links li:nth-child(3) a { transition-delay: 150ms; }
.nav-mobile.is-open .nav-mobile-links li:nth-child(4) a { transition-delay: 200ms; }
.nav-mobile.is-open .nav-mobile-links li:nth-child(5) a { transition-delay: 250ms; }
.nav-mobile-links .num {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.12em;
  flex-shrink: 0;
}
.nav-mobile-links a:hover { color: var(--accent); }
.nav-mobile-foot {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  opacity: 0;
  transition: opacity 0.4s var(--ease) 270ms;
}
.nav-mobile.is-open .nav-mobile-foot { opacity: 1; }
.nav-mobile-foot a {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.2s;
}
.nav-mobile-foot a:hover { color: var(--accent); }
