/* =========================================================
   Zion O'Juwonlo — personal site
   Tokens and patterns follow reference.md.
   Accent: cyan (from the withZion GitHub brand).
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #fafaf8;
  --surface: #f1f1ec;
  --surface-2: #e9e9e3;
  --ink: #191917;
  --muted: #54544e;
  --faint: #73736b;
  --line: #1919171a;
  --line-strong: #19191738;
  --accent: #0e7490;
  --ok: #047857;

  /* Headshot backdrop: deeper than the page so a white shirt still reads */
  --ph-haze: 34%; --ph-haze-2: 18%;
  --ph-base-1: #e4e3dc; --ph-base-2: #d6d5cd; --ph-base-3: #ebeae4;

  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-hand: "Caveat", "Comic Sans MS", cursive;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  --max: 64rem;
  --gutter: 1.5rem;
  color-scheme: light;
}

.dark {
  --bg: #0a0a0a;
  --surface: #141413;
  --surface-2: #1d1d1b;
  --ink: #f4f4f2;
  --muted: #a7a7a0;
  --faint: #7c7c75;
  --line: #f4f4f217;
  --line-strong: #f4f4f238;
  --accent: #22d3ee;
  --ok: #34d399;

  --ph-haze: 26%; --ph-haze-2: 12%;
  --ph-base-1: var(--surface); --ph-base-2: var(--bg); --ph-base-3: var(--surface-2);
  color-scheme: dark;
}

@media (min-width: 768px) {
  :root { --gutter: 2.5rem; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .35s, color .35s;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, svg { display: block; }
ul { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: .5rem .9rem; border-radius: 999px; font-size: .875rem;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono { font-family: var(--font-mono); }
.hand { font-family: var(--font-hand); }
.ink { color: var(--ink); }
.accent { color: var(--accent); }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Shared patterns ---------- */
.kicker {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
}

.link-slide {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size .35s var(--ease), color .15s;
}
.link-slide:hover, .link-slide:focus-visible { background-size: 100% 1px; }

.arrow { display: inline-block; transition: transform .3s var(--ease); }
.arrow-nudge:hover .arrow, .arrow-nudge:focus-visible .arrow { transform: translate(2px, -2px); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  border-radius: 999px;
  padding: .625rem 1.25rem;
  font-size: .875rem; font-weight: 500;
  white-space: nowrap;
}
.btn svg { width: 1rem; height: 1rem; }
.btn-primary {
  background: var(--ink); color: var(--bg);
  transition: transform .3s var(--ease);
}
.btn-primary:hover { transform: scale(1.03); }
.btn-primary:active { transform: scale(.98); }
.btn-outline {
  border: 1px solid var(--line); color: var(--muted);
  transition: border-color .15s, color .15s;
}
.btn-outline:hover { border-color: var(--line-strong); color: var(--ink); }
.btn-pill {
  position: relative;
  border: 1px solid var(--line); border-radius: 999px;
  padding: .5rem 1rem;
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--muted);
  overflow: hidden;
  transition: border-color .15s, color .15s;
}
.btn-pill:hover { border-color: var(--line-strong); color: var(--ink); }

/* Handwritten note with drawn arrow */
.scrawl {
  display: inline-flex; align-items: flex-start; gap: .375rem;
  margin-top: -.25rem;
  font-family: var(--font-hand);
  font-size: 1.375rem; line-height: 1;
  color: var(--accent);
  user-select: none;
}
.scrawl svg { width: 1.5rem; height: 1.5rem; margin-top: .5rem; flex-shrink: 0; }
.scrawl.left svg { transform: scaleX(-1); }
.scrawl .curve { stroke-dasharray: 1; stroke-dashoffset: 1; }
.scrawl .head { opacity: 0; }
.scrawl .words { opacity: 0; transform: translateY(4px); display: inline-block; }
.scrawl.drawn .curve { stroke-dashoffset: 0; transition: stroke-dashoffset .8s ease-out .25s; }
.scrawl.drawn .head { opacity: 1; transition: opacity .3s ease 1s; }
.scrawl.drawn .words { opacity: 1; transform: none; transition: opacity .5s var(--ease) .5s, transform .5s var(--ease) .5s; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 40;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background-color .35s;
}
.nav {
  height: 3.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-size: 15px; font-weight: 600; letter-spacing: -.025em; }
.brand .accent { margin-left: 1px; }
.nav-right { display: flex; align-items: center; gap: .5rem; }
.nav-links { display: none; align-items: center; gap: .5rem; }
.nav-links a {
  padding: .25rem .75rem; border-radius: 4px;
  font-size: .875rem; color: var(--muted);
}
.nav-links a:hover { color: var(--ink); }
.nav-divider { width: 1px; height: 1rem; margin-inline: .25rem; background: var(--line); }

.theme-toggle {
  position: relative;
  width: 2rem; height: 2rem; border-radius: 999px;
  display: grid; place-items: center;
  color: var(--muted);
  transition: background-color .15s, color .15s;
}
.theme-toggle:hover { background: var(--surface); color: var(--ink); }
.theme-toggle svg {
  position: absolute; width: 1rem; height: 1rem;
  transition: transform .45s var(--ease), opacity .3s;
}
.theme-toggle .sun { opacity: 0; transform: rotate(-90deg) scale(.6); }
.dark .theme-toggle .sun { opacity: 1; transform: none; }
.dark .theme-toggle .moon { opacity: 0; transform: rotate(90deg) scale(.6); }

/* Mobile menu */
.mobile-menu { position: relative; }
.mobile-menu summary {
  display: flex; align-items: center; gap: .375rem;
  list-style: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  padding: .375rem .75rem;
  font-family: var(--font-mono); font-size: .75rem; color: var(--muted);
  transition: border-color .15s, color .15s;
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary:hover { border-color: var(--line-strong); color: var(--ink); }
.mobile-menu summary svg { width: .75rem; height: .75rem; transition: transform .3s var(--ease); }
.mobile-menu[open] summary svg { transform: rotate(180deg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + .75rem);
  width: 11rem; padding: .5rem;
  border: 1px solid var(--line); border-radius: 1rem;
  background: color-mix(in oklab, var(--bg) 95%, transparent);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);
}
.menu-panel a {
  display: block; padding: .625rem .75rem; border-radius: .75rem;
  font-size: .875rem; color: var(--muted);
  transition: background-color .15s, color .15s;
}
.menu-panel a:hover { background: var(--surface); color: var(--ink); }

@media (min-width: 640px) {
  .nav-links { display: flex; }
  .mobile-menu { display: none; }
}

/* ---------- Sections ---------- */
main { flex: 1; }
.section { padding-block: 5rem; scroll-margin-top: 6rem; }
.section.ruled { border-top: 1px solid var(--line); }

.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem 2rem;
}
.section-title {
  margin-top: .5rem;
  font-size: 1.875rem; line-height: 1.2;
  font-weight: 500; letter-spacing: -.02em;
}
.section-sub { margin-top: .5rem; max-width: 36rem; font-size: .875rem; color: var(--muted); }
@media (min-width: 768px) {
  .section-title { font-size: 2.25rem; line-height: 1.15; }
}

/* ---------- Hero ---------- */
.hero { padding-top: 10rem; padding-bottom: 5rem; }
@media (min-width: 768px) { .hero { padding-top: 12rem; } }

/* Headshot: always on the right */
.hero-photo {
  display: flex; flex-direction: row-reverse; align-items: flex-end;
  justify-content: flex-start; gap: .75rem;
  margin-bottom: 1.75rem;
}
.photo-frame {
  position: relative; isolation: isolate;
  display: block; flex-shrink: 0;
  width: 7.5rem; aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line); border-radius: 1rem;
  /* Soft abstract backdrop built from the theme tokens, so it follows light and dark mode */
  background:
    radial-gradient(55% 45% at 78% 18%, color-mix(in oklab, var(--accent) var(--ph-haze), transparent), transparent 72%),
    radial-gradient(50% 40% at 12% 62%, color-mix(in oklab, var(--accent) var(--ph-haze-2), transparent), transparent 70%),
    radial-gradient(70% 55% at 40% 108%, color-mix(in oklab, var(--ink) 10%, transparent), transparent 70%),
    conic-gradient(from 210deg at 65% 35%, var(--ph-base-1), var(--ph-base-2), var(--ph-base-3), var(--ph-base-1));
}
/* Fine grain so the gradient reads as a surface, not a flat fill */
.photo-frame::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .22; mix-blend-mode: overlay;
}
.photo-frame img {
  position: relative;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease);
}
.hero-photo:hover .photo-frame img { transform: scale(1.03); }
.hero-photo .scrawl { margin-bottom: 1.25rem; flex-direction: row-reverse; }
.hero-photo .scrawl svg { transform: rotate(-75deg); }

/* Tablet and up: photo beside the text */
@media (min-width: 640px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 2.5rem;
    align-items: start;
  }
  .hero-text { grid-column: 1; grid-row: 1; }
  .hero-photo {
    grid-column: 2; grid-row: 1;
    flex-direction: column; align-items: flex-end;
    margin: 0; padding-top: 1.5rem;
  }
  .photo-frame { width: clamp(11rem, 26vw, 18.5rem); }
  .hero-photo .scrawl { margin: .25rem 1rem 0 0; flex-direction: row-reverse; }
  .hero-photo .scrawl svg { transform: scaleY(-1); margin-top: -.25rem; }
}

/* Wide screens: note sits to the upper right of the photo, pointing down-left */
@media (min-width: 1200px) {
  .hero { column-gap: 3rem; }
  .hero-photo { position: relative; }
  .hero-photo .scrawl {
    position: absolute; left: calc(100% - 1.25rem); top: -.25rem;
    flex-direction: row;
    margin: 0; white-space: nowrap;
  }
  .hero-photo .scrawl svg { transform: scaleX(-1); margin-top: .5rem; }
}

.status {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em;
  color: var(--muted);
}
.status .dot { position: relative; width: .5rem; height: .5rem; border-radius: 999px; background: var(--ok); }
.status .dot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--ok); animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping {
  0% { transform: scale(1); opacity: .6; }
  80%, 100% { transform: scale(2.6); opacity: 0; }
}

.hero-name {
  margin-top: 1.5rem;
  font-size: clamp(2.9rem, 9vw, 4.75rem);
  line-height: 1.02;
  font-weight: 500;
  letter-spacing: -.04em;
}
.hero-name .word-group { display: inline-block; white-space: nowrap; }
.hero-name .letter { display: inline-block; }

.hero-intro {
  margin-top: 1.25rem; max-width: 34rem;
  font-size: 1.125rem; line-height: 1.625; color: var(--muted);
}
.hero-meta {
  margin-top: 1rem;
  font-size: .75rem; letter-spacing: .08em; color: var(--faint);
}
.hero-cta {
  margin-top: 2.25rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem;
}
.hero-cta .group { display: inline-flex; align-items: center; gap: 1.25rem; }
.text-link {
  font-family: var(--font-mono); font-size: .875rem; color: var(--muted);
  transition: color .15s;
}
.text-link:hover { color: var(--ink); }
.hero-socials {
  margin-top: 3rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
}
.hero-socials a {
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em;
  color: var(--faint); transition: color .15s;
}
.hero-socials a:hover { color: var(--ink); }

/* Hero entrance */
@keyframes letter-in {
  from { opacity: 0; filter: blur(10px); transform: translateY(.4em); }
  to   { opacity: 1; filter: blur(0); transform: none; }
}
@keyframes rise-in {
  from { opacity: 0; filter: blur(6px); transform: translateY(22px); }
  to   { opacity: 1; filter: blur(0); transform: none; }
}
.hero-pending .hero-name,
.hero-pending .hero-item { opacity: 0; }
.hero-ready .hero-name .letter { animation: letter-in .7s var(--ease) both; }
.hero-ready .hero-item { animation: rise-in .8s var(--ease) both; }

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Projects ---------- */
.view-toggle {
  display: inline-flex; padding: .25rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in oklab, var(--surface) 30%, transparent);
}
.view-toggle button {
  width: 2.5rem; height: 2.5rem; border-radius: 999px;
  display: grid; place-items: center;
  color: var(--faint);
  transition: background-color .2s, color .2s, transform .2s;
}
.view-toggle button:active { transform: scale(.94); }
.view-toggle button:hover { color: var(--ink); }
.view-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); }
.view-toggle svg { width: 1rem; height: 1rem; }

.group-label { margin-top: 3rem; }
.group-label:first-child { margin-top: 0; }

.projects { margin-top: 2.5rem; }
.project-grid { margin-top: 1rem; display: grid; gap: 1.5rem; }
@media (min-width: 768px) {
  .project-grid { grid-template-columns: 1fr 1fr; }
  .card.featured { grid-column: span 2; }
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  height: 100%;
  padding: 1.5rem;
  border: 1px solid var(--line); border-radius: 1rem;
  background: color-mix(in oklab, var(--surface) 50%, transparent);
  transition: transform .3s var(--ease), border-color .3s var(--ease), opacity .7s var(--ease);
}
@media (min-width: 768px) { .card { padding: 1.75rem; } }
.card:hover { border-color: var(--line-strong); }
.js .card.reveal.in:hover { transform: translateY(-4px); }
.card > * { position: relative; }

.card { cursor: pointer; }

/* Cursor spotlight */
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in oklab, var(--accent) 10%, transparent), transparent 70%);
  opacity: 0; transition: opacity .4s;
}
.card:hover::before { opacity: 1; }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.card-title { font-size: 1.25rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; }
.card-open { text-align: left; font-weight: inherit; letter-spacing: inherit; }
.card-open::after { content: ""; position: absolute; inset: -1.75rem; border-radius: 1rem; }
.card-open:focus-visible { outline: none; }
.card:has(.card-open:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

.card-note {
  flex-shrink: 0; margin-top: -.25rem;
  font-family: var(--font-hand); font-size: 1.125rem; line-height: 1.2;
  color: var(--accent);
  transform: rotate(-2deg);
  transition: transform .3s var(--ease);
}
.card:hover .card-note { transform: rotate(-6deg) scale(1.05); }

.card-blurb { margin-top: .375rem; font-size: .875rem; line-height: 1.6; color: var(--muted); }

.card-rows { margin-top: 1.5rem; flex: 1; }
.card-rows > div {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem;
  padding-block: 1rem; border-top: 1px solid var(--line);
}
.card-rows dt, .dialog-rows dt {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .14em; color: var(--faint);
  padding-top: .15rem;
}
.card-rows dd { font-size: .875rem; line-height: 1.625; color: var(--muted); }

.card-foot {
  margin-top: .5rem; padding-top: 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--faint);
}
.card-more { flex-shrink: 0; transition: color .15s; }
.card:hover .card-more { color: var(--ink); }
.card:hover .card-more .arrow { transform: translate(2px, -2px); }

/* List view */
.list-view .project-grid { display: block; border-top: 1px solid var(--line); }
.list-view .card {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "title" "tags" "blurb";
  gap: .5rem;
  padding: 1.25rem 3rem 1.25rem 0;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: none;
  min-height: 7rem;
  transform: none !important;
}
.list-view .card::before, .list-view .card-rows, .list-view .card-note, .list-view .more-label { display: none; }
.list-view .card-head, .list-view .card-foot { display: contents; }
.list-view .card-title { grid-area: title; font-size: 1.125rem; transition: color .2s; }
.list-view .card-tags { grid-area: tags; }
.list-view .card-blurb { grid-area: blurb; margin: 0; max-width: 42rem; }
.list-view .card-blurb .accent { display: none; }
.list-view .card-more { position: absolute; right: 0; top: 1.25rem; }
.list-view .card-more .arrow { font-size: 1.125rem; }
.list-view .card:hover .card-title { color: var(--accent); }
.list-view .card-open::after { inset: 0; border-radius: 0; }
@media (min-width: 768px) {
  .list-view .card {
    grid-template-columns: minmax(10rem, .7fr) minmax(0, 1.6fr) 2rem;
    grid-template-areas: "title blurb more" "tags blurb more";
    align-items: center; column-gap: 2rem; row-gap: .375rem;
    padding-right: 0;
  }
  .list-view .card-title { align-self: end; }
  .list-view .card-tags { align-self: start; }
  .list-view .card-more {
    position: static; grid-area: more; justify-self: end;
    opacity: 0; transform: translate(-4px, 4px);
    transition: opacity .2s, transform .2s var(--ease);
  }
  .list-view .card:hover .card-more { opacity: 1; transform: none; color: var(--accent); }
}

/* ---------- Project dialog ---------- */
.project-dialog {
  margin: auto;
  width: calc(100% - 2rem); max-width: 42rem;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: 0;
  border: 1px solid var(--line); border-radius: 1rem;
  background: var(--bg); color: var(--ink);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / .35);
}
.project-dialog::backdrop {
  background: color-mix(in oklab, var(--ink) 36%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.project-dialog[open] { animation: dialog-in .28s var(--ease) both; }
.project-dialog[open]::backdrop { animation: fade-in .22s ease-out both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@keyframes fade-in { from { opacity: 0; } }

.dialog-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem;
  padding: 1.5rem; border-bottom: 1px solid var(--line);
}
.dialog-title { margin-top: .5rem; font-size: 1.5rem; font-weight: 500; letter-spacing: -.02em; line-height: 1.2; }
.dialog-note { margin-top: .5rem; font-family: var(--font-hand); font-size: 1.25rem; color: var(--accent); transform: rotate(-1deg); transform-origin: left; }
.dialog-close {
  min-height: 2.75rem; flex-shrink: 0; padding-inline: 1rem;
  border: 1px solid var(--line); border-radius: .75rem;
  font-size: .875rem; color: var(--muted);
  transition: border-color .2s, color .2s, transform .2s;
}
.dialog-close:hover { border-color: var(--line-strong); color: var(--ink); }
.dialog-close:active { transform: scale(.98); }
.dialog-body { padding: 1.5rem; }
.dialog-headline { font-size: 1.125rem; line-height: 1.5; letter-spacing: -.01em; max-width: 36rem; }
.dialog-story { margin-top: 1.25rem; display: grid; gap: 1rem; max-width: 36rem; font-size: 1rem; line-height: 1.7; color: var(--muted); }
.dialog-rows { margin-top: 1.75rem; border-top: 1px solid var(--line); }
.dialog-rows > div { display: grid; gap: .5rem; padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
.dialog-rows dd { font-size: .875rem; line-height: 1.625; color: var(--muted); }
.dialog-actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .75rem; }
@media (min-width: 640px) {
  .dialog-rows > div { grid-template-columns: 6rem 1fr; gap: 1.25rem; }
}
@media (min-width: 768px) {
  .dialog-head, .dialog-body { padding: 2rem; }
  .dialog-title { font-size: 1.875rem; }
}

/* ---------- Services accordion ---------- */
.services { margin-top: 2.5rem; }
.service { border-bottom: 1px solid var(--line); }
.service:last-child { border-bottom: 0; }
.service-btn {
  width: calc(100% + 1.5rem); margin-inline: -.75rem;
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem .75rem; border-radius: .75rem;
  text-align: left;
  transition: background-color .3s;
}
.service-btn:hover { background: color-mix(in oklab, var(--surface) 50%, transparent); }
.service-index { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; color: var(--faint); width: 1.75rem; flex-shrink: 0; }
.service-text { flex: 1; min-width: 0; }
.service-name { display: block; font-weight: 500; }
.service-sub { display: block; font-size: .875rem; color: var(--muted); }
.service-tag { display: none; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; color: var(--faint); }
@media (min-width: 640px) { .service-tag { display: block; } }
.chev { width: .75rem; height: .75rem; color: var(--faint); transition: transform .3s var(--ease), color .15s; flex-shrink: 0; }
.service-btn:hover .chev { color: var(--ink); }
.service-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.service-panel {
  display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows .45s var(--ease), opacity .45s var(--ease);
}
.service-panel > div { overflow: hidden; }
.service.open .service-panel { grid-template-rows: 1fr; opacity: 1; }
.service-inner { padding: 0 1rem 1.5rem 2.75rem; }
.service-inner p { font-size: .875rem; line-height: 1.625; color: var(--muted); max-width: 40rem; }
.service-inner ul { margin-top: .75rem; display: grid; gap: .5rem; }
.service-inner li { display: flex; gap: .625rem; font-size: .875rem; line-height: 1.6; color: var(--muted); }
.service-inner li::before { content: "✱"; color: var(--accent); flex-shrink: 0; }
@media (max-width: 639px) { .service-inner { padding-left: 0; } }

/* ---------- About ---------- */
.about-body {
  margin-top: 2rem; max-width: 62ch;
  display: grid; gap: 1.25rem;
  font-size: 1.125rem; line-height: 1.625; color: var(--muted);
}

/* ---------- Stack ---------- */
.stack-groups { margin-top: 2.5rem; display: grid; gap: 2.5rem 4rem; }
@media (min-width: 768px) { .stack-groups { grid-template-columns: 1fr 1fr; } }
.tiles { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.tile {
  position: relative;
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: .75rem;
  background: var(--surface);
  color: var(--muted);
  transition: transform .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.tile:hover, .tile:focus-visible { transform: translateY(-4px); border-color: var(--line-strong); color: var(--ink); }
.tile .icon { width: 1.25rem; height: 1.25rem; }
.tile .tip {
  position: absolute; bottom: calc(100% + .5rem); left: 50%;
  transform: translate(-50%, 4px);
  white-space: nowrap; pointer-events: none; z-index: 10;
  padding: .25rem .625rem; border-radius: .375rem;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-mono); font-size: 11px;
  opacity: 0; transition: opacity .2s ease-out, transform .2s ease-out;
}
.tile:hover .tip, .tile:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }

.js .tile.pop { opacity: 0; transform: translateY(10px) scale(.5); }
.js .tile.pop.in {
  opacity: 1; transform: none;
  transition: opacity .4s ease-out var(--d, 0s), transform .7s var(--spring) var(--d, 0s),
              border-color .3s, color .3s;
}
.js .tile.pop.in.settled { transition: transform .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease); }
.js .tile.pop.in.settled:hover { transform: translateY(-4px); }

/* ---------- Contact ---------- */
.rotator {
  position: relative; display: inline-flex; overflow: hidden;
  vertical-align: bottom; color: var(--accent);
  transition: width .5s var(--ease);
}
.rotator span { display: inline-block; white-space: nowrap; }
.rotator .out { position: absolute; left: 0; animation: word-out .5s var(--ease) forwards; }
.rotator .in-word { animation: word-in .5s var(--ease) both; }
@keyframes word-out { to { transform: translateY(-105%); } }
@keyframes word-in { from { transform: translateY(105%); } }

.contact-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.contact-actions .group { display: inline-flex; align-items: center; gap: 1rem; }
.copy-label { display: inline-block; }
.copy-label.swap { animation: swap-in .18s var(--ease) both; }
@keyframes swap-in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; }
.footer-line { margin-bottom: 2.5rem; text-align: center; font-family: var(--font-hand); font-size: 1.5rem; color: var(--muted); }
.footer-row { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 1.5rem; }
.footer-socials { display: flex; align-items: center; gap: 1.25rem; }
.footer-socials a { color: var(--faint); transition: color .15s; }
.footer-socials a:hover { color: var(--ink); }
.footer-socials svg { width: 1.125rem; height: 1.125rem; }
.footer-meta {
  text-align: center;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.7; letter-spacing: .06em;
  color: var(--faint);
}
.footer-meta a { text-decoration: underline; text-underline-offset: 2px; transition: color .15s; }
.footer-meta a:hover { color: var(--ink); }
@media (min-width: 640px) {
  .footer-row { flex-direction: row; }
  .footer-meta { text-align: right; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html:not(.force-motion) { scroll-behavior: auto; }
  html:not(.force-motion) *, html:not(.force-motion) *::before, html:not(.force-motion) *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    animation-delay: 0s !important;
  }
  html:not(.force-motion) .status .dot::after { display: none; }
}
