/* Coolors palette: a3a380 / d6ce93 / efebce / d8a48f / bb8588.
   Darker text tones keep the pastel surfaces readable at regular font weights. */
:root {
  --cream: #f4f2eb;
  --paper: #faf8ed;
  --ink: #2a2d22;
  --muted: #454938;
  --olive: #52543e;
  --sage: #a3a380;
  --butter: #d4d0b0;
  --peach: #d8a48f;
  --rose: #bb8588;
  --rose-ink: #744c50;
  --line: #c5c1a3;
  --soft-line: #ded7b4;
  --max-width: 800px;
  --serif: Georgia, 'Times New Roman', serif;
  --mono: 'Courier New', Courier, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 14px/1.85 var(--mono);
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-underline-offset: 5px; }
a:hover { color: var(--rose-ink); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 5px;
  border-radius: 2px;
}
[hidden] { display: none !important; }
main:focus { outline: none; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; line-height: 1.2; }
h1 { font-size: clamp(32px, 4.5vw, 48px); letter-spacing: -.035em; }
h2 { font-size: clamp(26px, 3vw, 32px); letter-spacing: -.025em; }
h3 { font-size: 23px; letter-spacing: -.015em; }
p { margin: 16px 0; }
::selection { background: var(--butter); color: var(--ink); }
.wrap { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 44px; }
.section { padding: 42px 0; }
.section-heading { margin-bottom: 32px; }
.section-heading > p:last-child { color: var(--muted); margin-top: 14px; max-width: 55ch; }
.eyebrow { margin: 0 0 18px; font-size: 11px; line-height: 1.65; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.paper { background: var(--paper); padding: 44px; border: 1px solid var(--soft-line); border-radius: 3px; box-shadow: 0 3px 8px #292c2704; }
.text-link { display: inline-flex; gap: 12px; align-items: center; padding-bottom: 4px; border-bottom: 1px solid var(--rose); text-decoration: none; font-size: 12px; line-height: 1.6; }
.text-link:hover { border-color: var(--rose-ink); }
.button { display: inline-flex; gap: 20px; align-items: center; justify-content: center; padding: 12px 20px; background: var(--rose); color: var(--ink); border: 1px solid var(--rose); font-size: 13px; }
.button:hover { background: var(--peach); border-color: var(--peach); }
.small-button { border: 1px solid var(--line); background: transparent; padding: 8px 10px; font-size: 12px; line-height: 1.5; }
.small-button:hover { border-color: var(--olive); background: var(--butter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 110; background: var(--paper); padding: 10px 18px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* Desktop contents sit beside the page rather than competing with its cover. */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 3px; pointer-events: none; }
.reading-progress span { display: block; height: 100%; width: 100%; background: var(--rose); transform: scaleX(0); transform-origin: left; }
.site-header { position: fixed; top: 50%; left: max(28px, calc((100vw - 1320px) / 2)); transform: translateY(-50%); z-index: 60; width: 160px; }
.site-nav { display: flex; flex-direction: column; gap: 26px; }
.brand { font: italic 32px/1 var(--serif); text-decoration: none; width: fit-content; }
.brand span { color: var(--rose-ink); }
.nav-caption { display: block; color: var(--muted); font-size: 11px; letter-spacing: .015em; margin-bottom: 20px; }
.nav-links { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.nav-links a { display: flex; gap: 10px; align-items: center; padding: 10px 6px 10px 0; color: var(--ink); font-size: 12px; font-weight: 400; text-decoration: none; }
.nav-number { font-size: 11px; color: var(--olive); width: 18px; flex-shrink: 0; }
.nav-links a[aria-current='location'] { color: var(--rose-ink); }
.nav-links a[aria-current='location'] .nav-number { opacity: 1; color: var(--olive); }
.nav-links a[aria-current='location']::after { content: ''; height: 4px; width: 4px; margin-left: auto; border-radius: 50%; background: var(--rose-ink); }
.nav-resume { display: inline-flex; gap: 30px; font-size: 12px; font-weight: 400; text-decoration: none; margin-top: 24px; padding-top: 15px; border-top: 1px solid var(--line); }
.menu-toggle { display: none; background: transparent; border: 0; padding: 8px 0 8px 12px; font-size: 12px; font-weight: 400; }
.menu-toggle span { display: inline-block; margin-left: 10px; transition: transform .2s ease; }
.menu-toggle[aria-expanded='true'] span { transform: rotate(45deg); }

/* The illustrated cover gives way to a short personal letter. */
.intro { padding-top: 70px; }
.cover { margin: 0 0 50px; }
.cover-art { position: relative; overflow: hidden; border: 6px solid var(--sage); background: var(--cream); }
.cover-art img { width: 100%; height: auto; display: block; }
.cover-title { position: absolute; top: 9%; left: 5%; font: italic 400 clamp(24px, 3.5vw, 36px)/1.15 var(--serif); color: var(--ink); }
.cover-title span { display: block; margin-top: 12px; font: 400 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.cover figcaption { display: flex; justify-content: space-between; gap: 16px; margin-top: 13px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .035em; }
.intro-heading { padding: 0 14px; margin-bottom: 32px; }
h1 em { color: var(--rose-ink); font-weight: 400; }
.availability-dot { display: inline-block; height: 6px; width: 6px; background: var(--sage); border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.letter { padding: 36px 44px 32px; position: relative; border-left: 3px solid var(--peach); }
.letter-greeting { font: 400 23px/1.5 var(--serif); margin-top: 0; }
.letter p:not(.letter-greeting):not(.signature) { color: var(--ink); }
.signature { margin-top: 26px; font-size: 13px; color: var(--muted); }
.signature span { display: inline-block; margin-top: 3px; color: var(--rose-ink); font: italic 32px/1.3 var(--serif); }
.letter-links { display: flex; gap: 26px; flex-wrap: wrap; border-top: 1px solid var(--soft-line); padding-top: 22px; margin-top: 22px; }

/* Project notes open in place, and filtering does not interrupt the reader. */
.project-controls { margin-bottom: 14px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-button { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 8px 12px; font-size: 12px; line-height: 1.5; transition: background .15s, color .15s; }
.filter-button[aria-pressed='true'] { color: var(--ink); background: var(--rose); border-color: var(--rose); }
.filter-button:hover:not([aria-pressed='true']) { background: var(--butter); }
.project-count { margin: 12px 0 16px; font-size: 12px; color: var(--muted); }
.project-card { --project-accent: var(--sage); padding: 32px 0; border-top: 1px solid var(--line); }
.project-card[data-category='web'] { --project-accent: var(--peach); }
.project-card[data-category='research'] { --project-accent: var(--rose); }
.project-meta { display: flex; align-items: center; gap: 18px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 16px; }
.project-number { color: var(--olive); display: inline-block; border-bottom: 2px solid var(--project-accent); padding-bottom: 2px; }
.project-card h3 { max-width: 24ch; font-size: 25px; }
.project-summary { color: var(--muted); margin: 14px 0; max-width: 58ch; }
.project-tools { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; padding: 0; margin: 20px 0; }
.project-tools li { border: 1px solid var(--soft-line); background: var(--paper); font-size: 12px; padding: 4px 8px; }
.project-details { margin: 22px 0; }
.project-details summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; padding: 13px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); font-size: 12px; }
summary::-webkit-details-marker { display: none; }
.details-arrow { font: 22px/1 var(--mono); color: var(--olive); transition: transform .2s; flex-shrink: 0; }
details[open] > summary .details-arrow { transform: rotate(45deg); }
.project-notes { background: #f2eed5; border-left: 2px solid var(--project-accent); padding: 22px 24px; margin-top: 16px; }
.project-note + .project-note { margin-top: 24px; }
.project-note h4 { font: 400 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; color: var(--olive); }
.project-note p { font-size: 13px; color: var(--ink); margin: 0; }

/* Background and tools share a single paper, with distinct sections. */
.timeline { display: grid; gap: 26px; }
.timeline-item + .timeline-item { border-top: 1px solid var(--soft-line); padding-top: 26px; }
.timeline-date { font-size: 12px; letter-spacing: .025em; color: var(--muted); margin: 0 0 12px; }
.timeline-role { font-size: 13px; color: var(--olive); margin: 10px 0; }
.timeline-item > p:last-child { color: var(--muted); font-size: 13px; margin-bottom: 0; }
.toolkit { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.toolkit .eyebrow { margin-bottom: 12px; }
.toolkit-list { margin: 24px 0 0; display: grid; gap: 17px; }
.toolkit-list > div { display: grid; grid-template-columns: 138px 1fr; gap: 20px; font-size: 13px; }
.toolkit-list dt { color: var(--olive); }
.toolkit-list dd { margin: 0; color: var(--muted); }

/* A deliberate, optional detour; the game only runs after Play. */
.play-note { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 24px 0; }
.play-note > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
.play-title { display: block; font: 400 30px/1.2 var(--serif); letter-spacing: -.02em; }
.play-subtitle { display: block; color: var(--muted); font-size: 13px; margin-top: 12px; }
.play-content { padding-top: 18px; }
.play-content > p { color: var(--muted); font-size: 13px; }
.game-panel { background: var(--paper); padding: 24px; border: 1px solid var(--soft-line); position: relative; margin-top: 22px; }
.game-hud { display: flex; align-items: center; gap: 25px; margin-bottom: 18px; }
.game-label, .game-value { display: block; }
.game-label { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.game-value { font-size: 20px; font-family: var(--serif); line-height: 1.6; }
.game-lives { color: var(--olive); font-size: 16px; }
.game-pause { margin-left: auto; }
.game-timer { height: 3px; background: var(--cream); margin-bottom: 20px; }
.game-timer span { display: block; height: 100%; background: var(--rose); width: 100%; }
.game-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; min-height: 220px; align-content: center; }
.game-dot { border: 0; border-radius: 50%; aspect-ratio: 1; padding: 0; min-width: 0; }
.game-dot:hover { box-shadow: 0 0 0 3px #a3a38065; }
.game-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; background: var(--paper); text-align: center; padding: 28px; }
.game-overlay h3 { font-size: 24px; }
.game-overlay p { color: var(--muted); font-size: 13px; max-width: 36ch; margin: 16px 0 22px; }

.contact-paper { border-top: 3px solid var(--rose); }
.contact-paper > p:not(.eyebrow):not(.copy-status) { color: var(--muted); }
.contact-email { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.email-link { font-size: 13px; overflow-wrap: anywhere; }
.copy-status { min-height: 18px; margin: 7px 0 15px; font-size: 12px; color: var(--olive); }
.contact-links { display: flex; gap: 28px; flex-wrap: wrap; }
.site-footer { display: flex; gap: 20px; justify-content: space-between; padding-top: 10px; padding-bottom: 55px; font-size: 12px; color: var(--muted); }
.site-footer a { text-decoration: none; }

@media (max-width: 1100px) {
  html { scroll-padding-top: 90px; }
  .site-header { position: sticky; top: 0; left: auto; width: 100%; transform: none; background: var(--cream); border-bottom: 1px solid var(--line); }
  .site-nav { max-width: var(--max-width); margin: auto; padding: 20px 44px; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0; }
  .brand { font-size: 28px; }
  .menu-toggle:not([hidden]) { display: block; }
  .nav-panel { width: 100%; padding: 20px 0 4px; }
  .js .nav-panel { display: none; }
  .js .site-header.is-open .nav-panel { display: block; }
  .nav-caption { display: none; }
  .nav-links { grid-template-columns: 1fr 1fr; gap: 3px 28px; }
  .nav-links a { padding: 10px 0; }
  .nav-resume { margin-top: 12px; }
  .intro { padding-top: 36px; }
}

@media (max-width: 600px) {
  body { font-size: 14px; }
  .wrap { padding: 0 22px; }
  .site-nav { padding: 16px 22px; }
  .section { padding: 30px 0; }
  .intro { padding-top: 26px; }
  .cover { margin-bottom: 35px; }
  .cover-art { border-width: 4px; }
  .cover-title { font-size: 23px; }
  .cover-title span { font-size: 10px; margin-top: 7px; }
  .cover figcaption { font-size: 10px; letter-spacing: .015em; }
  .intro-heading { padding: 0 3px; margin-bottom: 26px; }
  h1 { font-size: clamp(30px, 8.5vw, 38px); }
  h2 { font-size: 27px; }
  .eyebrow { font-size: 11px; margin-bottom: 15px; }
  .paper { padding: 28px 24px; }
  .letter-greeting { font-size: 22px; }
  .letter-links { gap: 24px; }
  .filter-button { padding: 8px 9px; }
  .project-card { padding: 26px 0; }
  .project-card h3 { font-size: 24px; }
  .project-notes { padding: 19px 18px; }
  .toolkit-list > div { grid-template-columns: 1fr; gap: 3px; }
  .play-title { font-size: 27px; }
  .play-subtitle { max-width: 27ch; line-height: 1.7; }
  .game-panel { padding: 20px; }
  .game-grid { gap: 8px; min-height: 220px; }
  .game-hud { gap: 20px; }
  .game-overlay { padding: 22px; }
  .game-overlay h3 { font-size: 23px; }
  .contact-email { gap: 15px; }
  .email-link { font-size: 13px; }
  .contact-links { gap: 24px; }
  .site-footer { flex-direction: column; gap: 6px; padding-top: 0; padding-bottom: 38px; }
}

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