/* =============================================================================
   THE GREAT TRUE-UP: theme.
   -----------------------------------------------------------------------------
   The ONLY file in this folder allowed to hold raw values (colours, px, rem, font
   stacks), the same rule styles/primitives.css has for the app. stage.css uses
   these names and nothing else.

   Co-brand theme: Stiles and Intelligent Buildings (IB), as partners.
     Stiles   crimson #B41F24 (the single accent), slate #1F3841, ink #222222,
              paper #FAF9F5, mist #C4C6C6, cloud #EFEFEF, Baskerville display.
     IB       navy #122048 and orange #E8540A, from its mark.
   The illustration is a flat Courthouse Square street elevation (Hill Valley): muted warm
   brick, cream and blue-grey, a pale sun, green trees, a slate road. Characters wear the
   brand: the owner crimson, the operator slate. Navy is the shared evidence layer; ochre is
   the thread of light and the "today" worry colour.

   System font stacks only: the page makes no network request after it loads.
   ========================================================================== */
:root {
  /* Brand constants */
  --gt-crimson:     #B41F24;
  --gt-navy:        #122048;
  --gt-orange:      #E8540A;

  /* The colour names the app's one animated TrueUp mark reads (js/trueup-mark.js): its two bars. */
  --color-brand-slate:   #1F3841;
  --color-brand-crimson: #B41F24;

  /* Surfaces and ink: light */
  --gt-bg:          #FAF9F5;
  --gt-surface:     #FFFFFF;
  --gt-plate:       #FFFFFF;
  --gt-plate-ink:   #5A6468;   /* text on the logo plate: the plate stays light in both schemes */
  --gt-on-fill:     #FFFFFF;
  --gt-ink:         #222222;
  --gt-head:        #1F3841;
  --gt-struct:      #1F3841;
  --gt-muted:       #5A6468;
  --gt-line:        #C4C6C6;
  --gt-line-soft:   #E2E1DB;
  --gt-soft:        #EFEFEF;

  /* Connected, owner, brand */
  --gt-accent:      #B41F24;
  --gt-accent-fill: #B41F24;
  --gt-accent-ink:  #FFFFFF;
  --gt-accent-soft: #F7E6E4;

  /* The shared evidence layer (IB navy) */
  --gt-layer:       #122048;
  --gt-layer-soft:  #E4E8F2;

  /* Today: the worry state */
  --gt-warn:        #8A5300;
  --gt-warn-fill:   #8A5300;
  --gt-warn-soft:   #F8EBD0;

  --gt-focus:       #0B5FD6;

  /* ---- The scene: Courthouse Square, flat shapes, muted and warm ---- */
  --gt-sky-a0:      #CCD6E3;   /* overcast morning: top */
  --gt-sky-a1:      #E9E6DD;   /* overcast morning: horizon */
  --gt-sky-b0:      #D5E1EE;   /* dawn: top */
  --gt-sky-b1:      #F7E6C9;   /* dawn: horizon */
  --gt-sun:         #F3D88E;
  --gt-sun-halo:    #F8E7B6;
  --gt-cloud:       #FFFFFF;
  --gt-hill:        #D2DBC4;
  --gt-hill-2:      #C3D0B8;
  --gt-brick:       #B65E4C;
  --gt-brick-d:     #97493B;
  --gt-cream:       #EEDFB6;
  --gt-cream-d:     #DDCB98;
  --gt-blue:        #BAC5D7;
  --gt-blue-d:      #A4B1C8;
  --gt-stone:       #CFC4A6;
  --gt-navy-sign:   #1D2A4F;
  --gt-trim:        #C9A55B;
  --gt-roof:        #2E3A5C;
  --gt-glass:       #BCD0E4;
  --gt-glass-d:     #9EB5CE;
  --gt-lit:         #F7CB6B;
  --gt-door:        #6B4A3A;
  --gt-leaf:        #7FA088;
  --gt-leaf-d:      #6B8E75;
  --gt-trunk:       #7B6048;
  --gt-walk:        #EAE2D1;
  --gt-walk-line:   #D3C9B3;
  --gt-curb:        #CFC6B2;
  --gt-road:        #4D5763;
  --gt-road-dash:   #E9ECEF;
  --gt-shadow:      rgba(31, 56, 65, 0.16);
  --gt-sign-ink:    #FFFFFF;
  --gt-sign-ink-d:  #1D2A4F;
  --gt-place-ink:   #1D2A4F;
  --gt-place-sub:   #5A6468;
  --gt-car-red:     #C0463C;
  --gt-car-teal:    #5E9496;

  /* The cast */
  --gt-skin-owner:  #7A4A30;
  --gt-skin-op:     #D49A6E;
  --gt-skin-tenant: #B9805A;
  --gt-hair-owner:  #CDD1D3;
  --gt-hair-op:     #2A2522;
  --gt-coat:        #B41F24;
  --gt-coat-d:      #8C171C;
  --gt-rim:         #F4E7D2;
  --gt-scarf:       #E0A23A;
  --gt-scarf-d:     #C4872A;
  --gt-bag:         #8A6140;
  --gt-pants:       #2B3340;
  --gt-blazer:      #1F3841;
  --gt-blazer-d:    #162A31;
  --gt-shirt:       #FAF6EC;
  --gt-ink-line:    #2A2522;
  --gt-blush:       #D9776A;

  /* Paper, thread and light */
  --gt-paper:       #FFFDF7;
  --gt-paper-edge:  #CDBB98;
  --gt-paper-line:  #B9AE98;
  --gt-glow:        #F7C25B;
  --gt-thread:      #D9971F;
  --gt-thread-dim:  #A89A86;
  --gt-pill:        #FFFDF7;
  --gt-pill-ink:    #222222;
  --gt-coin:        #E6B23C;
  --gt-coin-d:      #C9921F;

  /* Type */
  --gt-font-display: "Baskerville", "Libre Baskerville", "Baskerville Old Face", "Hoefler Text", Georgia, "Times New Roman", serif;
  --gt-font-body:    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gt-font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gt-text-xs:   0.8125rem;
  --gt-text-sm:   0.9375rem;
  --gt-text-md:   1.0625rem;
  --gt-text-lg:   clamp(1.25rem, 0.9rem + 1.4vw, 1.625rem);
  --gt-text-xl:   clamp(1.75rem, 1rem + 2.6vw, 2.75rem);
  --gt-text-xxl:  clamp(2rem, 1rem + 3.8vw, 3.5rem);
  --gt-text-num:  clamp(1.75rem, 1.2rem + 1.6vw, 2.25rem);

  /* SVG text sizes are in diagram units, not screen pixels. The tall scene is drawn near 1:1 on a phone. */
  --gt-svg-label: 14px;
  --gt-svg-q:     30px;
  --gt-svg-place: 13px;
  --gt-svg-sign:  13px;
  --gt-svg-label-t: 12.5px;
  --gt-svg-q-t:   26px;
  --gt-svg-place-t: 11.5px;

  /* Space */
  --gt-space-1: 0.25rem;
  --gt-space-2: 0.5rem;
  --gt-space-3: 0.75rem;
  --gt-space-4: 1rem;
  --gt-space-5: 1.5rem;
  --gt-space-6: 2rem;
  --gt-space-7: 3rem;
  --gt-space-8: 4.5rem;

  --gt-radius:    0;
  --gt-radius-art: 1rem;      /* the illustrated plate on a large screen */
  --gt-radius-pill: 62.5rem;

  /* Layout */
  --gt-gutter:   1rem;
  --gt-bar-h:    3.5rem;
  --gt-stage-h:  clamp(13rem, 36svh, 23rem);
  --gt-cap-h:    4.5rem;    /* room kept under the plate for its caption */
  --gt-copy-w:   31rem;
  --gt-page-w:   78rem;
  --gt-tap:      2.75rem;

  /* Logos */
  --gt-logo-stiles: 1.25rem;
  --gt-logo-ib:     1.75rem;

  /* Motion: short, and only ever after the visitor acts */
  --gt-dur:  0.7s;
  --gt-dur-s: 0.25s;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-brand-slate:   #A9BEC5;
    --color-brand-crimson: #E8595E;
    --gt-bg:          #111C21;
    --gt-surface:     #1A2A31;
    --gt-ink:         #ECE9E1;
    --gt-head:        #F6F3EC;
    --gt-struct:      #A9BEC5;
    --gt-muted:       #A5B2B6;
    --gt-line:        #3A4E56;
    --gt-line-soft:   #26373E;
    --gt-soft:        #1F3038;

    --gt-accent:      #F2696D;
    --gt-accent-fill: #B41F24;
    --gt-accent-ink:  #111C21;
    --gt-accent-soft: #3A2024;

    --gt-layer:       #A6B8F2;
    --gt-layer-soft:  #1E2A4A;

    --gt-warn:        #EBA83C;
    --gt-warn-fill:   #EBA83C;
    --gt-warn-soft:   #35290F;

    --gt-focus:       #86B4FF;

    /* The same square at dusk: indigo sky, an ember horizon, lit windows */
    --gt-sky-a0:      #1D2740;
    --gt-sky-a1:      #3C4764;
    --gt-sky-b0:      #232B52;
    --gt-sky-b1:      #D58E63;
    --gt-sun:         #F2B063;
    --gt-sun-halo:    #E58A55;
    --gt-cloud:       #4A5578;
    --gt-hill:        #243A38;
    --gt-hill-2:      #1E312F;
    --gt-brick:       #8A4539;
    --gt-brick-d:     #6E352C;
    --gt-cream:       #A8997A;
    --gt-cream-d:     #8F8164;
    --gt-blue:        #55627F;
    --gt-blue-d:      #46526D;
    --gt-stone:       #8A8068;
    --gt-navy-sign:   #141C38;
    --gt-trim:        #B08F47;
    --gt-roof:        #1B2442;
    --gt-glass:       #243B52;
    --gt-glass-d:     #1C3043;
    --gt-lit:         #F6BE5B;
    --gt-door:        #4A3226;
    --gt-leaf:        #4E7258;
    --gt-leaf-d:      #3F6049;
    --gt-trunk:       #5E4836;
    --gt-walk:        #4C4A48;
    --gt-walk-line:   #5E5B58;
    --gt-curb:        #5A5754;
    --gt-road:        #1F262E;
    --gt-road-dash:   #A9B0B8;
    --gt-shadow:      rgba(0, 0, 0, 0.3);
    --gt-place-ink:   #F6F3EC;
    --gt-place-sub:   #C9D3D6;
    --gt-coat:        #C22A30;
    --gt-coat-d:      #9A1E24;
    --gt-blazer:      #3D5C69;
    --gt-blazer-d:    #2D4753;
    --gt-pants:       #1A202B;
    --gt-thread:      #F2B54A;
    --gt-thread-dim:  #7E8794;
    --gt-glow:        #F7C25B;
    color-scheme: dark;
  }
}

/* A phone on its side is short: give the content the height. */
@media (max-height: 480px) {
  :root {
    --gt-bar-h: 3rem;
    --gt-logo-stiles: 1rem;
    --gt-logo-ib:     1.4rem;
  }
}

/* A wide desktop gives the diagram more room. */
@media (min-width: 1200px) {
  :root {
    --gt-page-w: 88rem;
    --gt-logo-stiles: 1.5rem;
    --gt-logo-ib:     2.125rem;
  }
}

/* =============================================================================
   THE INTELLIGENT BUILDINGS (IB) ONLY VERSION: the same page in IB's own colours, for IB's clients and prospects.
   The shell sets data-brand="ib" on <html> when a link was made for that version (viewer.js); nothing here applies otherwise.
   IB navy #122048 and orange #E8540A are from its mark and the IntelliNet portal; page grey, ink and muted are the portal's.
   The brand orange is for decoration (the bar's rule, the logo plate's underline). Text and button fills use a darker orange (#B93D0A) so
   white on it and it on the page pass 4.5:1; tests/great-true-up.spec.js measures both schemes. The owner's coat is orange and the
   operator's blazer navy, where the Stiles version has crimson and slate. No Stiles colour is used.
   ========================================================================== */
:root[data-brand="ib"] {
  --gt-crimson:     #E8540A;

  --gt-bg:          #F5F6F8;
  --gt-plate-ink:   #475569;
  --gt-ink:         #1E293B;
  --gt-head:        #122048;
  --gt-struct:      #122048;
  --gt-muted:       #4F5D75;
  --gt-line:        #CBD5E1;
  --gt-line-soft:   #E2E8F0;
  --gt-soft:        #EEF1F6;

  --gt-accent:      #B93D0A;
  --gt-accent-fill: #B93D0A;
  --gt-accent-soft: #FEF1E8;

  --gt-coat:        #D9531E;
  --gt-coat-d:      #B3430F;
  --gt-blazer:      #22336B;
  --gt-blazer-d:    #162250;
}
@media (prefers-color-scheme: dark) {
  :root[data-brand="ib"] {
    --gt-bg:          #0E1630;
    --gt-surface:     #172244;
    --gt-ink:         #E8ECF4;
    --gt-head:        #FFFFFF;
    --gt-struct:      #AAB8E0;
    --gt-muted:       #A9B4CC;
    --gt-line:        #34436E;
    --gt-line-soft:   #243157;
    --gt-soft:        #1B2850;

    --gt-accent:      #FF8A4C;
    --gt-accent-fill: #C2410C;
    --gt-accent-ink:  #FFFFFF;
    --gt-accent-soft: #3A2418;

    --gt-layer:       #AFC0F5;
    --gt-layer-soft:  #1E2A4A;

    --gt-coat:        #E2621F;
    --gt-coat-d:      #B84A12;
    --gt-blazer:      #3E5593;
    --gt-blazer-d:    #2D4073;
  }
}
