/* =========================================================================
   dclercq.com — "Drawing Set" engineering/blueprint identity
   Display: Archivo (expanded)  ·  Data/labels: IBM Plex Mono  ·  Body: IBM Plex Sans
   ========================================================================= */

:root {
  --paper:      #ECEEE8;   /* pale technical graph-paper */
  --paper-2:    #E4E7DF;   /* slightly deeper panel */
  --grid:       #D4D8CE;   /* faint grid lines */
  --grid-major: #C4C9BC;   /* major grid lines */
  --ink:        #16191A;   /* drafting ink */
  --ink-soft:   #595F58;   /* annotations / captions */
  --ink-faint:  #8A9085;   /* tertiary */
  --accent:     #E4431B;   /* safety vermilion */
  --accent-ink: #B5330F;
  --line:       #C7CCBF;

  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 72px);

  --f-display: "Archivo", "Arial Narrow", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --f-body: "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--f-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: -1px -1px;
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; }

/* ---- Layout primitives ------------------------------------------------- */

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

/* The "sheet": a bordered drawing surface that frames the whole page */
.sheet {
  position: relative;
  max-width: calc(var(--maxw) + 2px);
  margin: 0 auto;
  background: rgba(255,255,255,0.45);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 100vh;
}

/* Coordinate ticks down the left margin */
.coords {
  position: fixed;
  top: 0; bottom: 0;
  left: max(8px, calc((100vw - var(--maxw)) / 2 - 26px));
  width: 18px;
  display: none;
  flex-direction: column;
  justify-content: space-evenly;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-faint);
  pointer-events: none;
  z-index: 2;
}
@media (min-width: 1320px) { .coords { display: flex; } }

/* ---- Header / drawing index ------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, #fff);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--ink);
}
.topbar .wrap {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}
.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-decoration: none;
  border-right: 1px solid var(--line);
  padding-right: 22px;
  margin-right: 4px;
}
.brand .mark {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 17px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}
.brand .sub {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  margin-top: 4px;
  text-transform: uppercase;
}
.nav {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  text-decoration: none;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-left: 1px solid var(--line);
  transition: color .15s, background .15s;
}
.nav a .idx { color: var(--ink-faint); font-size: 10px; }
.nav a:hover { color: var(--ink); background: rgba(255,255,255,0.5); }
.nav a[aria-current="page"] { color: var(--accent); }
.nav a[aria-current="page"] .idx { color: var(--accent); }

.navtoggle { display: none; }

/* ---- Eyebrow / labels -------------------------------------------------- */

.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--accent);
  display: inline-block;
}

.kicker {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- Hero / title block ------------------------------------------------ */

.hero {
  position: relative;
  padding: clamp(48px, 9vw, 110px) var(--pad) clamp(36px, 6vw, 64px);
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
}
.hero .inner { max-width: var(--maxw); margin: 0 auto; }

.hero-id {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: clamp(24px, 5vw, 48px);
}
.hero-id b { color: var(--ink); font-weight: 600; }

.hero h1 {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 118%;
  font-size: clamp(2.6rem, 8.2vw, 6.6rem);
  line-height: 0.96;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
.hero h1 .em { color: var(--accent); }

.hero-lead {
  max-width: 60ch;
  margin: clamp(22px, 3.5vw, 34px) 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.32rem);
  line-height: 1.5;
  color: var(--ink-soft);
}
.hero-lead b { color: var(--ink); font-weight: 600; }

/* Dimension line under the headline */
.dimline {
  position: relative;
  height: 30px;
  margin-top: clamp(26px, 4vw, 40px);
  max-width: 520px;
}
.dimline .bar {
  position: absolute; top: 14px; left: 0; right: 0;
  height: 1px; background: var(--ink);
  transform-origin: left center;
}
.dimline .tick { position: absolute; top: 8px; width: 1px; height: 13px; background: var(--ink); }
.dimline .tick.l { left: 0; }
.dimline .tick.r { right: 0; }
.dimline .label {
  position: absolute; top: 17px; left: 50%; transform: translateX(-50%);
  background: var(--paper);
  padding: 0 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---- Generic section --------------------------------------------------- */

.section { padding: clamp(48px, 7vw, 88px) var(--pad); border-bottom: 1px solid var(--line); }
.section .inner { max-width: var(--maxw); margin: 0 auto; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 14px;
}
.section-head h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  letter-spacing: -0.01em;
  margin: 0;
  text-transform: uppercase;
}
.section-head .meta { font-family: var(--f-mono); font-size: 11px; color: var(--ink-soft); letter-spacing: 0.1em; text-transform: uppercase; }

/* ---- "Now" strip ------------------------------------------------------- */

.now { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); background: rgba(255,255,255,0.4); }
.now.two { grid-template-columns: repeat(2, 1fr); }

.statement {
  font-family: var(--f-display);
  font-weight: 600;
  font-stretch: 106%;
  font-size: clamp(1.4rem, 3vw, 2.25rem);
  line-height: 1.22;
  letter-spacing: -0.012em;
  max-width: 24ch;
  margin: 0 0 clamp(28px, 4vw, 44px);
  text-wrap: balance;
}
.statement b { font-weight: 600; color: var(--accent); }
.now .cell { padding: clamp(20px, 2.6vw, 30px); border-right: 1px solid var(--line); }
.now .cell:last-child { border-right: 0; }
.now .cell .k { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.now .cell .v { font-family: var(--f-display); font-stretch: 110%; font-weight: 700; font-size: clamp(1.15rem, 2vw, 1.5rem); margin-top: 8px; line-height: 1.05; }
.now .cell .d { font-size: 0.92rem; color: var(--ink-soft); margin-top: 8px; line-height: 1.45; }
.now .cell .v .accent { color: var(--accent); }

/* ---- Datasheet cards (ventures) --------------------------------------- */

.sheets { display: flex; flex-direction: column; gap: clamp(22px, 3vw, 34px); }

.ds {
  position: relative;
  border: 1px solid var(--ink);
  background: rgba(255,255,255,0.55);
  display: grid;
  grid-template-columns: 230px 1fr;
  grid-template-areas:
    "fig  fig"
    "spec body";
}
.ds-fig {
  grid-area: fig;
  position: relative;
  margin: 0;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-2);
  overflow: hidden;
}
.ds-fig img {
  display: block;
  width: 100%;
  height: clamp(220px, 30vw, 340px);
  object-fit: cover;
  object-position: center;
}
.ds-fig figcaption {
  position: absolute;
  left: 0; bottom: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 12px;
}
.ds-fig.placeholder {
  display: flex; align-items: center; justify-content: center;
  height: clamp(220px, 30vw, 340px);
  background:
    repeating-linear-gradient(45deg, var(--paper-2) 0 14px, var(--paper) 14px 28px);
  color: var(--ink-soft);
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; text-align: center; padding: 0 24px;
}
.ds-spec { grid-area: spec; }
.ds-body { grid-area: body; }
.ds-spec {
  border-right: 1px solid var(--line);
  padding: 0;
  background: var(--paper-2);
}
.ds-spec .partno {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: flex; justify-content: space-between; align-items: center;
}
.ds-spec .partno .yr { color: var(--accent); }
.ds-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}
.ds-row:last-child { border-bottom: 0; }
.ds-row .rk { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); padding: 11px 12px; border-right: 1px solid var(--line); }
.ds-row .rv { padding: 11px 14px; color: var(--ink); }
.ds-row .rv a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.ds-row .rv a:hover { border-bottom-color: var(--accent); }

.ds-body { padding: clamp(22px, 2.6vw, 32px); display: flex; flex-direction: column; }
.ds-body h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 115%;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  text-transform: uppercase;
}
.ds-body .tag { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-soft); text-transform: uppercase; margin-bottom: 16px; }
.ds-body p { margin: 0 0 14px; color: var(--ink-soft); }
.ds-body p b { color: var(--ink); font-weight: 600; }
.ds-body .ds-link {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 6px;
  align-self: flex-start;
}
.ds-body .ds-link:hover { color: var(--accent); }
.ds-body .ds-link::after { content: "↗"; }
.ds-body .pull {
  font-family: var(--f-display);
  font-stretch: 108%;
  font-weight: 600;
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
  line-height: 1.3;
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding-left: 16px;
  margin: 4px 0 18px;
}

/* ---- Projects: media gallery ------------------------------------------ */

.gallery { columns: 3 300px; column-gap: 16px; }
.tile {
  break-inside: avoid;
  margin: 0 0 16px;
  border: 1px solid var(--ink);
  background: #fff;
  position: relative;
  display: block;
}
.tile .media { display: block; width: 100%; height: auto; }
.tile figcaption {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-top: 1px solid var(--line);
  padding: 9px 12px;
  font-family: var(--f-mono);
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink);
}
.tile figcaption .t { color: var(--ink-faint); white-space: nowrap; }
.tile .badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--accent); color: #fff;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 8px;
}
@media (max-width: 600px) { .gallery { columns: 2 160px; column-gap: 12px; } }
@media (max-width: 380px) { .gallery { columns: 1; } }

/* ---- Projects: parts catalog (legacy) --------------------------------- */

.catalog { display: flex; flex-direction: column; gap: clamp(34px, 5vw, 56px); }
.cat-group .cat-head {
  display: flex; align-items: baseline; gap: 14px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 10px; margin-bottom: 22px;
}
.cat-group .cat-head h3 {
  font-family: var(--f-display); font-weight: 800; font-stretch: 112%;
  font-size: clamp(1.2rem, 2.2vw, 1.7rem); margin: 0; text-transform: uppercase; letter-spacing: -0.005em;
}
.cat-group .cat-head { justify-content: space-between; }
.cat-group .cat-head h3 a { color: inherit; text-decoration: none; }
.cat-group .cat-head h3 a:hover { color: var(--accent); }
.cat-group .cat-head .no { font-family: var(--f-mono); font-size: 11px; color: var(--ink-soft); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
a.no:hover { color: var(--accent); }
.backlink { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); text-decoration: none; }
.backlink:hover { color: var(--accent); }

.parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0; border: 1px solid var(--line); border-bottom: 0; }
.part {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 20px;
  background: rgba(255,255,255,0.45);
  display: flex; flex-direction: column; gap: 8px;
  min-height: 150px;
}
.part .rev { font-family: var(--f-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.08em; }
.part .pname { font-family: var(--f-display); font-weight: 700; font-stretch: 110%; font-size: 1.22rem; text-transform: uppercase; letter-spacing: -0.005em; }
.part .pyear { font-family: var(--f-mono); font-size: 11px; color: var(--ink-faint); }
.part .pdesc { font-size: 0.9rem; color: var(--ink-soft); margin-top: auto; }
.part a.plink { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.part a.plink:hover { color: var(--accent); }
.part a.plink::after { content: "→"; }

/* ---- About / contact sheet -------------------------------------------- */

.contact { border: 1px solid var(--ink); background: rgba(255,255,255,0.5); }
.contact .crow { display: grid; grid-template-columns: 200px 1fr; border-bottom: 1px solid var(--line); }
.contact .crow:last-child { border-bottom: 0; }
.contact .crow .ck { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); padding: 18px 22px; border-right: 1px solid var(--line); }
.contact .crow .cv { padding: 18px 22px; font-size: 1.05rem; }
.contact .crow .cv a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.contact .crow .cv a:hover { border-bottom-color: var(--accent); }

.prose { max-width: 64ch; }
.prose p { margin: 0 0 18px; color: var(--ink-soft); font-size: 1.08rem; line-height: 1.65; }
.prose p b { color: var(--ink); font-weight: 600; }

/* ---- Timeline rail (about) -------------------------------------------- */
.rail { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--ink); }
.rail li { position: relative; padding: 0 0 26px 26px; }
.rail li::before { content: ""; position: absolute; left: -4px; top: 6px; width: 7px; height: 7px; background: var(--accent); }
.rail li .yr { font-family: var(--f-mono); font-size: 11px; color: var(--ink-soft); letter-spacing: 0.08em; }
.rail li .ev { font-weight: 600; margin-top: 2px; }
.rail li .ev span { color: var(--ink-soft); font-weight: 400; }

/* ---- Footer ------------------------------------------------------------ */

.foot {
  padding: 30px var(--pad);
  display: flex; flex-wrap: wrap; gap: 14px 28px;
  align-items: center; justify-content: space-between;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--ink-soft); text-transform: uppercase;
}
.foot a { color: var(--ink-soft); text-decoration: none; }
.foot a:hover { color: var(--accent); }
.foot .links { display: flex; gap: 22px; flex-wrap: wrap; }

/* ---- Reveal animation -------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .dimline .bar { transform: none !important; }
  html { scroll-behavior: auto; }
}

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 820px) {
  body { font-size: 16px; }
  .ds { grid-template-columns: 1fr; grid-template-areas: "fig" "spec" "body"; }
  .ds-spec { border-right: 0; border-bottom: 1px solid var(--line); }
  .now, .now.two { grid-template-columns: 1fr; }
  .now .cell { border-right: 0; border-bottom: 1px solid var(--line); }
  .now .cell:last-child { border-bottom: 0; }
  .contact .crow { grid-template-columns: 130px 1fr; }
}

@media (max-width: 680px) {
  .topbar .wrap { flex-wrap: wrap; min-height: 0; }
  .brand { border-right: 0; padding: 12px 0; }
  .navtoggle {
    display: inline-flex; align-items: center; gap: 8px;
    margin-left: auto; align-self: center;
    background: none; border: 1px solid var(--ink); color: var(--ink);
    font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
    padding: 8px 12px; cursor: pointer;
  }
  .nav {
    flex-basis: 100%;
    flex-direction: column;
    border-top: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { border-left: 0; border-bottom: 1px solid var(--line); padding: 14px 4px; }
  .hero h1 { font-size: clamp(2.3rem, 12vw, 3.4rem); }
  .contact .crow { grid-template-columns: 1fr; }
  .contact .crow .ck { border-right: 0; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
  .ds-row { grid-template-columns: 76px 1fr; }
}
