/* ==========================================================================
   variables.css — self-hosted faces + the STÜDYO OS token set.
   Tokens are normative. Theme-aware (dark default, light via toggle / OS pref).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Faces. latin-ext is required for Turkish (ı İ ş Ş ğ Ğ) — never drop it.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../assets/fonts/geist-latin.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+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../assets/fonts/geist-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../assets/fonts/geistmono-latin.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+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../assets/fonts/geistmono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   Palette tokens — dark is the default world.
   -------------------------------------------------------------------------- */

:root {
  /* --- desktop ground / wallpaper --- */
  --bg: #0c0d11;
  --bg-deep: #08090c;
  --wallpaper-1: #16121a;   /* faint amber bloom top-left  */
  --wallpaper-2: #0b1418;   /* faint teal bloom bottom-right */

  /* --- window surfaces --- */
  --win: #14161b;
  --win-2: #191c22;
  --win-head: #1a1d24;
  --win-inset: #101216;

  /* --- structure --- */
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.22);

  /* --- ink --- */
  --ink: #f1f3f6;
  --ink-2: #aab0bb;
  --ink-3: #7b818d;   /* AA on window surfaces at small sizes */

  /* --- accent: amber / ember --- */
  --accent: #e8623a;
  --accent-2: #f0a24a;
  --accent-soft: rgba(232, 98, 58, 0.14);
  --accent-line: rgba(232, 98, 58, 0.42);
  --on-accent: #180c06;

  /* --- semantic status (separate from accent) --- */
  --live: #5fd08a;
  --live-soft: rgba(95, 208, 138, 0.16);

  /* --- dock / glass --- */
  --glass: rgba(20, 22, 28, 0.62);
  --glass-line: rgba(255, 255, 255, 0.10);

  --shadow-win: 0 26px 60px -30px rgba(0, 0, 0, 0.75);
  --shadow-pop: 0 40px 90px -30px rgba(0, 0, 0, 0.85);

  /* --- faces --- */
  --font-display: 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* --- type scale --- */
  --fs-hero: clamp(38px, 6vw, 82px);
  --fs-h2: clamp(26px, 3.2vw, 40px);
  --fs-h3: 20px;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-label: 10.5px;

  /* --- spacing: 8px base --- */
  --sp-xs: 8px;
  --sp-sm: 16px;
  --sp-md: 24px;
  --sp-lg: 40px;
  --sp-xl: 64px;
  --gutter: 40px;

  /* --- radius: OS surfaces are rounded, not chamfered --- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-win: 16px;

  /* --- motion --- */
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-ui: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 200ms;
  --dur-base: 340ms;
  --dur-slow: 560ms;

  /* --- layout --- */
  --max-w: 1240px;
  --menubar-h: 44px;
  --dock-h: 74px;

  /* --- legacy aliases (kept so charts.js / blog.js stay unchanged) --- */
  --ember: var(--accent);
  --ember-hot: var(--accent-2);
  --steel: var(--ink);
  --steel-2: var(--ink-2);
  --muted: var(--ink-3);
  --hair: var(--line);
  --hair-2: var(--line-2);
  --dim: var(--ink-3);
}

/* --------------------------------------------------------------------------
   Light theme — same care as dark; daytime desktop.
   -------------------------------------------------------------------------- */

@media (prefers-color-scheme: light) {
  :root {
    --bg: #e8e9ed;
    --bg-deep: #dcdee3;
    --wallpaper-1: #f2 e9 e2;
    --wallpaper-1: #f4ece4;
    --wallpaper-2: #e2ecee;

    --win: #ffffff;
    --win-2: #f6f7f9;
    --win-head: #f1f2f5;
    --win-inset: #f2f3f6;

    --line: rgba(15, 18, 24, 0.10);
    --line-2: rgba(15, 18, 24, 0.16);
    --line-strong: rgba(15, 18, 24, 0.26);

    --ink: #14161b;
    --ink-2: #4b515c;
    --ink-3: #616875;

    --accent: #d9552f;
    --accent-2: #e08a34;
    --accent-soft: rgba(217, 85, 47, 0.12);
    --accent-line: rgba(217, 85, 47, 0.40);
    --on-accent: #ffffff;

    --live: #15803d;
    --live-soft: rgba(21, 128, 61, 0.16);

    --glass: rgba(255, 255, 255, 0.66);
    --glass-line: rgba(15, 18, 24, 0.10);

    --shadow-win: 0 24px 50px -30px rgba(20, 22, 30, 0.35);
    --shadow-pop: 0 40px 80px -30px rgba(20, 22, 30, 0.40);
  }
}

/* Explicit toggle wins over the media query, in both directions. */
:root[data-theme="light"] {
  --bg: #e8e9ed;
  --bg-deep: #dcdee3;
  --wallpaper-1: #f4ece4;
  --wallpaper-2: #e2ecee;
  --win: #ffffff;
  --win-2: #f6f7f9;
  --win-head: #f1f2f5;
  --win-inset: #f2f3f6;
  --line: rgba(15, 18, 24, 0.10);
  --line-2: rgba(15, 18, 24, 0.16);
  --line-strong: rgba(15, 18, 24, 0.26);
  --ink: #14161b;
  --ink-2: #4b515c;
  --ink-3: #616875;
  --accent: #d9552f;
  --accent-2: #e08a34;
  --accent-soft: rgba(217, 85, 47, 0.12);
  --accent-line: rgba(217, 85, 47, 0.40);
  --on-accent: #ffffff;
  --live: #15803d;
  --live-soft: rgba(21, 128, 61, 0.16);
  --glass: rgba(255, 255, 255, 0.66);
  --glass-line: rgba(15, 18, 24, 0.10);
  --shadow-win: 0 24px 50px -30px rgba(20, 22, 30, 0.35);
  --shadow-pop: 0 40px 80px -30px rgba(20, 22, 30, 0.40);
}

:root[data-theme="dark"] {
  --bg: #0c0d11;
  --bg-deep: #08090c;
  --wallpaper-1: #16121a;
  --wallpaper-2: #0b1418;
  --win: #14161b;
  --win-2: #191c22;
  --win-head: #1a1d24;
  --win-inset: #101216;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.22);
  --ink: #f1f3f6;
  --ink-2: #aab0bb;
  --ink-3: #7b818d;
  --accent: #e8623a;
  --accent-2: #f0a24a;
  --accent-soft: rgba(232, 98, 58, 0.14);
  --accent-line: rgba(232, 98, 58, 0.42);
  --on-accent: #180c06;
  --live: #5fd08a;
  --live-soft: rgba(95, 208, 138, 0.16);
  --glass: rgba(20, 22, 28, 0.62);
  --glass-line: rgba(255, 255, 255, 0.10);
  --shadow-win: 0 26px 60px -30px rgba(0, 0, 0, 0.75);
  --shadow-pop: 0 40px 90px -30px rgba(0, 0, 0, 0.85);
}

@media (max-width: 1080px) {
  :root { --gutter: 30px; --max-w: 960px; }
}

@media (max-width: 720px) {
  :root {
    --gutter: 20px;
    --sp-xl: 48px;
    --fs-h3: 19px;
  }
}
