/* ==========================================================
   Ian Woolston — portfolio
   Clean aerospace theme · navy accent
   ========================================================== */

:root {
  --navy-950: #070d1c;
  --navy-900: #0b1630;
  --navy-800: #13234a;
  --navy-700: #1b3166;
  --navy-600: #1f3f8a;   /* primary accent */
  --navy-100: #e6ebf5;
  --navy-50:  #f3f6fb;

  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #8a94a6;
  --line: #dde3ee;
  --bg: #ffffff;
  --exhaust: #f28c38;    /* used sparingly: a single hot point */

  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, monospace;
  --font-serif: "Newsreader", Georgia, serif;

  --radius: 14px;
  --wrap: 1140px;
  --gutter: clamp(16px, 4vw, 40px);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.mono { font-family: var(--font-mono); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .8em 1.4em;
  border-radius: 999px;
  font: 600 15px/1 var(--font-body);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: .6em 1.1em; font-size: 14px; }
.btn-solid { background: var(--navy-600); color: #fff; }
.btn-solid:hover { background: var(--navy-700); }
.btn-light { background: #fff; color: var(--navy-900); }
.btn-light:hover { background: var(--navy-100); }
.btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost:hover { border-color: #fff; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background .25s, box-shadow .25s;
}
.nav.is-scrolled {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font: 600 16px var(--font-display);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid currentColor;
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: .04em;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a:not(.btn) {
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s;
}
.nav-links a:not(.btn):hover,
.nav-links a.is-active { color: #fff; }

.nav.is-scrolled .brand { color: var(--navy-900); }
.nav.is-scrolled .nav-links a:not(.btn) { color: var(--ink-soft); }
.nav.is-scrolled .nav-links a:not(.btn):hover,
.nav.is-scrolled .nav-links a.is-active { color: var(--navy-600); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  background: none; border: 0; padding: 0;
  cursor: pointer;
  flex-direction: column; justify-content: center; gap: 6px;
}
.nav-toggle span {
  display: block; height: 2px; width: 22px; margin: 0 auto;
  background: #fff; border-radius: 2px;
  transition: transform .25s, background .25s;
}
.nav.is-scrolled .nav-toggle span,
.nav.is-open .nav-toggle span { background: var(--navy-900); }
.nav.is-open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.nav.is-open .nav-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 140px 0 0;
  background:
    radial-gradient(1200px 600px at 85% 10%, rgba(52,92,190,.35), transparent 60%),
    linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 70%, var(--navy-800) 100%);
}
.hero::before {               /* faint drafting grid */
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
  pointer-events: none;
}
.hero-orbits {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  fill: none;
  stroke: rgba(255,255,255,.09);
  stroke-width: 1;
  pointer-events: none;
}
.hero-orbits .traj { stroke: rgba(242,140,56,.35); stroke-dasharray: 2 8; stroke-linecap: round; }

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--exhaust);
  box-shadow: 0 0 0 4px rgba(242,140,56,.2);
}
.hero h1 {
  font-size: clamp(44px, 7.5vw, 88px);
  margin: 18px 0 20px;
  letter-spacing: -0.035em;
}
.lede {
  max-width: 34ch;
  font-size: clamp(17px, 1.6vw, 20px);
  color: rgba(255,255,255,.78);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 32px;
  margin: 44px 0 0;
  font-size: 12.5px;
}
.hero-meta dt { color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 4px; }
.hero-meta dd { margin: 0; color: rgba(255,255,255,.9); }

.hero-photo {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  background: linear-gradient(180deg, #4d8fe0, #a9cdf5 60%, #e9f1fb);
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.hero-photo figcaption {
  position: absolute; left: 0; bottom: -28px;
  font-size: 11px; letter-spacing: .16em;
  color: rgba(255,255,255,.5);
}
.corner { position: absolute; width: 18px; height: 18px; border: 1.5px solid rgba(255,255,255,.6); }
.corner.tl { top: -10px; left: -10px; border-right: 0; border-bottom: 0; }
.corner.tr { top: -10px; right: -10px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: -10px; left: -10px; border-right: 0; border-top: 0; }
.corner.br { bottom: -10px; right: -10px; border-left: 0; border-top: 0; }

/* Missing-image placeholder (shows until the photo is added) */
.ph-label { display: none; }
figure.is-missing img { display: none; }
figure.is-missing .ph-label {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 12px;
  color: var(--navy-700);
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, rgba(31,63,138,.06) 10px 11px),
    var(--navy-50);
  border-radius: inherit;
}

/* Stats strip */
.stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 96px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.stats li {
  padding: 28px 24px 36px 0;
  display: flex; flex-direction: column; gap: 6px;
}
.stats li + li { padding-left: 24px; border-left: 1px solid rgba(255,255,255,.12); }
.stat-num { font: 600 clamp(26px, 3vw, 34px)/1 var(--font-display); letter-spacing: -0.02em; }
.stat-label { font-size: 13.5px; color: rgba(255,255,255,.6); line-height: 1.4; }

/* ---------- Sections ---------- */
.section { padding: clamp(80px, 11vw, 128px) 0; }
.section-tint { background: var(--navy-50); }
.section-head { margin-bottom: 48px; }
.kicker {
  font-size: 12.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy-600);
  margin-bottom: 14px;
}
.section h2 { font-size: clamp(32px, 4.2vw, 48px); color: var(--navy-900); }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(32px, 6vw, 96px);
}
.about-body { display: grid; gap: 20px; font-size: 18px; color: var(--ink-soft); }
.about-body strong { color: var(--ink); font-weight: 600; }
.edu-card {
  display: flex; gap: 16px; align-items: flex-start;
  margin-top: 12px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
}
.edu-icon {
  flex: none;
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--navy-100);
}
.edu-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--navy-600); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.edu-title { font-weight: 600; color: var(--ink); }
.edu-sub { color: var(--ink-soft); font-size: 14px; }
.edu-sub.mono { font-size: 12.5px; color: var(--ink-faint); margin-top: 4px; }

/* Projects */
.project {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .25s, transform .25s;
}
.project:hover { box-shadow: 0 18px 40px -20px rgba(11,22,48,.25); transform: translateY(-2px); }
.project-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 24px;
}
.project-media {
  position: relative;
  margin: 0;
  min-height: 280px;
  background: var(--navy-100);
}
.project-media.tall { aspect-ratio: 4 / 3; min-height: 0; }
.project-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: 14px; flex: 1; }
.project-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-faint); letter-spacing: .08em; }
.project-id { color: var(--navy-600); font-weight: 500; }
.project h3 { font-size: 26px; color: var(--navy-900); }
.project-sub { margin-top: -8px; font-size: 14.5px; font-weight: 500; color: var(--navy-600); }
.project-body > p:not(.project-sub) { color: var(--ink-soft); }
.bullets { display: grid; gap: 8px; font-size: 15px; color: var(--ink-soft); }
.bullets li { position: relative; padding-left: 20px; }
.bullets li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 9px; height: 1.5px; background: var(--navy-600);
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.tags li {
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  color: var(--navy-700);
}
.project-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* Experience timeline */
.exp-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(32px, 6vw, 96px);
}
.timeline { position: relative; display: grid; gap: 40px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 1px; background: var(--line);
}
.timeline li { position: relative; padding-left: 36px; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #fff; border: 2px solid var(--navy-600);
}
.timeline li:first-child::before { background: var(--navy-600); box-shadow: 0 0 0 4px var(--navy-100); }
.tl-date { font-size: 12.5px; color: var(--ink-faint); letter-spacing: .06em; margin-bottom: 6px; }
.tl-body h3 { font-size: 21px; color: var(--navy-900); }
.tl-org { font-size: 14.5px; font-weight: 500; color: var(--navy-600); margin: 4px 0 10px; }
.tl-body > p:last-child { color: var(--ink-soft); font-size: 15.5px; }

/* Milestones */
.awards {
  margin-top: clamp(64px, 8vw, 96px);
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.award-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px; }
.award-list li {
  display: flex; gap: 20px; align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15.5px;
}
.award-year { flex: none; font-size: 12.5px; color: var(--navy-600); width: 3.5em; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.skill-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
}
.skill-card h3 {
  font-size: 15px; letter-spacing: 0;
  color: var(--navy-900);
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 2px solid var(--navy-600);
  display: inline-block;
}
.skill-card ul { display: grid; gap: 8px; font-size: 14.5px; color: var(--ink-soft); }

/* Contact */
.contact {
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #fff;
  text-align: center;
}
.contact .kicker { color: #8fa9e6; }
.contact h2 { color: #fff; }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.contact-lede { max-width: 46ch; margin-top: 16px; color: rgba(255,255,255,.7); font-size: 17px; }
.contact-links {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  width: 100%; max-width: 1040px; margin-top: 44px;
}
.contact-card {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 22px;
  text-align: left;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
  font-size: 15px;
  min-width: 0;
  transition: border-color .2s, background .2s;
}
.contact-card:hover { border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.06); }
.contact-card span { min-width: 0; overflow-wrap: anywhere; }
.contact-card small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: 2px; }
.contact-card svg { flex: none; width: 22px; height: 22px; fill: none; stroke: #8fa9e6; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Footer */
.footer { background: var(--navy-950); color: rgba(255,255,255,.45); font-size: 12.5px; }
.footer-inner { display: flex; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; border-top: 1px solid rgba(255,255,255,.08); }
.footer a { text-decoration: none; }
.footer a:hover { color: #fff; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Small additions ---------- */
.text-link {
  justify-self: start;
  font-size: 15px; font-weight: 600;
  color: var(--navy-600);
  text-decoration: none;
  border-bottom: 1.5px solid var(--navy-100);
  padding-bottom: 2px;
  transition: border-color .2s;
}
.text-link:hover { border-color: var(--navy-600); }

/* Printer axis diagram (stands in for a photo) */
.media-diagram {
  display: grid; place-items: center;
  background:
    linear-gradient(rgba(31,63,138,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31,63,138,.06) 1px, transparent 1px),
    var(--navy-50);
  background-size: 24px 24px;
}
.media-diagram svg { width: 86%; height: auto; overflow: visible; }
.media-diagram .axis line { stroke: var(--navy-700); stroke-width: 1.5; }
.media-diagram text { font: 500 13px var(--font-mono); fill: var(--navy-700); }
.media-diagram .rot { fill: none; stroke: var(--navy-600); stroke-width: 1.5; stroke-dasharray: 5 5; }
.media-diagram .rot-arrow { fill: none; stroke: var(--navy-600); stroke-width: 1.5; }
.media-diagram .rot-label { fill: var(--navy-600); font-weight: 600; }
.media-diagram .cone { fill: rgba(242,140,56,.18); stroke: var(--exhaust); stroke-width: 1.5; }
.media-diagram .caption { font-size: 10.5px; letter-spacing: .12em; fill: var(--ink-faint); }

/* ---------- Background page ---------- */
.page-hero { padding-bottom: clamp(56px, 8vw, 96px); }
.page-hero-inner { position: relative; }
.page-hero h1 { font-size: clamp(38px, 6vw, 68px); max-width: 16ch; }
.page-hero .lede { max-width: 52ch; }

.route {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 0;
  margin-top: 40px;
  font-size: 12.5px;
}
.route li { display: flex; align-items: center; }
.route li span {
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: rgba(255,255,255,.85);
}
.route li + li::before {
  content: ""; width: 28px; height: 1px; margin: 0 6px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.5) 0 4px, transparent 4px 8px);
}
.route li.is-goal span { border-color: var(--exhaust); color: #fff; background: rgba(242,140,56,.12); }

.story .wrap { display: grid; gap: clamp(72px, 10vw, 120px); }
.chapter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.chapter.is-flipped .chapter-media { order: 2; }
.chapter-media { position: relative; margin: 0; }
.chapter-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 24px 48px -28px rgba(11,22,48,.45);
}
.chapter-media img.pos-top { object-position: center 30%; }
.chapter-media figcaption {
  margin-top: 12px;
  font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint);
}
.chapter-body { display: grid; gap: 16px; }
.chapter-body .kicker { margin-bottom: 0; }
.chapter-body h2 { font-size: clamp(28px, 3.4vw, 38px); }
.chapter-body p:not(.kicker) { font-size: 17px; color: var(--ink-soft); }
.chapter-body a { color: var(--navy-600); font-weight: 500; }

.pull-quote {
  margin: 0;
  padding: clamp(32px, 5vw, 56px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.pull-quote p {
  max-width: 24ch; margin: 0 auto;
  font: 600 clamp(26px, 3.6vw, 40px)/1.2 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--navy-900);
}
.pull-quote p::before { content: "“"; color: var(--exhaust); }
.pull-quote p::after { content: "”"; color: var(--exhaust); }

@media (max-width: 860px) {
  .chapter { grid-template-columns: 1fr; }
  .chapter.is-flipped .chapter-media { order: 0; }
  .route li + li::before { width: 14px; }
}

/* ---------- Full-screen home hero ---------- */
.hero-full {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-top: 68px;
}
.hero-full > .hero-grid { flex: 1; padding-top: clamp(24px, 5vh, 64px); padding-bottom: clamp(24px, 5vh, 56px); }
.hero-full .hero-photo {
  aspect-ratio: 4 / 5;
  height: min(620px, calc(100svh - 300px));
  min-height: 320px;
  width: auto;
  justify-self: end;
  background: var(--navy-800);
}
.hero-full .hero-photo img { object-position: 52% 40%; }
.hero-full h1 { margin-top: 0; }
.hero-full .lede { max-width: 40ch; }
.hero-full .stats { margin-top: 0; }

/* Project header: title + date on one line */
.project-top { align-items: baseline; gap: 16px; }
.project-top h3 { flex: 1; }
.project-date { flex: none; }

.more-projects {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin-top: 24px;
}
.more-projects li {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.more-projects h3 { font-size: 19px; color: var(--navy-900); margin-bottom: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.more-projects p { color: var(--ink-soft); font-size: 15px; }
.badge {
  font-size: 11px; font-weight: 500; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(242,140,56,.12); color: #b55a14;
}

.awards-title { font-size: 20px; color: var(--navy-900); margin-bottom: 8px; }
.skills-inline { margin-top: 56px; }
.skills-inline dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; margin: 0; }
.skills-inline dl > div { display: flex; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.skills-inline dt { flex: none; width: 7.5em; font-weight: 600; color: var(--navy-700); }
.skills-inline dd { margin: 0; color: var(--ink-soft); }

.btn-outline { border-color: var(--line); color: var(--navy-900); }
.btn-outline:hover { border-color: var(--navy-600); }

/* ---------- Background essay ---------- */
.essay-inner { max-width: 760px; }
.essay-inner > p {
  font-size: 18px; line-height: 1.75;
  color: #334155;
  margin-bottom: 1.3em;
}
.essay-inner h2 {
  font-size: clamp(26px, 3vw, 32px);
  margin: 2.2em 0 .7em;
}
.essay-inner em { color: var(--navy-700); }
.essay-photo { margin: 2em 0; }
.essay-photo img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
}
.essay-photo img.crop-top { object-position: top; }
.essay-photo figcaption { margin-top: 10px; font-size: 14px; color: var(--ink-faint); }
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 2em 0; }
.photo-pair .essay-photo { margin: 0; }
.photo-pair img { aspect-ratio: 1 / 1; }
.essay-end { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 3em; padding-top: 2em; border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .hero-full > .hero-grid { align-content: center; gap: 28px; }
  .hero-full .hero-photo {
    order: -1;
    height: auto; min-height: 0;
    width: auto;
    aspect-ratio: auto;
    height: 34svh;
    margin: 10px 10px 0;
    justify-self: stretch;
  }
  .hero-full .hero-photo img { object-position: 50% 35%; }
  .more-projects, .skills-inline dl, .photo-pair { grid-template-columns: 1fr; }
  .photo-pair img { aspect-ratio: 4 / 3; }
  .essay-inner > p { font-size: 17px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .skills { grid-template-columns: repeat(3, 1fr); }
  .contact-links { grid-template-columns: repeat(2, 1fr); max-width: 640px; }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px;
    background: #fff;
    box-shadow: 0 12px 24px -12px rgba(11,22,48,.2);
    display: none;
  }
  .nav.is-open { background: #fff; }
  .nav.is-open .brand { color: var(--navy-900); }
  .nav.is-open .nav-links { display: flex; }
  .nav-links a:not(.btn) { color: var(--ink) !important; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
  .nav-links .btn { margin-top: 16px; justify-content: center; }

  .hero { padding-top: 112px; }
  .hero-grid,
  .about-grid,
  .exp-grid,
  .project-feature,
  .project-pair { grid-template-columns: 1fr; }
  .hero-photo { aspect-ratio: 16 / 11; order: -1; margin: 10px 10px 24px; }
  .hero-photo figcaption { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); margin-top: 64px; }
  .stats li:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats li:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.12); }
  .project-media { min-height: 240px; }
  .award-list { grid-template-columns: 1fr; }
  .contact-links { grid-template-columns: repeat(2, 1fr); }
  .skills { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .skills { grid-template-columns: 1fr; }
  .contact-links { grid-template-columns: 1fr; }
  .stats li { padding-right: 12px; }
  .stats li + li { padding-left: 12px; }
  .hero-meta { gap: 20px; }
}

@media (max-width: 860px) {
  .hero.hero-full { padding-top: 68px; }
}

/* ---------- Photo background for the title areas ---------- */
.hero-full,
.page-hero {
  background:
    linear-gradient(90deg, rgba(7,13,28,.90) 0%, rgba(11,22,48,.68) 38%, rgba(11,22,48,.18) 72%, rgba(11,22,48,.08) 100%),
    linear-gradient(0deg, rgba(7,13,28,.92) 0%, rgba(7,13,28,0) 32%),
    url("images/hero-bg.jpg") center 35% / cover no-repeat,
    var(--navy-900);
}
.page-hero {
  background:
    linear-gradient(90deg, rgba(7,13,28,.88) 0%, rgba(11,22,48,.6) 45%, rgba(11,22,48,.15) 100%),
    url("images/hero-bg.jpg") center 40% / cover no-repeat,
    var(--navy-900);
}
.hero-full .hero-orbits,
.page-hero .hero-orbits { display: none; }
.hero-full::before,
.page-hero::before { opacity: .55; }

@media (max-width: 860px) {
  .hero-full {
    background:
      linear-gradient(180deg, rgba(7,13,28,.35) 0%, rgba(7,13,28,.75) 50%, rgba(7,13,28,.95) 100%),
      url("images/hero-bg.jpg") 62% center / cover no-repeat,
      var(--navy-900);
  }
}

/* ---------- Latest update (home) ---------- */
.latest-update {
  display: grid;
  gap: 6px;
  margin-top: 24px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--navy-900);
  color: #fff;
  text-decoration: none;
  transition: background .2s;
}
.latest-update[hidden] { display: none; }
.latest-update:hover { background: var(--navy-800); }
.latest-label { font-size: 13px; font-weight: 600; color: #8fa9e6; }
.latest-meta { font-weight: 400; color: rgba(255,255,255,.5); margin-left: 8px; font-size: 12px; }
.latest-text { font-size: 16px; color: rgba(255,255,255,.88); }
.latest-more { font-size: 14px; font-weight: 600; color: #fff; margin-top: 4px; }

/* ---------- Threads ---------- */
.threads-inner { max-width: 720px; }
.thread-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.thread-filters:empty { display: none; }
.chip {
  font: 500 13px var(--font-body);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.chip:hover { border-color: var(--navy-600); color: var(--navy-700); }
.chip[aria-pressed="true"] { background: var(--navy-600); border-color: var(--navy-600); color: #fff; }

.thread-feed { position: relative; }
.post {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding-bottom: 36px;
}
.post:not(:last-child)::before {          /* the thread line */
  content: "";
  position: absolute;
  left: 21px; top: 52px; bottom: 8px;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
}
.post-avatar {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--navy-900);
  color: #fff;
  font: 600 14px var(--font-display);
  letter-spacing: .03em;
}
.post-main { min-width: 0; padding-top: 2px; }
.post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.post-name { font-weight: 600; color: var(--ink); }
.post-date { font-size: 12.5px; color: var(--ink-faint); }
.post-tag {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  color: var(--navy-700);
}
.post-text p { font-size: 16.5px; line-height: 1.65; color: #334155; }
.post-text p + p { margin-top: .8em; }
.post-img {
  margin-top: 14px;
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.post-empty { color: var(--ink-faint); }

/* ---------- Threads: posting ---------- */
.thread-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 32px;
}
.thread-bar .thread-filters { margin-bottom: 0; }
.add-thread { margin-left: auto; cursor: pointer; }
.add-thread[hidden] { display: none; }
.thread-note { margin: -16px 0 28px; font-size: 14px; color: var(--ink-faint); }

.post-delete {
  margin-left: auto;
  font: 500 12.5px var(--font-body);
  color: #b42318;
  background: none; border: 0; padding: 2px 4px;
  cursor: pointer;
}
.post-delete:hover { text-decoration: underline; }

.thread-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 30px 80px -20px rgba(7,13,28,.5);
  color: var(--ink);
}
.thread-dialog::backdrop { background: rgba(7,13,28,.6); backdrop-filter: blur(3px); }
.thread-form { display: grid; gap: 16px; padding: 28px; }
.thread-form h2 { font-size: 24px; color: var(--navy-900); }
.thread-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.thread-form label[hidden] { display: none; }
.thread-form .optional { font-weight: 400; color: var(--ink-faint); }
.thread-form input[type="text"],
.thread-form input[type="password"],
.thread-form textarea {
  width: 100%;
  font: 400 15px/1.5 var(--font-body);
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.thread-form textarea { resize: vertical; min-height: 120px; }
.thread-form input:focus,
.thread-form textarea:focus { outline: 2px solid var(--navy-600); outline-offset: 1px; border-color: transparent; }
.thread-form input[type="file"] { font: 400 14px var(--font-body); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { min-height: 1.2em; margin: -4px 0 0; font-size: 14px; color: #b42318; }
.form-error:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.form-actions .btn { cursor: pointer; }
.form-actions .btn:disabled { opacity: .6; cursor: progress; }
.link-btn {
  margin-right: auto;
  background: none; border: 0; padding: 0;
  font: 500 13.5px var(--font-body); color: var(--navy-600);
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .link-btn { width: 100%; margin-bottom: 4px; }
}

/* ---------- Projects: wide printer card + TVC diagram ---------- */
.project-wide { grid-template-columns: 2fr 3fr; margin: 24px 0 0; }
.project-wide .project-media { min-height: 320px; }
.more-projects { grid-template-columns: 1fr; }

.media-diagram .body { fill: #fff; stroke: var(--navy-700); stroke-width: 1.8; }
.media-diagram .nozzle { fill: var(--navy-100); stroke: var(--navy-700); stroke-width: 1.8; }
.media-diagram .thrust { fill: none; stroke: var(--exhaust); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.media-diagram .gyro circle,
.media-diagram .gyro ellipse { fill: none; stroke: var(--navy-600); stroke-width: 1.5; }
.media-diagram .link { stroke: var(--navy-600); stroke-width: 1.2; stroke-dasharray: 3 4; }

@media (max-width: 860px) {
  .project-wide { grid-template-columns: 1fr; }
  .project-wide .project-media { min-height: 0; aspect-ratio: 4 / 3; }
}


/* ---------- Typography ---------- */
h1, h2, h3,
.brand,
.stat-num {
  font-stretch: 125%;          /* Archivo Expanded */
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-weight: 800; letter-spacing: -0.02em; }
.hero h1 { font-size: clamp(40px, 5.6vw, 76px); line-height: 1.02; }
.page-hero h1 { font-size: clamp(36px, 5vw, 64px); }
.section h2 { font-size: clamp(30px, 3.6vw, 44px); }
.project h3 { font-size: 21px; }
.tl-body h3 { font-size: 18px; }
.more-projects h3 { font-size: 17px; }
.awards-title { font-size: 18px; }
.thread-form h2 { font-size: 22px; }
.brand { font-size: 14.5px; letter-spacing: 0; }
.brand-mark { font-stretch: 125%; font-weight: 800; font-size: 11.5px; }

body { font-size: 16.5px; }
.lede { font-weight: 400; }
.nav-links a:not(.btn), .btn { font-family: var(--font-body); }
.btn { font-weight: 600; letter-spacing: .005em; }

/* Martian Mono runs wide, so keep it narrow and small */
.mono, .project-date, .tl-date, .award-year, .post-date, .post-tag, .badge, .contact-card small {
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-weight: 400;
  letter-spacing: 0;
}
.project-date, .tl-date, .post-date { font-size: 11px; text-transform: uppercase; }
.award-year { font-size: 11.5px; }
.post-avatar { font-stretch: 125%; font-weight: 800; font-size: 12.5px; }

/* Background essay reads in a serif */
.essay-inner > p {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.7;
  color: #1e293b;
}
.essay-inner em { font-style: italic; }
.essay-photo figcaption { font-family: var(--font-serif); font-style: italic; font-size: 15px; }
@media (max-width: 860px) {
  .essay-inner > p { font-size: 18.5px; }
}
.hero-full h1 { font-size: clamp(56px, 9vw, 120px); line-height: .95; }
.hero-full h1 { letter-spacing: 0; } .h1-dot { margin-left: .06em; }
.hero-full .hero-photo img { object-position: center; }
@media (max-width: 860px) { .hero-full .hero-photo img { object-position: 40% 28%; } }
