/* Joey · Projects
   A plain developer portfolio, made carefully: one typeface (Geist), near-black on white
   (or the reverse, following the system setting), one blue for links and focus, hairlines,
   and the projects' own pictures doing the talking. */

@font-face { font-family: "Geist"; src: url("/assets/fonts/geist/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/fonts/geist/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #ffffff;
  --raise: #f6f7f9;
  --ink: #0d0f14;
  --ink-2: #474e5b;
  --ink-3: #676e7c;
  --line: #e6e8ed;
  --line-2: #d2d6de;
  --accent: #2350d0;
  --ok: #137544;
  --wip: #8f5500;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 70rem;
  --gutter: clamp(20px, 5vw, 40px);
  --radius: 12px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0a0b0e;
    --raise: #13151a;
    --ink: #eceef3;
    --ink-2: #aab0bc;
    --ink-3: #8c929e;
    --line: #21242b;
    --line-2: #30343d;
    --accent: #8aa9ff;
    --ok: #52c78c;
    --wip: #e4a748;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  background: var(--bg);
  scroll-padding-top: 76px;
  scrollbar-color: var(--line-2) var(--bg);
}
body {
  margin: 0;
  background: var(--bg); color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { text-wrap: balance; }
p, li, dd, figcaption { text-wrap: pretty; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: 12px; z-index: 30; padding: 10px 14px; border-radius: 8px;
  background: var(--ink); color: var(--bg); font-weight: 500; text-decoration: none;
  transform: translateY(-160%); transition: transform .2s var(--ease);
}
.skip:focus-visible { transform: none; }

/* ── top bar ── */
.top {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.top.is-stuck { border-bottom-color: var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.mark { font-weight: 600; font-size: 1.0625rem; letter-spacing: -.02em; text-decoration: none; padding: 6px 0; }
.top-nav { display: flex; align-items: center; gap: 2px; margin-right: -10px; }
.top-nav a, .top-nav button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 10px; border-radius: 999px;
  background: none; border: 0; cursor: pointer;
  font-size: .875rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}
.top-nav a:hover, .top-nav button:hover { color: var(--ink); background: var(--raise); }

/* ── first screen ── */
.hero { padding-top: clamp(2rem, 7vw, 6rem); padding-bottom: clamp(2rem, 4.5vw, 4rem); }
.hero h1 { margin: 0; font-size: clamp(2.75rem, 8.4vw, 5rem); font-weight: 600; line-height: .96; letter-spacing: -.04em; }
.hero .lede { margin: 20px 0 0; max-width: 24ch; font-size: clamp(1.25rem, 3vw, 1.625rem); line-height: 1.3; letter-spacing: -.015em; }

/* ── projects ── */
.work-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
  padding-top: 20px; margin-bottom: 28px; border-top: 1px solid var(--line);
}
.work-head h2 { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); cursor: pointer;
  font-size: .875rem; font-weight: 500; color: var(--ink-2);
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.chip b { font: 500 .75rem/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-3); }
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] b { color: color-mix(in srgb, var(--bg) 66%, var(--ink)); }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 29rem), 1fr));
  gap: clamp(2.25rem, 4vw, 3.25rem) clamp(20px, 3vw, 32px);
  margin: 0; padding: 0; list-style: none;
}
.card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.card .media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius); background: var(--raise);
}
.card .media img, .card .media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s var(--ease);
}
.card .media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.card:hover .media img, .card:hover .media video { transform: scale(1.025); }
.badge {
  position: absolute; left: 10px; bottom: 10px; z-index: 1;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(13, 15, 20, .74); color: #fff;
  font-size: .71875rem; font-weight: 500; line-height: 1.5; letter-spacing: .005em;
}
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 18px; }
.card h3 { margin: 0; font-size: 1.1875rem; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.card h3 a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card h3 a:focus-visible { outline: none; }
.card:has(h3 a:focus-visible) .media { outline: 2px solid var(--accent); outline-offset: 3px; }
.arrow { flex: none; color: var(--ink-3); transition: transform .3s var(--ease), color .2s ease; }
.card:hover .arrow { transform: translateX(3px); color: var(--ink); }
.card > p { margin: 6px 0 0; color: var(--ink-2); font-size: .96875rem; line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.tags li { padding: 3px 9px; border-radius: 6px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); font-size: .78125rem; line-height: 1.5; color: var(--ink-2); }
.status {
  flex: none; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font: 500 .75rem/1 var(--mono); color: var(--ink-2);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--wip); }
.status.is-ok::before { background: var(--ok); }
.status.is-result::before { background: var(--accent); }

.smaller { margin-top: clamp(3.5rem, 7vw, 6.5rem); }
.smaller h2 { margin: 0 0 4px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.smaller dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 8px clamp(20px, 3vw, 32px); margin: 0; }
.smaller dl > div { padding: 14px 0; }
.smaller dt { font-weight: 600; letter-spacing: -.01em; }
.smaller dd { margin: 4px 0 0; color: var(--ink-2); font-size: .9375rem; line-height: 1.55; }

/* ── project pages ── */
.case { padding-top: clamp(1.25rem, 2.5vw, 2.5rem); }
.back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-left: -2px;
  color: var(--ink-2); font-size: .875rem; font-weight: 500; text-decoration: none;
}
.back:hover { color: var(--ink); }
.case h1 { margin: clamp(1rem, 2.5vw, 2.5rem) 0 0; font-size: clamp(2.5rem, 7vw, 4rem); font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.case .lede { margin: 16px 0 0; max-width: 44ch; font-size: clamp(1.125rem, 2.6vw, 1.375rem); line-height: 1.4; letter-spacing: -.012em; color: var(--ink-2); }
.case-rail { margin-top: 32px; }
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 0 clamp(20px, 3vw, 32px); margin: 0; padding: 0;
  border-top: 1px solid var(--line);
}
.facts > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: .8125rem; font-weight: 500; color: var(--ink-3); }
.facts dd { margin: 3px 0 0; font-size: .9375rem; line-height: 1.45; }
.case-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: .9375rem; font-weight: 500; text-decoration: none;
  transition: opacity .15s ease;
}
.btn:hover { opacity: .86; }
.btn.is-quiet { background: none; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.is-quiet:hover { opacity: 1; box-shadow: inset 0 0 0 1px var(--ink-3); }

.f { margin: 0; }
.f .frame { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--raise); }
.f .frame img, .f .frame video { width: 100%; }
.f .frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.f.is-wide { max-width: 64rem; }
.f.is-square { max-width: 40rem; }
.f figcaption { margin-top: 12px; max-width: 64ch; font-size: .875rem; line-height: 1.55; color: var(--ink-3); }
.f .keys { display: grid; grid-template-columns: 1fr 1fr; margin: 8px 0 0; font: 500 .75rem/1.3 var(--mono); color: var(--ink-3); text-align: center; }
.case-hero { margin-top: clamp(2rem, 4vw, 3.5rem); }

.case-body { margin-top: clamp(2.25rem, 4vw, 3.5rem); }
.case-body > p, .case-body > ul, .case-body > h2 { max-width: 40rem; }
.case-body > p { margin: 0 0 1.15em; font-size: 1.0625rem; line-height: 1.7; }
.case-body > h2 { margin: 2em 0 .6em; font-size: 1.4375rem; font-weight: 600; line-height: 1.25; letter-spacing: -.025em; }
.case-body > ul { margin: 0 0 1.2em; padding-left: 1.2em; }
.case-body > ul li { margin: 0 0 .7em; padding-left: 4px; font-size: 1.0625rem; line-height: 1.65; }
.case-body > ul li::marker { color: var(--ink-3); }
.case-body > .f { margin: clamp(2rem, 4vw, 3.25rem) 0; }
.case-body > .f:last-child { margin-bottom: 0; }

.next { margin-top: clamp(3.5rem, 7vw, 6.5rem); padding-top: 20px; border-top: 1px solid var(--line); }
.next a {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 15rem); align-items: center; gap: 20px;
  text-decoration: none;
}
.next-text { display: flex; flex-direction: column; gap: 4px; }
.next-name { display: inline-flex; align-items: center; gap: 6px; font-size: 1.375rem; font-weight: 600; letter-spacing: -.02em; }
.next-line { color: var(--ink-2); font-size: .9375rem; }
.next-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: var(--raise); }
.next-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.next-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.next a:hover .next-media img { transform: scale(1.03); }
.next a:hover .arrow { transform: translateX(3px); color: var(--ink); }

/* ── footer ── */
.foot { margin-top: clamp(3.5rem, 7vw, 6.5rem); border-top: 1px solid var(--line); }
.foot-in {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  padding-top: 22px; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  color: var(--ink-3); font-size: .875rem;
}
.foot-in p { margin: 0; max-width: 56ch; }
.text-button {
  min-height: 40px; padding: 0; background: none; border: 0; cursor: pointer;
  font-size: .875rem; font-weight: 500; color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em;
}

/* ── the QR code, full screen and always black on white so a camera reads it ── */
dialog.qr {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: #fff; color: #0d0f14;
}
dialog.qr::backdrop { background: #fff; }
.qr-in { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.qr-in svg { width: min(76vw, 52vh); height: auto; display: block; margin-bottom: 10px; }
.qr-in p { margin: 0; }
.qr-in .who { font-size: 1.5rem; font-weight: 600; letter-spacing: -.03em; }
.qr-in .what { color: #5b6270; }
.qr-in button {
  margin-top: 12px; min-height: 46px; padding: 0 24px; border-radius: 999px; border: 0; cursor: pointer;
  background: #0d0f14; color: #fff; font-size: .9375rem; font-weight: 500;
}
.qr-in button:focus-visible { outline: 2px solid #2350d0; outline-offset: 3px; }

/* wide screens: the project's facts sit in a rail beside the work, so the pictures lead */
@media (min-width: 1100px) {
  .case {
    display: grid; grid-template-columns: minmax(0, 1fr) 16rem; column-gap: clamp(48px, 5vw, 80px);
    grid-template-areas: "intro intro" "main rail" "next next"; align-items: start;
  }
  .case-intro { grid-area: intro; }
  .case-main { grid-area: main; min-width: 0; }
  .case-rail { grid-area: rail; position: sticky; top: 84px; margin-top: clamp(2rem, 4vw, 3.5rem); }
  .case-rail .facts { grid-template-columns: 1fr; }
  .case-rail .case-links { flex-direction: column; align-items: flex-start; }
  .case .next { grid-area: next; }
  .f.is-wide { max-width: none; }
}

/* filtering slides the cards to their new places where the browser can */
::view-transition-group(*) { animation-duration: .38s; animation-timing-function: var(--ease); }

@media (max-width: 640px) {
  .hero { padding-top: 28px; padding-bottom: 28px; }
  .hero .lede { margin-top: 14px; }
  .work-head { padding-top: 16px; margin-bottom: 22px; }
  .chip { padding: 0 12px; gap: 6px; }
  .top-nav span { display: none; }
  .top-nav button { padding: 0 11px; }
  .next a { grid-template-columns: 1fr; }
  .next-media { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  ::view-transition-group(*) { animation: none; }
}

@media print {
  .top, .filters, .foot button, dialog.qr, .skip { display: none !important; }
  :root { --bg: #fff; --ink: #000; }
}
