/* HornbeckCo — hornbeckco.com, Aidan Hornbeck's resume and portfolio
   Plain CSS, no build step. Two typefaces: Fraunces (text and display), IBM Plex Mono (labels). */

:root {
  --paper: #f4f0e6;
  --paper-2: #ebe5d6;
  --card: #fbf9f3;
  --ink: #16140f;
  --ink-2: #4a463d;
  --rule: #c9c1ae;
  --flag: #e2491b;      /* marks and large type only */
  --flag-ink: #a8300d;  /* the same orange, dark enough for small text */
  --grid: rgba(22, 20, 15, 0.055);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  --measure: 62ch;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.06rem, 0.98rem + 0.35vw, 1.22rem);
  line-height: 1.55;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-color: var(--flag); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { color: var(--flag-ink); }
:focus-visible { outline: 3px solid var(--flag); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; font-family: var(--mono); font-size: 0.85rem; z-index: 10; }
.skip:focus { left: var(--gutter); top: 0.5rem; }
.skip:hover { color: var(--paper); }

.wrap { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- labels ---------- */
.label, nav a, .meta, .role, .btn, footer { font-family: var(--mono); }
.label {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 0.6em; margin: 0;
}
.label::before { content: ""; width: 0.6em; height: 0.6em; flex-shrink: 0; background: var(--flag); display: inline-block; }

/* ---------- header ---------- */
.masthead { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1.4rem 0 1.1rem; border-bottom: 2px solid var(--ink); flex-wrap: wrap; }
.wordmark { font-size: 1.55rem; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; line-height: 1; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(0.9rem, 2.5vw, 1.8rem); flex-wrap: wrap; }
nav a { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current="page"] { border-bottom-color: var(--flag); color: var(--ink); }

/* ---------- intro: name, role, summary (same on every page) ---------- */
.intro { padding: clamp(2.2rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.intro h1 { font-size: clamp(2.5rem, 1.3rem + 5.4vw, 5.6rem); line-height: 0.98; letter-spacing: -0.025em; font-weight: 600; margin: 0.9rem 0 0.9rem; font-variation-settings: "WONK" 1; }
.intro.sub h1 { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 4rem); }
.role { font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--flag-ink); margin: 0 0 1.4rem; }
.summary { max-width: var(--measure); font-size: 1.18em; line-height: 1.45; color: var(--ink-2); margin: 0 0 1.8rem; }
.intro.sub .summary { font-size: 1.05em; margin-bottom: 0; }

.btn { font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; padding: 0.95rem 1.25rem; border: 2px solid var(--ink); display: inline-block; transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease; }
.btn-solid { background: var(--ink); color: var(--paper); box-shadow: 5px 5px 0 var(--flag); }
.btn-solid:hover { color: var(--paper); transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--flag); }

/* ---------- sections ---------- */
section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--rule); }
.sec { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: clamp(1rem, 4vw, 3rem); }
.sec > header .num { font-family: var(--mono); font-size: 0.78rem; color: var(--flag-ink); display: block; margin-bottom: 0.4rem; }
.sec > header .label { font-size: 0.72rem; font-weight: 400; line-height: 1.55; letter-spacing: 0.14em; margin: 0; max-width: none; align-items: baseline; text-wrap: balance; }
.sec h2 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.6rem); line-height: 1.05; letter-spacing: -0.02em; font-weight: 600; margin: 0 0 1.1rem; max-width: 24ch; text-wrap: balance; }
.sec p { max-width: var(--measure); margin: 0 0 1em; }
.sec p.lead { font-size: 1.18em; line-height: 1.45; }

/* ---------- two doors on the home page ---------- */
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1.5px solid var(--ink); background: var(--card); }
.doors a { display: block; padding: 1.4rem 1.4rem 1.5rem; text-decoration: none; border-right: 1px solid var(--rule); }
.doors a:last-child { border-right: 0; }
.doors a:hover { background: var(--paper-2); color: var(--ink); }
.doors b { display: block; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; margin-bottom: 0.4rem; }
.doors b::after { content: " \2192"; content: " \2192" / ""; color: var(--flag); }
.doors span { color: var(--ink-2); }

/* ---------- how I work (home page About) ---------- */
.ways { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1.5px solid var(--ink); background: var(--card); }
.ways li { padding: 1rem 1.1rem 1.1rem; border-right: 1px solid var(--rule); }
.ways li:last-child { border-right: 0; }
.ways b { display: block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--flag-ink); font-weight: 500; margin-bottom: 0.35rem; }

/* ---------- resume entries and portfolio projects ---------- */
.entries { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.entries > li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: clamp(1rem, 3vw, 2rem); padding: 1.3rem 0; border-bottom: 1px solid var(--rule); }
.entries .meta { font-size: 0.78rem; line-height: 1.5; color: var(--ink-2); padding-top: 0.35rem; margin: 0; }
.entries h3 { font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.6rem); line-height: 1.15; letter-spacing: -0.01em; font-weight: 600; margin: 0; }
.entries .org { margin: 0.15rem 0 0.6rem; color: var(--ink-2); }
.entries ul { margin: 0; padding-left: 1.1rem; max-width: var(--measure); }
.entries ul li { margin-bottom: 0.35rem; }
.entries ul li::marker { color: var(--flag-ink); }
.entries p { max-width: var(--measure); margin: 0 0 0.6rem; }
.entries .link { font-family: var(--mono); font-size: 0.82rem; margin: 0.8rem 0 0; }

/* a project written up as a short case study: result first */
.entries .case { margin: 0.3rem 0 0; max-width: var(--measure); }
.entries .case div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.8rem; padding: 0.5rem 0; border-top: 1px solid var(--rule); }
.entries .case dt { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--flag-ink); padding-top: 0.25rem; }
.entries .case dd { margin: 0; }
.fine { max-width: var(--measure); margin: 0.8rem 0 0; font-size: 0.95rem; color: var(--ink-2); }

.skills { margin: 0; border-top: 2px solid var(--ink); }
.skills div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: clamp(1rem, 3vw, 2rem); padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.skills dt { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--flag-ink); padding-top: 0.25rem; }
.skills dd { margin: 0; max-width: var(--measure); }

.callout { padding: 1.4rem 1.5rem; border: 1.5px solid var(--ink); background: var(--paper-2); display: flex; justify-content: space-between; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.callout p { margin: 0; font-size: 1.1em; max-width: 40ch; }

::selection { background: var(--ink); color: var(--paper); }

/* ---------- contact row under the summary: act without scrolling ---------- */
.reach { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.5rem; }
.reach .btn { margin-right: 0.3rem; }
.reach-links { display: inline-flex; gap: 1.5rem; }
.reach-link { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.reach p { flex-basis: 100%; margin: 0.3rem 0 0; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--ink-2); }

/* ---------- drafts: made-up text waiting for Aidan's check (check.py --release fails while any remain) ---------- */
.draft::before {
  content: "Draft: made up, check before upload";
  display: block; width: fit-content; margin-bottom: 0.35rem; padding: 0.1rem 0.45rem;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--flag-ink); background: var(--paper-2);
}

/* ---------- why planning: the plotted balance ---------- */
.growth { margin: 2.2rem 0 0; padding: 1.1rem 1.25rem 1rem; border: 1.5px solid var(--ink); background: var(--card); max-width: 46rem; container-type: inline-size; }
.growth svg { display: block; width: 100%; height: auto; overflow: visible; }
.growth .plot-sm { display: none; }
.growth .grid line { stroke: var(--rule); stroke-width: 1; }
.growth .grid .base { stroke: var(--ink); stroke-width: 1.5; }
.growth text { font-family: var(--mono); font-size: 11px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.growth .in { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-dasharray: 6 5; }
.growth .bal { fill: none; stroke: var(--flag); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.growth .end { fill: var(--flag-ink); font-size: 14px; font-weight: 600; }
.growth .readout { display: none; margin: 0 0 0.3rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--flag-ink); font-variant-numeric: tabular-nums; }
.growth figcaption { margin-top: 0.7rem; font-size: 0.95rem; line-height: 1.45; color: var(--ink-2); max-width: var(--measure); }

/* ---------- other paths: a route with three stops ---------- */
.route { list-style: none; margin: 1.8rem 0 1.4rem; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.route > li { position: relative; padding: 1.5rem 1.4rem 0 0; }
.route > li::before { content: ""; position: absolute; top: calc(-0.5rem - 1px); left: 0; width: 1rem; height: 1rem; background: var(--flag); border: 2px solid var(--ink); }
.route .stage { margin: 0 0 0.9rem; font-family: var(--mono); font-size: 0.72rem; font-weight: 400; line-height: inherit; letter-spacing: 0.12em; text-transform: uppercase; color: var(--flag-ink); }
.route ul { list-style: none; margin: 0; padding: 0; }
.route ul li { margin: 0 0 1.1rem; max-width: 34ch; color: var(--ink-2); font-size: 0.95em; line-height: 1.45; }
.route b { display: block; margin-bottom: 0.2rem; color: var(--ink); font-weight: 600; line-height: 1.25; }

/* ---------- day one: the ledger ---------- */
.ledger { width: 100%; max-width: 46rem; border-collapse: collapse; border-top: 2px solid var(--ink); font-variant-numeric: tabular-nums; }
.ledger caption { caption-side: bottom; text-align: left; padding-top: 0.7rem; font-size: 0.95rem; color: var(--ink-2); }
.ledger th, .ledger td { text-align: left; vertical-align: baseline; padding: 0.75rem 0.8rem 0.75rem 0; border-bottom: 1px solid var(--rule); }
.ledger thead th { font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.ledger tbody th { font-weight: 400; line-height: 1.35; }
.ledger thead th:nth-child(2), .ledger td:nth-child(2) { text-align: right; white-space: nowrap; padding-right: 1.4rem; }
.ledger td:last-child { font-size: 0.9rem; line-height: 1.35; color: var(--ink-2); }
.ledger .fig, .ledger .fig-now { font-family: var(--mono); font-size: 1.12rem; font-weight: 600; color: var(--ink); }
.ledger .fig-text { font-family: var(--mono); font-size: 0.95rem; font-weight: 600; white-space: normal; }
.ledger tbody tr:last-child th, .ledger tbody tr:last-child td { border-bottom: 4px double var(--ink); }
.ledger + p { margin-top: 1.6rem; }

/* ---------- motion: one moment, tied to scrolling, script-free, only where the browser supports it ----------
   The plotted balance draws as the chart comes into view, with the year counting up under the pen.
   Without support, with reduced motion, or in print, the finished chart simply shows. */
@property --yr { syntax: "<integer>"; inherits: true; initial-value: 0; }

@media screen and (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .growth { view-timeline: --plot block; }
    .growth .bal { stroke-dasharray: 1; animation: plot-draw linear both; animation-timeline: --plot; animation-range: entry 30% contain 15%; }
    .growth .readout { display: block; }
    .growth .yr { counter-reset: yr var(--yr); animation: plot-year linear both; animation-timeline: --plot; animation-range: entry 30% contain 15%; }
    .growth .yr .n { display: none; }
    .growth .yr::after { content: counter(yr) / ""; }
    .growth .end { animation: plot-end linear both; animation-timeline: --plot; animation-range: contain 5% contain 15%; }

  }
}
@keyframes plot-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
/* the stops follow the drawn length of the curve, which grows faster than the years, so the count stays under the pen */
@keyframes plot-year { 0% { --yr: 0; } 11.4% { --yr: 5; } 22.8% { --yr: 10; } 34.4% { --yr: 15; } 46.1% { --yr: 20; } 58.2% { --yr: 25; } 70.9% { --yr: 30; } 84.6% { --yr: 35; } 100% { --yr: 40; } }
@keyframes plot-end { from { opacity: 0; } to { opacity: 1; } }

/* the chart's labels follow the chart's own width; in a narrow chart a phone-sized drawing takes over,
   so its labels stay at 11.5 px or more */
@container (max-width: 600px) { .growth text { font-size: 16px; } .growth .end { font-size: 18px; } }
@container (max-width: 440px) {
  .growth .plot-lg { display: none; }
  .growth .plot-sm { display: block; }
  .growth text { font-size: 14px; }
  .growth .end { font-size: 16px; }
}

/* Windows contrast themes force the card to Canvas but leave SVG paint alone, so the chart takes system colors */
@media (forced-colors: active) {
  .growth text, .growth .end { fill: CanvasText; }
  .growth .grid line { stroke: GrayText; }
  .growth .in, .growth .grid .base { stroke: CanvasText; }
  .growth .bal { stroke: Highlight; }
}


/* ---------- 404 ---------- */
.page-head { padding: clamp(2rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.page-head h1 { font-size: clamp(2.2rem, 1.4rem + 4vw, 4.4rem); line-height: 1; letter-spacing: -0.025em; font-weight: 600; margin: 0.8rem 0 1rem; max-width: 18ch; }
.page-head p { max-width: var(--measure); color: var(--ink-2); font-size: 1.15em; margin: 0; }

/* ---------- footer ---------- */
footer { border-top: 2px solid var(--ink); padding: 1.6rem 0 2.4rem; font-size: 0.78rem; color: var(--ink-2); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
footer p { margin: 0; }
footer .disclaimer { flex-basis: 100%; }
.headshot { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ink); display: block; margin-bottom: 0.4rem; }
.intro .dl { margin: 1.2rem 0 0; }
.print-only { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .ways { grid-template-columns: minmax(0, 1fr); }
  .ways li { border-right: 0; border-bottom: 1px solid var(--rule); }
  .ways li:last-child { border-bottom: 0; }
}
@media (max-width: 900px) {
  /* case-study rows stack once the entry column gets narrow */
  .entries .case div { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
  /* the route turns to run down the page */
  .route { grid-template-columns: minmax(0, 1fr); border-top: 0; border-left: 2px solid var(--ink); margin-left: 0.5rem; }
  .route > li { padding: 0 0 0.6rem 1.6rem; }
  .route > li::before { top: 0.05rem; left: calc(-0.5rem - 1px); }
  .route ul li { max-width: var(--measure); }
}
@media (max-width: 640px) {
  /* the ledger stacks: entry on top, figure and source underneath */
  .ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ledger tr { display: grid; grid-template-columns: 6rem minmax(0, 1fr); column-gap: 0.9rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
  .ledger tbody tr:last-child { border-bottom: 4px double var(--ink); }
  .ledger tbody tr:last-child th, .ledger tbody tr:last-child td { border-bottom: 0; }
  .ledger th, .ledger td { border-bottom: 0; padding: 0; }
  .ledger tbody th { grid-column: 1 / -1; margin-bottom: 0.2rem; }
  .ledger thead th:nth-child(2), .ledger td:nth-child(2) { text-align: left; padding-right: 0; }
  .ledger td:last-child { align-self: center; }
  .growth { padding: 0.9rem 0.8rem 0.8rem; }
  /* nav always gets its own line, so the header height doesn't change when the web fonts arrive */
  .masthead { flex-direction: column; align-items: flex-start; gap: 0.7rem; }
  .sec, .entries > li, .skills div { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
  .doors { grid-template-columns: 1fr; }
  .doors a { border-right: 0; border-bottom: 1px solid var(--rule); }
  .doors a:last-child { border-bottom: 0; }
  .callout { flex-direction: column; align-items: flex-start; }
  .callout .btn, .reach .btn { max-width: 100%; padding-inline: 0.8rem; letter-spacing: 0.02em; overflow-wrap: anywhere; }
}

/* ---------- print: the resume page prints as a plain resume ---------- */
@media print {
  @page { margin: 0.4in 0.55in; }
  body { background: #fff; line-height: 1.25; font-size: 10.5pt; }
  .entries h3, .entries .org { margin-top: 0; margin-bottom: 0.1rem; }
  .entries ul li { margin-bottom: 0.1rem; }
  .no-print, .headshot, footer { display: none; }
  .print-only { display: block; margin: 0.2rem 0 0; font-size: 10pt; }
  nav, .skip, .sec > header .num { display: none; }
  .intro { padding: 0 0 0.6rem; }
  .intro h1, .intro.sub h1 { font-size: 22pt; margin: 0.2rem 0; }
  .intro .summary { font-size: 10.5pt; max-width: none; }
  section { padding: 0.3rem 0; }
  /* one column: the screen's label column would squeeze every entry into a narrow strip */
  .sec { display: block; }
  .sec > header { margin-bottom: 0.15rem; break-after: avoid; }
  .entries > li, .skills div { grid-template-columns: 9rem minmax(0, 1fr); gap: 0.8rem; padding: 0.25rem 0; break-inside: avoid; }
  .entries h3 { font-size: 12pt; }
  .entries .org, .entries p, .entries ul, .skills dd { font-size: 9.5pt; max-width: none; }
  .ways li, .route > li, .ledger tr, .growth, .doors, .callout { break-inside: avoid; }
  .sec h2, .ways b, .route .stage { break-after: avoid; break-inside: avoid; }
  a { text-decoration: none; }
}
