/* Layout concept: an engineering drawing set. Each case study is a "sheet" with a
   title block of real project data, set on cool vellum (light) or blueprint night (dark). */
:root {
  --paper: #eef0ee;
  --panel: #e2e6e5;
  --ink: #141821;
  --ink-2: #4b5261;
  --rule: #c3c9cf;
  --accent: #d9481a;      /* international orange, the aerospace safety color */
  --accent-ink: #ffffff;
  --ghost: #141821;
  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1360px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c131e; --panel: #121b29; --ink: #e5e9ef; --ink-2: #97a1b1;
    --rule: #26324a; --accent: #ff6a2b; --accent-ink: #0c131e; --ghost: #e5e9ef;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0c131e; --panel: #121b29; --ink: #e5e9ef; --ink-2: #97a1b1;
  --rule: #26324a; --accent: #ff6a2b; --accent-ink: #0c131e; --ghost: #e5e9ef;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.6;
  font-feature-settings: "kern";
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

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

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding-block: 18px; }
.mark { display: flex; align-items: baseline; gap: 14px; text-decoration: none; }
.mark b { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 20px; letter-spacing: 0.02em; }
.mark span { font-family: var(--mono); font-size: 12px; color: var(--ink-2); letter-spacing: 0.06em; text-transform: uppercase; }
.nav { display: flex; gap: 24px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* ---------- type ---------- */
.label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.display {
  font-family: var(--display); font-stretch: 125%; font-weight: 800;
  line-height: 0.98; letter-spacing: -0.01em; text-wrap: balance; margin: 0;
}
h1.display { font-size: clamp(40px, 7.2vw, 104px); }
h2.section-title { font-family: var(--display); font-stretch: 112%; font-weight: 700; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.1; margin: 0; text-wrap: balance; }
.lede { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; max-width: 62ch; margin: 0; }
.prose p { margin: 0; max-width: 62ch; }
.prose { display: grid; gap: 14px; }

/* ---------- home hero ---------- */
.hero { padding-block: clamp(48px, 8vw, 112px) clamp(32px, 5vw, 64px); display: grid; gap: 28px; }
.hero .display em { font-style: normal; color: var(--accent); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; }

/* ---------- drawing index (home) ---------- */
.index-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-top: 2px solid var(--ink); padding-top: 14px; margin-top: 8px; }
.cards { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 40px 28px; }
.card a { display: grid; gap: 0; text-decoration: none; }
.card figure { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--panel); }
.card figure img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card a:hover figure img { transform: scale(1.03); }
.card .tb { border: 1px solid var(--rule); border-top: 0; display: grid; grid-template-columns: 1fr auto; }
.card .tb > div { padding: 12px 14px; min-width: 0; }
.card .tb > div + div { border-left: 1px solid var(--rule); text-align: right; }
.card h3 { font-family: var(--display); font-stretch: 112%; font-weight: 700; font-size: 22px; line-height: 1.15; margin: 4px 0 0; }
.card a:hover h3 { color: var(--accent); }
.card .sheet { font-family: var(--mono); font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 4px; }
.card .tags { grid-column: 1 / -1; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 12px; color: var(--ink-2); letter-spacing: 0.04em; }

/* ---------- case study ---------- */
.cs-head { padding-block: clamp(36px, 6vw, 80px) 28px; display: grid; gap: 22px; }
.crumb { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--accent); }

.titleblock { border: 1.5px solid var(--ink); display: grid; grid-template-columns: repeat(12, 1fr); margin-top: 6px; }
.titleblock > div { padding: 10px 14px 12px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; display: grid; gap: 2px; align-content: start; }
.titleblock dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
.titleblock dd { margin: 0; font-size: 15px; line-height: 1.35; font-weight: 600; }
.tb-client { grid-column: span 3; } .tb-role { grid-column: span 4; } .tb-team { grid-column: span 3; }
.tb-sheet { grid-column: span 2; background: var(--ink); color: var(--paper); border-color: var(--ink) !important; }
.tb-sheet dt { color: var(--paper); opacity: .7; }
.tb-sheet dd { font-family: var(--mono); font-size: 22px; font-variant-numeric: tabular-nums; }
.tb-year { grid-column: span 3; } .tb-disc { grid-column: span 9; }
@media (max-width: 800px) {
  .titleblock { grid-template-columns: repeat(2, 1fr); }
  .titleblock > div { grid-column: span 1 !important; }
  .tb-disc, .tb-role { grid-column: span 2 !important; }
}

.cs-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 28px 56px; padding-block: 8px 40px; }
@media (max-width: 800px) { .cs-intro { grid-template-columns: 1fr; } }

.hero-fig { margin: 0; background: var(--panel); }
.hero-fig img { width: 100%; }

.section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px 56px; padding-block: clamp(48px, 6vw, 88px) 0; }
.section > header { display: grid; gap: 12px; align-content: start; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 24px); }
.section > header .label { color: var(--accent); }
.section .figs { display: grid; gap: 24px; min-width: 0; }
@media (max-width: 900px) { .section { grid-template-columns: 1fr; } .section > header { position: static; } }

.row { display: grid; gap: 16px; align-items: start; }
.row.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .row.c3, .row.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .row.c2, .row.eq { grid-template-columns: 1fr !important; } }

figure.fig { margin: 0; display: grid; gap: 8px; }
figure.fig .frame { background: var(--panel); }
figure.fig.pad .frame { padding: clamp(12px, 3vw, 36px); display: grid; place-items: center; }
figure.fig img { width: 100%; }
figure.fig figcaption { font-family: var(--mono); font-size: 12px; line-height: 1.45; color: var(--ink-2); letter-spacing: 0.02em; }
figure.fig figcaption b { color: var(--ink); font-weight: 500; }

figure.ghost .frame { background: var(--panel); position: relative; overflow: hidden; }
figure.ghost img { opacity: .22; filter: blur(1.2px) contrast(.8); mix-blend-mode: luminosity; }
figure.ghost .frame::after {
  content: "LAYOUT GHOSTED"; position: absolute; inset: auto 12px 12px auto;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--ink-2);
  border: 1px solid var(--rule); padding: 4px 8px; background: var(--paper);
}

.note { border-left: 3px solid var(--accent); background: var(--panel); padding: 14px 18px; font-size: 15px; line-height: 1.5; max-width: 72ch; }
.note .label { display: block; margin-bottom: 4px; }

/* ---------- next / footer ---------- */
.next { margin-top: clamp(64px, 8vw, 120px); border-top: 2px solid var(--ink); }
.next a { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; padding-block: 22px 8px; text-decoration: none; }
.next .display { font-size: clamp(28px, 4vw, 52px); }
.next a:hover .display { color: var(--accent); }
.next .arrow { font-family: var(--mono); font-size: 28px; }

.site-foot { margin-top: clamp(56px, 8vw, 104px); border-top: 1px solid var(--rule); }
.site-foot .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px 32px; padding-block: 28px 40px; }
.site-foot p { margin: 4px 0 0; font-size: 15px; }
.site-foot .copy { user-select: all; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
figure.fig video { display: block; width: 100%; height: auto; background: var(--panel); }
