/* Yanut design tokens, visual language v2 ("paper and stage", docs/design/visual-v2.md).
   Paper values on :root. Stage "gece" values: .tone-gece (anything that is a stage: the hero
   frame, the closing band) and the dark scheme of pages that opt in with .scheme-auto.
   .tone-paper puts paper values back inside a gece area. Every older token name is kept. */
:where(:root) {
  --c-paper: #ffffff;
  --c-paper-2: #f5f5f6; /* a quiet band or inset */
  --c-surface: #ffffff;
  --c-ink: #101216;
  --c-ink-2: #4b5160;
  --c-ink-3: #6c7282;
  --c-line: #e4e4e7;
  --c-line-strong: #cdcdd2;
  --c-control-line: #8e9099; /* fields and ordinary buttons: 3:1 on the ground */
  --c-accent: #b4432e;
  --c-accent-hover: #9a3725;
  --c-accent-ink: #ffffff;
  --c-accent-2: #0f4c5c;
  --c-bar: #ededef;
  --c-ink-hover: #2a2e36;
  --c-ok: #2f6b4f;
  --c-warn: #8a5a00;
  --c-danger: #a1262a;
  --c-ok-tint: #e9f1ec;
  --c-warn-tint: #fdf1c7;
  --c-danger-tint: #f7e6e6;
  --c-accent-tint: #f6e9e5;
  --c-muted: var(--c-ink-3);

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

  --r-1: 10px;
  --r-2: 16px;
  --r-3: 24px;
  --r-phone: 36px;

  /* Fixed steps (interface) and fluid steps (reading and display). */
  --t-1: 0.875rem;
  --t-2: 1rem;
  --t-3: 1.125rem;
  --t-4: 1.375rem;
  --t-5: 1.75rem;
  --t-6: 2.25rem;
  --t-7: 3rem;
  --t-small: 0.875rem;
  --t-body: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  --t-lead: clamp(1.125rem, 1.02rem + 0.45vw, 1.3125rem);
  --t-h3: clamp(1.25rem, 1.14rem + 0.45vw, 1.5rem);
  --t-h2: clamp(1.75rem, 1.35rem + 1.6vw, 2.75rem);
  --t-h1: clamp(2.25rem, 1.6rem + 2.6vw, 3.75rem);
  --t-display: clamp(2.5rem, 1.55rem + 3.9vw, 4.75rem);

  --f-display: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --f-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-serif: var(--f-display);
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --opsz-display: "opsz" 144;
  --opsz-sub: "opsz" 60;

  --sh-1: 0 1px 2px rgb(16 18 22 / 0.05), 0 2px 8px rgb(16 18 22 / 0.04);
  --sh-2: 0 2px 6px rgb(16 18 22 / 0.06), 0 18px 48px rgb(16 18 22 / 0.1);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --d-1: 160ms;
  --d-2: 240ms;
  --d-3: 320ms;

  --focus: 0 0 0 2px var(--c-paper), 0 0 0 4px var(--c-ink);
}

/* Stage "gece": the room's material. */
.tone-gece {
  --c-paper: #0e1014;
  --c-paper-2: #12151b;
  --c-surface: #171a21;
  --c-ink: #f4f4f5;
  --c-ink-2: #a9afbc;
  --c-ink-3: #7d8493;
  --c-line: #2a2f3a;
  --c-line-strong: #3a4050;
  --c-control-line: #6b7385;
  --c-accent: #ff7a5c;
  --c-accent-hover: #ff9378;
  --c-accent-ink: #14161a;
  --c-accent-2: #6fc3d6;
  --c-bar: #232833;
  --c-ink-hover: #d4d4d8;
  --c-ok: #7fc4a0;
  --c-warn: #e0b45c;
  --c-danger: #f08a8c;
  --c-ok-tint: #1d2b24;
  --c-warn-tint: #2c2619;
  --c-danger-tint: #2f1d1e;
  --c-accent-tint: #2c1f1b;
  color: var(--c-ink);
}

/* Paper values again, for a paper piece inside a gece area. */
.tone-paper {
  --c-paper: #ffffff;
  --c-paper-2: #f5f5f6;
  --c-surface: #ffffff;
  --c-ink: #101216;
  --c-ink-2: #4b5160;
  --c-ink-3: #6c7282;
  --c-line: #e4e4e7;
  --c-line-strong: #cdcdd2;
  --c-control-line: #8e9099;
  --c-accent: #b4432e;
  --c-accent-hover: #9a3725;
  --c-accent-ink: #ffffff;
  --c-accent-2: #0f4c5c;
  --c-bar: #ededef;
  --c-ink-hover: #2a2e36;
  color: var(--c-ink);
}

@media (prefers-color-scheme: dark) {
  .scheme-auto {
    --c-paper: #0e1014;
    --c-paper-2: #12151b;
    --c-surface: #171a21;
    --c-ink: #f4f4f5;
    --c-ink-2: #a9afbc;
    --c-ink-3: #7d8493;
    --c-line: #2a2f3a;
    --c-line-strong: #3a4050;
    --c-control-line: #6b7385;
    --c-accent: #ff7a5c;
    --c-accent-hover: #ff9378;
    --c-accent-ink: #14161a;
    --c-accent-2: #6fc3d6;
    --c-bar: #232833;
    --c-ink-hover: #d4d4d8;
    --c-ok: #7fc4a0;
    --c-warn: #e0b45c;
    --c-danger: #f08a8c;
    --c-ok-tint: #1d2b24;
    --c-warn-tint: #2c2619;
    --c-danger-tint: #2f1d1e;
    --c-accent-tint: #2c1f1b;
  }
}
