/* Watercolor blue-green palette, lifted from aldenblog.io so the two sites
   read as the same person's. Light is the default; dark is an override, which
   is the structure the blog uses too. */

/* Inter, SIL Open Font License 1.1 — the licence ships beside it in
   assets/fonts/OFL.txt. This is the latin subset of the variable face, so one
   48 KB file covers every weight from 400 to 700. Self-hosted rather than
   pulled from a font CDN: the hub has no third-party runtime dependencies and
   should not gain one for a typeface. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;

  --bg: #e4ebe7;
  --card: #f8faf9;
  --line: #c2d1c8;
  --line-2: #aec2b6;
  --ink: #1d3a2a;
  --dim: #3d5a4a;
  --dimmer: #4d6a5a;
  --link: #2a7d8a;
  --link-hover: #1d5a65;
  --primary: #4a7a6a;
  --shadow: rgba(35, 64, 48, .14);

  /* Two soft washes behind the page, echoing the blog's watercolor hero. */
  --wash-1: #d2e3da;
  --wash-2: #cfe0e5;

  /* Per-app accent tinting. Card colour is derived entirely from the app's own
     accent; --accent-shift is what accents are pulled toward for legibility.
     --ink-mix and --hot-mix are how far text roles are pulled: less accent means
     more shift, which is darker on light and lighter on dark, so a smaller mix
     is always the higher-contrast one. --hot-mix is therefore below --ink-mix,
     so hovering a title makes it easier to read rather than harder. */
  --tint: 9%;
  --chip-mix: 24%;
  --accent-shift: #10241f;
  --ink-mix: 45%;
  --hot-mix: 30%;
  --shot-base: #eef4f0;
  --glyph-mix: #24413a;

  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
  /* Inter is loaded above, so the wordmark's tracking is now applied to the face
     it was actually tuned for. The rest of the stack is what shows during swap. */
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1516;
    --card: #142224;
    --line: #1e3235;
    --line-2: #2b464a;
    --ink: #d5e4dc;
    --dim: #b0c8ba;
    --dimmer: #8aa89a;
    --link: #5abbc9;
    --link-hover: #7dd0dc;
    --primary: #7ab3a0;
    --shadow: rgba(0, 0, 0, .5);

    --wash-1: #16292b;
    --wash-2: #142a30;

    --tint: 14%;
    --chip-mix: 20%;
    --accent-shift: #f4fbf8;
    --ink-mix: 62%;
    --hot-mix: 45%;
    --shot-base: #0e1a1c;
    --glyph-mix: #e8f2ee;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1rem, 4vw, 2rem) 4rem;
  background:
    radial-gradient(60rem 32rem at 12% -8%, var(--wash-1), transparent 70%),
    radial-gradient(48rem 28rem at 92% 4%, var(--wash-2), transparent 68%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(76rem, 100%); margin: 0 auto; }

/* ---- masthead ---- */

/* Wordmark left, everything it has to say bottom-aligned beside it, so the
   small text sits on the wordmark's baseline. Wraps to a stack when there is
   no room. */
header {
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: clamp(1.25rem, 4vw, 3rem);
}

.mark {
  display: inline-flex;
  align-items: baseline;
  margin: 0;
  font: 700 clamp(3rem, 11vw, 5.5rem) / 1 var(--sans);
  letter-spacing: -.045em;
}

.mark em {
  font-style: normal;
  color: var(--ink);
}

/* "camp" is a window onto a mountain scene: the ridges are a background image
   clipped to the letterforms. Peaks sit inside the x-height band so they land
   where the glyphs actually are. The scene itself is generated in build.mjs and
   injected as a rule in the document head, one per colour scheme. */
.camp {
  font-style: normal;
  color: var(--primary);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* Only disappear the letterforms where the scene can actually show through.
   Unguarded, a blocked data URI or an engine without background-clip erases
   half the site name. */
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .camp {
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* Forced colours throw the scene away, so take the letterforms back. */
@media (forced-colors: active) {
  .camp {
    background-image: none;
    color: CanvasText;
  }
}

/* ---- lede ---- */

.says { padding-bottom: .45rem; }

.lede {
  margin: 0;
  max-width: 24rem;
  font-size: clamp(1rem, 2.4vw, 1.1rem);
  color: var(--dim);
}

.by {
  margin: .35rem 0 0;
  font: .78rem/1.5 var(--mono);
  color: var(--dimmer);
}

.by a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--link) 40%, transparent);
}

.by a:hover { color: var(--link-hover); }

/* ---- grid ---- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1.15rem;
}

/* Everything inside a card is derived from that card's own accent rather than
   the page palette, so each app keeps its own identity. */
.card {
  --accent: #8aa4c8;
  --accent-ink: color-mix(in srgb, var(--accent) var(--ink-mix), var(--accent-shift));
  --accent-hot: color-mix(in srgb, var(--accent) var(--hot-mix), var(--accent-shift));
  --accent-soft: color-mix(in srgb, var(--accent) var(--chip-mix), var(--card));
  --accent-line: color-mix(in srgb, var(--accent) 28%, var(--line));
  --accent-body: color-mix(in srgb, var(--accent) 16%, var(--dim));
  --accent-faint: color-mix(in srgb, var(--accent) 14%, var(--dimmer));
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) var(--tint), var(--card)), var(--card));
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.card:hover,
.card:focus-within {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--accent) 55%, var(--shadow));
}

/* Text roles take their hue and chroma from the app's accent but have their
   lightness capped, so legibility is a property of the design rather than of
   whichever hex a contributor liked. Verified across the whole hue circle at
   maximum in-gamut chroma: the worst case is 5.22:1 against the card and the
   chip, comfortably past the 4.5:1 AA floor. The color-mix values above remain
   the fallback for engines without relative colour syntax, which is why the
   accent contrast warning in the registry validator still earns its place. */
@supports (color: oklch(from red l c h)) {
  .card {
    --accent-ink: oklch(from var(--accent) min(l, 0.50) c h);
    --accent-hot: oklch(from var(--accent) min(l, 0.42) c h);
  }
}

/* Dark flips the cap into a floor: the same accent has to be light enough to
   read on a dark card instead of dark enough to read on a light one. */
@media (prefers-color-scheme: dark) {
  @supports (color: oklch(from red l c h)) {
    .card {
      --accent-ink: oklch(from var(--accent) max(l, 0.80) c h);
      --accent-hot: oklch(from var(--accent) max(l, 0.90) c h);
    }
  }
}

/* The whole card is one link (see .body h2 a::after), so the ring belongs on the
   card rather than the inline title text. Keyboard users previously got only the
   3px lift — which prefers-reduced-motion removes outright, leaving nothing. */
.card:focus-within {
  outline: 2px solid var(--accent-hot);
  outline-offset: 2px;
}

.shot {
  position: relative;
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid var(--accent-line);
  overflow: hidden;
  background: linear-gradient(140deg,
    color-mix(in srgb, var(--accent) 30%, var(--shot-base)),
    color-mix(in srgb, var(--accent) 7%, var(--shot-base)));
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.shot .glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 4.5rem/1 var(--sans);
  letter-spacing: -.06em;
  color: color-mix(in srgb, var(--accent) 55%, var(--glyph-mix));
  opacity: .45;
  text-transform: lowercase;
}

.body { padding: .95rem 1.05rem 1.05rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }

/* Title and destination chip share a baseline, so the chip reads as a label on
   the title rather than as another line of content. */
.hrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
}

.body h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.02em; }

.dest {
  flex: none;
  padding: .2rem .45rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font: .68rem/1 var(--mono);
}

.body h2 a {
  color: var(--accent-ink);
  text-decoration: none;
}

.body h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* The title link already covers the card, so its own ring would just duplicate
   the one .card:focus-within draws. */
.body h2 a:focus-visible { outline: none; }

.card:hover h2 a { color: var(--accent-hot); }

.tagline { margin: 0; color: var(--accent-body); font-size: .92rem; }

/* Tags stay in the registry but are no longer drawn: filled pills read as
   filters, and with a shelf this small there is nothing to filter. */

.meta {
  margin-top: auto;
  padding-top: .7rem;
  border-top: 1px solid var(--accent-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font: .72rem/1.4 var(--mono);
  color: var(--accent-faint);
}

/* Where the card actually takes you — a subdomain here, or somebody else's host. */
.where { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.who { flex: none; display: flex; align-items: center; gap: .4rem; }

.meta a {
  position: relative;
  z-index: 2;
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}

.meta a:hover { color: var(--accent-hot); }

/* Meta links are small targets inside an already-outlined card, so they get a
   tight ring of their own — the card ring says which card, this says which link. */
.meta a:focus-visible {
  outline: 2px solid var(--accent-hot);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Everything outside a card runs on the page palette rather than an accent. */
.by a:focus-visible,
footer a:focus-visible,
.oops .cta:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---- empty + footer ---- */

.empty {
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 3rem 1rem;
  text-align: center;
  color: var(--dim);
}

footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  font: .78rem/1.5 var(--mono);
  color: var(--dimmer);
}

footer a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--link) 40%, transparent);
}

footer a:hover { color: var(--link-hover); }
footer .right { margin-left: auto; }

/* ---- 404 ---- */

.oops { width: min(38rem, 100%); margin: 12vh auto 0; text-align: center; }
.oops h1 { font-size: clamp(2rem, 8vw, 3rem); letter-spacing: -.04em; margin: 0 0 .5rem; }
.oops p { color: var(--dim); }
.oops code { font-family: var(--mono); color: var(--ink); }

.oops .cta {
  display: inline-block;
  margin-top: 1.5rem;
  padding: .6rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
}

.oops .cta:hover { border-color: var(--primary); color: var(--link-hover); }

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover, .card:focus-within { transform: none; }
}
