/* ── Anany — portfolio index ──────────────────────────────────────────
   Palette: cool grey-green paper, graphite ink, ultramarine accent
   Type:    Fraunces (display, restrained) / Karla (body) / Plex Mono (data)
   ------------------------------------------------------------------ */

:root {
  --paper:  #EDEEE9;
  --ink:    #16181D;
  --muted:  #6A6F78;
  --rule:   #D3D5CD;
  --accent: #2A3FA0;
  --accent-wash: rgba(42, 63, 160, 0.08);

  --measure: 46rem;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Karla", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #15171B;
    --ink:    #E7E8E3;
    --muted:  #8F949C;
    --rule:   #2C2F36;
    --accent: #93A8FF;
    --accent-wash: rgba(147, 168, 255, 0.12);
  }
}

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

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

body {
  margin: 0;
  padding: 0 1.5rem 5rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--measure); margin: 0 auto; }

a { color: inherit; }

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

/* ── Masthead ─────────────────────────────────────────────────────── */

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 2rem 0 0;
}

.mark {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 1.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a { color: var(--muted); text-decoration: none; padding-bottom: 2px; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
}

/* ── Hero ─────────────────────────────────────────────────────────── */

.hero { padding: 4.5rem 0 3rem; }

.hero h1 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 120;
  font-weight: 600;
  font-size: clamp(2.75rem, 9vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0;
}

.hero .kicker {
  font-size: 1.125rem;
  color: var(--muted);
  margin: 1rem 0 0;
  max-width: 34rem;
}

/* Status readout — the small telemetry line under the name */
.status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.status span { display: inline-flex; align-items: center; gap: 0.5rem; }

.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

/* ── Filter rail ──────────────────────────────────────────────────── */

.rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.chip {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.chip:hover { color: var(--ink); border-color: var(--ink); }

.chip[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-wash);
}

.chip .count { opacity: 0.55; margin-left: 0.35rem; }

/* ── Index of work ────────────────────────────────────────────────── */

.index { list-style: none; margin: 0; padding: 0; }

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

.entry {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0 1.5rem;
  padding: 1.6rem 0 1.7rem;
  text-decoration: none;
  position: relative;
}

/* the trace: a hairline that draws in from the left on hover */
.entry::before {
  content: "";
  position: absolute;
  left: -1.25rem;
  top: 1.9rem;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.28s ease;
}

.entry:hover::before, .entry:focus-visible::before { width: 0.75rem; }

.entry .date {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.45rem;
  white-space: nowrap;
}

.entry h2 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 32;
  font-weight: 600;
  font-size: 1.3125rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  transition: color 0.15s;
}

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

.entry p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.tags {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.75;
}

.tags span::before { content: "· "; }
.tags span:first-child::before { content: ""; }
.tags span { margin-right: 0.5rem; }

.empty {
  padding: 3rem 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ── About page ───────────────────────────────────────────────────── */

.prose { padding: 3.5rem 0 0; }

.prose h1 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 120;
  font-weight: 600;
  font-size: clamp(2.25rem, 7vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 2rem;
}

.prose p { margin: 0 0 1.25rem; max-width: 36rem; }

.prose a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.section-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 3rem 0 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.pairs { display: grid; gap: 0.75rem; margin: 0; }

.pair {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1.5rem;
  font-size: 0.9375rem;
}

.pair dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.3rem;
}

.pair dd { margin: 0; }

/* ── Footer ───────────────────────────────────────────────────────── */

.foot {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.foot a { color: var(--muted); text-decoration: none; margin-left: 1.25rem; }
.foot a:first-child { margin-left: 0; }
.foot a:hover { color: var(--accent); }

/* ── Small screens ────────────────────────────────────────────────── */

@media (max-width: 34rem) {
  .entry, .pair { grid-template-columns: 1fr; gap: 0.4rem; }
  .entry .date { padding-top: 0; }
  .hero { padding: 3rem 0 2rem; }
}

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