/* ==========================================================================
   Om M. Patel, Aerospace Engineering Portfolio
   Design direction: flight-test log. Dark instrument-panel ground, a single
   caution-panel amber, condensed uppercase display type, and monospace
   carrying every number, label, and status flag. Projects read as numbered
   log entries with honest verification states.
   ========================================================================== */

:root {
  /* Ground */
  --bg:       #0A0E16;
  --bg-2:     #0D131F;
  --panel:    #101827;
  --panel-2:  #131C2E;
  --line:     #222D42;
  --line-2:   #182135;

  /* Ink */
  --ink:      #E9EDF5;
  --ink-2:    #9CA7BB;
  --ink-3:    #74809A;

  /* Signal */
  --amber:      #F2B63B;
  --amber-hi:   #FFCE63;
  --amber-wash: rgba(242, 182, 59, 0.09);
  --ok:         #5BCD8F;
  --ok-wash:    rgba(91, 205, 143, 0.09);
  --bad:        #EC6A55;
  --bad-wash:   rgba(236, 106, 85, 0.10);
  --na:         #8B96AC;

  /* Type */
  --display: 'Barlow Condensed', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --body:    'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Scale */
  --step--1: 0.8125rem;
  --step-0:  1.0625rem;
  --step-1:  1.25rem;
  --step-2:  1.625rem;
  --step-3:  clamp(1.9rem, 3.4vw, 2.5rem);
  --step-4:  clamp(2.4rem, 5vw, 3.6rem);
  --step-5:  clamp(3.2rem, 8.5vw, 5.75rem);

  --gutter: 1.5rem;
  --measure: 70ch;
  --radius: 2px;
  --speed: 160ms;
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
}

/* ========================= Reset ========================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line) var(--bg);
}

body {
  font-family: var(--body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

::selection { background: var(--amber); color: #14100A; }

/* ========================= Type ========================= */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--ink);
  /* A long word must never widen the page, e.g. CHARACTERIZATION on a narrow
     phone, or on any device where the condensed webfont fails to load. */
  overflow-wrap: break-word;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 {
  font-family: var(--body);
  font-size: var(--step-0);
  font-weight: 600;
  color: var(--ink);
}

p { max-width: var(--measure); }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ink-3);
  text-underline-offset: 3px;
  transition: color var(--speed) var(--ease), text-decoration-color var(--speed) var(--ease);
}

a:hover {
  color: var(--amber-hi);
  text-decoration-color: var(--amber);
}

strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

sub, sup { font-size: 0.72em; line-height: 0; }

/* Monospace labels: the connective tissue of the whole design */
.mono-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.mono-label .accent { color: var(--amber); }

/* ========================= Layout primitives ========================= */

.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: 4.5rem; }
.section + .section { border-top: 1px solid var(--line-2); }

.sec-head { margin-bottom: 2.75rem; }

.sec-head .mono-label { display: block; margin-bottom: 0.8rem; }

.sec-head .mono-label::before {
  content: "//";
  color: var(--amber);
  margin-right: 0.6em;
  letter-spacing: 0;
}

.sec-head h2 { margin-bottom: 0.75rem; }
.sec-head p { color: var(--ink-2); max-width: 62ch; }

/* ========================= Accessibility ========================= */

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--amber);
  color: #14100A;
  font-family: var(--mono);
  font-size: 0.8rem;
  text-decoration: none;
}

.skip-link:focus { top: 0.5rem; color: #14100A; }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ========================= Header ========================= */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 22, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  padding-block: 0.8rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid var(--amber);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.logo:hover { color: var(--ink); }
.logo:hover .logo-mark { background: var(--amber-wash); }

/* No hamburger: the nav stays in flow at every width, so navigation
   never depends on JavaScript. */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.45rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
}

.nav-link:hover { color: var(--ink); }

.nav-link.is-active {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

/* ========================= Hero ========================= */

.hero {
  position: relative;
  padding-block: 4.5rem 4rem;
  background-image:
    radial-gradient(ellipse 80% 55% at 70% 0%, rgba(242, 182, 59, 0.05), transparent 60%),
    radial-gradient(circle, var(--line-2) 1px, transparent 1px);
  background-size: auto, 26px 26px;
  border-bottom: 1px solid var(--line-2);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3rem;
  align-items: start;
}

.hero .mono-label { display: block; margin-bottom: 1.1rem; }

.hero .mono-label::before {
  content: "//";
  color: var(--amber);
  margin-right: 0.6em;
  letter-spacing: 0;
}

.hero h1 { margin-bottom: 1.1rem; }

.hero-thesis {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 54ch;
  margin-bottom: 1.8rem;
}

.hero-thesis strong { color: var(--ink); font-weight: 500; }

/* Telemetry strip: three fixed rows, so the location line never reflows
   up beside "Seeking" at an awkward width. */
.telemetry {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: none;
  padding-block: 0.8rem;
  margin-bottom: 1.8rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.telemetry span b { font-weight: 500; color: var(--amber); }

/* Location line carries no grey label, so the whole line is the signal colour */
.tel-loc { color: var(--amber); }

/* Spec list */
.spec {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 1.4rem;
  margin-bottom: 2.1rem;
  max-width: none;
}

.spec dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 0.22rem;
}

.spec dd { color: var(--ink-2); font-size: 0.9765rem; }

/* Portrait */
.hero-portrait {
  position: relative;
  padding: 0.9rem;
  align-self: start;
}

.hero-portrait::before,
.hero-portrait::after {
  content: "";
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  border: 0 solid var(--amber);
}

.hero-portrait::before { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.hero-portrait::after { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }

.hero-portrait img {
  width: 256px;
  height: auto;
  filter: grayscale(18%) contrast(1.04);
}

.hero-portrait figcaption {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
}

/* ========================= Buttons ========================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.72rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.btn:hover { border-color: var(--ink-3); color: var(--ink); background: var(--panel); }

.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #14100A;
}

.btn-primary:hover {
  background: var(--amber-hi);
  border-color: var(--amber-hi);
  color: #14100A;
}

.btn-ghost { border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); border-color: var(--line); }

.hero-actions, .btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* ========================= Status flags ========================= */

.flag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  max-width: 100%;
  line-height: 1.5;
}

.flag::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.flag-ok   { color: var(--ok);   border-color: rgba(91, 205, 143, 0.35); background: var(--ok-wash); }
.flag-warn { color: var(--amber); border-color: rgba(242, 182, 59, 0.35); background: var(--amber-wash); }
.flag-bad  { color: var(--bad);  border-color: rgba(236, 106, 85, 0.35); background: var(--bad-wash); }
.flag-na   { color: var(--na);   border-color: var(--line); background: var(--panel); }
.flag-na::before { background: transparent; border: 1px solid currentColor; }

/* ========================= Log rows ========================= */

.log-list { border-top: 1px solid var(--line); }

.log-row {
  position: relative;
  display: grid;
  grid-template-columns: 4.4rem minmax(0, 1fr) 15.5rem;
  gap: 1.5rem;
  padding: 1.7rem 1rem 1.7rem 0.25rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: background var(--speed) var(--ease);
}

.log-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: var(--amber);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--speed) var(--ease);
}

.log-row:hover { background: var(--bg-2); color: var(--ink); }
.log-row:hover::before { transform: scaleY(1); }

.log-idx {
  font-family: var(--display);
  font-size: 2.4rem;
  font-weight: 500;
  line-height: 1;
  color: var(--ink-3);
  padding-top: 0.2rem;
  transition: color var(--speed) var(--ease);
}

.log-row:hover .log-idx { color: var(--amber); }

.log-main { display: block; min-width: 0; }

.log-kicker {
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.log-kicker b { font-weight: 500; color: var(--amber); }

.log-title {
  display: block;
  font-family: var(--display);
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  margin-bottom: 0.55rem;
}

.log-desc {
  display: block;
  color: var(--ink-2);
  font-size: 0.9765rem;
  line-height: 1.55;
  max-width: 58ch;
}

.log-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  padding-top: 0.3rem;
}

/* No text-transform here: unit case (µs, kHz, lbf) must survive as written */
.log-data {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  line-height: 1.7;
  color: var(--ink-2);
}

.log-go {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color var(--speed) var(--ease);
}

.log-row:hover .log-go { color: var(--amber-hi); }

/* ========================= Stats strip ========================= */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: 3rem;
}

.stats > div {
  padding: 1.25rem 1.4rem 1.15rem;
  border-right: 1px solid var(--line);
}

.stats > div:last-child { border-right: 0; }

.stat-value {
  display: block;
  font-family: var(--mono);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.stat-value small { font-size: 0.9rem; font-weight: 500; color: var(--ink-2); }

/* No text-transform: labels may carry τ, µs, Isp, where case is meaning */
.stat-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  color: var(--ink-3);
}

/* ========================= Detail title block ========================= */

.crumb {
  padding-block: 1.4rem 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.crumb a { color: var(--ink-3); text-decoration: none; }
.crumb a:hover { color: var(--amber-hi); }
.crumb .sep { margin-inline: 0.5em; color: var(--line); }

.tblock-wrap { padding-block: 1.6rem 3.4rem; }

.tblock {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: 2.5rem;
  padding: 2.2rem 2.4rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

.tblock::before,
.tblock::after {
  content: "";
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  border: 0 solid var(--amber);
}

.tblock::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.tblock::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

.tblock-main { min-width: 0; }

.tblock .mono-label { display: block; margin-bottom: 0.9rem; }
.tblock .mono-label b { color: var(--amber); font-weight: 500; }

.tblock h1 { font-size: var(--step-4); margin-bottom: 1rem; }

.tblock-sum { color: var(--ink-2); font-size: var(--step-0); max-width: 56ch; }

.tblock-meta {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-left: 2rem;
  border-left: 1px solid var(--line);
  align-self: start;
}

.tblock-meta > div { min-width: 0; }

.tblock-meta dt {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.15rem;
}

.tblock-meta dd { font-size: 0.9375rem; color: var(--ink); }
.tblock-meta dd a { font-family: var(--mono); font-size: 0.8rem; }

/* ========================= Prose ========================= */

.prose { max-width: 46rem; }

.prose h2 {
  margin: 2.9rem 0 1.1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line-2);
}

.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.prose .sec-no {
  color: var(--amber);
  font-weight: 500;
  margin-right: 0.55em;
}

.prose h3 { font-size: var(--step-1); margin: 1.9rem 0 0.7rem; }

.prose p { margin-bottom: 1rem; color: var(--ink-2); }
.prose p strong { color: var(--ink); }

.prose ul { margin: 0 0 1.2rem; }

.prose ul li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.55rem;
  color: var(--ink-2);
  max-width: var(--measure);
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 0.42rem;
  height: 0.42rem;
  background: var(--amber);
}

.prose ul li strong { color: var(--ink); }

.eq {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--amber);
  padding: 0.7rem 1.1rem;
  margin-bottom: 0.7rem;
  overflow-x: auto;
}

/* ========================= Callout ========================= */

.callout {
  border: 1px solid var(--line);
  border-left: 2px solid var(--amber);
  background: var(--panel);
  padding: 1.5rem 1.7rem 1.2rem;
  margin: 1.6rem 0;
}

.callout > h3, .callout > h4 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 0.9rem;
}

.callout ul { margin-bottom: 0.2rem; }
.callout p:last-child { margin-bottom: 0.2rem; }

.callout-bad { border-left-color: var(--bad); }
.callout-bad > h3, .callout-bad > h4 { color: var(--bad); }

/* ========================= Tables ========================= */

.table-wrap {
  overflow-x: auto;
  margin: 1.4rem 0 1.8rem;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--panel);
}

caption {
  caption-side: top;
  text-align: left;
  padding: 0.8rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--amber);
  border-bottom: 1px solid var(--line);
}

th, td { padding: 0.6rem 1.1rem; text-align: left; }

/* No text-transform: headers carry SI units (kg/N·s) whose case matters */
thead th {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td { border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }

td.num, th.num { font-family: var(--mono); font-size: 0.84rem; text-align: right; color: var(--ink); }
thead th.num { color: var(--ink-3); font-size: 0.66rem; }

.table-note {
  padding: 0.75rem 1.1rem;
  font-size: 0.875rem;
  color: var(--ink-2);
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  max-width: none;
}

/* ========================= Requirement scoreboard ========================= */

.reqboard {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 1.5rem 1.7rem;
  margin: 1.8rem 0;
}

.reqboard-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 1rem;
}

.reqbar {
  display: grid;
  grid-template-columns: repeat(22, 1fr);
  gap: 3px;
  margin-bottom: 1rem;
}

.reqbar span { height: 1.6rem; border: 1px solid var(--line); }

.reqbar .r-ok   { background: var(--ok);   border-color: var(--ok); }
.reqbar .r-part { background: linear-gradient(to top, var(--amber) 50%, transparent 50%); border-color: var(--amber); }
.reqbar .r-no   { background: transparent; border-color: var(--ink-3); }

.reqlegend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.reqlegend .l-ok::before, .reqlegend .l-part::before, .reqlegend .l-no::before {
  content: "";
  display: inline-block;
  width: 0.62rem;
  height: 0.62rem;
  margin-right: 0.5em;
  vertical-align: -1px;
  border: 1px solid var(--line);
}

.reqlegend .l-ok::before { background: var(--ok); border-color: var(--ok); }
.reqlegend .l-part::before { background: linear-gradient(to top, var(--amber) 50%, transparent 50%); border-color: var(--amber); }
.reqlegend .l-no::before { border-color: var(--ink-3); }

/* ========================= Verification list ========================= */

.vlist { border-top: 1px solid var(--line); margin: 1.4rem 0 1.8rem; }

.vlist > div {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr) auto;
  gap: 1.2rem;
  padding: 0.95rem 0.2rem;
  border-bottom: 1px solid var(--line-2);
  align-items: baseline;
}

.vlist dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.vlist dd { color: var(--ink-2); font-size: 0.9375rem; max-width: 52ch; }
.vlist dd.v-flag { justify-self: end; }

/* ========================= Download strip ========================= */

.dstrip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin-top: 3rem;
  padding: 1.6rem 1.8rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--amber);
  background: var(--panel);
}

.dstrip h2 {
  font-size: var(--step-1);
  margin-bottom: 0.3rem;
}

.dstrip p { color: var(--ink-2); font-size: 0.9375rem; }

.dstrip .file-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-top: 0.35rem;
}

/* ========================= Pager ========================= */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.6rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line-2);
}

.pager a { max-width: 48%; }

/* ========================= Skills ========================= */

.skills-grid {
  display: grid;
  /* min() lets the track shrink below 19rem on very narrow phones instead of
     forcing a horizontal scrollbar. */
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.skill-block { background: var(--bg); padding: 1.6rem 1.7rem; }

/* Three-block variant (resume page): an odd item in a 2-up grid would leave an
   empty track showing the grid's own background, so the last block spans. */
.skills-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.skills-grid--3 > :last-child { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .skills-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .skills-grid--3 > :last-child { grid-column: auto; }
}

.skill-block h3 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.8rem;
}

.skill-block p {
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: none;
}

/* ========================= Resume ========================= */

.resume-wrap { max-width: 56rem; }

.resume-section { margin-bottom: 3.2rem; }

.resume-section > h2 {
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.6rem;
}

.resume-section > h2 .sec-no { color: var(--amber); font-weight: 500; margin-right: 0.55em; }

.resume-item { margin-bottom: 2.1rem; }
.resume-item:last-child { margin-bottom: 0; }

.resume-item-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.3rem 1.5rem;
  margin-bottom: 0.6rem;
}

.resume-item-head h3 {
  font-family: var(--body);
  font-size: var(--step-1);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.resume-item-head h3 a { text-decoration-color: var(--line); }

.resume-sub { color: var(--ink-3); font-size: 0.9375rem; margin-top: 0.15rem; }

.resume-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  white-space: nowrap;
}

.resume-item ul li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.5rem;
  color: var(--ink-2);
  max-width: var(--measure);
}

.resume-item ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 0.42rem;
  height: 0.42rem;
  background: var(--amber);
}

.resume-tools {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-top: 0.7rem;
  max-width: var(--measure);
}

/* ========================= Contact ========================= */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 4rem;
}

.contact-list { display: flex; flex-direction: column; gap: 1.4rem; margin-top: 1.6rem; }

.contact-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}

.contact-row svg {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--amber);
  margin-top: 0.3rem;
}

.contact-row dt {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.2rem;
}

.contact-row dd { color: var(--ink); }
.contact-row dd .sub { color: var(--ink-3); font-size: 0.875rem; }

/* Form */
.form { display: flex; flex-direction: column; gap: 1.2rem; margin-top: 1.6rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }

.field label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.field input, .field textarea {
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  transition: border-color var(--speed) var(--ease);
}

.field textarea { min-height: 9rem; resize: vertical; }

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber);
}

.field-error {
  display: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--bad);
}

.field.has-error input, .field.has-error textarea { border-color: var(--bad); }
.field.has-error .field-error { display: block; }

.form-note { font-size: 0.875rem; color: var(--ink-3); }

/* ========================= 404 ========================= */

.lost {
  padding-block: 7rem;
  text-align: left;
}

.lost h1 { margin-block: 0.8rem 1rem; }
.lost p { color: var(--ink-2); margin-bottom: 2rem; }

/* ========================= Footer ========================= */

.footer {
  border-top: 1px solid var(--line-2);
  background: var(--bg-2);
  padding-block: 3.4rem 1.6rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 1fr 1.4fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer h2 {
  font-size: var(--step-1);
  margin-bottom: 0.7rem;
}

.footer-grid > div > p { color: var(--ink-2); font-size: 0.9375rem; max-width: 38ch; }

.footer h3 {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.9rem;
}

.footer ul li { margin-bottom: 0.5rem; }

.footer ul a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9375rem;
}

.footer ul a:hover { color: var(--amber-hi); }

.footer ul .plain { color: var(--ink-3); font-size: 0.9375rem; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ========================= Reveal (opt-in via JS) =========================
   The .js-reveal class is added to <html> by main.js only when
   IntersectionObserver exists AND the user hasn't asked for reduced motion.
   Without JavaScript nothing is ever hidden. */

.js-reveal .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 480ms var(--ease), transform 480ms var(--ease);
}

.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* ========================= Reduced motion ========================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }

  .js-reveal .reveal { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ========================= Responsive ========================= */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-portrait { order: -1; }

  .log-row { grid-template-columns: 3rem minmax(0, 1fr); }
  .log-side {
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.2rem;
    padding-top: 0.4rem;
  }
  .log-go { margin-top: 0; margin-left: auto; }

  .tblock { grid-template-columns: 1fr; gap: 1.8rem; padding: 1.7rem 1.5rem; }
  .tblock-meta {
    padding-left: 0;
    border-left: 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1rem 1.6rem;
  }

  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  .vlist > div { grid-template-columns: 1fr; gap: 0.3rem; }
  .vlist dd.v-flag { justify-self: start; }
}

@media (max-width: 560px) {
  .section { padding-block: 3.2rem; }

  .hero { padding-block: 3rem 2.8rem; }
  .hero-portrait img { width: 200px; }

  .log-row { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; padding-inline: 0.6rem; }
  .log-idx { font-size: 1.5rem; padding-top: 0; }
  .log-side { grid-column: 1; }

  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div { border-bottom: 1px solid var(--line); }
  .stats > div:nth-child(even) { border-right: 0; }
  .stats > div:nth-last-child(-n+2) { border-bottom: 0; }

  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }

  .pager { flex-direction: column; }
  .pager a { max-width: none; }

  .dstrip { flex-direction: column; align-items: flex-start; }
}

/* ========================= Print ========================= */

@media print {
  :root {
    --bg: #FFFFFF;
    --bg-2: #FFFFFF;
    --panel: #FFFFFF;
    --panel-2: #FFFFFF;
    --ink: #111111;
    --ink-2: #333333;
    --ink-3: #555555;
    --line: #BBBBBB;
    --line-2: #DDDDDD;
    --amber: #8A6100;
    --ok: #1F7A4D;
    --bad: #A33A28;
  }

  body { background: #FFFFFF; color: #111111; font-size: 10.5pt; }

  .header, .footer, .skip-link, .hero-actions, .btn, .pager, .dstrip, .crumb { display: none !important; }

  .hero, .section { border: 0; padding-block: 1.2rem; }
  .hero { background: none; }

  a { color: #111111; text-decoration: none; }

  .js-reveal .reveal { opacity: 1 !important; transform: none !important; }

  .tblock, .callout, .stats, .reqboard { border-color: #BBBBBB; background: #FFFFFF; }

  h1, h2, h3 { break-after: avoid; }
  .resume-item, .callout, table { break-inside: avoid; }
}
