/* ─────────────────────────────────────────────────────────────────────────
   The page shell.

   Every content page (software, art, photography, myth/os, about) sits in the
   same frame: one max width, one set of side margins, one header treatment,
   one type scale. Pages differ in what they contain, never in how they are
   measured — that was the whole problem before, where each page had invented
   its own padding, its own title size, and its own phone breakpoints.
   ───────────────────────────────────────────────────────────────────────── */
:root {
  /* Measure */
  --page-max: 1220px;
  --page-pad-x: 2rem;
  --page-pad-top: 2.25rem;

  /* The footer bar is fixed, so content has to end above it. */
  --footer-h: 43px;
  --page-pad-bottom: calc(var(--footer-h) + 3.5rem);

  /* One type scale for the whole site. Each step grows a little on a phone,
     where the viewing distance is shorter and the column is narrower — but
     it grows by a step, not by a factor. The desktop end is deliberately
     quiet: this is a monospace face, which reads larger than its point size. */
  --t-label: clamp(0.75rem, 0.5rem + 0.85vw, 0.78rem);  /* tags, counters   */
  --t-small: clamp(0.82rem, 0.6rem + 0.8vw, 0.84rem);   /* captions, notes  */
  --t-body: clamp(0.92rem, 0.72rem + 0.7vw, 0.95rem);   /* running text     */
  --t-lead: clamp(1rem, 0.8rem + 0.7vw, 1.02rem);       /* intros           */
  --t-sect: clamp(1.02rem, 0.78rem + 1.2vw, 1.3rem);    /* section titles   */
  --t-page: clamp(1.45rem, 1.05rem + 2vw, 1.95rem);     /* page titles      */

  /* Rules and washes, so every border on the site is the same border. */
  --rule: rgba(var(--fg-rgb), 0.2);
  --rule-strong: rgba(var(--fg-rgb), 0.45);
  --wash: rgba(var(--fg-rgb), 0.05);
  --ink-dim: rgba(var(--fg-rgb), 0.62);
  --ink-faint: rgba(var(--fg-rgb), 0.42);

  --ease: 0.2s ease;
}

@media (max-width: 720px) {
  :root {
    --page-pad-x: 1.1rem;
    --page-pad-top: 1.5rem;
    --footer-h: 40px;
    --page-pad-bottom: calc(var(--footer-h) + 2.5rem);
  }
}

/* ── Frame ── */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--page-pad-top) var(--page-pad-x) var(--page-pad-bottom);
  box-sizing: border-box;
}

/* ── Header ──
   Title, an optional descriptor, and an optional right-hand slot, closed by a
   single rule that spans the measure. The rule belongs to the row rather than
   to the <h1>: a letter-spaced title underlines itself with a trailing gap
   where the last letter's spacing sits, which is what made these look untidy. */
.page-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding-bottom: 0.85rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.page-title {
  font-size: var(--t-page);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg);
  text-shadow: 0 0 12px rgba(var(--fg-rgb), 0.4);
  margin: 0;
  border: none;
  line-height: 1.1;
}

.page-sub {
  font-size: var(--t-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Pushed to the trailing edge: a count, a state, or a row of outbound links. */
.page-aside {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: var(--t-label);
  letter-spacing: 0.18em;
  color: var(--ink-faint);
}

@media (max-width: 720px) {
  /* On one column the aside sits under the title instead of fighting it for
     the same line. */
  .page-aside {
    margin-left: 0;
    width: 100%;
  }
}

/* ── Section heads ──
   A short rule, a name, an optional note, then a hairline to the margin. Used
   by the art sets, the photo sets, and anywhere else a page groups things. */
.set-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.set-rule {
  width: 1.4rem;
  height: 1px;
  background: var(--rule-strong);
  flex-shrink: 0;
}

.set-rule--fill {
  flex: 1;
  width: auto;
  background: var(--rule);
}

.set-name {
  font-size: var(--t-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(var(--fg-rgb), 0.85);
  margin: 0;
  white-space: nowrap;
}

.set-note {
  font-size: var(--t-label);
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── Buttons ──
   One outbound-link button, used by every page's calls to action. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font);
  font-size: var(--t-small);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--rule-strong);
  background: var(--wash);
  cursor: pointer;
  transition: background var(--ease), color var(--ease),
              border-color var(--ease), box-shadow var(--ease);
}

.btn:is(:hover, .is-hover) {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  text-shadow: none;
  box-shadow: 0 0 16px rgba(var(--fg-rgb), 0.4);
}

.btn--primary {
  border-color: var(--fg);
  background: rgba(var(--fg-rgb), 0.14);
}

/* Touch has no hover; a stuck hover state after a tap is worse than none. */
@media (hover: none) {
  .btn:is(:hover, .is-hover) {
    background: var(--wash);
    color: var(--fg);
    border-color: var(--rule-strong);
    box-shadow: none;
  }
}

/* Anything focused by keyboard gets the same ring everywhere. */
:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}
