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

:root {
  /* Surface */
  --bg: #F6F2EA;
  --rule: #E5DFD0;

  /* Ink */
  --ink: #1A1814;
  --ink-soft: #5A5448;
  --ink-faint: #8C8474;

  /* Accent — ivy green, used only for links and interactive states */
  --accent: #2E5A44;
  --accent-soft: #3F7159;

  /* Type */
  --serif: 'Source Serif 4', 'Source Serif Pro', Iowan Old Style, Apple Garamond, Baskerville, Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Layout */
  --container: 64rem;   /* 1024px */
  --measure: 36rem;     /* 576px — body prose measure */
  --hero-measure: 44rem;
}

/* ---------- Reset ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--bg); }

/* ---------- Layout ---------- */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2.5rem;
}

main > section + section { margin-top: 0; }

/* ---------- Top strip ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.75rem 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.topbar .wordmark {
  font-weight: 500;
}

.topbar nav {
  display: flex;
  gap: 1.75rem;
}

.topbar a {
  transition: color 180ms ease;
}

.topbar a:hover,
.topbar a:focus-visible { color: var(--accent); }

/* ---------- Hero ---------- */

.hero {
  padding: 5.5rem 0 5rem;
  max-width: var(--hero-measure);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 1rem + 2.4vw, 2.5rem);
  line-height: 1.28;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}

.hero__sub {
  margin-top: 1.75rem;
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-style: italic;
  color: var(--ink-soft);
  letter-spacing: 0.005em;
}

/* ---------- Section labels (h2 in mono uppercase) ---------- */

.label {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 2.25rem;
}

/* ---------- Projects ---------- */

.projects {
  padding: 0 0 5.5rem;
}

.project-list li {
  border-top: 1px solid var(--rule);
}

.project-list li:last-child {
  border-bottom: 1px solid var(--rule);
}

.project {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 2rem;
  padding: 2.25rem 0;
  transition: padding-left 220ms ease;
}

.project__text {
  min-width: 0;
}

.project__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.625rem;
  line-height: 1.2;
  letter-spacing: -0.011em;
  color: var(--ink);
  transition: color 200ms ease;
}

.project__desc {
  margin-top: 0.5rem;
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 32rem;
}

.project__url {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  white-space: nowrap;
  transition: color 200ms ease;
}

.project__arrow {
  display: inline-block;
  font-family: var(--mono);
  transition: transform 220ms ease;
  will-change: transform;
}

.project:hover .project__name,
.project:focus-visible .project__name {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.18em;
}

.project:hover .project__url,
.project:focus-visible .project__url {
  color: var(--accent);
}

.project:hover .project__arrow,
.project:focus-visible .project__arrow {
  transform: translateX(4px);
}

.project:focus-visible {
  outline: none;
}

/* ---------- Values ---------- */

.values {
  padding: 0 0 6rem;
}

.values__section + .values__section {
  margin-top: 3.75rem;
}

.values__section {
  max-width: var(--measure);
}

.values__heading {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.values__body {
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--ink);
  text-wrap: pretty;
}

/* ---------- Footer ---------- */

footer {
  margin-top: 1rem;
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

footer .wordmark {
  color: var(--ink);
  font-weight: 500;
}

footer a {
  transition: color 180ms ease;
}

footer a:hover,
footer a:focus-visible { color: var(--accent); }

/* ---------- Focus ring (default for everything else) ---------- */

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

/* ============================================================
   ENTRANCE ANIMATION — typographic settle
   ============================================================
   The hero text reads itself in at human cadence (word-by-word with
   punctuation beats), while the overall weight axis settles from light
   to regular underneath. The sub-line follows as a quiet enumeration
   ("ZK Email. ... Proteus. ... Screencap. ... More on the way.").
   Per-word delays are set by anim.js; this stylesheet provides the
   keyframes and per-element animations. One pass on load, then static. */

@keyframes word-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes hero-weight-settle {
  from { font-variation-settings: "wght" 280, "opsz" 36; }
  to   { font-variation-settings: "wght" 400, "opsz" 36; }
}

@keyframes sub-weight-settle {
  from { font-variation-settings: "wght" 250, "opsz" 12; }
  to   { font-variation-settings: "wght" 400, "opsz" 12; }
}

.hero h1 {
  font-variation-settings: "wght" 280, "opsz" 36;
  animation: hero-weight-settle 2800ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero h1 .word,
.hero h1 .emdash {
  opacity: 0;
  animation: word-in 780ms cubic-bezier(0.16, 1, 0.3, 1) var(--word-delay, 0ms) both;
}

.hero__sub {
  font-variation-settings: "wght" 250, "opsz" 12;
  animation: sub-weight-settle 2200ms cubic-bezier(0.16, 1, 0.3, 1) var(--sub-start, 3300ms) both;
}

.hero__sub .word {
  opacity: 0;
  animation: word-in 850ms cubic-bezier(0.16, 1, 0.3, 1) var(--word-delay, 0ms) both;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  .hero h1,
  .hero h1 .word,
  .hero h1 .emdash,
  .hero__sub,
  .hero__sub .word {
    opacity: 1 !important;
    font-variation-settings: normal !important;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 720px) {
  .container { padding: 0 1.5rem; }

  .topbar { padding: 1.25rem 0; }
  .topbar nav { gap: 1.25rem; }

  .hero { padding: 4rem 0 5rem; }
  .hero h1 {
    font-size: clamp(1.5rem, 5vw, 1.875rem);
    line-height: 1.3;
  }
  .hero__sub { margin-top: 1.25rem; font-size: 1rem; }

  .projects { padding: 0.5rem 0 4.5rem; }
  .project {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1.75rem 0;
  }
  .project__name { font-size: 1.375rem; }
  .project__desc { font-size: 1rem; }

  .values { padding: 0.5rem 0 4.5rem; }
  .values__section + .values__section { margin-top: 2.75rem; }
  .values__body { font-size: 1.0625rem; line-height: 1.65; }

  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 2rem 0 2.5rem;
  }
}
