/* ==========================================================================
   Zhan Supply Co. — importer of record, China → Canada
   Hand-written CSS. No framework. Documentary, not decorative.
   ========================================================================== */

/* ---- Fonts (self-hosted) ------------------------------------------------ */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-var.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-var.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens ------------------------------------------------------------- */

:root {
  /* Color — 5 working values + 2 supports. That's the whole palette. */
  --paper: #FBFAF8;
  --ink:   #14161A;
  --slate: #39414D;
  --muted: #666E78;  /* nudged darker than spec (#6E7681) to clear 4.5:1 on --paper */
  --rule:  #DCD8D2;
  --seal:  #9E2B25;  /* a stamp, not a brand color */
  --wash:  #F2EFEA;

  /* Type */
  --serif: "Source Serif 4", Georgia, serif;
  --sans:  "IBM Plex Sans", system-ui, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1:  clamp(1.2rem, 1.13rem + 0.35vw, 1.42rem);
  --step-2:  clamp(1.44rem, 1.32rem + 0.6vw, 1.85rem);
  --step-3:  clamp(1.73rem, 1.54rem + 0.95vw, 2.4rem);
  --step-4:  clamp(2.07rem, 1.78rem + 1.45vw, 3.1rem);

  /* Layout */
  --max: 1160px;
  --gutter: 24px;
  --header-h: 56px;
}

/* ---- Reset / base ------------------------------------------------------- */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1em; max-width: 68ch; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 120ms, text-decoration-color 120ms;
}
a:hover { text-decoration-color: var(--seal); }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Mono label — the workhorse. Every code, figure, and label wears this. */
.label {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: var(--step--1);
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---- Container / section grid ------------------------------------------ */

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

.section {
  padding-block: clamp(64px, 9vh, 112px);
  border-top: 1px solid var(--rule);
}
.section:first-of-type { border-top: 0; }

.section-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

/* The document margin: clause number that holds still while content scrolls */
.section-ref { grid-column: 1 / 3; }
.section-ref > span {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: block;
}
.section-body { grid-column: 3 / 13; min-width: 0; }

@media (max-width: 900px) {
  .section-ref, .section-body { grid-column: 1 / 13; }
  .section-ref > span { position: static; }
  .section-ref { margin-bottom: 8px; }
}

/* ---- Header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-header .container {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding-block: 8px;
}

.logotype {
  font-family: var(--serif);
  font-weight: 600;
  font-size: var(--step-1);
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--seal);
  padding-bottom: 2px;
  line-height: 1;
}
.logotype:hover { text-decoration: none; }

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.site-nav a {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--seal); }

.lang-toggle {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}
.lang-toggle a { color: var(--slate); text-decoration: none; }
.lang-toggle a:hover { text-decoration: underline; }
.lang-toggle [aria-current="true"] {
  color: var(--seal);
  font-weight: 500;
}

/* ---- Hero --------------------------------------------------------------- */

.hero { padding-block: clamp(64px, 10vh, 128px); }
.hero-inner { max-width: calc(8 / 12 * 100%); }
@media (max-width: 900px) { .hero-inner { max-width: none; } }

.hero h1 { margin-bottom: 0.5em; max-width: 22ch; }

.standfirst {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--slate);
  max-width: 52ch;
  margin-bottom: 1.6em;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--step-0);
  padding: 12px 24px;
  border: 1px solid var(--ink);
  border-radius: 0;
  text-decoration: none;
  transition: background-color 120ms, color 120ms;
}
.btn:hover { background: var(--slate); border-color: var(--slate); }

/* Corporate strip: accountability above the fold */
.corp-strip {
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  word-spacing: 0.05em;
}

/* ---- 01 The problem ----------------------------------------------------- */

.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px var(--gutter);
  max-width: 72ch;
}
@media (max-width: 700px) { .problem-grid { grid-template-columns: 1fr; } }

.problem-grid .label { display: block; margin-bottom: 6px; color: var(--ink); }
.problem-grid p { margin: 0; font-size: var(--step-0); color: var(--slate); }

/* ---- 02 Comparison table ------------------------------------------------ */

.table-scroll {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* Right-edge fade cue for horizontal scroll (small screens) */
@media (max-width: 700px) {
  .table-wrap { position: relative; }
  .table-wrap::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 32px;
    pointer-events: none;
    background: linear-gradient(to right, rgba(251, 250, 248, 0), var(--paper));
  }
}

table.compare {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: var(--step-0);
}
.compare caption {
  text-align: left;
  padding-bottom: 12px;
}
.compare th, .compare td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  line-height: 1.45;
}
.compare thead th {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-top: 0;
  padding-top: 0;
}
.compare tbody th[scope="row"] {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate);
  width: 26%;
  /* Pinned criterion column when the table scrolls */
  position: sticky;
  left: 0;
  background: var(--paper);
}
.compare tbody tr:nth-child(even) td { background: var(--wash); }
.compare tbody tr:nth-child(even) th[scope="row"] { background: var(--wash); }
.compare tbody tr:last-child { border-bottom: 1px solid var(--rule); }
/* The last row is the whole pitch. */
.compare tr.verdict td {
  color: var(--ink);
  font-weight: 600;
}

/* ---- 03 Landed cost sheet ----------------------------------------------- */

.cost-sheet {
  font-family: var(--mono);
  font-size: var(--step--1);
  line-height: 1.7;
  max-width: 560px;
  margin: 0;
  color: var(--ink);
}
.cost-sheet .cs-head {
  display: flex;
  gap: 16px;
  justify-content: space-between;
}
.cost-sheet .cs-head dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; flex-shrink: 0; }
.cost-sheet .cs-head dd { margin: 0; text-align: right; }

.cost-sheet .cs-rows {
  border-top: 1px solid var(--ink);
  margin-top: 10px;
  padding-top: 10px;
}
.cs-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.cs-row .cs-item { flex-shrink: 0; }
.cs-row .cs-dots {
  flex: 1;
  border-bottom: 1px dotted var(--muted);
  transform: translateY(-4px);
  min-width: 16px;
}
.cs-row .cs-figure { flex-shrink: 0; text-align: right; white-space: nowrap; }

.cost-sheet .cs-total {
  border-top: 1px solid var(--ink);
  margin-top: 10px;
  padding-top: 10px;
  font-weight: 500;
}
.cost-sheet .cs-note {
  margin-top: 4px;
  color: var(--muted);
}
.cost-sheet .cs-caption {
  margin-top: 16px;
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--muted);
  max-width: 52ch;
}

/* ---- 04 Process --------------------------------------------------------- */

.process { list-style: none; margin: 0; padding: 0; max-width: 72ch; }
.process li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--gutter);
  padding-block: 28px;
  border-top: 1px solid var(--rule);
}
.process li:first-child { border-top: 0; padding-top: 0; }
.process .step-no {
  font-family: var(--mono);
  font-size: var(--step-1);
  color: var(--muted);
  line-height: 1.2;
}
.process h3 { margin-bottom: 0.35em; }
.process p { margin-bottom: 0.6em; color: var(--slate); }
.process .meta { display: block; }

@media (max-width: 500px) {
  .process li { grid-template-columns: 1fr; gap: 8px; }
}

/* ---- 05 Scope ----------------------------------------------------------- */

.scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px var(--gutter);
  max-width: 76ch;
}
@media (max-width: 700px) { .scope-grid { grid-template-columns: 1fr; } }

.scope-grid .label { display: block; margin-bottom: 12px; color: var(--ink); }
.scope-grid ul { list-style: none; margin: 0; padding: 0; }
.scope-grid li {
  padding: 8px 0;
  border-top: 1px solid var(--rule);
  color: var(--slate);
}
.scope-grid li:first-child { border-top: 0; padding-top: 0; }
.scope-note { margin-top: 12px; color: var(--muted); font-size: var(--step--1); }

/* ---- 06 Who I am -------------------------------------------------------- */

.bio-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 40px var(--gutter);
  max-width: 900px;
}
@media (max-width: 700px) { .bio-grid { grid-template-columns: 1fr; } }

.bio-photo {
  margin: 0;
  border: 1px solid var(--rule);
}
.bio-photo img { display: block; width: 100%; height: auto; }
/* Placeholder until the real photograph exists */
.photo-placeholder {
  aspect-ratio: 4 / 5;
  background: var(--wash);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.bio-photo figcaption {
  padding: 8px 0;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  color: var(--muted);
}
.bio-text p { color: var(--ink); }

/* ---- 07 Quote form ------------------------------------------------------ */

.quote-form { max-width: 640px; }
.quote-form .form-intro { color: var(--slate); margin-bottom: 32px; }

.field { margin-bottom: 24px; }
.field > label, fieldset legend {
  display: block;
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
  margin-bottom: 6px;
  padding: 0;
}
.field .optional { color: var(--muted); text-transform: none; letter-spacing: 0.04em; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="file"],
textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: var(--step-0);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 10px 12px;
  transition: border-color 120ms;
}
input:focus, textarea:focus { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 0; }
textarea { min-height: 140px; resize: vertical; }
::placeholder { color: var(--muted); opacity: 1; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--gutter);
}
@media (max-width: 500px) { .field-row { grid-template-columns: 1fr; } }

fieldset {
  border: 0;
  margin: 0 0 24px;
  padding: 0;
}
.choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--step-0);
  color: var(--ink);
}
input[type="checkbox"], input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
}

/* Honeypot — hidden from humans, visible to bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.quote-form button[type="submit"] {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--step-0);
  padding: 12px 28px;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 120ms;
}
.quote-form button[type="submit"]:hover { background: var(--slate); border-color: var(--slate); }

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 40px;
  font-family: var(--mono);
  font-size: var(--step--1);
  line-height: 1.9;
  color: var(--slate);
}
.site-footer a { color: var(--slate); }
.site-footer .footer-meta { color: var(--muted); margin-top: 12px; }
