/* ==========================================================================
   The Researcher — Design Tokens
   ----------------------------------------------------------------------------
   An ALD-flagship register: a bone-and-walnut scholar's study that warms and
   dims across the day. MORNING is light — cream room, walnut ink, forest
   green, aged brass, with a dark walnut terminal inset. EVENING is golden-hour
   dusk. NIGHT is coffee-black with forest undertone and dim ember.

   Three layers per window: the dark walnut TERMINAL, the room-toned ENGAGEMENT
   surface, and the PAPER Mentor Brief. Plus gallery chrome (--page-*) for the
   contact-sheet that holds the windows.
   ========================================================================== */

:root {
  --ff-display: 'Fraunces', 'GT Sectra', 'Times New Roman', serif;
  --ff-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ff-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-7: 32px; --s-8: 48px; --s-9: 64px; --s-10: 96px;

  --r-0: 0px; --r-1: 2px; --r-2: 6px; --r-3: 12px; --r-4: 18px; --r-pill: 9999px;
}

/* ==========================================================================
   MORNING  ·  light  ·  "first light in the study"
   bone + cream · walnut ink · forest green · aged brass
   ========================================================================== */
[data-theme="morning"] {
  /* gallery chrome */
  --page-bg:   #DED2B9;
  --page-ink:  #2C2317;
  --page-ink2: #6A5B44;
  --page-ink3: #9A8A6E;
  --page-line: rgba(44, 35, 23, 0.16);

  /* window room — bone */
  --bg:      #EDE4D0;
  --bg-lift: #E5DAC2;
  --surface: #F2EBDB;
  --raised:  #F7F1E4;
  --hover:   #EBE1CE;

  --t1: #2C2317;   /* espresso walnut */
  --t2: #6A5B44;   /* walnut */
  --t3: #9A8A6E;   /* aged oak */
  --t4: #C2B499;   /* ghost */

  --line-faint:  rgba(44, 35, 23, 0.05);
  --line:        rgba(44, 35, 23, 0.10);
  --line-strong: rgba(44, 35, 23, 0.18);
  --line-glow:   rgba(44, 35, 23, 0.26);

  --accent:        #98712F;   /* aged brass — deep for cream */
  --accent-bright: #AE873B;
  --accent-deep:   #75561F;
  --accent-fill:   rgba(152, 113, 47, 0.10);
  --accent-fill-2: rgba(152, 113, 47, 0.18);
  --accent-line:   rgba(152, 113, 47, 0.30);
  --accent-glow:   rgba(152, 113, 47, 0.22);
  --accent-ink:    #FBF6EA;

  --good:      #355C40;   /* forest green */
  --good-fill: rgba(53, 92, 64, 0.12);
  --bad:       #9C4636;   /* burgundy clay */
  --bad-fill:  rgba(156, 70, 54, 0.10);

  /* terminal — dark walnut inset */
  --term-bg:    #211910;
  --term-text:  #DACBAE;
  --term-dim:   #8C7A5E;
  --term-faint: #5E5040;
  --term-ok:    #88A06A;   /* forest sage — complete */
  --term-warn:  #CBA350;   /* brass — in progress */
  --term-bad:   #C4715E;   /* clay — friction */
  --term-path:  #AC9270;
  --term-key:   #C2A87E;

  /* paper — Mentor Brief, cool bone with forest accent */
  --paper:       #E4E1CD;
  --paper-lift:  #DAD6BF;
  --paper-sunk:  #ECEAD9;
  --paper-ink:   #28281B;
  --paper-ink2:  #565540;
  --paper-ink3:  #87836A;
  --paper-line:  rgba(40, 40, 27, 0.10);
  --paper-line2: rgba(40, 40, 27, 0.18);
  --paper-accent: #46684A;   /* forest green — capability marker */

  --cover-shade: rgba(70, 52, 24, 0.14);

  --label: 'Morning session';
}

/* ==========================================================================
   EVENING  ·  dusk  ·  "golden hour, the lamps come on"
   warm umber room · amber brass · tobacco paper
   ========================================================================== */
[data-theme="evening"] {
  --page-bg:   #1A130C;
  --page-ink:  #EFE2CC;
  --page-ink2: #B19A77;
  --page-ink3: #7B6747;
  --page-line: rgba(239, 226, 204, 0.14);

  --bg:      #241B12;
  --bg-lift: #2B2117;
  --surface: #2F261A;
  --raised:  #382E20;
  --hover:   #423728;

  --t1: #EFE2CC;
  --t2: #B19A77;
  --t3: #7B6747;
  --t4: #4E4130;

  --line-faint:  rgba(239, 226, 204, 0.04);
  --line:        rgba(239, 226, 204, 0.09);
  --line-strong: rgba(239, 226, 204, 0.17);
  --line-glow:   rgba(239, 226, 204, 0.24);

  --accent:        #C99A4E;   /* amber brass */
  --accent-bright: #DDB266;
  --accent-deep:   #9C7530;
  --accent-fill:   rgba(201, 154, 78, 0.10);
  --accent-fill-2: rgba(201, 154, 78, 0.18);
  --accent-line:   rgba(201, 154, 78, 0.28);
  --accent-glow:   rgba(201, 154, 78, 0.22);
  --accent-ink:    #241B12;

  --good:      #7E9560;   /* warm olive-forest */
  --good-fill: rgba(126, 149, 96, 0.12);
  --bad:       #C2705A;
  --bad-fill:  rgba(194, 112, 90, 0.10);

  --term-bg:    #160F08;
  --term-text:  #CFBC99;
  --term-dim:   #816E50;
  --term-faint: #574832;
  --term-ok:    #8E9E68;
  --term-warn:  #D4A85C;
  --term-bad:   #C2705A;
  --term-path:  #AA8F68;
  --term-key:   #C2A476;

  --paper:       #DDCDB0;   /* aged tobacco paper */
  --paper-lift:  #D3C2A2;
  --paper-sunk:  #E6D8BE;
  --paper-ink:   #2C2316;
  --paper-ink2:  #5C4C36;
  --paper-ink3:  #8A7858;
  --paper-line:  rgba(44, 35, 22, 0.11);
  --paper-line2: rgba(44, 35, 22, 0.20);
  --paper-accent: #5E6B40;   /* deep olive */

  --cover-shade: rgba(0, 0, 0, 0.42);

  --label: 'Evening session';
}

/* ==========================================================================
   NIGHT  ·  dark  ·  "the lamp and the ledger"
   coffee black + forest undertone · dim ember · burgundy
   ========================================================================== */
[data-theme="night"] {
  --page-bg:   #080A07;
  --page-ink:  #E4E0D2;
  --page-ink2: #8C8A76;
  --page-ink3: #565A4C;
  --page-line: rgba(228, 224, 210, 0.13);

  --bg:      #0C0F0B;
  --bg-lift: #11150F;
  --surface: #141A14;
  --raised:  #1B221A;
  --hover:   #232C22;

  --t1: #E4E0D2;
  --t2: #8C8A76;
  --t3: #565A4C;
  --t4: #353A30;

  --line-faint:  rgba(228, 224, 210, 0.04);
  --line:        rgba(228, 224, 210, 0.09);
  --line-strong: rgba(228, 224, 210, 0.16);
  --line-glow:   rgba(228, 224, 210, 0.24);

  --accent:        #B8924E;   /* dim ember brass */
  --accent-bright: #CFA862;
  --accent-deep:   #8A6A30;
  --accent-fill:   rgba(184, 146, 78, 0.10);
  --accent-fill-2: rgba(184, 146, 78, 0.18);
  --accent-line:   rgba(184, 146, 78, 0.28);
  --accent-glow:   rgba(184, 146, 78, 0.22);
  --accent-ink:    #0C0F0B;

  --good:      #5E7A52;   /* forest */
  --good-fill: rgba(94, 122, 82, 0.14);
  --bad:       #A85A52;   /* burgundy */
  --bad-fill:  rgba(168, 90, 82, 0.10);

  --term-bg:    #060805;
  --term-text:  #C2BBA2;
  --term-dim:   #6A6450;
  --term-faint: #424032;
  --term-ok:    #7E966A;   /* forest */
  --term-warn:  #C79A52;   /* ember */
  --term-bad:   #B5685C;   /* burgundy */
  --term-path:  #9A9072;
  --term-key:   #B0A480;

  --paper:       #D8CFB8;
  --paper-lift:  #CEC4AB;
  --paper-sunk:  #E2DAC4;
  --paper-ink:   #26261C;
  --paper-ink2:  #555444;
  --paper-ink3:  #84826C;
  --paper-line:  rgba(38, 38, 28, 0.10);
  --paper-line2: rgba(38, 38, 28, 0.18);
  --paper-accent: #46684A;   /* forest green — capability marker */

  --cover-shade: rgba(0, 0, 0, 0.5);

  --label: 'Night session';
}

/* ==========================================================================
   Type roles
   ========================================================================== */
.t-display {
  font-family: var(--ff-display);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.04;
}
.t-display-italic {
  font-family: var(--ff-display);
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.01em;
}
.t-title {
  font-family: var(--ff-body);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.t-body {
  font-family: var(--ff-body);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.0em;
}
.t-meta {
  font-family: var(--ff-mono);
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.t-mono {
  font-family: var(--ff-mono);
  font-weight: 400;
  letter-spacing: -0.005em;
  font-feature-settings: 'tnum' 1;
}

/* ==========================================================================
   Reset
   ========================================================================== */
* { box-sizing: border-box; }

::selection {
  background: var(--accent-fill-2);
  color: var(--t1);
}

/* ==========================================================================
   Accent intensity — theme-relative via color-mix on the [data-theme] subtree
   ========================================================================== */
body[data-accent="whisper"] [data-theme],
body[data-accent="whisper"][data-theme] {
  --accent-fill:   color-mix(in srgb, var(--accent) 6%, transparent);
  --accent-fill-2: color-mix(in srgb, var(--accent) 11%, transparent);
  --accent-line:   color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-glow:   color-mix(in srgb, var(--accent) 12%, transparent);
}
body[data-accent="punctuation"] [data-theme],
body[data-accent="punctuation"][data-theme] {
  --accent-fill:   color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-fill-2: color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-line:   color-mix(in srgb, var(--accent) 28%, transparent);
  --accent-glow:   color-mix(in srgb, var(--accent) 20%, transparent);
}
body[data-accent="editorial"] [data-theme],
body[data-accent="editorial"][data-theme] {
  --accent-fill:   color-mix(in srgb, var(--accent) 15%, transparent);
  --accent-fill-2: color-mix(in srgb, var(--accent) 26%, transparent);
  --accent-line:   color-mix(in srgb, var(--accent) 40%, transparent);
  --accent-glow:   color-mix(in srgb, var(--accent) 32%, transparent);
}

/* ==========================================================================
   Type voice — serif-led (default) vs sans-led display
   ========================================================================== */
body[data-type="sans"] .t-display,
body[data-type="sans"] .t-display-italic {
  font-family: var(--ff-body) !important;
  font-style: normal !important;
  font-weight: 300 !important;
  letter-spacing: -0.03em !important;
}
