/* Atlas web palette shared with Sakura Connect. */
:root {
  color-scheme: light;
  --hero-base: hsl(236 29% 13%);
  --stage-base: light-dark(#fbf4f9, #29212d);
  --stage-edge: light-dark(#f4d7ed, #4c324d);
  --stage-blue: light-dark(#e5eafa, #2e3349);
  --disc-line: light-dark(#c9bfd7, #54465b);
  --stage-ink: #241e33;
  --screen-fg: #fbf6ff;
  --screen-muted: #d9cde3;
  --crystal-cyan: #64dcff;
  --crystal-rose: #ff8ebe;
  --color-bg: hsl(210 20% 98%);
  --color-surface: hsl(210 15% 96%);
  --color-surface-raised: hsl(0 0% 100%);
  --color-fg: hsl(220 25% 12%);
  --color-muted: hsl(215 10% 40%);
  --color-border: hsl(210 15% 88%);
  /* Sakura pink, three roles. The accent: focus ring, marker, tints, glow
     (3:1 on the page). */
  --color-primary: hsl(340 95% 57%);
  /* The fill: filled buttons, the end of the avatar gradient. A light pink,
     so the text on it is dark in both themes. */
  --color-primary-strong: hsl(345 100% 72%);
  --color-on-primary: hsl(220 25% 12%);
  /* Pink as text or a small icon on the page (4.5:1); the light fill fails. */
  --color-primary-deep: hsl(338 80% 42%);
  /* Blue: the second accent, the start of the avatar gradient, the second
     glow. Dark text on it. */
  --color-secondary: hsl(215 90% 72%);
  /* Blue as text (links): --color-secondary is too light on the page. */
  --color-secondary-strong: hsl(220 80% 48%);
  --color-on-secondary: hsl(220 25% 12%);
  --color-accent: hsl(165 70% 42%);
  --color-danger: hsl(0 75% 45%);
  --color-notice: hsl(35 90% 55%);
  --color-shadow: hsl(220 25% 12%);
  /* Behind and over a video, which is dark in either theme, so dark mode
     keeps these two as they are. */
  --color-video: hsl(220 25% 6%);
  --color-on-video: hsl(0 0% 100%);

  /* Derived from the colours above, so dark mode needs no second copy. */
  --color-glass: color-mix(in srgb, var(--color-bg) 70%, transparent);
  --color-hover: color-mix(in srgb, var(--color-fg) 6%, transparent);
  --color-glow: color-mix(in srgb, var(--color-primary) 12%, transparent);
  --color-glow-secondary: color-mix(in srgb, var(--color-secondary) 14%, transparent);
  --color-primary-soft: color-mix(in srgb, var(--color-primary) 14%, transparent);
  /* Text and icons on --color-primary-soft. */
  --color-primary-text: color-mix(in srgb, var(--color-primary-deep) 80%, var(--color-fg));
  /* A lighter fill, so its dark text gains contrast in both themes. */
  --color-primary-hover: color-mix(in srgb, var(--color-primary-strong) 80%, hsl(0 0% 100%));
  --color-accent-soft: color-mix(in srgb, var(--color-accent) 16%, transparent);
  --color-accent-text: color-mix(in srgb, var(--color-accent) 50%, var(--color-fg));
  --color-danger-soft: color-mix(in srgb, var(--color-danger) 10%, transparent);
  --color-notice-soft: color-mix(in srgb, var(--color-notice) 18%, transparent);
  --color-skeleton: color-mix(in srgb, var(--color-fg) 9%, transparent);
  --color-video-scrim: color-mix(in srgb, var(--color-video) 55%, transparent);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;

  --radius: 10px;
  --radius-small: 6px;
  --radius-pill: 999px;
  --border-width: 1px;
  --focus-width: 2px;

  --shadow-card: 0 1px 2px color-mix(in srgb, var(--color-shadow) 4%, transparent),
    0 6px 20px color-mix(in srgb, var(--color-shadow) 6%, transparent);
  --shadow-menu: 0 12px 36px color-mix(in srgb, var(--color-shadow) 18%, transparent);
  --blur: 12px;

  --duration-fast: 150ms;
  --duration-enter: 250ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --distance-enter: 6px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
  --font-sans-zh: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-sans-ja: "Inter", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.5rem;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --tracking-wide: 0.08em;
  --tracking-wordmark: 0.16em;
  --line-height: 1.5;
  --line-height-tight: 1.2;

  --size-icon: 20px;
  --size-control: 40px;
  --size-control-large: 48px;
  --size-avatar: 36px;
  --size-avatar-large: 64px;
  --size-header: 60px;
  --size-menu: 260px;
  --size-card-min: 260px;
  --size-heading-min: 140px;
  --width-content: 960px;
  --width-reading: 440px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: hsl(220 20% 6%);
  --color-surface: hsl(220 18% 10%);
  --color-surface-raised: hsl(220 16% 13%);
  --color-fg: hsl(210 15% 93%);
  --color-muted: hsl(215 10% 62%);
  --color-border: hsl(220 15% 18%);
  /* The original Sakura pink (#ff85a3) in all three roles; near-black
     text on it. */
  --color-primary: hsl(345 100% 76%);
  --color-primary-strong: hsl(345 100% 76%);
  --color-on-primary: hsl(220 20% 6%);
  --color-primary-deep: hsl(345 100% 76%);
  --color-secondary: hsl(215 85% 72%);
  --color-secondary-strong: hsl(220 80% 65%);
  --color-on-secondary: hsl(220 20% 6%);
  --color-accent: hsl(165 65% 50%);
  --color-danger: hsl(0 80% 70%);
  --color-notice: hsl(35 85% 60%);
  --color-shadow: hsl(0 0% 0%);

  /* On a dark background a border reads better than a shadow. */
  --shadow-card: none;
  --shadow-menu: 0 12px 36px color-mix(in srgb, var(--color-shadow) 60%, transparent);
}

@media (prefers-color-scheme: dark) {
:root:not([data-theme]) {
  color-scheme: dark;
  --color-bg: hsl(220 20% 6%);
  --color-surface: hsl(220 18% 10%);
  --color-surface-raised: hsl(220 16% 13%);
  --color-fg: hsl(210 15% 93%);
  --color-muted: hsl(215 10% 62%);
  --color-border: hsl(220 15% 18%);
  /* The original Sakura pink (#ff85a3) in all three roles; near-black
     text on it. */
  --color-primary: hsl(345 100% 76%);
  --color-primary-strong: hsl(345 100% 76%);
  --color-on-primary: hsl(220 20% 6%);
  --color-primary-deep: hsl(345 100% 76%);
  --color-secondary: hsl(215 85% 72%);
  --color-secondary-strong: hsl(220 80% 65%);
  --color-on-secondary: hsl(220 20% 6%);
  --color-accent: hsl(165 65% 50%);
  --color-danger: hsl(0 80% 70%);
  --color-notice: hsl(35 85% 60%);
  --color-shadow: hsl(0 0% 0%);

  /* On a dark background a border reads better than a shadow. */
  --shadow-card: none;
  --shadow-menu: 0 12px 36px color-mix(in srgb, var(--color-shadow) 60%, transparent);
}
}
