:root {
  --bg: #ffffff;
  --alt: #f5f8f6;
  --text: #1c2420;
  --muted: #5a6760;
  --accent: #2f7d5b;
  --accent-soft: #e3f1ea;
  --border: #dbe3de;
  --max: 1040px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101512;
    --alt: #161d19;
    --text: #e8efea;
    --muted: #9aa8a0;
    --accent: #5fc08f;
    --accent-soft: #1d2c24;
    --border: #28342d;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0;
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
a { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.02em; max-width: 20ch; }
h2 { font-size: 1.75rem; letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: 1.4em 0 .4em; }
h4:first-child { margin-top: 0; }
p { margin: 0 0 1em; }
section { padding: 72px 0; }
section.alt { background: var(--alt); }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.nav nav a { margin-left: 22px; color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav nav a:hover { color: var(--accent); }

/* hero */
.hero { padding: 88px 0 64px; }
.eyebrow { color: var(--accent); font-weight: 600; margin-bottom: .6em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 68ch; }
.stats { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stats li { border-left: 3px solid var(--accent); padding-left: 14px; }
.stats strong { display: block; font-size: 1.8rem; color: var(--accent); line-height: 1.1; }
.stats span { color: var(--muted); font-size: .9rem; }

.section-intro { color: var(--muted); max-width: 66ch; margin-bottom: 2em; }

/* cards */
.grid { display: grid; gap: 20px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card { background: var(--alt); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
section.alt .card { background: var(--bg); }
.card h3 { color: var(--accent); }
.card p:last-child { margin-bottom: 0; }

.sub { margin-top: 2.4em; }
.steps { list-style: none; counter-reset: s; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.steps li { counter-increment: s; border-top: 3px solid var(--accent); padding-top: 10px; }
.steps li::before { content: counter(s); color: var(--accent); font-weight: 700; }
.steps strong { display: block; }
.steps span { color: var(--muted); font-size: .92rem; }

/* work */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.chips a { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); text-decoration: none; font-size: .9rem; }
.chips a:hover { border-color: var(--accent); }

.project { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 32px; margin-bottom: 32px; }
.project > header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.tag { color: var(--accent); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .3em; }
.project h3 { font-size: 1.7rem; margin-bottom: .2em; }
.pitch { color: var(--muted); font-size: 1.05rem; margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 36px; }
.project ul { padding-left: 1.2em; margin: 0 0 1em; }
.project li { margin-bottom: .4em; }
aside { background: var(--accent-soft); border-radius: 10px; padding: 20px; align-self: start; }
.metrics { margin: 0 0 1em; }
.metrics div { margin-bottom: 12px; }
.metrics dt { font-size: 1.5rem; font-weight: 700; color: var(--accent); line-height: 1.15; }
.metrics dd { margin: 0; color: var(--muted); font-size: .9rem; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.pills span { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: .8rem; }

.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 1.2em 0 0; font-size: .85rem; }
.flow span { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 6px; padding: 4px 10px; }
.flow i { color: var(--accent); font-style: normal; font-weight: 700; }

.result { color: var(--accent); font-weight: 600; font-size: .95rem; }

/* timeline */
.timeline { list-style: none; padding: 0 0 0 22px; margin: 0 0 40px; border-left: 2px solid var(--border); }
.timeline > li { position: relative; margin-bottom: 36px; }
.timeline > li::before { content: ""; position: absolute; left: -29px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.when { color: var(--muted); font-size: .85rem; margin-bottom: .1em; }
.timeline h3 { margin-bottom: .1em; }
.role { color: var(--accent); font-style: italic; font-weight: 600; }
.plain { list-style: none; padding: 0; }
.plain li { margin-bottom: .6em; font-size: .95rem; }
.grid.small { margin-top: 20px; }

/* contact */
.center { text-align: center; }
.center .section-intro { margin-left: auto; margin-right: auto; margin-bottom: 1.2em; }
.button { display: inline-block; background: var(--accent); color: var(--bg); padding: 12px 26px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.button:hover { opacity: .9; }

footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: .9rem; }
footer p { margin: 0; }

@media (max-width: 760px) {
  .cols { grid-template-columns: 1fr; }
  .project { padding: 22px; }
  .nav nav a { margin-left: 14px; }
  section { padding: 52px 0; }
}
@media print {
  .nav, .chips { display: none; }
  section { padding: 24px 0; }
  .project { break-inside: avoid; }
}

.group { margin-top: 3em; font-size: 1.5rem; padding-top: 1.2em; border-top: 1px solid var(--border); }
.note { color: var(--muted); font-size: .8rem; font-style: italic; }

.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 1.2em 0; }
.ba-side { border-radius: 10px; padding: 16px; border: 1px solid var(--border); }
.ba-side p { margin: 0 0 .6em; font-size: .95rem; }
.ba-side .pills { margin: 0; }
.ba-side.before { background: var(--alt); }
.ba-side.after { background: var(--accent-soft); border-color: var(--accent); }
.ba-label { font-size: .75rem !important; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #b5533a; }
.ba-side.after .ba-label { color: var(--accent); }
@media (max-width: 760px) { .ba { grid-template-columns: 1fr; } }

/* diagrams */
.diagram { margin: 1.4em 0; }
.diagram svg { width: 100%; height: auto; display: block; font-family: inherit; }
.diagram figcaption { color: var(--muted); font-size: .8rem; font-style: italic; margin-top: 6px; }
.d-box { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.d-new { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.d-old { fill: var(--alt); stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 3; }
.d-t { fill: var(--text); font-size: 13px; font-weight: 600; }
.d-s { fill: var(--muted); font-size: 11px; }
.d-lab { fill: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.d-l { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.d-dash { stroke-dasharray: 4 3; }
.d-ah { fill: var(--accent); }

/* screenshots in a laptop frame */
.shots { margin: 0 0 28px; }
.shots-row { display: grid; gap: 22px; margin-top: 26px; align-items: start; }
.shots-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shots-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shots-row.wide-narrow { grid-template-columns: 2fr 1fr; }
.shots figure { margin: 0; }
.shots figcaption { color: var(--muted); font-size: .82rem; text-align: center; margin-top: 10px; }
.device-fig.device-hero { max-width: 780px; margin: 0 auto; }
.device { filter: drop-shadow(0 10px 18px rgba(0,0,0,.22)); }
.device-lid { position: relative; background: #0e0e10; border-radius: 12px 12px 3px 3px; padding: 2.4% 2.4% 3.2%; border: 1px solid #3a3a3e; }
.device-lid::before { content: ""; position: absolute; top: .9%; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #2c2c30; }
.device-lid img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: #fff; border-radius: 2px; }
.device-base { position: relative; height: 12px; margin: 0 -4%; background: linear-gradient(#dfe1e4, #b5b8bd); border-radius: 0 0 14px 14px / 0 0 10px 10px; border-top: 1px solid #8d9095; }
.device-base::after { content: ""; position: absolute; top: -1px; left: 50%; width: 15%; height: 5px; margin-left: -7.5%; background: #a2a5aa; border-radius: 0 0 8px 8px; }
.shots-row .device-base { height: 8px; }
.shot img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.shot.small { max-width: 240px; margin: 0 auto; }
@media (max-width: 760px) {
  .shots-row.two, .shots-row.three, .shots-row.wide-narrow { grid-template-columns: 1fr; }
}
.shots-row .device-base { margin: 0 -2%; }
.shots-note { color: var(--muted); font-size: .72rem; text-align: right; margin: 10px 0 0; opacity: .8; }

.timeline ul { padding-left: 1.2em; margin: .3em 0 1em; font-size: .95rem; }
.timeline ul li { margin-bottom: .45em; }
.timeline h4 { margin: 1.4em 0 .3em; }
.timeline .result { margin: -.4em 0 1em; font-size: .9rem; }
.role-block { margin: 1.1em 0 0; padding-left: 14px; border-left: 3px solid var(--accent-soft); }
.role-block .role { margin-bottom: 0; }
.role-block .when { margin-bottom: .5em; }

/* intro with portrait and open-to */
.hero-top { display: flex; gap: 48px; align-items: center; justify-content: space-between; }
.hero-text { flex: 1 1 auto; min-width: 0; }
.portrait { flex: 0 0 auto; width: 220px; height: 220px; border-radius: 50%; object-fit: cover; border: 5px solid var(--accent-soft); box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.open-to { display: inline-flex; align-items: center; gap: 10px; margin: 6px 0 0; padding: 8px 16px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent); font-size: .95rem; font-weight: 600; }
.open-to .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); flex: 0 0 auto; }
@media (max-width: 760px) {
  .hero-top { flex-direction: column-reverse; align-items: flex-start; gap: 24px; }
  .portrait { width: 140px; height: 140px; }
  .open-to { border-radius: 14px; }
}

.personal { color: var(--muted); font-size: .98rem; max-width: 68ch; margin: -.2em 0 1.1em; }
