/* Design system 1 library, revision sha256:8a0b55ce3acd */
/* DS1 — version 0.3.0-alpha.28+sha256:8a0b55ce3acd */
/* Design system 1 component library */
/* Resolve dimensions where a component is drawn. Inherited calc() values have
 * already used their ancestor's scale. Base tokens stay unscaled and inherit;
 * resolved tokens can still be overridden directly on a component.
 * data-ds-surface gives ordinary layout elements the same scaled measures.
 */
:where(a[data-library-button]) { display: inline-block; text-align: center; text-decoration: none; }
:root,
:host,
:where([data-ds-surface]) {
  --ds-unit: calc(var(--ds-1, 20px) * var(--ds-sf, 1));
  --ds-control-height: calc(var(--ds-control-size, var(--ds-08, 16px)) * var(--ds-sf, 1));
  --ds-row-height: calc(var(--ds-row-size, var(--ds-1, 20px)) * var(--ds-sf, 1));
  --ds-type-size-default: calc(var(--ds-text-size, 14px) * var(--ds-sf, 1));
  --ds-type-size-small: calc(var(--ds-small-text-size, 10px) * var(--ds-sf, 1));
  --ds-type-size-heading: calc(var(--ds-heading-text-size, 13px) * var(--ds-sf, 1));
  --ds-type-size-display: calc(var(--ds-display-text-size, 20px) * var(--ds-sf, 1));
  --ds-type-lineheight-default: calc(var(--ds-text-leading, 16px) * var(--ds-sf, 1));
  --ds-type-letterspacing-default: calc(var(--ds-text-tracking, -0.3px) * var(--ds-sf, 1));
  --ds-radius: calc(var(--ds-corner-size, 4px) * var(--ds-sf, 1));
  --ds-radius-card: calc(var(--ds-card-corner-size, 4px) * var(--ds-sf, 1));
}

/* Shared component tokens. Scoped names keep embedded documents independent.
 * Products may set tokens at their surface; component implementations stay shared.
 */
:root {
  /* Component scale is independent of an embedded document. */
  --ds-sf: 1;

  /* ----------------------------------------------------------
   SIZING SCALE
   One base unit and its multipliers, as in DS one.
   ---------------------------------------------------------- */

  --ds-1: 20px;
  --ds-01: calc(var(--ds-1) * 0.1);
  --ds-025: calc(var(--ds-1) * 0.25);
  --ds-05: calc(var(--ds-1) * 0.5);
  --ds-08: calc(var(--ds-1) * 0.8);
  --ds-2: calc(var(--ds-1) * 2);
  --ds-3: calc(var(--ds-1) * 3);
  --ds-4: calc(var(--ds-1) * 4);

  /* ----------------------------------------------------------
   PALETTE
   The same values as palette.ts and one.css; the accent is Atelier's own.
   ---------------------------------------------------------- */

  --ds-white: #ffffff;
  --ds-black: #2a2a2a;
  --ds-slate: #1e1e1e;
  --ds-slate-light: #e6e6e6;
  --ds-slate-dark: #3c3c3c;
  --ds-grey: #797979;

  --ds-tuned-red: #ff5f5f;
  --ds-red-for-blood: #de0331;
  --ds-pink: #f5aad1;
  --ds-sharp-blue: #594dff;
  --ds-zenith-blue: #ccccff;
  --ds-apple-green: #99ff73;
  /* Dark Apple green keeps a white switch thumb clear in either scheme. */
  --ds-switch-track-on: #529d36;
  --ds-yellow: #eaff00;
  --ds-orange: #fec20d;

  --ds-accent-color: light-dark(#18181b, #fafafa);

  /* ----------------------------------------------------------
   TYPE
   ---------------------------------------------------------- */

  --ds-typeface-regular:
    "Inter Arrows", "GT America", "GT-America-Standard-Regular", Inter, system-ui, -apple-system, sans-serif;
  /* The medium face for headings and strong text; one.css loads it as GT-America-Standard-Medium. */
  --ds-typeface-medium:
    "Inter Arrows", "GT-America-Standard-Medium", "GT America", Inter, system-ui, -apple-system, sans-serif;
  --ds-typeface-compressed: "Inter Arrows", "GT-America-Compressed-Regular", var(--ds-typeface-regular);
  --ds-typeface-mono: "Inter Arrows", "Iosevka", "Iosevka Extended", ui-monospace, "SF Mono", Menlo, monospace;
  /* Japanese and Chinese: Noto Sans when cjk.css (or the product) loads it,
     else the reader's own face. Latin keeps GT America. */
  --ds-typeface-regular-jp:
    "Inter Arrows", "GT America", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans CJK JP", sans-serif;
  --ds-typeface-regular-zh-hans:
    "Inter Arrows", "GT America", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --ds-typeface-regular-zh-hant:
    "Inter Arrows", "GT America", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", sans-serif;
  /* GT America exposes circular dots as stylistic set 05. */
  --ds-font-features: "ss05" 1;

  --ds-type-weight-default: 400;
  --ds-type-weight-bold: 500;

  /* ----------------------------------------------------------
   SURFACES
   The chrome's `--chrome-panel-*` tokens read these.
   ---------------------------------------------------------- */

  --ds-paper: light-dark(#fafafa, #0f0f10);
  --ds-text-color: light-dark(#18181b, #fafafa);
  --ds-text-color-muted: light-dark(#5c5c62, #a6a6ad);
  /* 5.1:1 on paper and 4.6:1 on the fill; the palette grey (#797979) reaches only 4.35:1 (color.text-contrast). */
  --ds-title-color: light-dark(#5c5c62, #a6a6ad);
  /* Text that reports a failure or warns of a loss. Red for blood on light
     paper and Tuned red on dark: both palette colours, legible as 14px text. */
  --ds-danger-color: light-dark(var(--ds-red-for-blood), var(--ds-tuned-red));
  /* Text that asks for care before something goes wrong. Orange is too light
     for text on light paper and so is its dark-mode version, so light paper
     takes Orange's dim (#4c3f1a, its pastel in dark mode); dark paper takes
     Orange itself. Both read above 4.5:1 as 14px text. */
  --ds-warning-color: light-dark(#4c3f1a, var(--ds-orange));
  /* What went well or is done. Apple green is too light for text and marks on
     light paper, so light paper takes it deepened with the ink (Money's green
     for money in); dark paper takes Apple green itself. */
  --ds-success-color: light-dark(color-mix(in oklab, var(--ds-apple-green) 30%, var(--ds-black)), var(--ds-apple-green));
  --ds-border-color: light-dark(#e2e2e5, #2e2e32);
  --ds-fill: light-dark(#f0f0f1, #1c1c1f);
  --ds-fill-hover: light-dark(#e6e6e8, #26262a);
  --ds-focus-ring: light-dark(#594dff, #ccccff);
  /* A row a person presses (ds-row, .ds-row, a tree's rows, ds-sidebar): under
     the pointer, pressed, and the current destination or selected row, which
     also takes the medium weight. */
  --ds-row-fill-hover: var(--ds-fill);
  --ds-row-fill-press: color-mix(in srgb, var(--ds-fill-hover) 92%, var(--ds-text-color));
  --ds-row-fill-current: var(--ds-fill-hover);
  --ds-row-current-weight: var(--ds-type-weight-bold);

  --ds-button-text-color: var(--ds-text-color);
  --ds-button-background-color-primary: var(--ds-accent-color);
  --ds-button-text-color-on-accent: light-dark(#fafafa, #18181b);
  --ds-button-background-color-secondary: var(--ds-fill);
  --ds-icon-color: currentColor;

  /* Shared fields, including the row treatment of a form's settings rows. */
  --ds-input-background: light-dark(#ffffff, #161618);
  --ds-input-color: light-dark(#18181b, #fafafa);
  --ds-input-placeholder-color: light-dark(#5c5c62, #a6a6ad);
  --ds-input-disabled-color: light-dark(#5c5c62, #a6a6ad);
  --ds-input-reveal-color: light-dark(#18181b, #fafafa);
}

/* A page written in Japanese or Chinese sets its labels in that language's
   face: Chinese in Simplified characters, as the shared words are written,
   unless it says Traditional. */
:root:lang(ja) {
  --ds-typeface-regular: var(--ds-typeface-regular-jp);
}

:root:lang(zh) {
  --ds-typeface-regular: var(--ds-typeface-regular-zh-hans);
}

:root:lang(zh-Hant),
:root:lang(zh-TW),
:root:lang(zh-HK),
:root:lang(zh-MO) {
  --ds-typeface-regular: var(--ds-typeface-regular-zh-hant);
}

/* Atelier: A design studio: near-white paper, ink buttons with soft corners, big rounded cards and sections that turn over to black. */
:root {
  --ds-corner-size: 8px;
  --ds-card-corner-size: 16px;
  --ds-button-inset: 5px;
  --ds-button-primary-fill: var(--ds-accent-color);
  --ds-button-primary-text: light-dark(#fafafa, #18181b);
  --background: var(--ds-paper);
  --dialog-background: var(--ds-paper);
  --text-color: var(--ds-text-color);
  --ds-tag-accent: var(--ds-accent-color);
  --ds-progress-color: var(--ds-accent-color);
  --accent-color: var(--ds-accent-color);
  --button-background-color-primary: var(--ds-accent-color);
  --button-text-color-on-light: var(--ds-button-text-color-on-accent);
  --button-background-color-secondary: var(--ds-fill);
  --brand-band: light-dark(#0a0a0a, #fafafa);
  --brand-band-ink: light-dark(#fafafa, #18181b);
  --brand-highlight: light-dark(#fde70c, #fde70c);
}

/* The canvas behind the page is the library's paper too, over the paper the theme's head script paints. */
html {
  background-color: var(--background) !important;
}

/* Charts and the heat of a month take the library's colour; they set these on themselves, so the library names them. */
ds-chart, ds-bars, ds-spark, ds-ratio {
  --ds-chart-up: light-dark(#594dff, #ccccff);
  --ds-chart-live: var(--ds-chart-up);
  --ds-chart-ink: var(--ds-text-color);
  --ds-chart-muted: var(--ds-text-color-muted);
  --ds-chart-faint: var(--ds-border-color);
  --ds-chart-fill: var(--ds-fill);
}

/* Button sizes: data-size="medium" (two squares) and "large" (three); the default is one control in one square. */
ds-button[data-size="medium"] {
  --ds-control-size: 36px;
  --ds-text-size: 16px;
  --ds-text-leading: 20px;
  --ds-button-inset: 12px;
  --ds-corner-size: 16px;
  vertical-align: bottom;
}

ds-button[data-size="large"] {
  --ds-control-size: 56px;
  --ds-text-size: 24px;
  --ds-text-leading: 28px;
  --ds-button-inset: 20px;
  --ds-corner-size: 24px;
  vertical-align: bottom;
}

/* On a phone a large button takes the medium measures, so a call to action keeps to the screen. */
@media (max-width: 600px) {
  ds-button[data-size="large"] {
    --ds-control-size: 36px;
    --ds-text-size: 16px;
    --ds-text-leading: 20px;
    --ds-button-inset: 12px;
    --ds-corner-size: 16px;
  }
}

/* An outlined face: no fill, a hairline inside its edge, the ink for words. */
ds-button[data-face="outlined"]::part(control) {
  background: transparent;
  color: var(--ds-text-color);
  box-shadow: inset 0 0 0 1px var(--ds-border-color);
  padding: 0 calc(var(--ds-button-inset, 4px) * var(--ds-sf, 1));
}

ds-button[data-face="outlined"]:hover::part(control) {
  background: var(--ds-fill);
}

ds-calendar {
  --ds-calendar-heat-1: color-mix(in oklab, light-dark(#594dff, #ccccff) 20%, var(--ds-paper));
  --ds-calendar-heat-2: color-mix(in oklab, light-dark(#594dff, #ccccff) 40%, var(--ds-paper));
  --ds-calendar-heat-3: light-dark(#594dff, #ccccff);
  --ds-calendar-heat-4: color-mix(in oklab, light-dark(#594dff, #ccccff) 60%, var(--ds-text-color));
  --ds-calendar-heat-ink-1: var(--ds-text-color);
  --ds-calendar-heat-ink-2: var(--ds-text-color);
  --ds-calendar-heat-ink-3: light-dark(#ffffff, #1e1e1e);
  --ds-calendar-heat-ink-4: var(--ds-paper);
}

ds-button { --ds-typeface-regular: var(--ds-typeface-mono); --ds-typeface-medium: var(--ds-typeface-mono); }
