/* Dasasian — one stylesheet, no build step.
   Type system is deliberately two families: a serif for everything readable,
   a mono for everything that labels. No sans anywhere. */

/* ---------- fonts ----------
   Self-hosted so the site looks the same everywhere. On system stacks alone it
   rendered as Iowan Old Style on macOS, Georgia on Windows and DejaVu on Linux
   — three materially different sites, and typography IS the design here.

   Newsreader is a variable font: one file covers 200-800 plus an optical-size
   axis, so display sizes get a face cut for display automatically.
   Both are OFL — see fonts/LICENSES.md. System fallbacks are kept so a failed
   fetch degrades rather than breaks. The italic only downloads on pages that
   actually use <em>; browsers defer font files until a glyph needs them. */

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-var-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c0d0f;
  --bg-raise: #131418;
  --ink: #e9e5dd;
  --ink-dim: #9a958c;
  --ink-faint: #6a665f;
  --rule: #212329;
  --rule-soft: #17191d;
  --accent: #cf9457;
  --accent-soft: #8a6540;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino,
    "Book Antiqua", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo,
    Consolas, "Liberation Mono", monospace;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.1875rem);
  /* 430, not 400. Light text on a dark ground blooms, so strokes read finer
     than they measure — the standard correction is a little extra weight.
     Newsreader is variable, so this costs nothing: no second file. 460+ starts
     to read semi-bold and loses the refinement that made it worth choosing. */
  font-weight: 430;
  line-height: 1.65;
  /* Newsreader carries an optical-size axis; let it pick a display cut for
     large settings and a text cut for body copy. */
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: #14100b;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- shell ---------- */

.page {
  width: 100%;
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: clamp(2rem, 6vw, 3.5rem) 0;
}

/* The masthead is the horizontal lockup, assembled from the mark plus live
   text rather than the lockup SVG — so the wordmark stays real selectable text
   in the page's own serif, and only the pictorial mark is an asset.

   The mark comes in as a MASK rather than an <img>: an image gets no cascade,
   so its currentColor would resolve to black and the hover state could not
   reach it. As a mask, only the alpha matters and `background` supplies the
   colour — which means it inherits and transitions like any text. */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--serif);
  font-size: 1.0625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

/* 2.8em ≈ 48px. Sized by legibility, not taste: below about 2.2em the letters
   stop resolving and the mark reads as a generic four-square, losing the only
   thing that makes it the name. Much above this and the header stops being
   navigation and starts competing with the lede directly beneath it. */
.wordmark::before {
  content: "";
  flex: none;
  width: 2.8em;
  height: 2.8em;
  background: currentColor;
  -webkit-mask: url("/assets/mark.svg") center / contain no-repeat;
  mask: url("/assets/mark.svg") center / contain no-repeat;
}

.wordmark:hover {
  color: var(--accent);
}

.masthead .back {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-decoration: none;
}

.masthead .back:hover {
  color: var(--accent);
}

main {
  padding-block: clamp(3rem, 10vw, 5.5rem) 0;
}

/* ---------- type ---------- */

.lede {
  font-size: clamp(1.4rem, 1.15rem + 1.3vw, 1.85rem);
  line-height: 1.45;
  /* Serif faces are spaced for body copy. At display size that spacing reads
     loose, so large settings want a touch of negative tracking to hold together
     — the larger the type, the more it needs. */
  letter-spacing: -0.012em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

.lede-sub {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0;
  max-width: 30rem;
  text-wrap: pretty;
}

p {
  text-wrap: pretty;
}

.label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.5rem;
}

section {
  margin-block: clamp(3.5rem, 11vw, 6rem);
}

a {
  color: var(--accent);
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-color: var(--accent);
}

/* ---------- work list ---------- */

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.entry {
  border-bottom: 1px solid var(--rule);
}

.entry-link {
  display: grid;
  grid-template-columns: 2.75rem 1fr auto;
  align-items: baseline;
  gap: 0 0.5rem;
  padding-block: 1.5rem;
  text-decoration: none;
  color: inherit;
}

.entry-num {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  transition: color 160ms ease;
}

.entry-name {
  font-size: 1.3125rem;
  line-height: 1.3;
  color: var(--ink);
  transition: color 160ms ease;
}

/* No max-width here on purpose. Capping this at 26rem while the belief block
   ran the full measure gave the page two different right edges — the single
   most visible sloppiness on it. Everything shares one measure now. */
.entry-desc {
  grid-column: 2 / -1;
  margin: 0.4rem 0 0;
  color: var(--ink-dim);
  font-size: 1rem;
  line-height: 1.55;
}

.entry-meta {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
  transition: color 160ms ease, transform 160ms ease;
}

.entry-link:hover .entry-name,
.entry-link:hover .entry-num {
  color: var(--accent);
}

.entry-link:hover .entry-meta {
  color: var(--accent);
  transform: translateX(3px);
}

/* ---------- belief block ---------- */

.belief {
  border-left: 1px solid var(--rule);
  padding-left: clamp(1rem, 4vw, 1.75rem);
}

.belief h2 {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.4;
  margin: 0 0 0.9rem;
  color: var(--ink);
  text-wrap: balance;
}

/* Contact deserves more than a default underlined link — it is the only thing
   on the page asking the reader to do something. */
.contact-link {
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.45rem);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 0.12em;
  transition: border-color 160ms ease, color 160ms ease;
}

.contact-link:hover {
  border-color: var(--accent);
}

.belief p {
  margin: 0 0 1rem;
  color: var(--ink-dim);
  font-size: 1.0625rem;
}

.belief p:last-child {
  margin-bottom: 0;
}

/* ---------- product pages ---------- */

.product-title {
  font-size: clamp(2rem, 1.5rem + 2.4vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.product-tagline {
  font-size: 1.15rem;
  color: var(--ink-dim);
  margin: 0 0 2.5rem;
  text-wrap: pretty;
}

.shot {
  margin: 0 0 2.5rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-raise);
}

.prose p {
  margin: 0 0 1.35rem;
  color: #d6d2ca;
}

.prose p:last-child {
  margin-bottom: 0;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  padding: 0.85rem 1.4rem;
  border-radius: 2px;
  text-decoration: none;
  transition: background 160ms ease;
}

.cta:hover {
  background: #e0a869;
}

.cta-note {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 0.9rem 0 0;
}

/* not-yet-released state: no dead links, so the install line is inert text */

.cta.is-pending {
  background: transparent;
  color: var(--ink-faint);
  border: 1px dashed var(--rule);
  cursor: default;
}

.code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--ink-dim);
  background: var(--bg-raise);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.9rem 1.1rem;
  margin: 0;
  overflow-x: auto;
}

/* The $ is unselectable so a triple-click copies a command that actually runs.
   It is also why this page needs no copy button and the site stays JS-free. */
.code .prompt {
  color: var(--ink-faint);
  user-select: none;
}

/* The install line when it is the page's primary action rather than an aside:
   larger, roomier, and edged in accent so it reads as the thing to do. */
.code-lead {
  font-size: 0.9375rem;
  padding: 1.15rem 1.35rem;
  border-color: var(--accent-soft);
  color: var(--ink);
  margin-bottom: 0.9rem;
}

.cta-row {
  margin-top: 1.9rem;
}

/* facts table */

.facts {
  border-top: 1px solid var(--rule);
  margin: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem 1rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--rule-soft);
}

.facts dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.28rem;
}

.facts dd {
  margin: 0;
  color: var(--ink-dim);
  font-size: 1rem;
  line-height: 1.55;
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--rule);
  margin-top: clamp(4rem, 12vw, 7rem);
  padding-block: 1.5rem clamp(2.5rem, 8vw, 4rem);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

/* Cross-navigation. Without this a product page's only exit is back to the
   homepage — you could not get from Slingers to gdocs-mcp directly, which on a
   site whose whole purpose is browsing the work is a functional hole. */
.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.4rem;
}

.foot-nav a {
  color: var(--ink-dim);
}

/* The page you are already on stays listed but stops being a link, so the set
   always reads as the complete body of work. */
.foot-nav [aria-current="page"] {
  color: var(--ink-faint);
  text-decoration: none;
  cursor: default;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.5rem;
  justify-content: space-between;
}

.foot-note {
  margin: 0;
  line-height: 1.8;
  max-width: 30rem;
  text-wrap: pretty;
}

.foot a {
  color: var(--ink-faint);
  text-decoration-color: var(--rule);
}

.foot a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent-soft);
}

/* ---------- small screens ---------- */

@media (max-width: 32rem) {
  .entry-link {
    grid-template-columns: 2.25rem 1fr;
  }

  .entry-meta {
    grid-column: 2;
    margin-top: 0.55rem;
  }

  .entry-desc {
    grid-column: 2;
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .facts dt {
    padding-top: 0;
  }
}

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