:root {
  --bg: #f6f3ee;
  --bg-2: #ece7df;
  --ink: #17181c;
  --ink-2: #4d4f56;
  --ink-3: #66686f;
  --line: #ddd7cd;
  --accent: #0f5e4f;
  --accent-ink: #f6f3ee;
  --phone: #1a1b1f;
  --phone-edge: #3a3b41;
  --shadow: 0 30px 80px -20px rgba(20, 20, 25, .45);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1080px;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #131417; --bg-2: #1b1c21; --ink: #ecebe6; --ink-2: #b4b3ad; --ink-3: #7c7b78;
  --line: #2a2b31; --accent: #4fb39b; --accent-ink: #0f1512; --phone: #08090b; --phone-edge: #2a2b31;
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.05; margin: 0; }
h1 em { font-style: italic; font-weight: 400; color: var(--accent); }
p { margin: 0; }
[id] { scroll-margin-top: 72px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-name { font-family: var(--serif); font-weight: 600; font-size: 19px; text-decoration: none; white-space: nowrap; }
.nav-links { display: flex; gap: clamp(14px, 3vw, 28px); font-size: 15px; }
.nav-links a { text-decoration: none; color: var(--ink-2); }
.nav-links a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(64px, 12vh, 140px) var(--gutter) clamp(40px, 8vh, 80px);
}
.eyebrow { font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 20px; }
.hero h1 { font-size: clamp(40px, 7.5vw, 88px); max-width: 14ch; }
.lede { max-width: 58ch; font-size: clamp(17px, 1.6vw, 21px); color: var(--ink-2); margin-top: 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.btn {
  display: inline-block; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line);
  text-decoration: none; font-weight: 500; font-size: 15px; background: var(--bg);
  transition: transform .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--ink); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { color: var(--accent-ink); filter: brightness(1.08); }
.proof { margin-top: 22px; font-size: 14px; color: var(--ink-3); max-width: 60ch; }
.proof a { color: var(--ink-2); }
.scroll-hint { margin-top: clamp(40px, 8vh, 72px); font-size: 14px; color: var(--ink-3); }

/* ---------- scroll story ---------- */
.story { position: relative; }
.js .story { height: 420vh; }
.story-sticky { position: sticky; top: 0; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
.story-grid {
  width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 5vw, 72px);
}
.phone-wrap { display: flex; justify-content: center; perspective: 1400px; }
.phone {
  position: relative; width: min(300px, 62vw); aspect-ratio: 618 / 1338;
  background: var(--phone); border-radius: 46px; padding: 11px;
  box-shadow:
    var(--shadow),
    inset 0 0 0 1.5px #55565c,
    inset 0 0 0 4px #202126,
    inset 0 0 0 5px #0c0d10;
  transform-origin: center center; will-change: transform;
  transform-style: preserve-3d;
}
.phone-btn { position: absolute; width: 3px; background: linear-gradient(90deg, #3d3e44, #1c1d21); border-radius: 2px; }
.phone-btn-vol1  { left: -3px; top: 25%; height: 8%; }
.phone-btn-vol2  { left: -3px; top: 35%; height: 8%; }
.phone-btn-power { right: -3px; top: 28%; height: 13%; background: linear-gradient(270deg, #3d3e44, #1c1d21); }
.js .phone { transform: translateY(35vh) scale(.62) rotateX(22deg); }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 36px; overflow: hidden; background: #f4f6f5; }
.screen-strip { position: absolute; inset: 0; will-change: transform; }
.screen { position: absolute; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.screen:nth-child(1) { top: 0; } .screen:nth-child(2) { top: 100%; } .screen:nth-child(3) { top: 200%; } .screen:nth-child(4) { top: 300%; }
.phone-glare { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,.05) 28%, rgba(255,255,255,0) 45%); }
.phone-cam { position: absolute; top: 22px; left: 50%; width: 12px; height: 12px; transform: translateX(-50%); background: #000; border-radius: 50%; box-shadow: inset 0 0 0 2px #1d2a44; }

.captions { list-style: none; margin: 0; padding: 0; position: relative; min-height: 260px; }
.caption { position: absolute; inset: 0; opacity: 0; transform: translateY(18px); pointer-events: none; will-change: opacity, transform; }
.caption.is-active { opacity: 1; transform: none; pointer-events: auto; }
.caption-kicker { display: block; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.caption h2 { font-size: clamp(26px, 3.4vw, 40px); margin-bottom: 14px; }
.caption p { color: var(--ink-2); max-width: 44ch; }
.js .captions { opacity: 0; transition: opacity .4s ease; }
.js .story.is-in .captions { opacity: 1; }

/* progress dots */
.story-dots { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; gap: 8px; }
.story-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background .3s, transform .3s; }
.story-dots i.is-active { background: var(--accent); transform: scale(1.4); }

/* no-JS / reduced-motion fallback: stack everything, no pinning */
.no-js .story-sticky, .reduce-motion .story-sticky, .static-story .story-sticky { position: static; min-height: 0; overflow: visible; padding: 48px 0; }
.no-js .story, .reduce-motion .story, .static-story .story { height: auto; }
.no-js .phone, .reduce-motion .phone, .static-story .phone { transform: none !important; }
.no-js .captions, .reduce-motion .captions, .static-story .captions { opacity: 1 !important; min-height: 0; display: grid; gap: 40px; }
.no-js .caption, .reduce-motion .caption, .static-story .caption { position: static; opacity: 1; transform: none; pointer-events: auto; }
.no-js .screen-strip, .reduce-motion .screen-strip, .static-story .screen-strip { transform: none !important; }

@media (max-width: 760px) {
  .nav-links a[href="#internship"] { display: none; }
  .story-grid { grid-template-columns: 1fr; gap: 20px; align-content: center; }
  .phone { width: min(200px, 48vw); border-radius: 30px; padding: 7px; box-shadow: var(--shadow), inset 0 0 0 1px #55565c, inset 0 0 0 3px #202126; }
  .phone-screen { border-radius: 24px; }
  .phone-btn { width: 2px; }
  .phone-cam { width: 8px; height: 8px; top: 15px; }
  .js .phone { transform: translateY(30vh) scale(.7) rotateX(18deg); }
  .captions { min-height: 220px; text-align: center; }
  .caption p { margin: 0 auto; }
  .story-dots { bottom: 16px; }
}

/* ---------- numbers ---------- */
.numbers {
  max-width: var(--max); margin: 0 auto; padding: clamp(40px, 8vh, 96px) var(--gutter);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  border-top: 1px solid var(--line);
}
.num strong { display: block; font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 4.5vw, 56px); line-height: 1; letter-spacing: -0.02em; }
.num span { display: block; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
@media (max-width: 760px) { .numbers { grid-template-columns: 1fr 1fr; } }

/* ---------- also / internship ---------- */
.section-title { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 24px; }
.also, .internship { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 8vh, 96px) var(--gutter); border-top: 1px solid var(--line); }
.card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); }
.card > p { max-width: 68ch; }
.card h3 { font-size: 22px; margin-bottom: 10px; }
.card p { color: var(--ink-2); }
.card .meta { margin-top: 14px; font-size: 13px; color: var(--ink-3); }

.internship .big { font-size: clamp(20px, 2.4vw, 28px); line-height: 1.35; max-width: 30ch; font-family: var(--serif); font-weight: 400; }
.facts { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; max-width: 64ch; color: var(--ink-2); }
.facts strong { color: var(--ink); }

.btn.js-copy { font: inherit; font-weight: 500; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px;
  transition: opacity .25s, transform .25s; pointer-events: none; z-index: 20; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.browser { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.browser-bar { display: flex; gap: 5px; padding: 8px 10px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.browser-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.browser img { display: block; width: 100%; height: auto; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } }

/* ---------- side progress rail (desktop) ---------- */
.rail { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 9;
  display: none; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; text-decoration: none; color: var(--ink-3); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.rail a span { opacity: 0; transform: translateX(6px); transition: opacity .2s, transform .2s; }
.rail a i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); border: 1px solid var(--ink-3); transition: transform .2s, background .2s; flex: none; }
.rail a:hover span, .rail a.is-active span { opacity: 1; transform: none; }
.rail a.is-active { color: var(--accent); }
.rail a.is-active i { background: var(--accent); border-color: var(--accent); transform: scale(1.5); }
.rail-track { position: absolute; right: 2px; top: -8px; bottom: -8px; width: 2px; border-radius: 2px; background: var(--line); z-index: -1; }
.rail-fill { position: absolute; left: 0; top: 0; width: 100%; height: 0; background: var(--accent); transition: height .15s linear; }
@media (min-width: 1180px) and (min-height: 600px) { .js .rail { display: flex; } }

/* ---------- footer ---------- */
.foot {
  max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 48px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  font-size: 14px; color: var(--ink-3); border-top: 1px solid var(--line);
}
.foot nav { display: flex; gap: 18px; }
.foot a { text-decoration: none; color: var(--ink-2); }
.foot a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
