/* AmagiLabs: amagilabs.github.io
   Tokens run in three layers: primitives (the brand's own values), chapter tokens (what a field
   of the page is painted with), component tokens (what a control takes from its chapter).
   Every section is a chapter; the fixed header takes the chapter beneath it. */

@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/playfair-display-latin.woff2") format("woff2");
  font-weight: 600 900;
  font-display: swap;
}

/* ---------------------------------------------------------------- 1. primitives */
:root {
  --c-cream: #F6F4F1;
  --c-ink: #161616;
  --c-clay: #D27A73;
  --c-clay-deep: #B4544B;
  --c-sand: #E6C89C;
  --c-coal: #2B2523;
  --c-submerged: #3A1512;
  --c-stone: #5A524D;
  --c-umber: #5A4A3C;

  --f-text: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-code: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace; /* taste-skill-ignore: only the literal pipx commands use it */

  --pad: clamp(20px, 4.5vw, 64px);
  --bar-h: 72px;
  --r-s: 6px;
  --r-m: 10px;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 160ms;
  --t-chapter: 300ms;
  --t-reveal: 640ms;

  /* ---------------------------------------------------------------- 2. chapters (light) */
  --paper-ground: var(--c-cream);
  --paper-fg: var(--c-ink);
  --paper-muted: var(--c-stone);
  --paper-tint: rgba(22, 22, 22, .07);

  --clay-ground: var(--c-clay);
  --clay-fg: var(--c-ink);
  --clay-muted: var(--c-submerged);
  --clay-tint: rgba(22, 22, 22, .1);

  --ink-ground: var(--c-ink);
  --ink-fg: var(--c-cream);
  --ink-muted: var(--c-sand);
  --ink-tint: rgba(246, 244, 241, .09);

  --sand-ground: var(--c-sand);
  --sand-fg: var(--c-ink);
  --sand-muted: var(--c-umber);
  --sand-tint: rgba(22, 22, 22, .08);

  --hero-top-ink: var(--c-ink);
  --hero-low-ink: var(--c-submerged);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper-ground: var(--c-ink);
    --paper-fg: var(--c-cream);
    --paper-muted: var(--c-sand);
    --paper-tint: rgba(246, 244, 241, .09);

    --ink-ground: var(--c-coal);
    --ink-tint: rgba(246, 244, 241, .1);

    --hero-top-ink: var(--c-cream);
  }
}

[data-chapter="paper"], .bar[data-ink="paper"] {
  --ground: var(--paper-ground); --fg: var(--paper-fg); --muted: var(--paper-muted); --tint: var(--paper-tint);
  --action-bg: var(--c-clay); --action-fg: var(--c-ink);
}
[data-chapter="clay"], .bar[data-ink="clay"] {
  --ground: var(--clay-ground); --fg: var(--clay-fg); --muted: var(--clay-muted); --tint: var(--clay-tint);
  --action-bg: var(--c-ink); --action-fg: var(--c-cream);
}
[data-chapter="ink"], .bar[data-ink="ink"] {
  --ground: var(--ink-ground); --fg: var(--ink-fg); --muted: var(--ink-muted); --tint: var(--ink-tint);
  --action-bg: var(--c-clay); --action-fg: var(--c-ink);
}
[data-chapter="sand"], .bar[data-ink="sand"] {
  --ground: var(--sand-ground); --fg: var(--sand-fg); --muted: var(--sand-muted); --tint: var(--sand-tint);
  --action-bg: var(--c-ink); --action-fg: var(--c-cream);
}
[data-chapter] { background: var(--ground); color: var(--fg); }

/* ---------------------------------------------------------------- 3. components */
:root {
  --code-bg: var(--tint);
  --btn-h: 44px;
  --focus: 3px solid currentColor;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font: 400 17px/1.6 var(--f-text);
  background: var(--paper-ground);
  color: var(--paper-fg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 3px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: var(--focus); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--c-clay); color: var(--c-ink); }
code { font-family: var(--f-code); font-size: .88em; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: 12px; z-index: 100; padding: 12px 18px;
  background: var(--c-ink); color: var(--c-cream); font-weight: 600; border-radius: var(--r-s);
  transform: translateY(-160%); transition: transform var(--t-fast) var(--ease-out);
}
.skip:focus { transform: none; }

/* ---------------------------------------------------------------- header */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--bar-h);
  display: flex; align-items: center; gap: 28px; padding: 0 var(--pad);
  background: var(--ground); color: var(--fg);
  transition: background-color var(--t-chapter) ease, color var(--t-chapter) ease;
}
.mark { display: flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.mark img { width: 40px; height: 40px; }
.wordmark svg { display: block; height: 36px; width: auto; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a, .menu summary {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  font-weight: 600; font-size: 15px; text-decoration: none; border-radius: var(--r-s);
  transition: background-color var(--t-fast) ease;
}
.nav a:hover, .menu summary:hover { background: var(--tint); }
.action {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  background: var(--action-bg); color: var(--action-fg); font-weight: 700; font-size: 15px;
  text-decoration: none; border-radius: var(--r-s);
  transition: background-color var(--t-chapter) ease, color var(--t-chapter) ease, transform var(--t-fast) var(--ease-out);
}
.action:hover { transform: translateY(-2px); }
.action:active { transform: translateY(1px) scale(.98); }
.menu { display: none; position: relative; margin-left: auto; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav {
  position: absolute; right: 0; top: calc(100% + 12px); min-width: 200px; padding: 8px;
  display: grid; background: var(--c-ink); color: var(--c-cream); border-radius: var(--r-m);
}
.menu nav a { display: flex; align-items: center; min-height: 48px; padding: 0 14px; font-weight: 600; text-decoration: none; border-radius: var(--r-s); }
.menu nav a:hover { background: rgba(246, 244, 241, .12); }

/* ---------------------------------------------------------------- hero: one headline across two fields */
.hero {
  --seam: 50svh;
  --h: clamp(64px, 10.4vw, 172px);
  --cut: 1.27em;                 /* the seam crosses line two a third of the way down */
  position: relative; min-height: 130svh; overflow: hidden;
}
.field { position: absolute; left: 0; right: 0; }
.field-top { top: 0; height: var(--seam); }
.field-low { top: var(--seam); bottom: 0; }
.hero-type {
  position: absolute; left: var(--pad); right: var(--pad);
  top: calc(var(--seam) - var(--cut));
  margin: 0; font-size: var(--h);
  display: grid;
}
.headline {
  display: block; grid-area: 1 / 1;
  font: 900 1em/.95 var(--f-display);
  letter-spacing: -.025em;
}
.headline .line { display: block; white-space: nowrap; }
.ink-top { color: var(--hero-top-ink); clip-path: inset(0 0 calc(100% - var(--cut)) 0); }
.ink-low { color: var(--hero-low-ink); clip-path: inset(var(--cut) 0 0 0); pointer-events: none; }
.slot {
  display: inline-block; width: 2.5em; height: .72em; vertical-align: -.02em;
  border-radius: .08em; overflow: hidden; background: var(--c-ink);
}
.ink-low .slot { visibility: hidden; }
.slot-clip { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.hero-more {
  position: absolute; left: var(--pad); right: var(--pad); top: calc(var(--seam) + .72 * var(--h) + 48px);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 88px);
  align-items: start; color: var(--c-ink);
}
.hero-sub { max-width: 34ch; font-size: 22px; font-weight: 500; line-height: 1.45; }
.hero-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.hero-shots a { display: block; text-decoration: none; font-size: 15px; font-weight: 600; }
.hero-shots img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top;
  border-radius: var(--r-m); background: var(--c-ink);
  transition: transform 260ms var(--ease-out);
}
.hero-shots a:hover img { transform: translateY(-4px); }
.hero-shots span { display: block; margin-top: 10px; }
.hero-shots a:hover span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; }

/* ---------------------------------------------------------------- tools: statement, table pushed right */
.tools { padding: clamp(96px, 12vw, 168px) var(--pad) clamp(80px, 10vw, 140px); }
.statement {
  font: 800 clamp(34px, 4.5vw, 68px)/1.05 var(--f-display);
  letter-spacing: -.02em; max-width: 18ch; margin-bottom: clamp(48px, 6vw, 88px);
}
.tools-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 88px); align-items: start;
}
.preview { position: sticky; top: calc(var(--bar-h) + 32px); }
.preview-img {
  width: 100%; border-radius: var(--r-m); background: var(--c-ink);
  transition: opacity 220ms ease, transform 320ms var(--ease-out);
}
.preview-img.swap { opacity: .25; transform: scale(.985); }
.preview-cap { margin-top: 14px; font-size: 15px; color: var(--muted); }
.group + .group { margin-top: clamp(56px, 6vw, 88px); }
.group-name { font: 800 32px/1.15 var(--f-display); margin-bottom: 8px; }
.row { padding: 22px 0 22px; }
.row-name { font: 700 22px/1.25 var(--f-text); letter-spacing: -.01em; overflow-wrap: anywhere; }
.row-name a { text-decoration: none; }
.row-name a:hover, .row.on .row-name a { text-decoration: underline; text-decoration-thickness: 3px; }
.row-name .pre { color: var(--muted); font-weight: 500; }
.row-desc { margin-top: 6px; max-width: 64ch; }
.row-meta { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cmd {
  display: inline-flex; align-items: center; min-height: var(--btn-h); padding: 0 14px;
  background: var(--code-bg); border-radius: var(--r-s); font-size: 15px;
  overflow-wrap: anywhere;
}
.copy {
  min-height: var(--btn-h); min-width: 72px; padding: 0 16px; border: 0; border-radius: var(--r-s);
  background: var(--fg); color: var(--ground); font-weight: 700; font-size: 15px;
  transition: transform var(--t-fast) var(--ease-out), background-color var(--t-fast) ease;
}
.copy:hover { transform: translateY(-2px); }
.copy:active { transform: scale(.96); }
.copy.done { background: var(--c-clay); color: var(--c-ink); }
.tag { font-size: 15px; font-weight: 600; color: var(--muted); }
.gh {
  display: inline-flex; align-items: center; min-height: var(--btn-h); padding: 0 4px;
  font-size: 15px; font-weight: 600;
}

/* ---------------------------------------------------------------- find: a headline you can type */
.find { padding: clamp(96px, 11vw, 160px) var(--pad); }
.find-box { max-width: 1400px; }
.find-q {
  display: block; width: 100%; padding: 0 0 .08em; border: 0; border-radius: 0;
  background: transparent; color: var(--fg); caret-color: var(--c-clay);
  font: 800 clamp(44px, 8vw, 132px)/1.1 var(--f-display); letter-spacing: -.025em;
  -webkit-appearance: none; appearance: none;
}
.find-q::-webkit-search-cancel-button { display: none; }
.find-q:focus-visible { outline: 4px solid var(--c-clay); outline-offset: 10px; }
.find-help { margin-top: 18px; color: var(--muted); }
.find-out {
  margin-top: clamp(40px, 5vw, 72px);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px);
}
.hit-pic { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; border-radius: var(--r-m); background: #000; }
.hit .row-body { margin-top: 18px; }
.hit.fresh { animation: rise 420ms var(--ease-out) both; animation-delay: var(--d, 0ms); }
.find-none { grid-column: 1 / -1; font-size: 22px; }
.find-try { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.find-try button {
  min-height: var(--btn-h); padding: 0 20px; border: 0; border-radius: var(--r-s);
  background: var(--tint); color: var(--fg); font-weight: 600; font-size: 15px;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-fast) var(--ease-out);
}
.find-try button:hover { background: var(--c-clay); color: var(--c-ink); transform: translateY(-2px); }
.find-try button:active { transform: scale(.97); }
.find-try button[aria-pressed="true"] { background: var(--c-cream); color: var(--c-ink); }

/* ---------------------------------------------------------------- about: portrait as drop cap */
.about {
  padding: clamp(96px, 11vw, 160px) var(--pad);
  display: grid; grid-template-columns: minmax(180px, 3fr) minmax(0, 9fr); gap: clamp(32px, 5vw, 96px);
}
.facts { display: grid; gap: 22px; align-content: start; font-size: 15px; padding-top: .6em; }
.facts span { display: block; font-weight: 700; }
.facts a { overflow-wrap: anywhere; }
.bio-lead { font: 600 clamp(24px, 2.5vw, 38px)/1.32 var(--f-display); max-width: 30em; }
.bio-lead strong { font-weight: 900; }
.dropcap {
  float: left; width: 3.6em; height: 3.6em; margin: .12em .5em .1em 0;
  shape-outside: circle(50%);
}
.bio-more { clear: both; margin-top: 40px; max-width: 62ch; padding-top: 4px; }

/* ---------------------------------------------------------------- footer: contact as the headline */
.foot {
  min-height: 92svh; padding: clamp(56px, 6vw, 88px) var(--pad) 40px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 56px;
}
.foot-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 48px; }
.foot-note { max-width: 34ch; font-size: 17px; font-weight: 500; }
.foot-note img { display: inline-block; width: 32px; height: 32px; vertical-align: middle; margin-right: 8px; }
.foot-up {
  margin-left: auto; display: inline-flex; align-items: center; min-height: 44px; font-weight: 700;
}
.foot-mail {
  display: block; text-decoration: none;
  font: 900 clamp(26px, 6.6vw, 124px)/.98 var(--f-display); letter-spacing: -.03em;
}
.foot-mail span { display: block; }
.foot-mail span:first-child { font-size: 1.55em; }
.foot-mail:hover span:last-child { text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .12em; }
.foot-meta {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 40px;
  font-size: 15px; font-weight: 500;
}
.foot-meta p:first-child { display: flex; gap: 20px; flex-wrap: wrap; }
.foot-meta a { display: inline-flex; align-items: center; min-height: 44px; }
.foot-meta p { align-self: center; }
.foot-meta p:last-child { text-align: right; }

/* ---------------------------------------------------------------- motion */
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
html.rv [data-reveal]:not(.in) { opacity: 0; transform: translateY(24px); }
html.rv [data-reveal] {
  transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out);
  transition-delay: var(--d, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-delay: 0ms !important; }
  html.rv [data-reveal]:not(.in) { transform: none; }
  .action:hover, .copy:hover, .find-try button:hover { transform: none; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .nav a { padding: 0 10px; }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .menu { display: block; }
  .tools-grid { grid-template-columns: 1fr; }
  .preview { position: static; max-width: 640px; }
  .find-out { grid-template-columns: 1fr 1fr; }
  .hero-more { grid-template-columns: 1fr; }
  .hero { min-height: max(130svh, 1180px); }
  .about { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 0; order: 2; }
  .foot-meta { grid-template-columns: 1fr; }
  .foot-meta p:last-child { text-align: left; }
}
@media (max-width: 640px) {
  :root { --bar-h: 64px; }
  body { font-size: 16px; }
  .bar { gap: 8px; }
  .wordmark { display: none; }
  .action { padding: 0 14px; }
  .menu summary { padding: 0 12px; }
  .hero { --h: clamp(48px, 16vw, 96px); --seam: 36svh; min-height: max(124svh, 980px); }
  .slot { display: none; }
  .hero-more { top: calc(var(--seam) + .72 * var(--h) + 28px); gap: 28px; }
  .hero-sub { font-size: 20px; }
  .hero-shots { gap: 16px; }
  .hero-shots a { overflow-wrap: anywhere; }
  .row-name { font-size: 20px; }
  .cmd { font-size: 13px; }
  .find-out { grid-template-columns: 1fr; }
  .find-help { font-size: 16px; }
  .find-try button { flex: 1 1 100%; justify-content: flex-start; text-align: left; }
  .facts { grid-template-columns: 1fr; gap: 16px; }
  .bio-lead { font-size: 20px; }
  .dropcap { width: 3em; height: 3em; }
  .foot-up { margin-left: 0; }
}

/* ---------------------------------------------------------------- 404 */
.lost { min-height: 100svh; padding: var(--pad); display: grid; align-content: center; gap: 24px; font-size: 19px; }
.lost .statement { margin: 0; }
