/* ───────────────────────────────────────────────
   Apple HIG–inspired tokens
   System font, semantic colors, materials, 8pt grid
   ─────────────────────────────────────────────── */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-round: ui-rounded, -apple-system, "SF Pro Rounded", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* Semantic colors — light */
  --bg: #f5f2ee;                 /* systemGroupedBackground, warmed */
  --bg-elevated: #ffffff;        /* secondarySystemGroupedBackground */
  --fill: rgba(120, 100, 85, 0.10);
  --fill-strong: rgba(120, 100, 85, 0.16);
  --label: #1d1b19;
  --label-2: rgba(60, 52, 46, 0.72);
  --label-3: rgba(60, 52, 46, 0.48);
  --separator: rgba(60, 50, 40, 0.14);
  --tint: #8a5a3c;               /* accent — warm brown from your icon set */
  --tint-fill: rgba(138, 90, 60, 0.12);
  --on-tint: #ffffff;
  --green: #34c759;
  --material: rgba(245, 242, 238, 0.72);
  --shadow: 0 1px 2px rgba(40, 30, 20, 0.04), 0 8px 24px rgba(40, 30, 20, 0.06);

  --r-card: 20px;
  --r-control: 12px;
  --maxw: 980px;
  --gutter: clamp(16px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --fill: rgba(118, 118, 128, 0.20);
    --fill-strong: rgba(118, 118, 128, 0.30);
    --label: #f5f5f7;
    --label-2: rgba(235, 235, 245, 0.66);
    --label-3: rgba(235, 235, 245, 0.40);
    --separator: rgba(84, 84, 88, 0.60);
    --tint: #e0a77f;
    --tint-fill: rgba(224, 167, 127, 0.16);
    --on-tint: #1d1209;
    --green: #30d158;
    --material: rgba(22, 22, 24, 0.72);
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;               /* HIG body */
  line-height: 1.47;
  letter-spacing: -0.022em;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--tint); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; border-radius: 8px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--bg-elevated); padding: 10px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }

/* ── Navigation bar (material) ── */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}
.navbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--label); font-weight: 600; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--tint); color: var(--on-tint); font: 700 12px/1 var(--font-round); letter-spacing: 0;
}
.nav-links { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--label-2); font-size: 14px; border-radius: 10px;
}
.nav-links a:hover { color: var(--label); text-decoration: none; }
.nav-cta { color: var(--tint) !important; font-weight: 600; }
@media (max-width: 720px) {
  .nav-links li:not(:last-child) { display: none; }
  .brand-name { display: none; }
}

/* ── Layout ── */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 48px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-title { font-size: 28px; line-height: 1.14; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 16px; }
.title-2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.group-header {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.02em; font-weight: 500;
  color: var(--label-2); margin: 28px 0 10px 16px;
}
.link-more { font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }

/* ── Hero ── */
.hero { padding: clamp(56px, 10vw, 112px) 0 24px; }
.large-title {
  font-size: clamp(40px, 7vw, 72px); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em;
  margin: 16px 0 16px;
}
.hero-sub { font-size: clamp(19px, 2.2vw, 22px); line-height: 1.4; color: var(--label-2); max-width: 36ch; margin: 0 0 28px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  padding: 6px 12px; border-radius: 999px; background: var(--fill); color: var(--label-2);
  font-size: 13px; font-weight: 500;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }

.facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 48px 0 0;
  background: var(--separator); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow);
}
.facts > div { background: var(--bg-elevated); padding: 18px 20px; }
.facts dt { font-size: 13px; color: var(--label-3); font-weight: 500; margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.facts dd span { font-weight: 400; color: var(--label-2); }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } }

/* ── Buttons (filled / tinted, 44pt min) ── */
.button-row { display: flex; flex-wrap: wrap; gap: 12px; }
.button-row.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  transition: transform .15s ease, filter .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn:active { transform: scale(0.97); }
.btn-filled { background: var(--tint); color: var(--on-tint); }
.btn-tinted { background: var(--tint-fill); color: var(--tint); }
.btn[hidden] { display: none; }

/* ── Cards ── */
.card {
  background: var(--bg-elevated); border-radius: var(--r-card);
  padding: 24px; box-shadow: var(--shadow);
}
.prose p { margin: 0 0 14px; color: var(--label); }
.prose p:last-child { margin: 0; }

.feature { display: grid; grid-template-columns: 56px 1fr; gap: 20px; }
.feature-icon img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.feature p { margin: 0 0 12px; }
.eyebrow { font-size: 13px; color: var(--label-3); font-weight: 500; }
.feature-title { font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0 12px; }
.callout { background: var(--tint-fill); border-radius: var(--r-control); padding: 12px 14px; margin-top: 16px !important; }
@media (max-width: 640px) { .feature { grid-template-columns: 1fr; } }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chips li {
  background: var(--bg-elevated); border: 0.5px solid var(--separator);
  padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--label-2);
}

/* ── Segmented control ── */
.segmented {
  display: inline-flex; padding: 2px; gap: 2px; margin: 0 0 20px;
  background: var(--fill); border-radius: 10px; max-width: 100%; overflow-x: auto;
}
.segmented button {
  appearance: none; border: 0; background: transparent; color: var(--label);
  font: 500 13px/1 var(--font); min-height: 32px; padding: 0 16px; border-radius: 8px; cursor: pointer;
  white-space: nowrap;
}
.segmented button[aria-selected="true"] { background: var(--bg-elevated); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
@media (prefers-color-scheme: dark) { .segmented button[aria-selected="true"] { background: #636366; } }

/* ── Projects ── */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.project {
  display: flex; flex-direction: column; gap: 10px; min-height: 200px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.project:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 16px 40px rgba(40,30,20,.10); }
.project-top { display: flex; align-items: center; gap: 12px; }
.app-icon {
  width: 48px; height: 48px; flex: none; border-radius: 12px; /* ~22% squircle */
  display: grid; place-items: center; color: #fff; font: 700 20px/1 var(--font-round); letter-spacing: 0;
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,.08);
}
.project h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.project .meta { font-size: 13px; color: var(--label-3); }
.project p { margin: 0; color: var(--label-2); font-size: 15px; flex: 1; }
.project-actions { display: flex; gap: 8px; margin-top: 6px; }
.project-actions .btn { min-height: 36px; padding: 0 14px; font-size: 13px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--tint); background: var(--tint-fill); padding: 3px 8px; border-radius: 6px; }
.skeleton { min-height: 200px; background: linear-gradient(90deg, var(--bg-elevated) 0%, var(--fill) 50%, var(--bg-elevated) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.footnote { font-size: 13px; color: var(--label-3); margin: 14px 4px 0; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--label-2); }

/* ── Inset grouped list ── */
.inset-list { list-style: none; margin: 0; padding: 0; background: var(--bg-elevated); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.inset-list li { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 16px 20px; position: relative; }
.inset-list li + li::before { content: ""; position: absolute; top: 0; left: 20px; right: 0; border-top: 0.5px solid var(--separator); }
.when { color: var(--label-3); font-size: 15px; font-variant-numeric: tabular-nums; }
.what { display: flex; flex-direction: column; gap: 2px; }
.what strong { font-weight: 600; }
.what span { color: var(--label-2); font-size: 15px; }
@media (max-width: 560px) { .inset-list li { grid-template-columns: 1fr; gap: 2px; } }

/* ── Interests ── */
.interests { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 16px; }
.interests li { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: var(--label-2); }
.interests img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
@media (prefers-color-scheme: dark) { .interests img, .feature-icon img { filter: brightness(.9); } }

/* ── Contact & footer ── */
.contact { text-align: center; padding: 40px 24px; }
.contact p { color: var(--label-2); max-width: 46ch; margin: 0 auto 24px; }
.footer { text-align: center; color: var(--label-3); font-size: 13px; padding: 48px var(--gutter) calc(32px + env(safe-area-inset-bottom)); }

/* ── Motion ── */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
