/* ---------- Tokens ---------- */
:root {
  --paper: #F1F3EF;
  --paper-raised: #F9FAF7;
  --ink: #161A1E;
  --ink-2: #454E57;
  --ink-3: #5C656E;
  --rule: #C8CDC7;
  --grid: rgba(22, 26, 30, 0.055);
  --accent: #BF3F0A;

  --display: "Michroma", "Eurostile Extended", "Eurostile", Arial, sans-serif;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  color-scheme: only light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F151B;
    --paper-raised: #151D25;
    --ink: #E4E8E3;
    --ink-2: #AAB3BA;
    --ink-3: #8C969F;
    --rule: #2B3641;
    --grid: rgba(228, 232, 227, 0.045);
    --accent: #FF7B3F;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0F151B;
  --paper-raised: #151D25;
  --ink: #E4E8E3;
  --ink-2: #AAB3BA;
  --ink-3: #8C969F;
  --rule: #2B3641;
  --grid: rgba(228, 232, 227, 0.045);
  --accent: #FF7B3F;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  padding-inline: clamp(16px, 3vw, 40px);
  padding-block: clamp(16px, 3vw, 40px);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover { color: var(--accent); }

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

@media (prefers-reduced-motion: no-preference) {
  a, .btn { transition: color 0.15s ease, background-color 0.15s ease; }
}

/* Shared label style: drawing-annotation mono caps */
.eyebrow,
.contact dt,
.specs dt,
.entry-where,
.skills dt,
.tb-label,
.fig-no {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Sheet ---------- */
.sheet {
  max-width: 70rem;
  margin-inline: auto;
  padding: clamp(16px, 5vw, 64px);
  border: 1.5px solid var(--ink);
  display: grid;
  gap: clamp(48px, 7vw, 80px);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px 56px;
}

.hero-id { container-type: inline-size; }

.eyebrow { margin: 0 0 1.25rem; }

.name {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-synthesis: none;
  font-size: clamp(2.5rem, 16cqi, 5.25rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.name span { display: block; }

.lede {
  max-width: 54ch;
  margin: 1.5rem 0 0;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.contact {
  margin: 0;
  display: grid;
  gap: 16px;
  min-width: 15rem;
}
.contact div { display: grid; gap: 4px; }
.contact dd { margin: 0; overflow-wrap: anywhere; }

/* A quiet accent-tinted button: reads as an action without competing with the name. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--accent);
  color: color-mix(in srgb, var(--accent) 82%, var(--ink));
  background: var(--paper-raised);
  background: color-mix(in srgb, var(--accent) 7%, var(--paper-raised));
  border: 1px solid var(--rule);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--rule));
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover {
  color: color-mix(in srgb, var(--accent) 82%, var(--ink));
  background: color-mix(in srgb, var(--accent) 13%, var(--paper-raised));
  border-color: var(--accent);
}
.btn-icon {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linejoin: round;
}

/* ---------- Fig. 1 — rocket drawing ---------- */
.figure { margin: 0; display: grid; gap: 12px; }

.figure-box {
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  min-width: 0; /* as a grid item it would otherwise stretch to its widest drawing */
}

.drawing {
  padding-block: clamp(16px, 3vw, 32px);
  padding-inline: clamp(8px, 2.5vw, 28px);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}

.dwg { display: block; width: 100%; max-width: 100%; height: auto; overflow: visible; }

.dwg .part {
  fill: var(--paper-raised);
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.dwg .cl {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1;
  stroke-dasharray: 18 5 3 5;
  vector-effect: non-scaling-stroke;
}
.dwg .ext {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.dwg .dim {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.dwg .arrowhead { fill: var(--accent); }
.dwg .lbl {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.1em;
  fill: var(--ink-2);
}
.dwg .dim-lbl { fill: var(--accent); }
.dwg .ln {
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

@media (max-width: 560px) {
  .rocket .annot { display: none; }
}

.specs {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}
.specs div {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  border-left: 1px solid var(--rule);
}
.specs div:first-child { border-left: 0; }
.specs dd {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  font-stretch: 112%;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

@media (max-width: 640px) {
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .specs div:nth-child(3) { border-left: 0; }
  .specs div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}

figcaption {
  font-size: 0.875rem;
  color: var(--ink-2);
}
.fig-no { color: var(--accent); margin-right: 0.75em; }

/* min-width: 0 lets the figure shrink, so only its drawing scrolls sideways. */
.figure-wide { grid-column: 1 / -1; min-width: 0; }

/* ---------- Sections ---------- */
.sections {
  display: grid;
  gap: clamp(40px, 6vw, 64px);
}

.section {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 20px 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-synthesis: none;
  font-size: 0.875rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entries { display: grid; gap: 36px; }

.entry { display: grid; gap: 4px; }

/* One entry can hold several roles; each one is a .subentry. */
.subentry { display: grid; gap: 4px; }
.subentry + .subentry { margin-top: 20px; }

.entry-figure {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  max-width: 34rem;
}
.entry-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
}

.entry-head,
.entry-role {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 24px;
  margin: 0;
}

.entry-org {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 600;
  font-stretch: 112%;
  line-height: 1.35;
}

.entry-where { margin: 0; }

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

.dates {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.now { font-style: normal; color: var(--accent); }
.now::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.12em;
}

.points {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-width: 68ch;
  color: var(--ink-2);
}
.points li { position: relative; padding-left: 1.4em; }
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.8em;
  width: 0.7em;
  height: 1px;
  background: var(--ink-3);
}

.skills { margin: 0; display: grid; gap: 18px; }
.skills div {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 4px 24px;
}
.skills dt { padding-top: 0.2em; }
.skills dd { margin: 0; max-width: 60ch; }

/* ---------- Footer / title block ---------- */
.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
}

.foot-note { margin: 0; color: var(--ink-2); }

.title-block {
  width: min(100%, 28rem);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--ink);
  border: 1.5px solid var(--ink);
}
.tb-cell {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  background: var(--paper);
}
.tb-title { grid-column: 1 / -1; }
.tb-label { font-size: 0.625rem; }
.tb-value {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-top { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .section { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

@media (max-width: 560px) {
  .figure-wide .drawing { overflow-x: auto; }
  .figure-wide .dwg { min-width: 620px; }
  .skills div { grid-template-columns: minmax(0, 1fr); }
  .contact { min-width: 0; }
}

/* ---------- Print: one clean page ---------- */
@media print {
  :root,
  :root:not([data-theme="light"]),
  :root[data-theme="dark"] {
    --paper: #fff;
    --paper-raised: #fff;
    --ink: #000;
    --ink-2: #222;
    --ink-3: #444;
    --rule: #bbb;
    --accent: #000;
    color-scheme: light;
  }
  @page { size: letter; margin: 0.5in; }
  body { padding: 0; font-size: 10pt; line-height: 1.4; }
  .sheet { max-width: none; padding: 0; border: 0; gap: 14pt; }
  .hero { gap: 0; }
  .hero-top { grid-template-columns: minmax(0, 1fr) auto; gap: 12pt 24pt; }
  .name { font-size: 24pt; }
  .name span { display: inline; }
  .eyebrow { margin-bottom: 6pt; }
  .lede { font-size: 10pt; margin-top: 6pt; }
  .contact { gap: 4pt; }
  .contact div:last-child,
  .figure,
  .entry-figure,
  .sheet-foot { display: none; }
  .sections { gap: 12pt; }
  .section { grid-template-columns: 9rem minmax(0, 1fr); gap: 6pt 16pt; padding-top: 8pt; }
  .entries { gap: 10pt; }
  .entry { break-inside: avoid; }
  .points { margin-top: 3pt; gap: 2pt; }
  .skills { gap: 4pt; }
  .skills div { grid-template-columns: 9rem minmax(0, 1fr); }
  a { text-decoration: none; }
}
