/*
 * aarontaylor.me — splash.
 *
 * Black and white, Archivo Black for display, Roboto for reading. The warm
 * paper palette shared with notes.aarontaylor.me was deliberately dropped
 * here; the two sites are now siblings in structure, not in colour.
 *
 * Ink is #111 on #fcfcfc rather than pure #000 on #fff. At 21:1 the pure
 * pairing glares on long text; this holds 18.41:1 and reads calmer without
 * softening the character of the type. Every pair below was measured
 * against the darkest grain pixel (#f5f5f5), not the flat background.
 */

/* Fonts ------------------------------------------------------------------- */
/* Latin subsets, copied from Fontsource. No build step, so the @font-face
 * rules are written by hand and carry the same unicode-range as the originals. */

@font-face {
  font-family: 'Archivo Black';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/archivo-black-latin-400-normal.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+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Roboto Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/roboto-latin-wght-normal.woff2') format('woff2-variations');
  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+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tokens ------------------------------------------------------------------ */

:root {
  --bg: #fcfcfc;
  --ink: #111;
  --grey: #444;           /* intro — 9.49:1, 8.93:1 under grain */
  --grey-soft: #666;      /* labels, descriptions — 5.60:1, 5.27:1 under grain */
  --rule: #e5e5e5;        /* hairlines; decorative, no contrast requirement */

  --display: 'Archivo Black', Impact, 'Arial Black', sans-serif;
  --body: 'Roboto Variable', Roboto, ui-sans-serif, system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Base -------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(2rem, 8vw, 5rem) clamp(1.25rem, 5vw, 2.5rem);

  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/*
 * Grain. A tiled SVG feTurbulence at just under 3% — enough to stop a large
 * flat field reading as dead screen white, not enough to notice as texture.
 * Fixed rather than scrolling, so it behaves like the surface rather than
 * like content. Desaturated in the filter, since feTurbulence is colour
 * noise by default and any tint would fight the monochrome.
 *
 * Absolutely positioned, so it is out of flow and never becomes a grid item
 * of the centring grid on body.
 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyMDAnIGhlaWdodD0nMjAwJz48ZmlsdGVyIGlkPSduJz48ZmVUdXJidWxlbmNlIHR5cGU9J2ZyYWN0YWxOb2lzZScgYmFzZUZyZXF1ZW5jeT0nMC44NScgbnVtT2N0YXZlcz0nNCcgc3RpdGNoVGlsZXM9J3N0aXRjaCcvPjxmZUNvbG9yTWF0cml4IHR5cGU9J3NhdHVyYXRlJyB2YWx1ZXM9JzAnLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0nMjAwJyBoZWlnaHQ9JzIwMCcgZmlsdGVyPSd1cmwoI24pJy8+PC9zdmc+");
  background-size: 200px 200px;
}

.card {
  position: relative;
  z-index: 1;
  width: min(100%, 44rem);
}

/* Masthead ---------------------------------------------------------------- */

.name {
  margin: 0 0 0.9rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 8vw, 4rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.intro {
  margin: 0 0 clamp(2.6rem, 7vw, 3.6rem);
  max-width: 36rem;
  color: var(--grey);
  font-size: 1.08rem;
  text-wrap: pretty;
}

/* Index ------------------------------------------------------------------- */
/* Label column left, content right, hairlines between. No cards, no fills. */

.index { border-top: 2px solid var(--ink); }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
}

/*
 * The hairline redraws in ink from the left on hover. Sits at -1px so it
 * covers the border rather than stacking above it, which would shift the
 * row by a pixel.
 */
.row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 420ms var(--ease);
}

.row:hover::after,
.row:focus-visible::after { transform: scaleX(1); }

.row-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--grey-soft);
}

.row-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.45rem, 4.2vw, 2.05rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* The whole row is the link, but the title still carries the affordance. */
.row:hover .row-title,
.row:focus-visible .row-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.row-desc {
  grid-column: 2 / 4;
  margin: 0.45rem 0 0;
  color: var(--grey-soft);
  font-size: 0.97rem;
  line-height: 1.5;
  text-wrap: pretty;
}

/*
 * The Cloaked alias is 34 characters of machine-generated words. As a display-face
 * title it overflowed a 375px viewport and collided with the arrow, so the address
 * sits on the description line and the title carries the destination instead.
 */
.address {
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.row-mark {
  font-size: 1.05rem;
  color: var(--grey-soft);
  transition: transform 420ms var(--ease);
}

.row:hover .row-mark,
.row:focus-visible .row-mark { transform: translate(3px, -3px); }

/* Narrow: the label stacks above its row rather than sitting beside it. */
@media (max-width: 36rem) {
  .row { grid-template-columns: minmax(0, 1fr) auto; gap: 0; }
  .row-label { grid-column: 1 / 3; margin-bottom: 0.4rem; }
  .row-desc { grid-column: 1 / 3; }
}

/* Focus — visible, never removed ------------------------------------------ */

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

/* Motion ------------------------------------------------------------------ */
/* The hairline still redraws, it just arrives rather than travels. */

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