/* ==========================================================================
   Adkinsio after dark
   Loaded only when the visitor's device is set to dark mode. There is no
   switch on the site: it simply follows the phone or laptop setting.
   Slate grounds, cream type, brand orange as the one warm light.
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    /* Grounds: brand slate, with a deeper night slate for the dark chapters */
    --paper: #283d4d;
    --paper-warm: #223545;
    --paper-card: #2e4557;

    /* Type: brand cream */
    --ink: #eee6dd;
    --ink-secondary: #d3d6d4;
    --ink-muted: #aab6bf;
    --ink-soft: #aab6bf;

    /* Dark chapters sink a step deeper so they still read as chapters */
    --slate: #182733;
    --slate-surface: #203240;
    --slate-ink: #f6f3ec;
    --slate-muted: #b9c6d0;

    /* Orange that passes contrast on slate */
    --accent: #ff8a42;
    --accent-on-dark: #ff8a42;

    /* Rules in cream */
    --rule: rgba(238, 230, 221, 0.14);
    --rule-strong: rgba(238, 230, 221, 0.3);
    --rule-dark: rgba(246, 243, 236, 0.16);
    --rule-dark-strong: rgba(246, 243, 236, 0.28);

    /* Fixed dark type for use on cream and orange */
    --night-ink: #15212b;
    --field: #1d2f3c;

    /* Grain lightens rather than darkens on a dark ground */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.93 0 0 0 0 0.9 0 0 0 0 0.87 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  body::before { mix-blend-mode: screen; }

  /* Multiply would turn images black on slate */
  .editorial-figure img,
  .hero-visual-band img,
  .plate-card img { mix-blend-mode: normal; }

  /* Header and footer: night slate */
  .site-header { background: rgba(24, 39, 51, 0.97); }
  .site-header.is-scrolled { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }

  /* Buttons: cream on slate, dark type on cream and orange */
  .btn-primary,
  .contact-submit .btn { color: var(--night-ink); }
  .btn-primary:hover,
  .contact-submit .btn:hover { background: #ffffff; border-color: #ffffff; color: var(--night-ink); }
  .surface-dark .btn-primary,
  .a2-side-card--dark .btn-primary,
  .a2-band .btn-primary,
  .share-btn.is-copied { color: var(--night-ink); }
  .surface-dark .btn-primary:hover,
  .a2-side-card--dark .btn-primary:hover,
  .a2-band .btn-primary:hover { background: #ff8a42; border-color: #ff8a42; }
  .btn-secondary:hover { background: rgba(238, 230, 221, 0.06); }
  .header-cta { color: var(--night-ink); }
  .filter-pill:hover,
  .filter-pill.is-active,
  .topic-chips input:checked + span { color: var(--night-ink); }
  .share-btn:hover,
  .share-btn:focus-visible { background: var(--ink); color: var(--night-ink); border-color: var(--ink); }

  /* Places that used slate as a type colour */
  .article-body--dropcap > p:first-of-type::first-letter,
  .a2-head h1 em { color: var(--accent); }
  .dossier-rail { border-top-color: var(--ink); }

  /* Form fields */
  .field input,
  .field select,
  .field textarea,
  .contact-form .field input,
  .contact-form .field textarea,
  .topic-chips span { background: var(--field); color: var(--ink); }
  .field input::placeholder,
  .field textarea::placeholder { color: rgba(238, 230, 221, 0.5); }
  .contact-form { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6); }

  /* Soften the bright portrait background a touch after dark */
  .founder-portrait img { filter: brightness(0.9); }

  .office-plate:hover { background: rgba(238, 230, 221, 0.05); }
  .a2-body mark { background: linear-gradient(transparent 55%, rgba(255, 117, 31, 0.35) 55%); }

  /* ------------------------------------------------------------------
     Illustrations after dark. The colour map below this block is
     generated by the build; here the windows come on.
     ------------------------------------------------------------------ */
  :is(.plate-svg, .hero-plate-svg, .street-svg) .lit[class] {
    fill: #ff751f;
    filter: drop-shadow(0 0 3px rgba(255, 117, 31, 0.55));
  }
  :is(.plate-svg, .hero-plate-svg, .street-svg) .lit.lit-soft[class] {
    fill: #f6b26b;
    filter: drop-shadow(0 0 2px rgba(246, 178, 107, 0.45));
  }

  /* Street doors glow at night rather than waiting for a hover */
  .street-svg .st-or,
  .street-svg:hover .st-bldg:nth-of-type(2):not(:hover) .st-or { fill: #ff751f; }
  .street-svg .st-or-s,
  .street-svg:hover .st-bldg:nth-of-type(2):not(:hover) .st-or-s { stroke: #ff751f; }
}

/* Generated by scripts/night.py: night versions of the drawing colours. */
@media (prefers-color-scheme: dark) {
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#15212b"] { fill: #1b2934; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#1b2833"] { fill: #1c2a35; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#283d4d"] { fill: #202f3b; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#3e5669"] { fill: #253541; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#5d7486"] { fill: #2d3c48; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#7a9893"] { fill: #33454d; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#7d8f9e"] { fill: #34434f; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#8d8aa3"] { fill: #364352; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#8f9a84"] { fill: #36454d; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#9aa27c"] { fill: #3b4747; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#9aa58f"] { fill: #384850; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#9b869b"] { fill: #384250; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#9b9289"] { fill: #37454f; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#9c7a6b"] { fill: #3a3e44; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#a38585"] { fill: #3c414b; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#a88a7c"] { fill: #3e4247; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#a89273"] { fill: #3e4445; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#a89c6e"] { fill: #3d4644; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#ad9174"] { fill: #3f4445; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#afc4bf"] { fill: #3d525d; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#b3c0cb"] { fill: #3d5160; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#b89f7e"] { fill: #434747; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#b9c0ad"] { fill: #3f5159; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#bdbbcd"] { fill: #405062; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#bec7a8"] { fill: #435452; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#c3cfc4"] { fill: #415561; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#c8c1b9"] { fill: #42525d; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#c9aa9a"] { fill: #49494d; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#cdb592"] { fill: #4a4e4a; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#cdbb9c"] { fill: #4a504d; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#cfb3b3"] { fill: #484b56; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#cfc299"] { fill: #4b524c; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#d1b6a8"] { fill: #4c4c4f; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#d3e0dd"] { fill: #445b69; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#d6dee5"] { fill: #445a6b; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#d8bea3"] { fill: #4f504d; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#d9ddd0"] { fill: #465a64; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#dcdbe6"] { fill: #46596c; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#dfe3d2"] { fill: #495c63; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#dfe6e3"] { fill: #465d6c; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#e3dfda"] { fill: #485b69; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#e5dbe5"] { fill: #49596c; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#e6d3c9"] { fill: #535458; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#e6ddd0"] { fill: #4e5a5f; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#e8d6d6"] { fill: #4d5563; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#e8dcc6"] { fill: #575a53; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#e9e1c4"] { fill: #585f52; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#ead8cf"] { fill: #54555a; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#efdcca"] { fill: #5b5752; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [fill="#f3ede3"] { fill: #515f66; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#15212b"] { stroke: #dfd9d0; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#1b2833"] { stroke: #ddd8ce; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#283d4d"] { stroke: #d7d3cb; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#3e5669"] { stroke: #cdcbc6; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#5d7486"] { stroke: #c0c1bf; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#63807b"] { stroke: #c0c1bf; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#667886"] { stroke: #bebfbe; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#74718a"] { stroke: #babdbc; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#77826d"] { stroke: #bdbfbd; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#806c80"] { stroke: #bebfbe; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#80776f"] { stroke: #bdbfbd; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#808865"] { stroke: #bdbfbd; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#808b76"] { stroke: #b8bcbb; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#826153"] { stroke: #c3c3c0; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#886b6b"] { stroke: #bcbebd; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#8c8158"] { stroke: #bfc1bf; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#8d7064"] { stroke: #bcbebd; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#8d785b"] { stroke: #bec0be; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#91765c"] { stroke: #bdbfbd; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#afc4bf"] { stroke: #9aa4ab; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#b3c0cb"] { stroke: #97a2a9; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#b9c0ad"] { stroke: #9ba6ac; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#bdbbcd"] { stroke: #94a0a7; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#bec7a8"] { stroke: #9ba5ab; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#c8c1b9"] { stroke: #96a1a9; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#c9aa9a"] { stroke: #9ea8ad; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#cbb9cb"] { stroke: #95a1a8; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#cdbb9c"] { stroke: #9da7ac; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#cfb3b3"] { stroke: #95a1a8; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#cfc299"] { stroke: #9da7ac; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#d1b6a8"] { stroke: #98a3aa; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#d8bea3"] { stroke: #97a3a9; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#e6ddd0"] { stroke: #8695a0; }
  :is(.plate-svg, .hero-plate-svg, .street-svg) [stroke="#f3ede3"] { stroke: #7c8e9b; }
}
