/* ============================================================
   Portfolio — shared styles
   Edit the tokens below to re-theme the whole site.
   ============================================================ */

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #16150f;
  --ink-soft: #5b5950;
  --line: #e2ded4;
  --accent: #ff5b2e;
  --accent-ink: #ffffff;

  /* project card tints */
  --tint-1: #ffd8c9;
  --tint-2: #d6e4ff;
  --tint-3: #d9f0de;
  --tint-4: #efe1ff;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;

  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12110e;
    --surface: #1b1a16;
    --ink: #f3f0e8;
    --ink-soft: #a3a097;
    --line: #2c2a24;
    --accent: #ff6e45;
    --tint-1: #3a2219;
    --tint-2: #1b2640;
    --tint-3: #1a3022;
    --tint-4: #2c2140;
  }
}
:root[data-theme="dark"] {
  --bg: #12110e;
  --surface: #1b1a16;
  --ink: #f3f0e8;
  --ink-soft: #a3a097;
  --line: #2c2a24;
  --accent: #ff6e45;
  --tint-1: #3a2219;
  --tint-2: #1b2640;
  --tint-3: #1a3022;
  --tint-4: #2c2140;
}

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { font-family: var(--serif); font-size: 26px; text-decoration: none; letter-spacing: -0.01em; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { text-decoration: none; font-size: 15px; color: var(--ink-soft); transition: color .15s; }
.nav-links a:hover { color: var(--ink); }
.theme-toggle {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 15px;
  display: grid; place-items: center;
}
@media (max-width: 640px) {
  .nav-links a:not(.keep) { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 500; text-decoration: none;
  transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-ghost { border: 1px solid var(--line); background: var(--surface); }

/* ---------- Type ---------- */
.eyebrow {
  font-size: 13px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-soft); font-weight: 500;
}
h1, h2, h3 { font-weight: 400; margin: 0; }
.display {
  font-family: var(--serif);
  font-size: clamp(48px, 8.4vw, 116px);
  line-height: .98; letter-spacing: -0.025em;
}
.display em { color: var(--accent); }
.h2 { font-family: var(--serif); font-size: clamp(36px, 5vw, 60px); line-height: 1.05; letter-spacing: -0.02em; }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--ink-soft); max-width: 40ch; }

section { padding: clamp(72px, 11vw, 140px) 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 48px; flex-wrap: wrap; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(56px, 9vw, 120px); padding-bottom: clamp(56px, 8vw, 100px); }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; padding: 7px 14px 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); margin-bottom: 32px;
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: #2bb673; box-shadow: 0 0 0 4px color-mix(in srgb, #2bb673 22%, transparent); }
.hero .display { margin-bottom: 36px; }
.hero-foot { display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.logos { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; }
.logos .wrap { display: flex; align-items: center; gap: clamp(20px, 5vw, 56px); flex-wrap: wrap; }
.logos .eyebrow { margin-right: auto; }
.logos b { font-weight: 600; font-size: 17px; color: var(--ink-soft); letter-spacing: -0.01em; }

/* ---------- Work grid ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
@media (max-width: 820px) { .work-grid { grid-template-columns: 1fr; } }
.card { text-decoration: none; display: block; }
.card-media {
  aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  position: relative; display: grid; place-items: center;
}
.mock {
  width: 64%; aspect-ratio: 16 / 11; border-radius: 10px;
  background: var(--surface); box-shadow: 0 30px 60px -20px rgba(0,0,0,.25);
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
  padding: 7% 7%; display: grid; gap: 7%; grid-template-rows: auto 1fr;
}
.card:hover .mock { transform: translateY(-8px) scale(1.03); }
.mock .bar { height: 8px; width: 40%; border-radius: 4px; background: var(--line); }
.mock .blocks { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8%; }
.mock .blocks div { border-radius: 6px; background: var(--line); }
.mock .blocks div:first-child { background: currentColor; opacity: .85; }
.card-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; }
.card h3 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.card p { margin: 4px 0 0; color: var(--ink-soft); font-size: 15px; }
.card .year { color: var(--ink-soft); font-size: 15px; white-space: nowrap; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tag { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); }

/* ---------- About ---------- */
.about { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(32px, 6vw, 96px); }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }
.portrait {
  aspect-ratio: 4 / 5; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--tint-1), var(--tint-4));
  display: grid; place-items: center; color: var(--ink-soft); font-size: 14px;
}
.about-copy p { font-size: 19px; margin: 0 0 20px; }
.about-copy .h2 { margin-bottom: 28px; }

.exp { margin-top: 44px; }
.exp-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); font-size: 16px; }
.exp-row:last-child { border-bottom: 1px solid var(--line); }
.exp-row span { color: var(--ink-soft); }

.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 44px; }
@media (max-width: 560px) { .skills { grid-template-columns: 1fr; } }
.skills h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.skills ul { margin: 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: 15px; line-height: 1.9; }

/* ---------- Process ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.step .num { font-family: var(--serif); font-size: 40px; color: var(--accent); line-height: 1; }
.step h3 { font-size: 19px; font-weight: 500; margin: 18px 0 8px; }
.step p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- Quote ---------- */
.quote blockquote {
  margin: 0; font-family: var(--serif); font-size: clamp(28px, 4vw, 48px);
  line-height: 1.15; letter-spacing: -0.015em; max-width: 22ch;
}
.quote figcaption { margin-top: 28px; color: var(--ink-soft); font-size: 15px; }
.quote figcaption b { color: var(--ink); font-weight: 500; }

/* ---------- Contact / footer ---------- */
.contact { background: var(--ink); color: var(--bg); }
.contact .eyebrow { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.contact .display { margin: 20px 0 40px; }
.contact .display a { text-decoration: none; border-bottom: 3px solid var(--accent); }
.contact-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 32px; border-top: 1px solid color-mix(in srgb, var(--bg) 18%, transparent); font-size: 15px; }
.contact-row nav { display: flex; gap: 24px; flex-wrap: wrap; }
.contact-row a { text-decoration: none; opacity: .75; }
.contact-row a:hover { opacity: 1; }
.contact .email { overflow-wrap: anywhere; }

/* ---------- Case study ---------- */
.cs-hero { padding-top: clamp(48px, 7vw, 96px); padding-bottom: 48px; }
.back { display: inline-flex; gap: 8px; text-decoration: none; color: var(--ink-soft); font-size: 15px; margin-bottom: 40px; }
.back:hover { color: var(--ink); }
.cs-hero .display { font-size: clamp(44px, 7vw, 92px); margin: 16px 0 28px; }
.cs-cover { aspect-ratio: 16 / 9; border-radius: var(--radius); display: grid; place-items: center; color: var(--accent); }
.cs-cover .mock { width: 56%; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 36px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 720px) { .facts { grid-template-columns: repeat(2, 1fr); } }
.facts div span { display: block; font-size: 13px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.facts div { font-size: 16px; }

.cs-body section { padding: clamp(56px, 8vw, 96px) 0; border-bottom: 1px solid var(--line); }
.cs-body section:last-child { border-bottom: 0; }
.cs-row { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(24px, 5vw, 80px); }
@media (max-width: 820px) { .cs-row { grid-template-columns: 1fr; } }
.cs-row h2 { font-family: var(--serif); font-size: clamp(30px, 3.6vw, 42px); line-height: 1.1; }
.cs-row p { margin: 0 0 18px; font-size: 18px; }
.cs-row p.muted { color: var(--ink-soft); }
.cs-img { aspect-ratio: 16 / 10; border-radius: var(--radius); margin-top: 32px; display: grid; place-items: center; color: var(--ink-soft); font-size: 14px; }
.cs-img-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 620px) { .cs-img-pair { grid-template-columns: 1fr; } }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
@media (max-width: 620px) { .metrics { grid-template-columns: 1fr; } }
.metric { padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.metric b { display: block; font-family: var(--serif); font-weight: 400; font-size: 56px; line-height: 1; color: var(--accent); margin-bottom: 10px; }
.metric span { color: var(--ink-soft); font-size: 15px; }

.next { display: block; text-decoration: none; padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
.next .display { font-size: clamp(40px, 6vw, 80px); transition: color .2s; }
.next:hover .display { color: var(--accent); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
