/* ==========================================================================
   Best Web Design - bestwebdesign.lk
   Design system: "The Drawing Set"
   Ceylon sapphire ink, chalk line work, brass annotation.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Surface */
  --ink:        #0B1A33;   /* Ceylon sapphire, the sheet */
  --ink-deep:   #071224;   /* recessed */
  --ink-raise:  #102546;   /* raised panel */
  --vellum:     #E9E1D0;   /* ola leaf paper */
  --vellum-2:   #DED4BE;

  /* Line work */
  --chalk:      #E8EEF6;   /* primary line + text */
  --chalk-mid:  #A9BBD1;   /* secondary text */
  --chalk-dim:  #6E85A3;   /* tertiary, notes */
  --rule:       rgba(232, 238, 246, 0.16);
  --rule-soft:  rgba(232, 238, 246, 0.08);
  --grid:       rgba(160, 195, 235, 0.055);

  /* Accent */
  --brass:      #C9A063;
  --brass-lit:  #E0BE86;
  --brass-soft: rgba(201, 160, 99, 0.16);

  /* Type */
  --display: "Marcellus", "Times New Roman", serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tech: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Scale */
  --t-hero:  clamp(2.6rem, 6vw, 5rem);
  --t-h2:    clamp(1.95rem, 4.2vw, 3.4rem);
  --t-h3:    clamp(1.25rem, 2vw, 1.6rem);
  --t-lead:  clamp(1.05rem, 1.5vw, 1.28rem);
  --t-body:  1rem;
  --t-note:  0.815rem;
  --t-micro: 0.7rem;

  /* Space */
  --gap:   clamp(1.5rem, 3vw, 2.5rem);
  --bay:   clamp(4.5rem, 10vw, 9rem);
  --pad:   clamp(1.25rem, 5vw, 4.5rem);
  --sheet: 1440px;
  --read:  62ch;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------------------
   2. RESET
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* --------------------------------------------------------------------------
   3. BASE
   -------------------------------------------------------------------------- */
body {
  font-family: var(--body);
  font-size: var(--t-body);
  font-weight: 300;
  line-height: 1.65;
  color: var(--chalk-mid);
  background-color: var(--ink);
  /* Drafting grid: 8mm major, 2mm minor */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(rgba(160,195,235,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160,195,235,0.022) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  color: var(--chalk);
  line-height: 1.08;
  letter-spacing: -0.005em;
}

p { max-width: var(--read); }
strong { color: var(--chalk); font-weight: 500; }

::selection { background: var(--brass); color: var(--ink-deep); }

:focus-visible {
  outline: 2px solid var(--brass-lit);
  outline-offset: 3px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--brass); color: var(--ink-deep);
  padding: 0.75rem 1.25rem; font-family: var(--tech); font-size: var(--t-note);
}
.skip:focus { left: 0; }

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

/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */
.shell {
  max-width: var(--sheet);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.sheet {
  position: relative;
  padding-block: var(--bay);
  border-top: 1px solid var(--rule);
}
.sheet:first-of-type { border-top: 0; }

/* Registration ticks at the sheet corners */
.sheet::before,
.sheet::after {
  content: "";
  position: absolute;
  top: -1px;
  width: 11px; height: 11px;
  border: 1px solid var(--rule);
  pointer-events: none;
}
.sheet::before { left: 0; border-right: 0; border-bottom: 0; }
.sheet::after  { right: 0; border-left: 0; border-bottom: 0; }

/* Sheet identification, sits in the top-right of a bay */
.sheet-id {
  font-family: var(--tech);
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  color: var(--chalk-dim);
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2.75rem;
  border-bottom: 1px dashed var(--rule-soft);
  padding-bottom: 0.6rem;
}
.sheet-id span { white-space: nowrap; }
.sheet-id .num { color: var(--brass); }

/* --------------------------------------------------------------------------
   5. HEADER
   -------------------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(11, 26, 51, 0.86);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--rule);
}

.masthead-in {
  max-width: var(--sheet);
  margin-inline: auto;
  padding: 0.9rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}

.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand svg { flex: none; }
.brand-name {
  font-family: var(--display);
  font-size: 1.14rem;
  color: var(--chalk);
  line-height: 1;
  letter-spacing: 0.02em;
}
.brand-sub {
  display: block;
  font-family: var(--tech);
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  color: var(--chalk-dim);
  margin-top: 0.32rem;
}

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2rem); }
.nav a {
  font-size: 0.85rem;
  color: var(--chalk-mid);
  padding-block: 0.3rem;
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.nav a:hover { color: var(--chalk); border-bottom-color: var(--brass); }
.nav a[aria-current="page"] { color: var(--chalk); border-bottom-color: var(--brass); }

.nav-mail {
  font-family: var(--tech);
  font-size: 0.78rem;
  color: var(--brass) !important;
  border: 1px solid var(--brass-soft);
  padding: 0.5rem 0.9rem !important;
  transition: background 0.25s var(--ease);
}
.nav-mail:hover { background: var(--brass-soft); border-bottom-color: var(--brass-soft) !important; }

.burger {
  display: none;
  width: 40px; height: 34px;
  border: 1px solid var(--rule);
  position: relative;
}
.burger i {
  position: absolute; left: 9px; right: 9px; height: 1px;
  background: var(--chalk); transition: transform 0.3s var(--ease), opacity 0.2s;
}
.burger i:nth-child(1) { top: 12px; }
.burger i:nth-child(2) { top: 21px; }
.burger[aria-expanded="true"] i:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.burger[aria-expanded="true"] i:nth-child(2) { transform: translateY(-4.5px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   6. HERO
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(3.5rem, 8vw, 7rem) clamp(3rem, 6vw, 5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.hero h1 {
  font-size: var(--t-hero);
  letter-spacing: -0.018em;
  margin-bottom: 1.6rem;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  display: block;
  color: var(--brass);
}

.hero-lead {
  font-size: var(--t-lead);
  color: var(--chalk-mid);
  max-width: 46ch;
  line-height: 1.7;
}

/* Text-heavy hero where the copy needs more room than the drawing. */
.hero-grid.hero-wide { grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr); }

/* In a hero column the address has to fit on one line at every width. */
.hero .mail-link { font-size: clamp(1.3rem, 2.9vw, 2.5rem); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.4rem;
}

/* Datum line under the hero */
.datum {
  margin-top: clamp(3rem, 6vw, 5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-family: var(--tech);
  font-size: var(--t-micro);
  letter-spacing: 0.16em;
  color: var(--chalk-dim);
}
.datum span { white-space: nowrap; }
.datum-line {
  flex: 1 1 60px;
  height: 1px;
  background: var(--rule);
  position: relative;
}
.datum-line::before,
.datum-line::after {
  content: ""; position: absolute; top: -4px; width: 1px; height: 9px; background: var(--rule);
}
.datum-line::before { left: 0; }
.datum-line::after { right: 0; }

/* --------------------------------------------------------------------------
   7. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--tech);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  padding: 0.92rem 1.5rem;
  border: 1px solid var(--brass);
  color: var(--brass-lit);
  background: transparent;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.btn:hover { background: var(--brass); color: var(--ink-deep); }

.btn-solid { background: var(--brass); color: var(--ink-deep); }
.btn-solid:hover { background: var(--brass-lit); color: var(--ink-deep); }

.btn-quiet {
  border-color: var(--rule);
  color: var(--chalk-mid);
}
.btn-quiet:hover { background: transparent; border-color: var(--chalk); color: var(--chalk); }

/* --------------------------------------------------------------------------
   8. SECTION HEADS
   -------------------------------------------------------------------------- */
.head { max-width: 68ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.head h2 { font-size: var(--t-h2); margin-bottom: 1.1rem; }
.head p { font-size: var(--t-lead); line-height: 1.7; }

/* --------------------------------------------------------------------------
   9. STATEMENT BAY
   -------------------------------------------------------------------------- */
.statement {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.6vw, 2.9rem);
  line-height: 1.24;
  color: var(--chalk);
  max-width: 22ch;
}
.statement-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.statement-notes { display: grid; gap: 1.9rem; }
.note {
  padding-left: 1.35rem;
  border-left: 1px solid var(--rule);
  position: relative;
}
.note::before {
  content: "";
  position: absolute; left: -1px; top: 0; width: 1px; height: 22px; background: var(--brass);
}
.note h3 {
  font-family: var(--body);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--chalk);
  letter-spacing: 0;
  margin-bottom: 0.4rem;
}
.note p { font-size: 0.92rem; }

/* Where one column of a pair is much taller, the short one holds its place
   until the reader has passed the whole section. */
@media (min-width: 1001px) {
  .statement-grid.hold > .statement-notes,
  .statement-grid.hold > .hold-col {
    position: sticky;
    top: 96px;
    align-self: start;
  }
}

/* Tall drawing beside a long list, sized to run the height of the list. */
.riser-grid {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (max-width: 1000px) {
  .riser-grid { grid-template-columns: 1fr; }
  .riser-grid > .figure { max-width: 320px; }
}

/* --------------------------------------------------------------------------
   10. SERVICE PLATES
   -------------------------------------------------------------------------- */
.plates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.plate {
  background: var(--ink);
  padding: clamp(1.6rem, 2.6vw, 2.4rem);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  position: relative;
  transition: background 0.35s var(--ease);
}
.plate:hover { background: var(--ink-raise); }

.plate-fig {
  height: 92px;
  margin-bottom: 0.4rem;
}
.plate-fig svg { height: 100%; width: auto; overflow: visible; }

.plate h3 { font-size: var(--t-h3); }
.plate p { font-size: 0.93rem; }

.plate-list {
  font-family: var(--tech);
  font-size: var(--t-note);
  color: var(--chalk-dim);
  display: grid;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--rule-soft);
}
.plate-list li { display: flex; gap: 0.6rem; }
.plate-list li::before { content: "+"; color: var(--brass); }

.plate-ref {
  position: absolute;
  top: clamp(1.6rem, 2.6vw, 2.4rem);
  right: clamp(1.6rem, 2.6vw, 2.4rem);
  font-family: var(--tech);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  color: var(--chalk-dim);
}

/* --------------------------------------------------------------------------
   11. THRESHOLD (moonstone) - vellum bay
   -------------------------------------------------------------------------- */
.threshold {
  background: var(--vellum);
  background-image:
    linear-gradient(rgba(90, 70, 40, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 70, 40, 0.045) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px;
  color: #4A4335;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.threshold h2, .threshold h3 { color: #1C1810; }
/* Line drawings placed on the paper bay inherit ink values, not the chalk-on-blue set. */
.threshold {
  --chalk: #2E2718;
  --chalk-dim: #8A7A5C;
  --brass: #8A6A28;
}
.threshold .sheet-id { color: #7A6E55; border-bottom-color: rgba(90,70,40,0.18); }
.threshold .sheet-id .num { color: #8A6A28; }
.threshold p { color: #55503F; }
.threshold::before, .threshold::after { border-color: rgba(90,70,40,0.25); }

.threshold-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (min-width: 1001px) {
  .threshold-grid > .figure { position: sticky; top: 96px; }
}

.stages { counter-reset: stage; display: grid; gap: 0; margin-top: 2rem; }
.stage {
  counter-increment: stage;
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 1.2rem;
  padding: 1.15rem 0;
  border-top: 1px solid rgba(90, 70, 40, 0.2);
}
.stage:last-child { border-bottom: 1px solid rgba(90, 70, 40, 0.2); }
.stage::before {
  content: "R" counter(stage);
  font-family: var(--tech);
  font-size: var(--t-note);
  color: #8A6A28;
  letter-spacing: 0.08em;
  padding-top: 0.15rem;
}
.stage h3 { font-family: var(--body); font-size: 1rem; font-weight: 500; margin-bottom: 0.25rem; letter-spacing: 0; }
.stage p { font-size: 0.9rem; max-width: 48ch; }

.threshold .btn { border-color: #8A6A28; color: #6B5220; }
.threshold .btn:hover { background: #8A6A28; color: var(--vellum); }

/* --------------------------------------------------------------------------
   12. STANDARDS / TWO COLUMN LEDGER
   -------------------------------------------------------------------------- */
.ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.5rem, 4vw, 3.5rem);
}
.ledger-col h3 {
  font-family: var(--body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--chalk-dim);
  margin-bottom: 1.4rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
}
.ledger-col li {
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--rule-soft);
  font-size: 0.95rem;
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
}
.ledger-col li b {
  font-family: var(--tech);
  font-weight: 400;
  font-size: 0.78rem;
  flex: none;
  width: 1.1rem;
}
.yes li b { color: var(--brass); }
.no li b { color: var(--chalk-dim); }
.no li { color: var(--chalk-dim); }

/* --------------------------------------------------------------------------
   13. FIGURES / CAPTIONS
   -------------------------------------------------------------------------- */
.figure { position: relative; }
.figure svg { width: 100%; height: auto; overflow: visible; }
.figcap {
  font-family: var(--tech);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  color: var(--chalk-dim);
  margin-top: 1.1rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
}
.threshold .figcap { color: #7A6E55; border-top-color: rgba(90,70,40,0.2); }

/* --------------------------------------------------------------------------
   13b. LONG-FORM PROSE (legal pages)
   -------------------------------------------------------------------------- */
.prose { max-width: 74ch; }
.prose h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  margin: 2.8rem 0 0.9rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 {
  font-family: var(--body);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--chalk);
  letter-spacing: 0;
  margin: 1.7rem 0 0.5rem;
}
.prose p { margin-bottom: 0.95rem; max-width: none; }
.prose ul { display: grid; gap: 0.55rem; margin: 0 0 1.2rem; }
.prose li { position: relative; padding-left: 1.3rem; }
.prose li::before {
  content: "";
  position: absolute; left: 0; top: 0.72em;
  width: 7px; height: 1px; background: var(--brass);
}
.prose a { color: var(--brass-lit); border-bottom: 1px solid var(--brass-soft); }
.prose a:hover { border-bottom-color: var(--brass); }
.prose .updated {
  font-family: var(--tech);
  font-size: var(--t-note);
  letter-spacing: 0.1em;
  color: var(--chalk-dim);
  margin-bottom: 2.5rem;
}

/* --------------------------------------------------------------------------
   14. FAQ
   -------------------------------------------------------------------------- */
.faq { display: grid; gap: 0; border-top: 1px solid var(--rule); max-width: 900px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 1.35rem 3rem 1.35rem 0;
  position: relative;
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  color: var(--chalk);
  transition: color 0.25s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--brass-lit); }
.faq summary::after {
  content: "";
  position: absolute; right: 0.4rem; top: 50%;
  width: 13px; height: 1px; background: var(--brass);
  transform: translateY(-50%);
}
.faq summary::before {
  content: "";
  position: absolute; right: 6.4px; top: 50%;
  width: 1px; height: 13px; background: var(--brass);
  transform: translateY(-50%);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.faq details[open] summary::before { transform: translateY(-50%) rotate(90deg); opacity: 0; }
.faq .answer { padding: 0 3rem 1.6rem 0; }
.faq .answer p + p { margin-top: 0.9rem; }

/* --------------------------------------------------------------------------
   15. CONTACT BAY
   -------------------------------------------------------------------------- */
.contact-bay { text-align: left; }
.mail-link {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(1.6rem, 5.2vw, 3.6rem);
  color: var(--chalk);
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--brass-soft);
  padding-bottom: 0.15em;
  margin-block: 1.5rem 2rem;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
  word-break: break-word;
}
.mail-link:hover { color: var(--brass-lit); border-color: var(--brass); }

.brief-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 2.5rem;
}
.brief-list li {
  background: var(--ink);
  padding: 1.3rem 1.4rem;
  font-size: 0.9rem;
}
.brief-list b {
  display: block;
  font-family: var(--tech);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  color: var(--brass);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.copy-btn {
  font-family: var(--tech);
  font-size: var(--t-note);
  color: var(--chalk-dim);
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 2px;
  transition: color 0.25s var(--ease);
}
.copy-btn:hover { color: var(--brass); }

/* --------------------------------------------------------------------------
   16. FOOTER / TITLE BLOCK
   -------------------------------------------------------------------------- */
.colophon {
  border-top: 1px solid var(--rule);
  background: var(--ink-deep);
}
.title-block {
  max-width: var(--sheet);
  margin-inline: auto;
  padding: clamp(2.5rem, 5vw, 4rem) var(--pad) 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
}
.tb-col h4 {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--chalk-dim);
  margin-bottom: 1rem;
}
.tb-col li { padding: 0.32rem 0; font-size: 0.9rem; overflow-wrap: break-word; }
.tb-col a:hover { color: var(--brass-lit); }
.tb-col p { font-size: 0.9rem; max-width: 34ch; }

.tb-brand .brand { margin-bottom: 1.1rem; }

.tb-bar {
  max-width: var(--sheet);
  margin-inline: auto;
  padding: 1.1rem var(--pad) 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  font-family: var(--tech);
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  color: var(--chalk-dim);
  border-top: 1px solid var(--rule);
}
.tb-bar .sinhala { font-family: var(--body); letter-spacing: 0; font-size: 0.8rem; color: var(--brass); }

/* --------------------------------------------------------------------------
   17. INSTRUMENTS (desktop only, decorative, all injected by JS)
   -------------------------------------------------------------------------- */

/* Status bar, bottom right. Cursor position, viewport, breakpoint, scroll. */
.hud {
  position: fixed;
  right: 14px; bottom: 12px;
  z-index: 60;
  display: flex;
  font-family: var(--tech);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  color: var(--chalk-dim);
  background: rgba(7, 18, 36, 0.74);
  border: 1px solid var(--rule-soft);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.hud.on { opacity: 0.86; }
.hud span {
  padding: 5px 9px;
  border-left: 1px solid var(--rule-soft);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hud span:first-child { border-left: 0; }
.hud b { color: var(--brass); font-weight: 400; }

/* The layout grid the site is actually built on, revealed on demand. */
.gridlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.gridlay.on { opacity: 1; }
.gridlay-in {
  max-width: var(--sheet);
  margin-inline: auto;
  padding-inline: var(--pad);
  height: 100%;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}
.gridlay-in i {
  background: rgba(201, 160, 99, 0.09);
  border-left: 1px solid rgba(201, 160, 99, 0.28);
  border-right: 1px solid rgba(201, 160, 99, 0.28);
}
.gridlay-tag {
  position: absolute;
  left: var(--pad);
  top: 76px;
  font-family: var(--tech);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--brass);
}

/* Key hints, bottom left. Fades out once read. */
.keys {
  position: fixed;
  left: 14px; bottom: 12px;
  z-index: 60;
  font-family: var(--tech);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  color: var(--chalk-dim);
  background: rgba(7, 18, 36, 0.74);
  border: 1px solid var(--rule-soft);
  backdrop-filter: blur(6px);
  padding: 5px 10px;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}
.keys.on { opacity: 0.82; }
.keys b { color: var(--brass); font-weight: 400; }

/* Scroll progress, drawn as a rule under the masthead. */
.progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 1px;
  width: 0;
  background: var(--brass);
}

/* Shown only when the device asks for reduced motion. */
.motion-note {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  z-index: 70;
  max-width: 540px;
  background: var(--ink-deep);
  border: 1px solid var(--rule);
  padding: 1.05rem 1.2rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--chalk-mid);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.motion-note p { margin: 0; max-width: 46ch; }
.motion-note .hint {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--tech);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--chalk-dim);
}
.motion-note .row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.9rem; }
.motion-note button {
  font-family: var(--tech);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--brass);
  color: var(--brass-lit);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.motion-note button:hover { background: var(--brass); color: var(--ink-deep); }
.motion-note .ghost { border-color: var(--rule); color: var(--chalk-dim); }
.motion-note .ghost:hover { background: transparent; border-color: var(--chalk); color: var(--chalk); }

@media (max-width: 860px) {
  .hud, .keys, .gridlay { display: none; }
}
@media (max-width: 600px) {
  .motion-note { left: 12px; right: 12px; transform: none; max-width: none; }
}

/* --------------------------------------------------------------------------
   17b. CONTENT GUARD (notice and developer tools gate)
   -------------------------------------------------------------------------- */
.guard-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(8px);
  z-index: 90;
  max-width: min(90vw, 460px);
  background: var(--ink-deep);
  border: 1px solid var(--brass-soft);
  border-left: 2px solid var(--brass);
  padding: 0.8rem 1.05rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--chalk-mid);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.guard-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

html.guard-locked, html.guard-locked body { overflow: hidden; }

.guard-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  background: var(--ink);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px;
}
.guard-gate.on { display: flex; }
.guard-gate-in {
  max-width: 52ch;
  border: 1px solid var(--rule);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  position: relative;
}
.guard-gate-ref {
  position: absolute;
  top: 1.2rem; right: 1.4rem;
  font-family: var(--tech);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  color: var(--brass);
}
.guard-gate h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 1rem; }
.guard-gate p { font-size: 0.95rem; margin-bottom: 0.9rem; }
.guard-gate-esc { color: var(--chalk-dim); font-size: 0.86rem !important; }
.guard-gate button {
  font-family: var(--tech);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--brass-lit);
  border-bottom: 1px solid var(--brass-soft);
  padding-bottom: 1px;
}
.guard-gate button:hover { border-bottom-color: var(--brass); }

/* --------------------------------------------------------------------------
   18. LINE DRAWING ANIMATION
   -------------------------------------------------------------------------- */
.dl {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.is-drawn .dl {
  animation: draw var(--dur, 1.1s) var(--d, 0s) var(--ease) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.fx { opacity: 0; }
.is-drawn .fx { animation: fx 0.7s var(--d, 0s) var(--ease) forwards; }
@keyframes fx { to { opacity: 1; } }

/* Text and content reveal: opacity only, no slide */
.reveal { opacity: 0; transition: opacity 0.85s var(--ease); }
.reveal.is-drawn { opacity: 1; }

/* Slow rotation for the moonstone construction ring */
.spin { transform-origin: center; animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   19. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1150px) {
  .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .plates { grid-template-columns: minmax(0, 1fr); }
  /* auto-fit columns get narrower than the email address below this width */
  .title-block { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1000px) {
  .hero-grid,
  .hero-grid.hero-wide,
  .statement-grid,
  .threshold-grid { grid-template-columns: minmax(0, 1fr); }
  /* Drawing full width on top, copy full width beneath it. */
  .hero-grid > .figure,
  .hero-fig { order: -1; }
  .hero-grid > .figure { margin-bottom: 0.5rem; }
}

@media (max-width: 860px) {
  .burger { display: block; }
  .nav {
    position: fixed;
    inset: 61px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink-deep);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--pad) 1.5rem;
    transform: translateY(-140%);
    transition: transform 0.4s var(--ease);
  }
  .nav.open { transform: translateY(0); }
  .nav a {
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--rule-soft);
    font-size: 1rem;
  }
  .nav-mail { text-align: center; margin-top: 1rem; }
  .readout { display: none; }
}

@media (max-width: 600px) {
  /* Three mono strings will not sit on one line at this width. */
  .tb-bar { flex-direction: column; gap: 0.55rem; }
  .sheet-id { flex-wrap: wrap; gap: 0.5rem 1rem; }
  .faq summary { font-size: 1.02rem; padding-right: 2.2rem; }
  .stage { grid-template-columns: 2.4rem 1fr; gap: 0.8rem; }
}

/* --------------------------------------------------------------------------
   20. MOTION / PRINT
   -------------------------------------------------------------------------- */
/* Reduced motion is honoured by default. Adding .motion-on to <html> lets a
   visitor opt back in for this session without changing their OS setting. */
@media (prefers-reduced-motion: reduce) {
  html:not(.motion-on) { scroll-behavior: auto; }
  html:not(.motion-on) .dl { stroke-dashoffset: 0; }
  html:not(.motion-on) .fx,
  html:not(.motion-on) .reveal { opacity: 1; }
  html:not(.motion-on) .spin { animation: none; }
  html:not(.motion-on) *,
  html:not(.motion-on) *::before,
  html:not(.motion-on) *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body { background: #fff; color: #000; }
  .masthead, .hud, .keys, .gridlay, .motion-note, .guard-toast, .guard-gate, .btn { display: none; }
}
