/* Portfolio — one stylesheet, no build step. Tokens first, then layout, then components. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --text: #1b1d21;
  --muted: #5d636e;
  --line: #e3e0d8;
  --accent: #1f6feb;
  --accent-ink: #ffffff;
  --direct: #1f6feb;
  --verify: #1a7f4b;
  --ship: #b4560f;
  --radius: 14px;
  --max: 1040px;
  --gutter: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #161a20;
    --surface-2: #1c2129;
    --text: #e8eaee;
    --muted: #9aa3b0;
    --line: #2a303a;
    --accent: #5b9dff;
    --accent-ink: #0b0d10;
    --direct: #5b9dff;
    --verify: #43c27f;
    --ship: #f0954a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 5px; }

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

/* Header / nav */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* Sections */
section { padding: 56px 0; }
section + section { border-top: 1px solid var(--line); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; }
h1 { font-size: clamp(32px, 6vw, 52px); }
h2 { font-size: clamp(24px, 4vw, 32px); }
h3 { font-size: 19px; }
p { margin: 0 0 14px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.lede { font-size: clamp(18px, 2.4vw, 21px); color: var(--muted); max-width: 680px; }
.muted { color: var(--muted); }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero h1 span { color: var(--accent); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn { display: inline-block; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid var(--line); color: var(--text); background: var(--surface); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Pillars */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 28px; }
.pillar { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c, var(--accent)); border-radius: var(--radius); padding: 22px; }
.pillar.direct { --c: var(--direct); }
.pillar.verify { --c: var(--verify); }
.pillar.ship { --c: var(--ship); }
.pillar h3 { color: var(--c); font-size: 22px; }
.pillar ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 15.5px; }
.pillar li + li { margin-top: 6px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 28px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }

/* Cards / lists */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin: 0 6px 6px 0; }

/* Article (case study, essay) */
.article { padding: 48px 0 72px; }
.article h2 { margin-top: 44px; }
.article h3 { margin-top: 28px; }
.article ul, .article ol { padding-left: 22px; }
.article li + li { margin-top: 6px; }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 16px 18px; margin: 20px 0; }
.callout.verify { border-left-color: var(--verify); }
.callout.ship { border-left-color: var(--ship); }
.callout p:last-child { margin-bottom: 0; }
.quote { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; border-left: 4px solid var(--accent); padding-left: 16px; margin: 24px 0; }

/* Diagram */
.loop { width: 100%; max-width: 760px; margin: 24px 0; }
.loop text { font-family: var(--font); fill: var(--text); }
.loop .sub { fill: var(--muted); font-size: 12px; }
.loop .box { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.loop .arrow { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.loop .head { fill: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 16px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }

/* Screenshot slots */
.shot { border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); display: grid; place-items: center; min-height: 220px; text-align: center; padding: 16px; font-size: 14px; }

/* Captured media (from portfolio/capture) */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 20px 0; }
.shot-fig { margin: 20px 0; }
.gallery .shot-fig { margin: 0; }
.shot-fig img, .shot-fig video { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.video-fig video { max-width: 360px; display: block; margin: 0 auto; }
.shot-fig figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; text-align: center; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.hero-shot { width: 260px; margin: 0; }
.hero-shot img { border-radius: 22px; border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0,0,0,0.12); }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } .hero-shot { width: 220px; margin: 0 auto; } }

/* Project cards */
.project { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); text-decoration: none; transition: border-color 0.15s; }
a.project:hover { border-color: var(--accent); }
.project.feature { margin-top: 24px; border-top: 4px solid var(--accent); }
.project-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project-body h3 { margin: 0; }
.project-body p { margin: 0; color: var(--muted); font-size: 15.5px; }
.project-meta { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.project-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border-bottom: 1px solid var(--line); }
.project-link { color: var(--accent); font-weight: 600; font-size: 15px; margin-top: auto; }
.shot-fig.wide img { width: 100%; }

/* Device frames: phones get a phone bezel, desktop shots get a browser window */
.browser { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16); }
.browser-bar { display: flex; align-items: center; gap: 7px; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #e0e0e0; display: block; }
.browser-bar i:nth-child(1) { background: #ff5f57; } .browser-bar i:nth-child(2) { background: #febc2e; } .browser-bar i:nth-child(3) { background: #28c840; }
.browser-bar span { margin-left: 10px; flex: 1; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser img { display: block; width: 100%; }
.phone { width: 100%; max-width: 250px; margin: 0 auto; border: 9px solid #15171c; border-radius: 34px; overflow: hidden; background: #15171c; box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22); position: relative; }
.phone::before { content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 64px; height: 16px; border-radius: 10px; background: #15171c; z-index: 2; }
.phone img { display: block; width: 100%; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; border-radius: 25px; }
.phones { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 22px; margin: 28px 0; }
figure.framed { margin: 0; }
figure.framed figcaption { font-size: 13.5px; color: var(--muted); margin-top: 12px; text-align: center; }
.showcase { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 28px; align-items: end; margin-top: 28px; }
@media (max-width: 760px) { .showcase { grid-template-columns: 1fr; } .showcase .phone { max-width: 220px; } }

/* Feature rows: paragraph beside a screenshot, alternating sides */
.frow { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 36px; align-items: center; padding: 34px 0; border-top: 1px solid var(--line); }
.frow.flip .frow-text { order: 2; }
.frow h3 { font-size: 22px; margin-bottom: 8px; }
.frow p { color: var(--muted); }
.frow ul { color: var(--muted); padding-left: 18px; margin: 8px 0 0; font-size: 15.5px; }
.frow li + li { margin-top: 4px; }
.frow .phone { max-width: 210px; }
@media (max-width: 820px) { .frow { grid-template-columns: 1fr; gap: 18px; } .frow.flip .frow-text { order: 0; } }
.wide-wrap { max-width: 1120px; }

/* "How it works" note under a feature */
.how { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--verify); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; color: var(--muted); line-height: 1.55; }
.how > b { display: block; color: var(--verify); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.how-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.how-tags span { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); }

/* Hero with photo */
.hero-photo { width: 190px; height: 190px; border-radius: 50%; object-fit: cover; border: 4px solid var(--surface); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18); }
@media (max-width: 820px) { .hero-photo { width: 130px; height: 130px; } }

/* Proof strip */
.proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.proof div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.proof b { display: block; font-size: 30px; letter-spacing: -0.02em; color: var(--accent); }
.proof span { display: block; font-weight: 600; margin-top: 2px; }
.proof small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 4px; line-height: 1.45; }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 22px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.feature b { display: block; font-size: 15.5px; }
.feature span { color: var(--muted); font-size: 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  section { padding: 40px 0; }
  .hero { padding: 48px 0 40px; }
}
