/* ==========================================================
   Personal site
   Sections: tokens, base, links, header, layout, contact
   ========================================================== */

/* ---------- tokens ---------- */

:root {
  --bg:     #fcfcfa;
  --ink:    #1b1b19;
  --muted:  #7a7a72;
  --rule:   #e2e2dc;
  --accent: #2f4f9e;
  --mark:   #f2f0e8;

  --measure: 46rem;   /* max line length */
  --gap:     3rem;    /* space between sections */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #1a1a18;
    --ink:    #e6e4dd;
    --muted:  #8d8d84;
    --rule:   #2f2f2b;
    --accent: #8fa9ee;
    --mark:   #26261f;
  }
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
               "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
  padding: 4rem 1.5rem 6rem;
  max-width: var(--measure);
}

@media (min-width: 700px) {
  body {
    padding-left: 4rem;
    font-size: 15.5px;
  }
}

/* ---------- links ---------- */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

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

/* ---------- header ---------- */

h1 {
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
}

.tagline {
  color: var(--muted);
  margin: 0.25rem 0 1.25rem;
}

nav a { margin-right: 1.25rem; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* ---------- sections ---------- */

section { margin-bottom: var(--gap); }

h2 {
  font-size: inherit;
  font-weight: 700;
  margin: 0 0 1rem;
}

.year {
  color: var(--muted);
  margin: 1.5rem 0 0.4rem;
}

.year:first-of-type { margin-top: 0; }

/* Two-column rows: aligned on desktop, stacked on mobile.
   Replaces the space-padded monospace alignment trick,
   which collapses on narrow screens. */
.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1.5rem;
  padding: 0.15rem 0;
}

@media (min-width: 620px) {
  .row      { grid-template-columns: 15rem 1fr; }
  .row--work { grid-template-columns: 17rem 1fr; }
}

.row .desc { color: var(--muted); }

.aside {
  color: var(--muted);
  font-size: 0.9em;
}

/* ---------- contact ---------- */

.copy {
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0 0.35rem;
  cursor: pointer;
}

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

.copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
