/* Tokens ------------------------------------------------------------ */

:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --ink: #11141a;
  --muted: #5b6170;
  --line: #dcd6c8;
  --accent: #2446f0;
  --accent-ink: #ffffff;
  --chip: #e9e4d8;
  --shadow: 0 1px 2px rgba(17, 20, 26, 0.05), 0 14px 34px rgba(17, 20, 26, 0.08);
  --etw-navy: #18233f;
  --etw-navy-2: #223158;
  --etw-gold: #dcb565;
  --radius: 18px;
  --wrap: 1120px;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e13;
    --surface: #151821;
    --ink: #f1eee6;
    --muted: #a0a6b4;
    --line: #262b38;
    --accent: #8fa2ff;
    --accent-ink: #0b0e17;
    --chip: #1c202b;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.03);
    --etw-navy: #141d35;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0c0e13;
  --surface: #151821;
  --ink: #f1eee6;
  --muted: #a0a6b4;
  --line: #262b38;
  --accent: #8fa2ff;
  --accent-ink: #0b0e17;
  --chip: #1c202b;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.03);
  --etw-navy: #141d35;
  color-scheme: dark;
}

/* Base -------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

main {
  flex: 1;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

ul {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 20;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.muted {
  color: var(--muted);
}

/* Header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 6px;
  padding-top: 11px;
  padding-bottom: 11px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.site-nav .nav-home {
  display: none;
}

.site-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--chip);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  background: var(--chip);
}

.theme {
  display: none;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.js .theme {
  display: inline-flex;
}

.theme:hover {
  border-color: var(--accent);
}

.theme svg {
  width: 16px;
  height: 16px;
}

/* Buttons and chips -------------------------------------------------- */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.btn:hover {
  border-color: var(--ink);
}

.btn:active,
.card:active,
.float-card:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
  }

  .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
  }

  .card:hover .thumb img {
    transform: scale(1.04);
  }

  .float-card:hover {
    transform: translateY(-3px);
  }
}

.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.btn.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.icon {
  padding: 12px;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.chips li {
  background: var(--chip);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.875rem;
}

/* Reveal on scroll (only once site.js is running) ---------------------- */

.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-ready .reveal.in {
  opacity: 1;
  transform: none;
}

/* Phone frame ---------------------------------------------------------- */

.phone {
  --w: 250px;
  width: var(--w);
  flex: none;
  padding: calc(var(--w) * 0.032);
  border-radius: calc(var(--w) * 0.17);
  background: #07080b;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 30px 60px rgba(0, 0, 0, 0.35);
}

.phone img,
.phone video {
  width: 100%;
  aspect-ratio: 990 / 2152;
  object-fit: cover;
  border-radius: calc(var(--w) * 0.14);
  background: #f4f1ea;
}

/* Home: hero ----------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 56px;
  align-items: center;
  padding-top: 48px;
  padding-bottom: 64px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-wrap: balance;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  margin: 0 0 22px;
}

.status .dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #1fa971;
  box-shadow: 0 0 0 4px rgba(31, 169, 113, 0.2);
}

.hero h1 {
  font-size: clamp(2.6rem, 6.6vw, 4.7rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.98;
  margin-bottom: 22px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 58ch;
  margin-bottom: 32px;
}

.lede strong {
  color: var(--ink);
  font-weight: 600;
}

.intro {
  font-size: clamp(1.2rem, 2.1vw, 1.45rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  max-width: 34em;
  margin-bottom: 16px;
}

.intro-sub {
  color: var(--muted);
  max-width: 62ch;
  margin-bottom: 32px;
}

.intro strong,
.intro-sub strong {
  color: var(--ink);
  font-weight: 600;
}

.hero-art {
  position: relative;
  justify-self: center;
  width: 320px;
  max-width: 100%;
}

.ring {
  position: relative;
}

.ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  transform: translate(16px, 14px);
}

.portrait {
  position: relative;
  width: 100%;
  border-radius: 50%;
}

.float-card {
  position: absolute;
  left: -34px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.25;
  white-space: nowrap;
  transition: transform 0.15s, border-color 0.15s;
}

.float-card:hover {
  border-color: var(--accent);
}

.float-card img {
  width: 44px;
  height: 44px;
  border-radius: 11px;
}

.float-card b {
  display: block;
  font-size: 0.95rem;
}

.float-card small {
  color: var(--muted);
  font-size: 0.8125rem;
}

/* Home: facts strip ------------------------------------------------------ */

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  list-style: none;
  padding: 0;
  margin: 0;
}

.facts li {
  padding: 26px 24px 26px 0;
}

.facts li + li {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.facts b {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 8px;
}

.facts span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
  display: block;
}

/* Sections --------------------------------------------------------------- */

.section {
  padding-top: 96px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 36px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 700;
}

.section-sub {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 12px 0 0;
  max-width: 60ch;
}

.work-note {
  color: var(--muted);
  margin: 24px 0 0;
  max-width: 78ch;
}

.decision .chips {
  margin-top: 18px;
}

.decision .built {
  padding-left: 1.1em;
  margin: 16px 0 0;
  color: var(--muted);
}

.decision .built li {
  margin-bottom: 10px;
}

.decision .built li::marker {
  color: var(--accent);
}

.decision .built strong {
  color: var(--ink);
  font-weight: 600;
}

.decision .expand {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink);
  margin: -4px 0 12px;
}

.more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.more:hover {
  text-decoration: underline;
}

/* Explore the Word panel --------------------------------------------------- */

.feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 40px;
  padding: 60px 60px 0;
  border-radius: 32px;
  overflow: hidden;
  color: #f5f1e6;
  background:
    radial-gradient(900px 500px at 88% 0%, rgba(220, 181, 101, 0.2), transparent 60%),
    linear-gradient(160deg, var(--etw-navy-2), var(--etw-navy) 55%);
}

.feature .eyebrow {
  color: var(--etw-gold);
}

.feature-copy {
  padding-bottom: 60px;
}

.app-id {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.app-id img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.feature h2,
.feature h1 {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  font-weight: 700;
  color: #fff;
}

.feature .tagline {
  font-size: 1.2rem;
  color: var(--etw-gold);
  margin: 0 0 18px;
}

.feature p {
  color: rgba(245, 241, 230, 0.82);
  max-width: 54ch;
}

.ticks {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
}

.ticks li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  color: rgba(245, 241, 230, 0.92);
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--etw-gold);
  border-bottom: 2px solid var(--etw-gold);
  transform: rotate(-45deg);
}

.feature .chips {
  margin-bottom: 30px;
}

.feature .chips li {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f1e6;
}

.feature .btn {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.feature .btn:hover {
  border-color: #fff;
}

.feature .btn.primary {
  background: var(--etw-gold);
  border-color: var(--etw-gold);
  color: #18233f;
}

.feature .btn.primary:hover {
  background: #fff;
  border-color: #fff;
  color: #18233f;
}

.phones {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: -90px;
}

.feature.tall .phones {
  align-self: start;
  margin-bottom: -150px;
}

.phones .back {
  --w: 230px;
  margin-right: -60px;
  transform: rotate(-7deg) translateY(30px);
}

.phones .front {
  --w: 285px;
  position: relative;
  z-index: 1;
  transform: rotate(3deg);
}

/* Project cards ------------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--accent);
}

.thumb {
  aspect-ratio: 16 / 9;
  background: var(--chip);
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.thumb.plot {
  background: linear-gradient(150deg, #0d1322, #1d2b52);
  color: #9fb1ff;
}

.thumb.plot svg {
  width: 100%;
  height: 100%;
  display: block;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px 22px;
  flex: 1;
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.card .tags {
  margin-top: auto;
  padding-top: 10px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Timeline ------------------------------------------------------------------- */

.timeline {
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 6px 32px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.row .when {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  padding-top: 5px;
  margin: 0;
}

.row h3 {
  font-size: 1.3rem;
  font-weight: 700;
}

.row .org {
  color: var(--muted);
  margin: 4px 0 0;
}

.row .sum {
  margin: 10px 0 0;
  max-width: 68ch;
}

.row ul {
  padding-left: 1.1em;
  margin-top: 12px;
  max-width: 72ch;
}

.row li {
  margin-bottom: 6px;
}

.row li::marker,
.project li::marker,
.prose li::marker {
  color: var(--accent);
}

.skill-rows {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px 32px;
  margin: 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
}

.skill-rows dt {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  padding-top: 5px;
}

.skill-rows dd {
  margin: 0;
}

/* Contact call to action -------------------------------------------------------- */

.cta {
  margin-top: 96px;
  margin-bottom: 96px;
  padding: 64px 56px;
  border-radius: 32px;
  background: var(--ink);
  color: var(--bg);
}

.cta h2 {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}

.cta p {
  max-width: 52ch;
  opacity: 0.8;
  margin-bottom: 28px;
}

.cta .btn {
  background: transparent;
  color: var(--bg);
  border-color: color-mix(in srgb, var(--bg) 35%, transparent);
}

.cta .btn:hover {
  border-color: var(--bg);
}

.cta .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* Inner pages --------------------------------------------------------------------- */

.page-head {
  padding: 72px 0 8px;
}

.page-head h1 {
  font-size: clamp(2.5rem, 7vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.page-head p {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 60ch;
  margin: 18px 0 0;
}

.sub {
  padding-top: 64px;
}

.sub > h2 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.last {
  padding-bottom: 96px;
}

/* Projects page */

.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px 44px;
  padding: 52px 0;
  border-bottom: 1px solid var(--line);
}

.project:last-child {
  border-bottom: 0;
}

.project header {
  grid-column: 1 / -1;
}

.project h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  font-weight: 700;
}

.project .lede {
  font-size: 1.05rem;
  margin: 10px 0 0;
}

.project h3 {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 22px 0 10px;
}

.project .body > h3:first-child {
  margin-top: 0;
}

.project .body > ul:not(.chips) {
  padding-left: 1.1em;
}

.project .body > ul:not(.chips) li {
  margin-bottom: 6px;
}

.project.no-media .body {
  grid-column: 1 / -1;
  max-width: 72ch;
}

.project .btn-row {
  margin-bottom: 24px;
}

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Case study */

.cs-top {
  margin-top: 40px;
}

.cs-top .phones {
  margin-bottom: -70px;
}

.meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.meta li {
  padding: 20px 20px 20px 0;
}

.meta li + li {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.meta span {
  display: block;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.prose {
  max-width: 70ch;
}

.prose p {
  font-size: 1.1rem;
}

.prose ul {
  padding-left: 1.1em;
}

.prose li {
  margin-bottom: 8px;
}

.split {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  padding: 44px 0;
  border-top: 1px solid var(--line);
}

.split.flip {
  grid-template-columns: minmax(0, 1fr) auto;
}

.split.flip .phone {
  order: 2;
}

.split .phone {
  --w: 240px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), var(--shadow);
}

.split h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.split p {
  color: var(--muted);
  max-width: 56ch;
}

.split ul {
  padding-left: 1.1em;
  max-width: 56ch;
}

.split li {
  margin-bottom: 6px;
}

.split li::marker {
  color: var(--accent);
}

.decisions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.decision {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.decision .eyebrow {
  margin-bottom: 10px;
}

.decision h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.decision p {
  color: var(--muted);
  margin: 0;
}

.gallery {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 8px 28px 28px;
  margin: 0 -28px;
  scrollbar-width: thin;
}

.gallery figure {
  margin: 0;
  scroll-snap-align: center;
}

.gallery .phone {
  --w: 220px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), var(--shadow);
}

.gallery figcaption {
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 12px;
}

/* Contact page */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  padding: 44px 0 96px;
  align-items: stretch;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.panel h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.big-link {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.3rem, 3.2vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
  padding: 10px 0;
  margin-bottom: 8px;
}

.big-link:hover {
  color: var(--accent);
}

.reasons {
  padding-left: 1.1em;
  margin: 0 0 24px;
}

.reasons li {
  margin-bottom: 10px;
}

.reasons li::marker {
  color: var(--accent);
}

.details {
  margin: 0;
}

.details div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.details div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.details dt {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 4px;
}

.details dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.details dd a {
  display: inline-block;
  padding: 11px 0;
  margin: -11px 0;
}


/* Footer -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.site-footer .wrap > span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 9px;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  margin: 0 -9px;
}

.lost {
  padding: 140px 0;
  text-align: center;
}

.lost h1 {
  font-size: clamp(2.4rem, 7vw, 4rem);
  margin-bottom: 12px;
}

.lost p {
  color: var(--muted);
}

/* Responsive ---------------------------------------------------------------------- */

@media (max-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
    padding-top: 56px;
  }

  .theme {
    width: 44px;
    height: 44px;
  }

  .site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
  }

  .hero-art {
    order: -1;
    justify-self: start;
    width: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 36px;
  }

  .ring {
    width: 170px;
  }

  .ring::before {
    transform: translate(10px, 9px);
  }

  .float-card {
    position: static;
  }

  .feature {
    grid-template-columns: minmax(0, 1fr);
    padding: 44px 32px 0;
    gap: 8px;
  }

  .feature-copy {
    padding-bottom: 36px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project,
  .contact-grid,
  .decisions {
    grid-template-columns: minmax(0, 1fr);
  }

  .split,
  .split.flip {
    gap: 36px;
  }

  .split .phone {
    --w: 210px;
  }

  .facts,
  .meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .facts li:nth-child(3),
  .meta li:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .facts li:nth-child(n + 3),
  .meta li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .section {
    padding-top: 72px;
  }

  .cta {
    padding: 44px 32px;
    margin-top: 72px;
    margin-bottom: 72px;
  }
}

@media (max-width: 720px) {
  .split,
  .split.flip {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 36px 0;
  }

  .split .phone {
    --w: min(230px, 62vw);
    justify-self: center;
  }

  .split.flip .phone {
    order: 0;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 16px;
  }

  .wrap {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Header: one row with the name and the theme switch. The page links move
     to a floating bar at the bottom, within reach of a thumb. */
  .site-header {
    position: static;
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .bar {
    flex-wrap: nowrap;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .theme {
    margin-left: auto;
  }

  .site-nav {
    position: fixed;
    z-index: 30;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-width: 420px;
    margin: 0 auto;
    padding: 5px;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    box-shadow: 0 1px 2px rgba(17, 20, 26, 0.08), 0 10px 30px rgba(17, 20, 26, 0.18);
  }

  .site-nav a,
  .site-nav .nav-home {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 8px;
    font-size: 0.9rem;
    font-weight: 500;
  }

  .site-nav a:hover {
    background: transparent;
  }

  .site-nav a[aria-current="page"] {
    background: var(--ink);
    color: var(--bg);
  }

  .site-footer .wrap {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  /* Buttons fill their row and are easy to hit. */
  .btn {
    min-height: 48px;
    justify-content: center;
  }

  .btn-row .btn:not(.icon) {
    flex: 1 1 auto;
  }

  .btn.icon {
    width: 48px;
    padding: 0;
  }

  /* Hero: portrait and status share a row, then headline, intro and buttons
     before the longer biography. */
  .hero {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0 14px;
    padding-top: 22px;
    padding-bottom: 44px;
  }

  .hero-copy {
    display: contents;
  }

  .hero-art {
    grid-column: 1;
    grid-row: 1;
    display: block;
  }

  .ring {
    width: 68px;
  }

  .ring::before {
    border-width: 1.5px;
    transform: translate(5px, 4px);
  }

  .float-card {
    display: none;
  }

  /* Beside the portrait the status reads as two plain lines: role, then place. */
  .status {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 2px 9px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-family: var(--sans);
    font-size: 0.98rem;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.35;
  }

  .status .role {
    grid-column: 1 / -1;
    grid-row: 1;
    font-weight: 600;
  }

  .status .sep {
    display: none;
  }

  .status .dot {
    grid-row: 2;
    margin-left: 4px;
  }

  .status .place {
    grid-row: 2;
    color: var(--muted);
  }

  .hero h1,
  .hero .intro,
  .hero .intro-sub,
  .hero .btn-row {
    grid-column: 1 / -1;
  }

  .hero h1 {
    margin-top: 22px;
    margin-bottom: 18px;
  }

  .hero .intro {
    font-size: 1.125rem;
    margin-bottom: 22px;
  }

  .hero .btn-row {
    order: 1;
  }

  .hero .btn.primary {
    flex-basis: 100%;
  }

  .hero .intro-sub {
    order: 2;
    margin: 26px 0 0;
  }

  .section {
    padding-top: 60px;
  }

  .section-head {
    margin-bottom: 24px;
  }

  .section-sub {
    font-size: 1.02rem;
  }

  .decision,
  .panel {
    padding: 22px 20px;
  }

  /* Earlier projects become compact rows. */
  .cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .cards .card {
    flex-direction: row;
  }

  .cards .thumb {
    flex: 0 0 104px;
    aspect-ratio: auto;
  }

  .cards .card-body {
    gap: 4px;
    padding: 14px 16px;
  }

  .cards .card h3 {
    font-size: 1.05rem;
  }

  .cards .card p {
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }

  .cards .card .tags {
    padding-top: 6px;
  }

  .row,
  .skill-rows {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .row {
    padding: 22px 0;
  }

  /* The home page keeps the roles and dates; the detail is one tap away. */
  .timeline.brief .sum {
    display: none;
  }

  .skill-rows dd {
    margin-bottom: 12px;
  }

  .feature {
    border-radius: 24px;
    padding: 32px 22px 0;
  }

  .feature .tagline {
    font-size: 1.1rem;
  }

  .phones .back {
    --w: clamp(112px, 38vw, 150px);
    margin-right: -40px;
  }

  .phones .front {
    --w: clamp(144px, 48vw, 190px);
  }

  .gallery {
    padding: 8px 20px 24px;
    margin: 0 -20px;
    gap: 16px;
  }

  .gallery .phone {
    --w: 200px;
  }

  .page-head {
    padding: 44px 0 4px;
  }

  .page-head p {
    font-size: 1.05rem;
  }

  .sub {
    padding-top: 48px;
  }

  .last {
    padding-bottom: 64px;
  }

  .project {
    padding: 40px 0;
  }

  .contact-grid {
    gap: 16px;
    padding: 32px 0 64px;
  }

  .details div {
    flex-direction: column;
    gap: 0;
    padding: 12px 0;
  }

  .details dt {
    padding-top: 0;
  }

  .details dd {
    text-align: left;
  }

  .details dd a {
    padding: 8px 0 12px;
    margin: 0 0 -12px;
  }

  .cta {
    border-radius: 24px;
    padding: 36px 24px;
    margin-top: 60px;
    margin-bottom: 60px;
  }

  .facts li,
  .facts li + li,
  .meta li,
  .meta li + li {
    padding: 18px 12px 18px 0;
  }

  .facts li:nth-child(even),
  .meta li:nth-child(even) {
    padding-left: 16px;
  }

  .lost {
    padding: 88px 0;
  }
}

@media (max-width: 370px) {
  .hero .btn-row .btn:not(.icon) {
    flex-basis: 100%;
  }
}

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

  .btn,
  .card,
  .float-card,
  .thumb img {
    transition: none;
  }

  .reveal-ready .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media print {
  .reveal-ready .reveal {
    opacity: 1;
    transform: none;
  }

  .site-nav,
  .theme {
    display: none;
  }
}
