/* =============================================================================
   Sawaf Services — "Fire Danger"

   The conceit: the roadside fire danger rating sign every person in British
   Columbia has driven past ten thousand times, pointed at office technology
   instead of forest. LOW / MODERATE / HIGH / EXTREME / CRITICAL.

   The joke is structural rather than decorative. The site is funny at the
   bottom of the scale and completely straight at the top, because the person
   reading CRITICAL has a machine showing a ransom note and does not want a
   gag. Humour is aimed at the situation and at Mark. Never at the reader.

   Deliberately NOT the v1 site: that one is light editorial grotesk with
   hairlines and a single cobalt accent. This one is a dark enamel sign with
   a five-colour hazard scale, condensed sign lettering and a mono readout.

   Type   Anton (sign face) · IBM Plex Sans (prose) · IBM Plex Mono (readout)
   Ground Warm near-black, like a sign at dusk
   Scale  Green -> amber -> orange -> red. The colour IS the information,
          so unlike v1 this site needs more than one accent.
   ========================================================================== */

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: dark;

  --ground:  #12100d;   /* the page                                        */
  --panel:   #1b1813;   /* raised slat                                     */
  --panel-2: #241f18;   /* inset                                           */

  --ink:     #f7f3ea;   /* headings — 15.9:1 on ground                     */
  --ink-2:   #c8c0af;   /* prose    —  9.6:1 on ground                     */
  --ink-3:   #968d7d;   /* muted    —  5.3:1 on ground                     */

  --rule:    #332c22;   /* structural edge                                 */
  --rule-2:  #262019;   /* light divider                                   */

  /* the hazard scale — each verified against --ground */
  --l1: #63c26a;   /*  6.9:1  LOW        */
  --l2: #ffc233;   /* 11.6:1  MODERATE   */
  --l3: #ff9538;   /*  8.6:1  HIGH       */
  --l4: #ff6b4a;   /*  6.4:1  EXTREME    */
  --l5: #ff4d6a;   /*  5.9:1  CRITICAL   */

  --accent:  var(--l2);          /* amber does the everyday work */
  --on-accent: #12100d;          /* 11.6:1 the other way         */

  --sign:  "Anton", "Arial Narrow", Impact, sans-serif;
  --sans:  "IBM Plex Sans", ui-sans-serif, system-ui, "Segoe UI", Arial, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --gut: clamp(18px, 4.5vw, 60px);
  --max: 1240px;
  --step: clamp(54px, 8.5vw, 120px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 600; text-wrap: balance; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { max-width: 100%; height: auto; display: block; }
strong { color: var(--ink); font-weight: 600; }
a { color: var(--accent); text-decoration: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--on-accent); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--on-accent);
  padding: 14px 22px; font-family: var(--mono); font-size: 13px; font-weight: 600;
}
.skip:focus { left: 12px; top: 12px; }

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

/* --------------------------------------------------------------- structure */
.wrap {
  max-width: var(--max); margin: 0 auto;
  padding-left: var(--gut); padding-right: var(--gut);
}
.sec { padding: var(--step) 0; }
.sec-sm { padding: clamp(40px, 6vw, 76px) 0; }
.band { background: var(--panel); }
.rule-top { border-top: 1px solid var(--rule); }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: clamp(18px, 3vw, 38px); }
.c-1-7  { grid-column: 1 / 8; }
.c-1-8  { grid-column: 1 / 9; }
.c-1-6  { grid-column: 1 / 7; }
.c-7-13 { grid-column: 7 / 13; }
.c-8-13 { grid-column: 8 / 13; }
.c-9-13 { grid-column: 9 / 13; }
@media (max-width: 900px) {
  .c-1-7, .c-1-8, .c-1-6, .c-7-13, .c-8-13, .c-9-13 { grid-column: 1 / 13; }
}

/* ------------------------------------------------------------------- type */
/* Anton only ever sets sign faces. It is unreadable at paragraph length and
   is not asked to do that anywhere. */
.face {
  font-family: var(--sign); font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.01em;
  line-height: 0.88; color: var(--ink);
}
.face-xl { font-size: clamp(58px, 13vw, 168px); }
.face-lg { font-size: clamp(40px, 7.5vw, 92px); }
.face-md { font-size: clamp(29px, 4.4vw, 54px); }

.h2 { font-size: clamp(25px, 3.2vw, 40px); line-height: 1.1; letter-spacing: -0.02em; max-width: 22ch; }
.h3 { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.3; letter-spacing: -0.01em; }
.h4 { font-size: 16px; line-height: 1.35; }

.lede { font-size: clamp(18px, 1.75vw, 21px); line-height: 1.55; color: var(--ink-2); max-width: 50ch; }
.prose { max-width: 58ch; }
.small { font-size: 14.5px; line-height: 1.6; color: var(--ink-3); }

/* the mono readout label, used everywhere a sign would stencil something */
.stencil {
  display: block; font-family: var(--mono);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.19em;
  text-transform: uppercase; color: var(--ink-3);
}
.stencil-a { color: var(--accent); }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 18px; }
.mt-3 { margin-top: 28px; }
.mt-4 { margin-top: clamp(32px, 4vw, 50px); }
.mt-5 { margin-top: clamp(42px, 5.5vw, 72px); }

/* ----------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 90;
  background: var(--ground);
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.top.stuck { border-bottom-color: var(--rule); }
.top-in { display: flex; align-items: center; justify-content: space-between;
          gap: 20px; padding-top: 15px; padding-bottom: 15px; }

.brand { display: flex; align-items: center; gap: 11px; }
.brand .mark {
  width: 26px; height: 26px; flex: none;
  border: 2.5px solid var(--accent);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--accent);
}
.brand .bn { font-family: var(--sign); font-size: 21px; text-transform: uppercase;
             letter-spacing: 0.015em; color: var(--ink); line-height: 1; }
.brand:hover .bn { color: var(--accent); }

.menu { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); }
.menu-links { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); }
.menu-links a {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
  padding-bottom: 3px; border-bottom: 2px solid transparent;
}
.menu-links a:hover { color: var(--accent); border-bottom-color: var(--rule); }
.menu-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.burger {
  display: none; background: none; border: 1px solid var(--rule);
  color: var(--ink); font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; padding: 10px 14px; cursor: pointer;
}
.burger:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 900px) {
  .burger { display: inline-block; }
  .menu-links {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ground);
    border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
    padding: 4px var(--gut) 16px;
  }
  .menu-links.open { display: flex; }
  .menu-links a { padding: 15px 0; border-bottom: 1px solid var(--rule-2);
                  font-size: 14px; }
  .menu-links .btn-in-menu {
    margin-top: 14px; border: 0; background: var(--accent); color: var(--on-accent);
    text-align: center; padding: 15px;
  }
}
@media (max-width: 620px) { .menu .btn-sm { display: none; } }
@media (min-width: 901px) { .menu-links .btn-in-menu { display: none; } }

/* ============================================================== THE SIGN ==
   The centrepiece. A dark enamel plate with a stencilled header, a rating
   window, and a row of five lamps. Modelled on the roadside fire danger
   sign, which is why the rating word is enormous and everything else is not. */
.sign {
  border: 2px solid var(--rule);
  background:
    linear-gradient(180deg, var(--panel) 0%, var(--ground) 100%);
  padding: clamp(20px, 3vw, 34px);
}
.sign-head {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  align-items: baseline; justify-content: space-between;
  padding-bottom: 16px; margin-bottom: clamp(20px, 3vw, 30px);
  border-bottom: 1px solid var(--rule);
}
.sign-rating { display: flex; align-items: baseline; gap: clamp(14px, 2.5vw, 28px); flex-wrap: wrap; }
.sign-rating .face-xl { color: var(--l2); }
.sign-note { max-width: 40ch; }

/* the five lamps */
.lamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
         margin-top: clamp(24px, 3.4vw, 38px); }
.lamp {
  border: 1px solid var(--rule); background: var(--panel-2);
  padding: 12px 10px 14px; text-align: center;
  transition: transform .18s ease, border-color .18s ease;
}
.lamp .dot {
  width: 14px; height: 14px; border-radius: 50%; margin: 0 auto 10px;
  background: currentColor; opacity: .26;
}
.lamp .lb {
  display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3);
  line-height: 1.3;
}
.lamp.n1 { color: var(--l1); } .lamp.n2 { color: var(--l2); }
.lamp.n3 { color: var(--l3); } .lamp.n4 { color: var(--l4); }
.lamp.n5 { color: var(--l5); }
/* the live one */
.lamp.on { border-color: currentColor; background: color-mix(in srgb, currentColor 11%, var(--panel-2)); }
.lamp.on .dot { opacity: 1; box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 20%, transparent); }
.lamp.on .lb { color: var(--ink); }
a.lamp:hover { transform: translateY(-2px); border-color: currentColor; }
a.lamp:hover .lb { color: var(--ink); }
@media (max-width: 700px) {
  .lamps { grid-template-columns: repeat(2, 1fr); }
  .lamps > :last-child { grid-column: 1 / -1; }
}

/* ================================================== THE SCALE (level rows)
   One slab per severity level. The left edge carries the level colour, which
   is the only place colour is load-bearing. */
.levels { display: grid; gap: clamp(14px, 2vw, 22px); }

.level {
  border: 1px solid var(--rule);
  border-left: 5px solid currentColor;
  background: var(--panel);
  padding: clamp(20px, 2.8vw, 34px);
}
.level.n1 { color: var(--l1); } .level.n2 { color: var(--l2); }
.level.n3 { color: var(--l3); } .level.n4 { color: var(--l4); }
.level.n5 { color: var(--l5); }

.level-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 20px; }
.level-n {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  letter-spacing: 0.17em; color: currentColor;
}
.level-name { font-family: var(--sign); text-transform: uppercase;
              font-size: clamp(28px, 4vw, 46px); line-height: 0.92;
              color: currentColor; letter-spacing: 0.015em; }
.level-sub { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
             text-transform: uppercase; color: var(--ink-3); }
.level p { color: var(--ink-2); }
.level .body { margin-top: 18px; max-width: 62ch; }

/* the "what I do about it" strip inside a level */
.level-do {
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr);
  gap: 6px clamp(14px, 3vw, 40px); align-items: baseline;
}
@media (max-width: 640px) { .level-do { grid-template-columns: 1fr; } }
.level-do dt { font-family: var(--mono); font-size: 11px; font-weight: 600;
               letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-3); }
.level-do dd { margin: 0; color: var(--ink-2); font-size: 16px; }

/* ---------------------------------------------------------------- readout
   Mono key/value. The site's workhorse list, used for terms and specs. */
.readout { border-top: 1px solid var(--rule); }
.readout > div {
  display: grid; grid-template-columns: minmax(0,4fr) minmax(0,7fr);
  gap: 6px clamp(14px, 3vw, 40px); align-items: baseline;
  padding: 15px 0; border-bottom: 1px solid var(--rule-2);
}
.readout dt { font-family: var(--mono); font-size: 11.5px; font-weight: 600;
              letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); }
.readout dd { margin: 0; font-size: 16px; color: var(--ink-2); }
.readout .ok { color: var(--l1); font-weight: 600; }
@media (max-width: 700px) { .readout > div { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- placard */
.placard {
  border: 1px solid var(--rule); border-left: 4px solid var(--accent);
  background: var(--panel); padding: 20px 22px;
}
.placard.hot { border-left-color: var(--l5); }
.placard .h4 { margin-bottom: 6px; }
.placard p { font-size: 15.5px; margin: 0; }

/* hazard tape — used once, on the emergency block */
.tape {
  height: 10px;
  background: repeating-linear-gradient(45deg,
    var(--l2) 0 14px, var(--ground) 14px 28px);
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--accent); color: var(--on-accent);
  border: 2px solid var(--accent); padding: 14px 22px; cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.btn:hover { background: transparent; color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-sm { padding: 10px 15px; font-size: 11.5px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.tlink {
  display: inline-flex; align-items: baseline; gap: 9px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
  border-bottom: 2px solid var(--rule); padding-bottom: 3px;
}
.tlink:hover { border-bottom-color: var(--accent); }

/* -------------------------------------------------------------------- form */
.form-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.3fr);
             gap: clamp(28px, 5vw, 70px); align-items: start; }
@media (max-width: 940px) { .form-grid { grid-template-columns: 1fr; gap: 36px; } }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .pair { grid-template-columns: 1fr; gap: 0; } }

.f { margin-bottom: 20px; }
.f > label {
  display: block; font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px;
}
.f > label .req { color: var(--accent); }
.f > label .opt { opacity: .7; }
.f input, .f textarea {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--rule);
  border-radius: 0; padding: 13px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.f textarea { min-height: 160px; resize: vertical; line-height: 1.6; }
.f input:focus, .f textarea:focus {
  outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.f input::placeholder, .f textarea::placeholder { color: var(--ink-3); opacity: .8; }
.f [aria-invalid="true"] { border-color: var(--l5); }
.f .err { display: none; margin-top: 7px; font-family: var(--mono);
          font-size: 12.5px; color: var(--l5); }
.f .err.on { display: block; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fineprint { font-size: 13.5px; line-height: 1.6; color: var(--ink-3);
             margin: 16px 0 0; max-width: 52ch; }

.flash { display: none; padding: 18px 20px; margin-bottom: 24px;
         border-left: 4px solid; background: var(--panel); font-size: 15.5px; }
.flash.on { display: block; }
.flash .h4 { margin-bottom: 4px; }
.flash.good { border-color: var(--l1); }
.flash.bad  { border-color: var(--l5); }

/* ----------------------------------------------------------------- footer */
.foot { border-top: 1px solid var(--rule); background: var(--panel);
        padding: clamp(44px, 6vw, 76px) 0 32px; }
.foot-grid { display: grid; grid-template-columns: minmax(0,2fr) repeat(2, minmax(0,1fr));
             gap: clamp(26px, 4vw, 52px); }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr; gap: 30px; } }
.foot .fh { font-family: var(--mono); font-size: 11px; font-weight: 600;
            letter-spacing: 0.16em; text-transform: uppercase;
            color: var(--ink-3); margin: 0 0 14px; }
.foot-links { display: flex; flex-direction: column; gap: 10px; }
.foot-links a { font-size: 15px; color: var(--ink-2); }
.foot-links a:hover { color: var(--accent); }
.foot p { font-size: 15px; color: var(--ink-2); max-width: 38ch; }
.foot-base {
  margin-top: clamp(34px, 5vw, 56px); padding-top: 22px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; color: var(--ink-3);
}
.foot-base a { color: var(--ink-3); }
.foot-base a:hover { color: var(--accent); }

/* -------------------------------------------------------------------- 404 */
.void { text-align: center; padding-top: clamp(70px, 12vw, 170px);
        padding-bottom: clamp(70px, 12vw, 170px); }
.void .lede { margin-left: auto; margin-right: auto; }

/* ----------------------------------------------------------------- reveal */
.js [data-rise] {
  opacity: 0; transform: translateY(14px);
  transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1);
  transition-delay: var(--d, 0ms);
}
.js [data-rise].in { opacity: 1; transform: none; }
.rm [data-rise] { opacity: 1 !important; transform: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-rise] { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ print */
@media print {
  .top, .foot-base, .btn, .burger, .tape { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .sign, .level, .placard { border-color: #999; background: #fff; }
  .face, .level-name, h1, h2, h3 { color: #000; }
  a { color: #000; }
}
