/* Layout: prompt-motion's gallery grammar. One 1400px column, a quiet header,
   a short title block, pill filters, then a masonry of autoplaying previews.
   Light only, like the reference: the identity is white paper and black ink. */
:root {
  --background: #fff;
  --foreground: #111;
  --muted: #f2f2f2;
  --muted-foreground: #6b6b6b;
  --border: #e5e5e5;
  --ring: #c4c4c4;
  --ink-soft: rgba(17, 17, 17, 0.05);
  --ink-hover: rgba(17, 17, 17, 0.15);
  --live: #16a34a;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 0.625rem;
  --tile-radius: 12px;
  --gap: 20px;
  --max: 1400px;
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 640px) { .wrap { padding-inline: 24px; } }
@media (min-width: 1024px) { .wrap { padding-inline: 32px; } }

/* ── Header ───────────────────────────────────────────── */
.site-header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}
.brand img { width: 20px; height: 20px; border-radius: 6px; }
.header-links { display: flex; align-items: center; gap: 4px; }
/* On a phone the hire button matters more than the outbound links. */
@media (max-width: 419px) { .header-links .btn-ghost { display: none; } }

.btn-hire {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin-left: 4px;
  padding-inline: 12px;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s;
}
.btn-hire:hover { background: rgba(0, 0, 0, 0.85); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding-inline: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.btn-ghost:hover { background: var(--muted); color: var(--foreground); }
.btn-ghost svg { width: 14px; height: 14px; }

/* ── Title block ──────────────────────────────────────── */
main { flex: 1; padding-bottom: 96px; }

.intro { padding-block: 40px 32px; }
@media (min-width: 640px) { .intro { padding-block: 64px 40px; } }
.intro h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.33;
  font-weight: 500;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
@media (min-width: 640px) { .intro h1 { font-size: 1.875rem; line-height: 1.2; } }
.intro p { margin: 8px 0 0; max-width: 62ch; color: var(--muted-foreground); }

/* ── Toolbar ──────────────────────────────────────────── */
.toolbar {
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}
.toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar-label { color: rgba(107, 107, 107, 0.6); }
@media (max-width: 559px) { .toolbar-label { display: none; } }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  min-width: 32px;
  padding-inline: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.pill:hover { background: var(--muted); color: var(--foreground); }
.pill[aria-checked="true"] { background: #000; border-color: #000; color: #fff; }
.pill[aria-checked="true"]:hover { background: rgba(0, 0, 0, 0.85); }
.pill .count { font-family: var(--font-mono); font-size: 0.75rem; opacity: 0.6; font-variant-numeric: tabular-nums; }

.pill-quiet { border-color: transparent; }

/* The side branch: one quiet pill after a hairline, a note above the grid, a link below it. */
.pill-sep { width: 1px; height: 18px; margin-inline: 4px; background: var(--border); }
.pill-side { border-style: dashed; }
.side-intro { margin: -8px 0 20px; font-size: 0.875rem; color: var(--muted-foreground); }
.side-intro[hidden] { display: none; }
.side-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: color 0.15s;
}
.side-link:hover { color: var(--foreground); }
.side-link svg { width: 16px; height: 16px; }
.side-link .count { font-family: var(--font-mono); font-size: 0.75rem; opacity: 0.6; }
.pill-quiet[aria-pressed="true"] { color: var(--foreground); background: var(--muted); }

.sort-icon { width: 16px; height: 16px; color: rgba(107, 107, 107, 0.6); }
.select-wrap { position: relative; display: inline-flex; }
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  height: 32px;
  padding: 0 30px 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}
.select-wrap select:hover { background: var(--muted); color: var(--foreground); }
.select-wrap svg { position: absolute; right: 10px; top: 8px; width: 16px; height: 16px; pointer-events: none; color: var(--muted-foreground); }

.pause-glyph { position: relative; width: 14px; height: 14px; }
.pause-glyph svg { position: absolute; inset: 0; width: 14px; height: 14px; fill: currentColor; transition: opacity 0.15s; }
.pause-glyph .g-play { opacity: 0; }
[aria-pressed="true"] .pause-glyph .g-pause { opacity: 0; }
[aria-pressed="true"] .pause-glyph .g-play { opacity: 1; }

/* ── Masonry ──────────────────────────────────────────── */
.masonry { display: flex; align-items: flex-start; gap: var(--gap); }
.masonry-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.tile { display: block; border-radius: var(--tile-radius); outline: none; }
.tile + .tile { margin-top: 16px; }

.media {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--tile-radius);
  background: var(--muted);
}
.media > img,
.media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, center);
}
.media > .poster {
  opacity: 0;
  filter: blur(16px);
  transition: opacity 0.5s var(--ease-out), filter 0.5s var(--ease-out);
}
.media > .poster.is-loaded { opacity: 1; filter: none; }
.media > video { opacity: 0; transition: opacity 0.3s var(--ease-out); }
.media > video.is-playing { opacity: 1; }

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--ink-soft);
  transition: box-shadow 0.2s;
  pointer-events: none;
}
.tile:hover .media::after { box-shadow: inset 0 0 0 1px var(--ink-hover); }
.tile:focus-visible .media { outline: 2px solid var(--foreground); outline-offset: 3px; }

.meta { height: 44px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  position: relative;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--muted-foreground);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1px solid var(--border); mix-blend-mode: darken; }
.meta-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.15s;
}
.tile:hover .meta-name { color: var(--foreground); }
.meta-badges { margin-left: auto; display: flex; flex-shrink: 0; gap: 6px; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding-inline: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  white-space: nowrap;
}

.badge-live { gap: 5px; color: var(--foreground); }
.badge-live::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--live); }

.empty { padding-block: 64px; color: var(--muted-foreground); text-align: center; }

/* ── Detail ───────────────────────────────────────────── */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-block: 16px 24px;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.15s;
}
.back:hover { color: var(--foreground); }
.back svg { width: 16px; height: 16px; }

.detail { display: flex; flex-direction: column; gap: 32px; }
@media (min-width: 768px) { .detail { flex-direction: row; align-items: flex-start; gap: 40px; } }

.stage-shell { margin-inline: -16px; background: rgba(242, 242, 242, 0.6); }
@media (min-width: 640px) { .stage-shell { margin-inline: 0; border-radius: 16px; } }
@media (min-width: 768px) { .stage-shell { flex: 1; min-width: 0; padding: 32px; position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); } }

.stage { display: flex; justify-content: center; }
.views { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 16px 16px 20px; }
@media (min-width: 768px) { .views { padding: 20px 0 0; } }
.views .pill { background: var(--background); }
.views .pill[aria-checked="true"] { background: #000; }
.stage .media { width: 100%; }
@media (min-width: 768px) {
  .stage .media { width: auto; height: min(76dvh, 800px); max-height: calc((100vw - 560px) / var(--r)); aspect-ratio: var(--r); }
}
.stage .media::after { display: none; }
@media (max-width: 639px) { .stage .media { border-radius: 0; } }

.player-bar {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 32px 8px 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  color: #fff;
}
.player-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.player-btn:hover { background: rgba(255, 255, 255, 0.15); }
.player-btn svg { width: 16px; height: 16px; fill: currentColor; }
.player-btn svg.stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.player-btn svg.stroke .solid { fill: currentColor; }
.seek { position: relative; flex: 1; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.seek span { position: absolute; inset: 0 auto 0 0; width: 0; background: #fff; }

.side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (min-width: 768px) { .side { width: 380px; flex-shrink: 0; } }

.side-head { display: flex; align-items: center; gap: 12px; }
.side-head .avatar { width: 32px; height: 32px; font-size: 12px; }
.side-head .who { min-width: 0; font-size: 0.875rem; line-height: 1.25; }
.side-head .who b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-head .who span { display: block; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ext {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.15s;
}
.ext:hover { color: var(--foreground); }
.ext-inline { margin-left: 0; }
.ext svg { width: 14px; height: 14px; }

.side h1 { margin: 0; font-size: 1.25rem; line-height: 1.4; font-weight: 500; letter-spacing: -0.025em; text-wrap: balance; }

.block { display: flex; flex-direction: column; gap: 8px; }
.block h2 { margin: 0; height: 24px; display: flex; align-items: center; justify-content: space-between; font-size: 0.75rem; font-weight: 500; color: var(--muted-foreground); }
.block p { margin: 0; font-size: 0.9375rem; line-height: 1.6; }
.block ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.9375rem; line-height: 1.55; }
.block li::marker { color: var(--ring); }

.code {
  position: relative;
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
@media (max-width: 479px) { .code { font-size: 0.75rem; padding-inline: 12px; } }
.copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding-inline: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}
.copy:hover { background: var(--muted); color: var(--foreground); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .badge { font-family: var(--font-mono); font-size: 0.6875rem; height: 22px; }

.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.875rem; }
.facts dt { color: var(--muted-foreground); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.more-title { margin: 72px 0 20px; font-size: 0.875rem; font-weight: 500; color: var(--muted-foreground); }

/* Blur-in, like the reference's detail column. Resting state is visible. */
@keyframes enter { from { opacity: 0; filter: blur(6px); transform: translateY(6px); } }
.enter > * { animation: enter 0.45s var(--ease-out) both; }
.enter > *:nth-child(2) { animation-delay: 0.05s; }
.enter > *:nth-child(3) { animation-delay: 0.1s; }
.enter > *:nth-child(4) { animation-delay: 0.15s; }
.enter > *:nth-child(5) { animation-delay: 0.2s; }
.enter > *:nth-child(6) { animation-delay: 0.25s; }
.enter > *:nth-child(n + 7) { animation-delay: 0.3s; }

.hire-cta {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: border-color 0.15s, color 0.15s;
}
.hire-cta b { font-weight: 500; color: var(--foreground); }
.hire-cta:hover { border-color: var(--ring); color: var(--foreground); }

/* ── Work with me ─────────────────────────────────────── */
.hire { margin-top: 96px; padding-top: 48px; border-top: 1px solid var(--border); scroll-margin-top: 16px; }
.hire-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hire h2 { margin: 0; font-size: 1.5rem; line-height: 1.33; font-weight: 500; letter-spacing: -0.025em; }
@media (min-width: 640px) { .hire h2 { font-size: 1.875rem; line-height: 1.2; } }
.hire-intro { margin: 8px 0 32px; max-width: 62ch; color: var(--muted-foreground); }

.packages { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .packages { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .packages { grid-template-columns: repeat(4, 1fr); } }

.package {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--tile-radius);
}
.package-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.package h3 { margin: 0; font-size: 1rem; font-weight: 500; letter-spacing: -0.01em; }
.package p { margin: 0; font-size: 0.9375rem; line-height: 1.55; color: var(--muted-foreground); }
.package .price { font-family: var(--font-mono); font-size: 1.25rem; color: var(--foreground); font-variant-numeric: tabular-nums; }

.examples { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted-foreground); }
.badge-link { color: var(--foreground); transition: background-color 0.15s, border-color 0.15s; }
.badge-link:hover { background: var(--muted); border-color: var(--ring); }

.hire-foot { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.terms { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 0.875rem; color: var(--muted-foreground); }
.contact { display: flex; flex-wrap: wrap; gap: 8px; }

.btn-solid,
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding-inline: 16px;
  border: 1px solid #000;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.btn-solid { background: #000; color: #fff; }
.btn-solid:hover { background: rgba(0, 0, 0, 0.85); }
.btn-outline { border-color: var(--border); }
.btn-outline:hover { background: var(--muted); }
.btn-outline svg { width: 14px; height: 14px; }
@media (max-width: 419px) { .contact, .btn-solid, .btn-outline { width: 100%; justify-content: center; } }

/* ── Footer ───────────────────────────────────────────── */
.site-footer { padding-block: 24px 32px; border-top: 1px solid var(--border); font-size: 0.8125rem; color: var(--muted-foreground); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.site-footer a:hover { color: var(--foreground); }

.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; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Legal notice (/#legal) */
.legal { max-width: 720px; display: flex; flex-direction: column; gap: 28px; padding-block: 8px 64px; }
.legal h1 { margin: 0; font-size: 1.5rem; line-height: 1.33; font-weight: 500; letter-spacing: -0.025em; }
.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--foreground); }
