/* ===========================================================================
   HEATER CAP: DESIGN TOKENS

   Every colour, face, size and rhythm the site uses is declared once here.
   site.css may read these and must not invent its own values, so a change to
   the brand is a change to this file.

   THESE VALUES COME FROM THE APPROVED HOME PAGE DESIGN. Where the reference
   sets a number inline, that number is a token here, so the inner pages are
   built from the same system rather than from a second guess at it. There is
   no inline style= anywhere in this codebase: style-src in the CSP is 'self'
   with no 'unsafe-inline', so an inline declaration would be dropped and the
   element would render unstyled with nothing reporting an error.

   THE PALETTE IS CONTRAST CHECKED. Every ratio below was computed from the
   WCAG formula rather than estimated. Every foreground-on-background pair the
   site actually uses clears AA at 4.5:1, which is not automatic: --ember on
   white is 2.8:1 and fails badly. Rather than dull the brand
   orange everywhere, there are two: --ember stays the vivid accent and is only
   ever used as a SURFACE (a filled button, the play button core, a numeral on
   a dark ground) or as text on dark; --ember-ink is the same hue taken down
   for use as TEXT on a light ground, where it is 4.9:1. Using the wrong one is
   the kind of mistake that looks fine and fails an audit, so they are named
   for the job rather than for the shade.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   FACES

   Satoshi for display, Inter for body and UI. Self-hosted woff2 only: no
   Google Fonts, no Fontshare API, no CDN, because font-src in the CSP is
   'self' and a request to api.fontshare.com would be blocked rather than
   merely slow.

   SATOSHI, by Indian Type Foundry, free under the ITF Free Font License,
   which permits commercial use and self-hosting and asks for no credit. The
   file is the VARIABLE woff2 from the Fontshare web kit, carried whole: at
   42,588 bytes it is smaller than the three static weights this site needs
   (500 + 700 + 900 would be 78,216 bytes), and the licence forbids subsetting
   and format conversion, so a cut-down copy was never an option either. Only
   the file NAME on disk differs from the download; the bytes are the official
   distribution. The licence sits beside it as satoshi-FFL.txt.

   Its axis is wght 300 to 900, so the declared range is the real one. Note
   that the file's DEFAULT instance is 900: the range on this @font-face is
   what makes font-weight: 500 resolve to Medium rather than to Black.

   THE GROTESQUE THAT CAME BEFORE IT IS GONE. It was the display face of the
   approved design and this pass replaces it: no files, no @font-face, no
   references, and the same is still true of the serif before that. Neither
   name is written out here, because TypographyTests fails the build if
   either reappears anywhere under src/, and a comment counts.

   font-display: swap, because a headline in the fallback for 100ms is better
   than a headline that is not there, and 'Satoshi Fallback' below is what
   keeps that swap from moving anything.
--------------------------------------------------------------------------- */

@font-face {
  font-family: 'Satoshi';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/static/fonts/satoshi-variable.woff2') format('woff2');
}

/* ---------------------------------------------------------------------------
   THE FALLBACK FACE, AND WHY IT IS NOT JUST ANOTHER NAME IN A LIST.

   With font-display: swap the first paint of a heading is in the fallback and
   the second is in Satoshi. If the two occupy different boxes then every
   heading reflows the moment the webfont lands, and that reflow is Cumulative
   Layout Shift on the one element at the top of the page.

   So the fallback is a face of its own: a local system font with Satoshi's
   metrics written over it. The numbers are computed rather than guessed.

     Satoshi's own metrics, per 1000 units of em:
       ascent 1010, descent 240, line gap 100
     Average advance width, weighted by English letter frequency:
       Satoshi at wght 700   0.46079em
       Arial Bold            0.47369em

     size-adjust       = 0.46079 / 0.47369 = 97.3%
     ascent-override   = 1.010 / 0.973     = 103.8%
     descent-override  = 0.240 / 0.973     = 24.7%
     line-gap-override = 0.100 / 0.973     = 10.3%

   The three overrides are DIVIDED BY size-adjust because size-adjust scales
   the overridden metrics too: an ascent-override of 101% would otherwise come
   out as 98.3% of the font size rather than 101%.

   Tuned against the BOLD system cut, and src names the bold faces first,
   because every heading on this site is 700 or 900. There is no font file
   behind this rule: local() either finds a face already on the machine or the
   whole declaration is skipped and the next family in the list is used, so it
   costs no bytes and no request.
--------------------------------------------------------------------------- */

@font-face {
  font-family: 'Satoshi Fallback';
  font-style: normal;
  font-weight: 300 900;
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Bold'),
       local('Liberation Sans Bold'), local('Arial'), local('Helvetica'),
       local('Liberation Sans');
  size-adjust: 97.3%;
  ascent-override: 103.8%;
  descent-override: 24.7%;
  line-gap-override: 10.3%;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* -------------------------------------------------------------------------
     GROUND

     Two darks and a raised panel. --midnight is the hero, the dealer band and
     the solid nav; --midnight-deep is the video band and the footer, a shade
     below it so the film and the legal matter sit back; --navy is the ordinary
     dark section; --panel is the raised surface on top of either.
  ------------------------------------------------------------------------- */
  --midnight: #07111F;
  --midnight-deep: #050C17;
  --navy: #0A1628;
  --panel: #11223A;

  /* Light grounds. --white is the page; --ground is the cool tint that keeps a
     light section from reading as plain white. */
  --white: #FFFFFF;
  --ground: #F2F8FC;

  /* -------------------------------------------------------------------------
     HEAT AND ICE
  ------------------------------------------------------------------------- */
  --ember: #FF7A3D;          /* surfaces, and text on dark only (6.9:1 on navy) */
  --ember-soft: #FFB088;     /* eyebrows and small text on dark (10.7:1) */
  --ember-ink: #C2410C;      /* ember-coloured TEXT on light (5.2:1 on white) */
  --ice: #BFE3F5;            /* the one word in a headline that is a colour */

  /* Type on light grounds. */
  --ink: #0A1628;
  --muted: #44546A;          /* 7.7:1 on white, 7.2:1 on ground */
  --link-ink: #1D5C8E;       /* an inline link in body copy, 6.6:1 on ground */

  /* Type on dark grounds, in descending weight of voice. */
  --on-dark: #FFFFFF;
  --on-dark-soft: #E4EEF7;
  --on-dark-lead: #D7E2EE;
  --on-dark-body: #C9D6E4;
  --on-dark-dim: #9FB3C8;    /* 8.8:1 on midnight: the quietest allowed */

  /* Footer, which is quieter again on an even deeper ground. */
  --foot-text: #B5C6DA;
  --foot-meta: #8094AA;      /* 6.3:1 on midnight-deep */

  /* The muted mark on the heat tape panel. */
  --mark-dim: #8094AA;

  /* -------------------------------------------------------------------------
     HAIRLINES

     The design separates things with a one-pixel line and whitespace. These
     are the only rules it draws.
  ------------------------------------------------------------------------- */
  --hair-dark: #1C3152;
  --hair-dark-lifted: #2A4468;             /* a tile border on a photo */
  --hair-light: #D6E4EF;
  --hair-glass: rgba(191, 227, 245, 0.18); /* the top bar's underline */

  /* Frosted panels: the hero's two paths, and the same treatment reused on
     /contact/ and /find-an-installer/. */
  --glass: rgba(10, 22, 40, 0.72);
  --glass-border: rgba(191, 227, 245, 0.25);
  --glass-field: rgba(7, 17, 31, 0.6);
  --glass-field-border: rgba(191, 227, 245, 0.4);
  --outline-light: rgba(255, 255, 255, 0.45);
  --tile-glass: rgba(17, 34, 58, 0.85);    /* a benefit tile over a photo */
  --hover-dark: rgba(255, 255, 255, 0.08);
  --lightbox-bg: rgba(7, 17, 31, 0.95);

  /* Ember used as a wash rather than as ink: the PDF tag, the warranty strip
     and the focus ring on a field. --placeholder-border is gone with the
     placeholders themselves: the client has settled every open item, there is
     no bracketed note left on the site, and a token for one is an invitation
     to write another. */
  --ember-wash: rgba(255, 122, 61, 0.12);
  --ember-ring: rgba(255, 122, 61, 0.25);

  /* Form chrome. --error-ink is 6.4:1 on white, which a message a visitor has
     to read has to clear. */
  --field-border: #C6D4E0;
  --error-ink: #A3300B;

  /* Overlays over a photograph. The hero's is directional because the
     headline sits left and the photograph's own interest is right. */
  --wash-hero: linear-gradient(90deg, rgba(7, 17, 31, 0.96) 0%,
    rgba(7, 17, 31, 0.85) 38%, rgba(7, 17, 31, 0.35) 70%, rgba(7, 17, 31, 0.55) 100%);
  --wash-hero-foot: linear-gradient(0deg, rgba(7, 17, 31, 0.95), rgba(7, 17, 31, 0));
  --wash-head: linear-gradient(90deg, rgba(7, 17, 31, 0.95) 0%,
    rgba(7, 17, 31, 0.82) 42%, rgba(7, 17, 31, 0.5) 100%);
  --wash-band: rgba(7, 17, 31, 0.86);
  --wash-cta: rgba(7, 17, 31, 0.82);

  /* -------------------------------------------------------------------------
     TYPE SCALE

     The approved design's clamps, refined rather than reinvented. Nothing
     here jumps at a breakpoint, and the display sizes are still the point of
     the typography: a Satoshi 700 headline at 92px is what opens the site.

     Satoshi is a tighter and more optically even face than the one it
     replaces, so it wants more negative tracking at display size and carries
     a shorter line height comfortably. The three numbers the brief sets are here: the hero
     at -0.035em on 0.98, every other h2 at -0.025em on 1.04, and an h3 at
     -0.01em. Body tracking is left at Inter's own, which is correct at 17px.
  ------------------------------------------------------------------------- */
  --font-display: 'Satoshi', 'Satoshi Fallback', 'Segoe UI', system-ui,
    -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;

  --step-hero: clamp(44px, 6.2vw, 92px);   /* the home page h1 */
  --step-h1: clamp(38px, 4.6vw, 64px);     /* an inner page h1 */
  --step-h2-xl: clamp(32px, 4.2vw, 60px);  /* a section that opens a page */
  --step-h2: clamp(34px, 3.8vw, 56px);     /* every other section */
  --step-h2-band: clamp(36px, 4vw, 58px);  /* over a photograph */
  --step-cta: clamp(38px, 5vw, 70px);      /* the closing call to action */
  --step-h3: 20px;                         /* Satoshi 700, the brief's floor */
  --step-panel: 23px;                      /* a panel or path title */

  --step-lead: 18px;
  --step-body: 17px;
  --step-copy: 18px;
  --step-ui: 16px;
  --step-btn: 15px;                        /* buttons and nav links */
  --step-small: 15px;
  --step-fine: 14px;
  --step-meta: 13px;
  --step-eyebrow: 12.5px;

  --lh-hero: 0.98;
  --lh-display: 1.04;
  --lh-tight: 1.02;
  --lh-body: 1.6;
  --lh-copy: 1.65;
  --lh-prose: 1.75;

  /* DISPLAY WEIGHT. Satoshi 700 is the heading weight everywhere. 900 is kept
     for the numerals, which are the only place this design raises its voice,
     and they set it themselves rather than reading this token. */
  --weight-display: 700;

  --track-hero: -0.035em;
  --track-xl: -0.03em;
  --track-display: -0.025em;
  --track-h3: -0.01em;
  --track-eyebrow: 0.2em;
  --track-ui: 0.01em;
  --track-label: 0.14em;

  /* THE MEASURE. 64ch is the widest any column of body copy is set. */
  --measure: 64ch;
  --measure-narrow: 62ch;

  /* -------------------------------------------------------------------------
     RHYTHM
  ------------------------------------------------------------------------- */
  --container: 1240px;
  --pad-x: 28px;
  --section-y: 110px;
  --section-y-tight: 72px;

  /* THE RHYTHM AROUND A HEADING, which is the one spacing this pass tightens.
     Section padding is untouched. What changes is the three gaps inside a
     section head, so an eyebrow reads as attached to its heading and the
     heading as attached to its lead line, rather than all three floating
     equally far apart. */
  --rhythm-eyebrow: 16px;   /* eyebrow to h2 */
  --rhythm-lead: 20px;      /* h2 to lead */
  --rhythm-content: 40px;   /* lead to the content under it */

  /* The height the fixed head reserves at the top of every hero. It is a
     fixed number rather than a measurement because the top bar is held to one
     line at every width, which is what makes it predictable. */
  --head-h: 140px;

  /* The hero's own minimum height, and the inner pages' photo hero, which the
     brief sets at 440 to 520. */
  --hero-min: 820px;
  --pagehead-min: 480px;

  --r-sm: 12px;
  --r-tile: 16px;
  --r-panel: 18px;
  --r-photo: 20px;
  --r-lg: 22px;
  --r-card: 14px;
  --r-pill: 999px;

  --shadow-film: 0 40px 120px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 18px 40px -24px rgba(10, 22, 40, 0.4);

  /* -------------------------------------------------------------------------
     MOTION, WHAT LITTLE OF IT LIVES HERE

     One easing and one hover duration, which is all site.css still needs: a
     transition on a real state change, such as a button hover, the chevron on
     an open accordion or the head going solid on scroll. Everything with a
     timeline moved to motion.css and motion.js in the typography and motion
     pass, and declares its own numbers there, so there is one file to read
     when asking what moves and why.

     --rise-distance and --rise-duration are gone with the scroll reveal that
     used them. A token nothing reads is the one the next person reaches for
     when they want to invent a second motion system.
  ------------------------------------------------------------------------- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --hover-duration: 220ms;
}

@media (max-width: 1080px) {
  :root {
    --head-h: 132px;
  }
}

@media (max-width: 860px) {
  :root {
    --section-y: 72px;
    --section-y-tight: 56px;
    --hero-min: 760px;
    --pagehead-min: 440px;
  }
}

@media (max-width: 560px) {
  :root {
    --head-h: 124px;
  }
}
