/* ==========================================================
   GFJ material system — the layer that gives the platform its
   depth, loaded after each page's own styles so it composes
   rather than fights them.

   Written against the 2026 brand guidelines, which rule out the
   usual "glassmorphism" shortcuts: corners stay square, gold
   stays under 5% and never fills a field, and there are no
   gradients, shine, or decorative shadows.

   So the modern feel here comes from the honest sources:
   translucency only where a layer genuinely sits above another,
   hairlines that appear the moment content slides beneath the
   chrome, elevation used to say "this floats" and never for
   ornament, and motion with real easing. Material, not makeup.
   ========================================================== */

:root{
  /* glass is for chrome only — the bar content scrolls under */
  --glass:            rgba(247,247,245,.72);
  --glass-solid:      rgba(247,247,245,.94);
  --glass-blur:       saturate(180%) blur(20px);
  --hairline:         rgba(26,26,26,.09);
  --hairline-strong:  rgba(26,26,26,.16);

  /* elevation says "this layer floats". never decoration. */
  --lift-1: 0 1px 1px rgba(26,26,26,.04);
  --lift-2: 0 6px 20px -6px rgba(26,26,26,.13);
  --lift-3: 0 18px 44px -12px rgba(26,26,26,.22);

  /* motion: decelerating like a real object, never linear */
  --ease:        cubic-bezier(.22,.68,0,1);
  --ease-spring: cubic-bezier(.34,1.30,.64,1);
  --t-fast: 160ms; --t-mid: 260ms; --t-slow: 420ms;
}

/* ---------- chrome: glass that reacts to the content beneath ---------- */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)){
  body.gfj header{
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
            backdrop-filter: var(--glass-blur);
    transition: background var(--t-mid) var(--ease),
                box-shadow var(--t-mid) var(--ease),
                border-color var(--t-mid) var(--ease);
  }
}
/* Sticky chrome runs edge to edge — a bar, not a floating card — while its
   contents stay aligned with the content column beneath. */
body.gfj header[data-chrome]{
  margin-inline: calc(50% - 50vw);
  padding-inline: max(20px, calc(50vw - 50% + 20px));
}

/* the hairline and lift arrive only once something is actually under it */
body.gfj header{ border-bottom-color: transparent; }
body.gfj.is-scrolled header{
  border-bottom-color: var(--hairline);
  box-shadow: var(--lift-2);
}

/* ---------- surfaces that respond to the pointer ---------- */
.slot, .tile, .sess, .pcard, .clientrow{
  transition: border-color var(--t-fast) var(--ease),
              background   var(--t-fast) var(--ease),
              box-shadow   var(--t-mid)  var(--ease),
              transform    var(--t-mid)  var(--ease);
  will-change: transform;
}
.slot:hover, .tile:hover, .sess:hover, .pcard:hover{
  transform: translateY(-1px);
  box-shadow: var(--lift-1);
}
.slot:active, .tile:active{ transform: translateY(0); transition-duration: 60ms; }

/* a pressed control should feel pressed */
button:not(.link):active{ transform: scale(.985); }
button{ transition: background var(--t-fast) var(--ease), transform 90ms var(--ease),
                    border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }

/* one focus treatment everywhere, in the accent */
:focus-visible{ outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- floating layers ---------- */
#vdock{ box-shadow: var(--lift-3); }

/* ---------- numbers that line up ---------- */
.tile .v, .tally .n, .count, td, th, time,
.slot .when, .sess .when{ font-variant-numeric: tabular-nums; }

/* ---------- staged entrance ----------
   Elements opt in with data-reveal; --i staggers siblings.        */
/* Hidden only when the page has declared it can animate. No JS, no hiding. */
.gfj-anim [data-reveal]{
  opacity: 0;
  transform: translateY(10px);
}
[data-reveal].in{
  opacity: 1;
  transform: none;
  transition: opacity var(--t-slow) var(--ease),
              transform var(--t-slow) var(--ease);
  transition-delay: calc(var(--i, 0) * 55ms);
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  .gfj-anim [data-reveal]{ opacity: 1; transform: none; }
  .slot:hover, .tile:hover, .sess:hover, .pcard:hover{ transform: none; }
}

/* ==========================================================
   THEME — light is the default ground; dark is the guide's
   Charcoal ground with Soft White type. Both palettes come from
   the brand's five colours. The guide's own contrast notes are
   the spec here: Soft White on Charcoal 16.1:1, Gold on Charcoal
   7.2:1, and Warm Gray text — which "belongs on Charcoal, not on
   Soft White" — finally gets its proper home as dark captions.
   Deep Olive is a ground, not text, on dark: links and labels use
   a lightened tint of the same hue so they stay legible.

   Only the staff surfaces set data-theme. Client-facing pages
   never do, so a visitor always meets the brand's Soft White.
   ========================================================== */
:root{
  --surface-2:     #F1F0EB;   /* tinted panel            */
  --surface-soft:  #FCFBF9;   /* barely-there panel      */
  --surface-warn:  #F6EFDD;   /* warm, gold-adjacent     */
  --surface-ok:    #EAEDE3;   /* olive-adjacent          */
  --surface-muted: #EFEDE8;   /* retired / inactive      */
  --field:         #FFFFFF;   /* inputs                  */
  --gold-ink:      #7A5F1E;   /* gold-family TEXT on light (gold itself fails here) */
  --ink-soft:      #3A3831;
  --ink-press:     #000000;
  --alert-bg:      #1A1A1A;   /* gold on charcoal = 7.2:1 */
  --alert-fg:      #C4A24D;
}

:root[data-theme="dark"]{
  --paper:   #1A1A1A;         /* Charcoal Black, the brand's dark ground */
  --card:    #232321;
  --ink:     #F7F7F5;         /* Soft White — 16.1:1 */
  --caption: #B9B5AC;         /* Warm Gray, where the guide says it belongs */
  --gray:    #8C877E;
  --hair:    #2E2C28;
  --line:    #403D37;
  --olive:   #9BAA7E;         /* Deep Olive lightened for text on Charcoal */
  --olive-dk:#ADBB90;         /* hover brightens on dark */
  --gold:    #C4A24D;         /* unchanged — 7.2:1 on Charcoal */

  --surface-2:     #232321;
  --surface-soft:  #201F1D;
  --surface-warn:  #2C2617;
  --surface-ok:    #1F2419;
  --surface-muted: #262521;
  --field:         #1E1E1C;
  --gold-ink:      #D4B565;   /* gold-family text, lifted for the dark ground */
  --ink-soft:      #D8D5CC;
  --ink-press:     #FFFFFF;
  --alert-bg:      #C4A24D;   /* inverted: charcoal on gold reads on a dark page */
  --alert-fg:      #1A1A1A;

  /* glass and elevation re-tuned: shadows need more weight on dark */
  --glass:       rgba(26,26,26,.72);
  --glass-solid: rgba(26,26,26,.94);
  --hairline:        rgba(247,247,245,.13);
  --hairline-strong: rgba(247,247,245,.22);
  --lift-1: 0 1px 1px rgba(0,0,0,.30);
  --lift-2: 0 6px 20px -6px rgba(0,0,0,.55);
  --lift-3: 0 18px 44px -12px rgba(0,0,0,.70);
}

/* the page ground itself, and a calm cross-fade when switching */
:root[data-theme="dark"] body{ background: var(--paper); color: var(--ink); }
body{ transition: background var(--t-mid) var(--ease), color var(--t-mid) var(--ease); }

/* dark: the sticky chrome's own translucent ground */
:root[data-theme="dark"] body.gfj header{ background: var(--glass); }
/* dark: the video dock already sits on charcoal, so give it an edge */
:root[data-theme="dark"] #vdock{ border-top: 1px solid var(--hairline); }
/* dark: form fields need their text colour stated, not inherited from the OS */
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea{ color: var(--ink); }
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder{ color: var(--gray); }
/* dark: checkboxes and the like follow the accent */
:root[data-theme="dark"]{ color-scheme: dark; }

/* ---------- the control ---------- */
.themetoggle{
  background: none; border: 1px solid var(--line); color: var(--ink);
  min-height: 34px; padding: 5px 11px; font-size: 12.5px; line-height: 1;
  display: inline-flex; align-items: center; gap: 7px;
}
.themetoggle:hover{ background: none; border-color: var(--ink); }
.themetoggle .ico{ font-size: 13px; }
