/* ==========================================================================
   memori tty01 — Design Tokens
   --------------------------------------------------------------------------
   The memori archive language (warm near-black, cream ink, hairlines, one
   ember accent, IBM Plex Mono) carried over from the landing page design
   system and adapted to a single-purpose surface: a text terminal.

   Everything is mono here; the ember accent is the only expressive voice.
   Never hardcode a value that exists as a token — reference one, or
   color-mix() on one.

   Themes: the phosphor is hardware, so `theme` swaps the accent family via
   html[data-theme] (ember stays the brand default). --cream is remapped per
   theme too — every component reads its ink through that one token.
   ========================================================================== */

/* ---- Self-hosted webfont (the only family on this machine) ---------------- */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-normal-400.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+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-normal-500.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+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-normal-600.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+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  /* ---- Surfaces ------------------------------------------------------------ */
  --bg:      #0D0C0A;                  /* the tube's black */
  --bg-2:    #100F0C;                  /* statusbar, inset strips */
  --well:    #0B0A09;                  /* code wells */
  --void:    #080706;                  /* deepest ground */

  /* ---- Ink ------------------------------------------------------------------- */
  --cream:   #EFE9DC;                  /* primary phosphor text */
  --ink:     #14110C;                  /* text on cream/accent surfaces */
  --soft:    rgba(239, 233, 220, 0.72);
  --faint:   rgba(239, 233, 220, 0.56); /* AA floor — decoration may go fainter */
  --ghost:   rgba(239, 233, 220, 0.38); /* tab-completion suggestion — decoration */

  /* ---- Hairlines ---------------------------------------------------------------- */
  --hair:        rgba(239, 233, 220, 0.11);
  --hair-strong: rgba(239, 233, 220, 0.24);
  --line:        rgba(239, 233, 220, 0.20);

  /* ---- Accent — ember (the only accent on-brand) ------------------------------ */
  --accent:      #FF7A29;
  --accent-hi:   #FFA45C;
  --accent-deep: #C2410C;

  /* ---- Typography ------------------------------------------------------------------ */
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', Consolas, Menlo,
               monospace;
  /* Terminal body: comfortable at lounge distance, never below 12px. */
  --fs-term:  clamp(0.84rem, 0.24vw + 0.78rem, 0.95rem);
  --fs-code:  0.92em;                    /* code wells relative to body */
  --fs-micro: 0.66rem;                   /* statusbar — 10.5px readable floor */
  /* The live input must clear iOS zoom-on-focus (16px) on coarse pointers. */
  --fs-input-touch: max(var(--fs-term), 1rem);

  /* ---- Layout ------------------------------------------------------------------------ */
  --screen-pad: clamp(16px, 4vw, 56px);
  --buffer-max: 100ch;                   /* COLUMNS=100, effectively */
  --statusbar-h: 34px;

  /* ---- Cursor (CRT-accurate blink: 1.06 s) ------------------------------------------ */
  --blink: 1.06s;

  /* ---- Motion --------------------------------------------------------------------------- */
  --ease-out:  cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-pop:  cubic-bezier(0.2, 0.9, 0.3, 1.4);
  --dur-fast:  .18s;
  --dur-med:   .25s;
  --type-ms:   22ms;                     /* man-page pager line interval */

  /* ---- Radii / elevation -------------------------------------------------------------------- */
  --radius-s: 2px;
  --radius-l: 4px;
  --toast-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
}

/* ---- Phosphor themes — hardware, not brand ----------------------------------
   ember is the brand accent and the default; green/amber are period-correct
   CRT phosphors; paper is a printed-terminal inversion. Only ink + accent
   families move; surfaces stay warm where possible. -------------------------- */
html[data-theme="green"] {
  --accent:      #3DE07C;
  --accent-hi:   #7CEFA9;
  --accent-deep: #1F9E55;
  --ghost:       rgba(239, 233, 220, 0.34);
}
html[data-theme="amber"] {
  --accent:      #FFB000;
  --accent-hi:   #FFC94D;
  --accent-deep: #C28400;
}
html[data-theme="paper"] {
  color-scheme: light;
  --bg:      #E9E3D5;
  --bg-2:    #E2DCCC;
  --well:    #E4DECE;
  --void:    #D9D2C0;
  --cream:   #171310;
  --ink:     #EFE9DC;
  --soft:    rgba(23, 19, 16, 0.74);
  --faint:   rgba(23, 19, 16, 0.58);
  --ghost:   rgba(23, 19, 16, 0.38);
  --hair:        rgba(23, 19, 16, 0.14);
  --hair-strong: rgba(23, 19, 16, 0.30);
  --line:        rgba(23, 19, 16, 0.24);
  --accent:      #C2410C;
  --accent-hi:   #9A3412;
  --accent-deep: #7C2D12;
}

/* Scanlines multiply on light paper — pull them way back so the printed
   page stays calm. */
html[data-theme="paper"] .crt::before {
  opacity: 0.22;
}
html[data-theme="paper"] .crt::after {
  animation: none;
}
