/*
 * TinyWoolf Studio design tokens.
 * Brand values match tinywoolf.com (verified 3 November 2026), adapted to a calm,
 * productive app scale. Everything else in app.css builds on these.
 *
 * Light is the default. static/js/theme.js sets data-theme on <html> before the page
 * paints, from the person's saved choice or their system setting.
 */
:root {
  color-scheme: light;

  /* Brand */
  --tw-paper: #F7F5F1;
  --tw-ink: #1E1E1E;
  --tw-blue: #3663E4;
  --tw-sand: #B7A99A;

  /* Surfaces. --surface stays opaque: the sticky columns of the timeline and Gantt
     chart rely on it to hide what scrolls underneath. Hover and sunken tints are
     translucent, so they read the same on glass and on solid surfaces. */
  --surface-page: #EEEBE5;
  --surface: #FFFFFF;
  --surface-hover: rgba(30, 30, 30, 0.03);
  --surface-sunken: rgba(30, 30, 30, 0.06);
  --surface-column: rgba(255, 255, 255, 0.32);
  /* The sidebar and the small top bar on phones: the app's chrome. */
  --surface-chrome: rgba(255, 255, 255, 0.6);

  /*
   * Liquid glass. Translucent layers over a soft wash of brand colour (--ambient),
   * each with a light-catching rim (--glass-edge), a glow across the top (--glass-sheen)
   * and a soft shadow. Like Apple's materials, there are three thicknesses:
   * --glass-fill-thin: tracks and board columns that hold other glass.
   * --glass-fill: cards and tiles that sit in the page.
   * --glass-fill-strong: layers that float over content (menus, the task panel), so
   *   text on them stays crisp whatever is underneath.
   * --glass-bubble: the selected item in a nav or segmented control.
   */
  --ambient:
    radial-gradient(52vw 46vw at 4% -6%, rgba(54, 99, 228, 0.22), transparent 70%),
    radial-gradient(42vw 42vw at 104% 6%, rgba(150, 120, 240, 0.17), transparent 70%),
    radial-gradient(56vw 48vw at 94% 106%, rgba(214, 168, 116, 0.26), transparent 70%),
    radial-gradient(42vw 42vw at -6% 98%, rgba(60, 180, 220, 0.14), transparent 70%);
  --glass-fill: rgba(255, 255, 255, 0.56);
  --glass-fill-strong: rgba(255, 255, 255, 0.76);
  --glass-fill-thin: rgba(255, 255, 255, 0.32);
  --glass-bubble: rgba(255, 255, 255, 0.94);
  --glass-rim: rgba(255, 255, 255, 0.78);
  --glass-sheen:
    radial-gradient(120% 80% at 50% -20%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 46%);
  /* Light catching the rim: brightest at the top-left corner, fading down the sides,
     with a little coming back along the bottom. Drawn as a 1px ring over the border. */
  --glass-edge: linear-gradient(160deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.5) 28%, rgba(255, 255, 255, 0.12) 62%, rgba(255, 255, 255, 0.6));
  --glass-blur: blur(24px) saturate(1.8);
  --glass-blur-strong: blur(40px) saturate(2);
  --control-fill: rgba(255, 255, 255, 0.62);
  --field-fill: rgba(255, 255, 255, 0.82);

  /* Text. Three levels, like Apple's label colours: primary, secondary for nav and
     supporting copy, muted for hints and metadata. */
  --text: var(--tw-ink);
  --text-secondary: #3A3936;
  --text-muted: #5C5B58;
  --text-on-primary: #FFFFFF;
  --link: #2A50C4;

  /* Lines. Control borders are strong enough for 3:1 against white. */
  --border: rgba(30, 30, 30, 0.11);
  --border-strong: rgba(30, 30, 30, 0.2);
  --border-control: rgba(30, 30, 30, 0.5);

  /* Actions and focus */
  --primary: var(--tw-blue);
  --primary-hover: #2B51C6;
  --primary-tint: #E8EDFC;
  --focus-ring: var(--tw-blue);
  --danger: #A3231B;
  --danger-hover: #861C15;
  --danger-solid: #A3231B;
  --danger-tint: #FBE9E7;

  /* The main button: solid brand blue with light catching the top edge. The sheen fades
     out above the label, so the white text keeps its contrast. */
  --btn-primary-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 45%), var(--primary);
  --btn-primary-bg-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 45%), var(--primary-hover);
  --btn-primary-text: var(--text-on-primary);
  --btn-primary-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 1px 2px rgba(30, 30, 30, 0.12), 0 6px 18px rgba(54, 99, 228, 0.3);

  /* Feedback */
  --toast-bg: rgba(30, 30, 30, 0.82);
  --toast-text: #FFFFFF;
  --backdrop: rgba(30, 30, 30, 0.2);
  /* Laid over the progressive blur under a stuck header, like the dimming under the
     status bar on iOS. */
  --veil-tint: rgba(238, 235, 229, 0.55);

  /* Workflow status. Always shown with a text label, never colour alone. */
  --status-todo-text: #4A4A46;
  --status-todo-bg: #ECE9E2;
  --status-in_progress-text: #2447B3;
  --status-in_progress-bg: #E7ECFB;
  --status-internal_review-text: #5B3FA6;
  --status-internal_review-bg: #EFEAFA;
  --status-waiting_client-text: #7A4E00;
  --status-waiting_client-bg: #FBF0D9;
  --status-done-text: #1C6B45;
  --status-done-bg: #E3F2EA;
  /* Gantt bars, filled in their status colour, and the chart's other marks. */
  --gantt-todo: #9A978F;
  --gantt-in_progress: #3663E4;
  --gantt-internal_review: #7C58D6;
  --gantt-waiting_client: #D68C14;
  --gantt-done: #2E9E62;
  --gantt-link: rgba(30, 30, 30, 0.45);
  --gantt-summary: rgba(30, 30, 30, 0.14);
  --gantt-summary-done: rgba(30, 30, 30, 0.42);
  --gantt-critical: #E39A00;
  --gantt-critical-tint: #FDF1D6;
  /* A Board column's outline, in its status colour. */
  --status-todo-line: rgba(74, 74, 70, 0.22);
  --status-in_progress-line: rgba(54, 99, 228, 0.42);
  --status-internal_review-line: rgba(124, 88, 214, 0.4);
  --status-waiting_client-line: rgba(214, 140, 20, 0.5);
  --status-done-line: rgba(31, 140, 85, 0.4);
  /* An urgent Board card glows like neon: a red rim, a light at its top-left corner, and
     a glow rising from its bottom edge and spilling below it. */
  --neon-urgent-rim: rgba(235, 64, 45, 0.55);
  --neon-urgent-fill:
    radial-gradient(110% 55% at 50% 120%, rgba(255, 90, 60, 0.5), rgba(255, 90, 60, 0.18) 45%, rgba(255, 90, 60, 0) 75%),
    radial-gradient(50% 40% at 0% 0%, rgba(255, 140, 90, 0.22), rgba(255, 140, 90, 0) 70%);
  --neon-urgent-glow: inset 0 -2px 0 rgba(255, 120, 90, 0.65), 0 14px 30px -12px rgba(235, 64, 45, 0.6);
  /* The neon's breath: a brighter rim and a wider glow that slowly swell and fade. */
  --neon-urgent-pulse: 0 0 0 1px rgba(245, 90, 65, 0.55), 0 0 18px 1px rgba(245, 80, 55, 0.3), 0 20px 38px -12px rgba(235, 64, 45, 0.7);
  /* The filled circle of a ticked task. White on it is at least 4.5:1. */
  --done-solid: #1F7A4D;
  /* An approval sent back for changes. White on it is at least 4.5:1. */
  --changes-solid: #A35400;
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  /* Avatar tones, picked from the person's name so everyone keeps one colour. */
  --tone-0-bg: #E7ECFB; --tone-0-text: #2447B3;
  --tone-1-bg: #E3F2EA; --tone-1-text: #1C6B45;
  --tone-2-bg: #FBF0D9; --tone-2-text: #7A4E00;
  --tone-3-bg: #EFEAFA; --tone-3-text: #5B3FA6;
  --tone-4-bg: #FBE9E7; --tone-4-text: #A3231B;
  --tone-5-bg: #E2F1F4; --tone-5-text: #155E6E;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Typography */
  --font-heading: "effra-cc", Arial, sans-serif;
  --font-body: "neue-haas-grotesk-text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 26px;
  --text-3xl: 30px;
  /* The font kit includes only these two weights. */
  --weight-regular: 400;
  --weight-strong: 700;

  /* Shape and depth */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-pill: 999px;
  /* Each shadow starts with the glass highlight along the top edge, then a hairline
     so light glass still has an edge on a light page, then the soft drop. */
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 0 0 0.5px rgba(30, 30, 30, 0.07), 0 1px 2px rgba(30, 30, 30, 0.04), 0 8px 24px rgba(30, 30, 30, 0.05);
  --shadow-raised: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 0.5px rgba(30, 30, 30, 0.08), 0 4px 10px rgba(30, 30, 30, 0.06), 0 16px 36px rgba(30, 30, 30, 0.1);
  --shadow-menu: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 0.5px rgba(30, 30, 30, 0.1), 0 20px 50px rgba(30, 30, 30, 0.18);
  --shadow-panel: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 0.5px rgba(30, 30, 30, 0.1), 0 30px 80px rgba(30, 30, 30, 0.22);
  --shadow-control: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(30, 30, 30, 0.06), 0 2px 8px rgba(30, 30, 30, 0.04);
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* Controls. Every input, select and button uses one of these two heights. */
  --control-h: 38px;
  --control-h-sm: 32px;
  --control-px: 16px;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%235C5B58' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  /* Layout. The sidebar floats --sidebar-gap from the window's edges; below 1024px it
     becomes a drawer and the small top bar (--topbar-height) takes its place. */
  --page-max: 1320px;
  --page-max-wide: 1560px;
  --page-max-narrow: 680px;
  --sidebar-w-open: 240px;
  --sidebar-w: var(--sidebar-w-open);
  --sidebar-gap: 12px;
  --sidebar-offset: calc(var(--sidebar-w) + var(--sidebar-gap));
  --topbar-height: 0px;
  /* Where sticky things stop: level with the sidebar's top, or just under the small top
     bar when it shows (see app.css). */
  --sticky-top: var(--sidebar-gap);
}

/*
 * Dark, after Apple's Human Interface Guidelines ("Dark Mode") and WWDC19 "Implementing
 * Dark Mode on iOS":
 * - A true black base, so the content and the glass on it carry the light.
 * - Base and elevated levels: the further forward a surface is, the lighter it gets
 *   (page, then cards, then menus and the task panel), because shadows barely read on
 *   black. Values follow systemBackground #000, secondary #1C1C1E, tertiary #2C2C2E.
 * - Labels in a hierarchy (primary, secondary, muted), all opaque so they keep at least
 *   4.5:1 on any glass, and 7:1 on cards where most small text sits.
 * - Colours from Apple's dark system palette (blue, green, orange, purple, red, teal),
 *   brightened for the dark and tinted only slightly into their backgrounds.
 * - Glass reads by its rim and the light across its top, not by heavy shadow.
 */
:root[data-theme="dark"] {
  color-scheme: dark;

  --surface-page: #000000;
  --surface: #1C1C1E;
  --surface-hover: rgba(255, 255, 255, 0.045);
  --surface-sunken: rgba(118, 118, 128, 0.2);
  --surface-column: rgba(255, 255, 255, 0.03);
  --surface-chrome: rgba(28, 28, 30, 0.6);

  /* Black, with a spotlight from above and a little of the system blue and indigo at
     the corners, so the glass has something to show through without tinting the page. */
  --ambient:
    radial-gradient(70vw 42vw at 38% -14%, rgba(255, 255, 255, 0.075), transparent 70%),
    radial-gradient(46vw 42vw at -2% -4%, rgba(10, 132, 255, 0.17), transparent 70%),
    radial-gradient(42vw 42vw at 102% 2%, rgba(94, 92, 230, 0.15), transparent 70%),
    radial-gradient(54vw 46vw at 92% 108%, rgba(191, 90, 242, 0.08), transparent 70%),
    radial-gradient(42vw 42vw at -4% 102%, rgba(100, 210, 255, 0.06), transparent 70%);
  --glass-fill: rgba(28, 28, 30, 0.58);
  --glass-fill-strong: rgba(44, 44, 46, 0.74);
  --glass-fill-thin: rgba(255, 255, 255, 0.035);
  --glass-bubble: rgba(120, 120, 128, 0.3);
  --glass-rim: rgba(255, 255, 255, 0.07);
  --glass-sheen:
    radial-gradient(120% 80% at 50% -20%, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 42%);
  --glass-edge: linear-gradient(160deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.1) 26%, rgba(255, 255, 255, 0.03) 60%, rgba(255, 255, 255, 0.12));
  --glass-blur: blur(24px) saturate(1.6);
  --glass-blur-strong: blur(40px) saturate(1.7);
  --control-fill: rgba(118, 118, 128, 0.16);
  --field-fill: rgba(118, 118, 128, 0.14);

  --text: #F5F5F7;
  --text-secondary: #D1D1D6;
  --text-muted: #A1A1A8;
  --text-on-primary: #FFFFFF;
  --link: #93AEFF;

  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-control: rgba(255, 255, 255, 0.4);

  --primary: var(--tw-blue);
  --primary-hover: #5A80F0;
  --primary-tint: #1B2846;
  --focus-ring: #93AEFF;
  --danger: #FF6B61;
  --danger-hover: #FF8A82;
  --danger-solid: #C9342B;
  --danger-tint: #3D1614;

  /* The main button stays the exact tinywoolf.com blue (white on it is 5.2:1), as glass:
     a specular top edge and a soft blue glow on the black. Hover brightens the light
     across the top rather than the blue, so the label keeps its contrast. */
  --btn-primary-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 50%), var(--tw-blue);
  --btn-primary-bg-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.04) 55%), var(--tw-blue);
  --btn-primary-text: #FFFFFF;
  --btn-primary-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(54, 99, 228, 0.35);

  /* Toasts and tooltips are an elevated layer too: lighter than what they float over. */
  --toast-bg: rgba(58, 58, 60, 0.86);
  --toast-text: #F5F5F7;
  --backdrop: rgba(0, 0, 0, 0.5);
  --veil-tint: rgba(0, 0, 0, 0.55);

  --status-todo-text: #C7C7CC;
  --status-todo-bg: #2C2C2E;
  --status-in_progress-text: #6CB0FF;
  --status-in_progress-bg: #102A4C;
  --status-internal_review-text: #D49BFF;
  --status-internal_review-bg: #2E1E42;
  --status-waiting_client-text: #FFB64D;
  --status-waiting_client-bg: #3A2A0E;
  --status-done-text: #5EDB86;
  --status-done-bg: #0F3220;
  --gantt-todo: #8E8E93;
  --gantt-in_progress: #0A84FF;
  --gantt-internal_review: #BF5AF2;
  --gantt-waiting_client: #FF9F0A;
  --gantt-done: #30D158;
  --gantt-link: rgba(255, 255, 255, 0.42);
  --gantt-summary: rgba(255, 255, 255, 0.14);
  --gantt-summary-done: rgba(255, 255, 255, 0.5);
  --gantt-critical: #FFC53D;
  --gantt-critical-tint: #3A2E0A;
  --status-todo-line: rgba(199, 199, 204, 0.2);
  --status-in_progress-line: rgba(108, 176, 255, 0.45);
  --status-internal_review-line: rgba(212, 155, 255, 0.42);
  --status-waiting_client-line: rgba(255, 182, 77, 0.42);
  --status-done-line: rgba(94, 219, 134, 0.4);
  --neon-urgent-rim: rgba(255, 99, 82, 0.6);
  --neon-urgent-fill:
    radial-gradient(110% 55% at 50% 120%, rgba(255, 80, 50, 0.85), rgba(255, 60, 40, 0.35) 45%, rgba(255, 60, 40, 0) 75%),
    radial-gradient(50% 40% at 0% 0%, rgba(255, 130, 80, 0.35), rgba(255, 130, 80, 0) 70%);
  --neon-urgent-glow: inset 0 -2px 0 rgba(255, 170, 140, 0.8), 0 16px 36px -14px rgba(255, 69, 58, 0.9);
  --neon-urgent-pulse: 0 0 0 1px rgba(255, 120, 100, 0.75), 0 0 22px 2px rgba(255, 80, 60, 0.45), 0 22px 44px -12px rgba(255, 69, 58, 1);
  --done-solid: #23804F;
  --changes-solid: #A65A0A;

  --tone-0-bg: #102A4C; --tone-0-text: #6CB0FF;
  --tone-1-bg: #0F3220; --tone-1-text: #5EDB86;
  --tone-2-bg: #3A2A0E; --tone-2-text: #FFB64D;
  --tone-3-bg: #2E1E42; --tone-3-text: #D49BFF;
  --tone-4-bg: #3D1614; --tone-4-text: #FF6B61;
  --tone-5-bg: #0B3340; --tone-5-text: #6FD6F5;

  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23A1A1A8' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 0 0 0.5px rgba(0, 0, 0, 0.6), 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-raised: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.7), 0 18px 40px rgba(0, 0, 0, 0.55);
  --shadow-menu: inset 0 1px 0 rgba(255, 255, 255, 0.13), 0 0 0 0.5px rgba(0, 0, 0, 0.8), 0 24px 60px rgba(0, 0, 0, 0.7);
  --shadow-panel: inset 0 1px 0 rgba(255, 255, 255, 0.13), 0 0 0 0.5px rgba(0, 0, 0, 0.8), 0 30px 80px rgba(0, 0, 0, 0.75);
  --shadow-control: inset 0 1px 0 rgba(255, 255, 255, 0.09), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Browsers without backdrop blur: floating layers get nearly solid, so text stays readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass-fill-strong: rgba(255, 255, 255, 0.97); --surface-chrome: rgba(255, 255, 255, 0.97); }
  :root[data-theme="dark"] { --glass-fill-strong: rgba(44, 44, 46, 0.98); --surface-chrome: rgba(28, 28, 30, 0.98); }
}

/* "Reduce transparency" in the system settings: solid surfaces, no blur, no rim light. */
@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-fill: #FFFFFF; --glass-fill-strong: #FFFFFF; --glass-fill-thin: #E6E3DC; --glass-bubble: #FFFFFF;
    --surface-column: #E6E3DC; --surface-chrome: #FFFFFF; --control-fill: #FFFFFF; --field-fill: #FFFFFF;
    --toast-bg: #1E1E1E; --veil-tint: var(--surface-page); --glass-sheen: none; --glass-edge: none; --glass-blur: none; --glass-blur-strong: none;
  }
  :root[data-theme="dark"] {
    --glass-fill: #1C1C1E; --glass-fill-strong: #2C2C2E; --glass-fill-thin: #141416; --glass-bubble: #3A3A3C;
    --surface-column: #141416; --surface-chrome: #1C1C1E; --control-fill: #2C2C2E; --field-fill: #1C1C1E;
    --toast-bg: #3A3A3C; --veil-tint: var(--surface-page); --glass-sheen: none; --glass-edge: none; --glass-blur: none; --glass-blur-strong: none;
  }
}

/* Blocked, a Studio Tasks status: a rose that reads apart from Urgent's red. */
:root {
  --status-blocked-text: #9E1F4F;
  --status-blocked-bg: #FBE8EF;
  --status-blocked-line: rgba(158, 31, 79, 0.38);
}
:root[data-theme="dark"] {
  --status-blocked-text: #FF7AA8;
  --status-blocked-bg: #3E1426;
  --status-blocked-line: rgba(255, 122, 168, 0.42);
}
