/* Generated for theicxc — pier-plank theicxc skin (theicxc-design-tokens-v1). */
/* Source: theicxc-design-tokens-v1.md. Re-authored from o9k pier-plank.web.css. */
/* Light "parchment" is the DEFAULT theme; "candlelit" warm-dark is the variant. */
/* Structure/naming/scales inherited from pier-plank verbatim; only the color/    */
/* elevation/focus-color groups + type families are theicxc's.                    */

:root {
  /* ---- Color: LIGHT "parchment" (PRIMARY / default theme) ---- */

  /* surfaces */
  --pp-color-surface-background: #FBF7EE;   /* warm ivory paper */
  --pp-color-surface-sunken: #F2EADB;       /* deeper parchment (wells, code) */
  --pp-color-surface-raised: #FFFDF8;        /* warm near-white (cards/sheets) */
  --pp-color-surface-overlay: rgba(34,28,18,0.45); /* warm scrim */
  --pp-color-surface-scrim: rgba(34,28,18,0.55);
  /* stratum surface ladder (light: ascend toward warm-white) */
  --pp-color-surface-l0: #F2EADB;
  --pp-color-surface-l1: #FFFDF8;
  --pp-color-surface-l2: #FBF7EE;
  --pp-color-surface-l3: #F2EADB;
  /* app.css convenience aliases (kept defined, not fallback) */
  --pp-color-surface-base: #FBF7EE;
  --pp-color-surface-elevated: #FFFDF8;
  --pp-color-surface-hover: #F2EADB;
  --pp-color-bg: #FBF7EE;

  /* text */
  --pp-color-text-primary: #241E14;          /* warm near-black ink (NOT #000) */
  --pp-color-text-secondary: #6E6450;        /* warm taupe */
  --pp-color-text-tertiary: #948A74;          /* muted */
  --pp-color-text-disabled: #B8AE96;
  --pp-color-text-inverse: #FBF7EE;          /* ivory (on brass/dark) */
  --pp-color-text-link: #836726;             /* brass-ink, AA on ivory */
  --pp-color-text: #241E14;
  --pp-color-text-dim: #6E6450;

  /* action — antique brass-gold (AA: ivory onPrimary = 5.3:1 on #836726) */
  --pp-color-action-primary: #836726;
  --pp-color-action-primary-seed: #836726;
  --pp-color-action-primary-hover: #9A7B2E;
  --pp-color-action-primary-pressed: #6E5520;
  --pp-color-action-primary-disabled: #D8CBA6;
  --pp-color-action-secondary: #F2EADB;
  --pp-color-action-secondary-hover: #EBE0CB;
  --pp-color-action-secondary-pressed: #E0D2B6;
  --pp-color-action-destructive: #9A3B2E;
  --pp-color-action-destructive-hover: #B0493B;
  --pp-color-action-destructive-pressed: #823024;

  /* accents */
  --pp-color-accent-gold: #C2A24E;           /* brighter gold — IC XC mark */
  --pp-color-accent-soft: rgba(154,123,46,0.12);
  --pp-color-accent-liturgical: #6E2A2A;     /* deep oxblood — sacred only */

  /* borders — warm */
  --pp-color-border-default: #E5DBC8;
  --pp-color-border-strong: #CFC2A6;
  --pp-color-border-subtle: #EFE7D6;
  --pp-color-border-focus: #9A7B2E;          /* brass, >=3:1 both themes */
  --pp-color-border: #E5DBC8;

  /* feedback / status */
  --pp-color-feedback-error: #9A3B2E;
  --pp-color-feedback-info: #5A6E7E;
  --pp-color-feedback-success: #4E7A52;      /* muted green — sparing */
  --pp-color-feedback-warning: #B0903B;

  /* stratum scale — warm parchment→brass ladder (light) */
  --pp-color-stratum-s0: #F2EADB; --pp-color-stratum-s0-fg: #948A74;
  --pp-color-stratum-s1: #EFE7D6; --pp-color-stratum-s1-fg: #6E6450;
  --pp-color-stratum-s2: #EBE0CB; --pp-color-stratum-s2-fg: #4A4232;
  --pp-color-stratum-s3: #E5DBC8; --pp-color-stratum-s3-fg: #241E14;
  --pp-color-stratum-s4: #DFD0AE; --pp-color-stratum-s4-fg: #241E14;
  --pp-color-stratum-s5: #D6C193; --pp-color-stratum-s5-fg: #241E14;
  --pp-color-stratum-s6: #C9A84C; --pp-color-stratum-s6-fg: #241E14;
  --pp-color-stratum-s7: #9A7B2E; --pp-color-stratum-s7-fg: #FBF7EE;
  --pp-color-stratum-s8: #B0903B; --pp-color-stratum-s8-fg: #FBF7EE;
  --pp-color-stratum-s9: #C2A24E; --pp-color-stratum-s9-fg: #241E14;
  --pp-color-stratum-s10: #D9BA5E; --pp-color-stratum-s10-fg: #241E14;

  /* ---- Elevation: soft, WARM-toned, layered (paper lifting) ---- */
  --pp-elevation-0-shadow: none;
  --pp-elevation-1-shadow: 0 1px 2px rgba(60,45,20,0.10), 0 2px 8px rgba(60,45,20,0.06);
  --pp-elevation-2-shadow: 0 2px 4px rgba(60,45,20,0.10), 0 4px 12px rgba(60,45,20,0.08);
  --pp-elevation-3-shadow: 0 4px 8px rgba(60,45,20,0.12), 0 8px 20px rgba(60,45,20,0.10);
  --pp-elevation-4-shadow: 0 6px 12px rgba(60,45,20,0.14), 0 12px 28px rgba(60,45,20,0.12);
  --pp-elevation-5-shadow: 0 8px 16px rgba(60,45,20,0.16), 0 16px 36px rgba(60,45,20,0.14);

  /* ---- Focus (brass ring, 2dp/2dp) ---- */
  --pp-focus-color: #9A7B2E;
  --pp-focus-offset_dp: 2px;
  --pp-focus-style: solid;
  --pp-focus-width_dp: 2px;
  /* canonical aliases used by the global :focus-visible rule (AA P11 §6.3) */
  --pp-focus-width: 2px;
  --pp-focus-offset: 2px;

  /* ---- Motion (inherited durations; theicxc tunes easing via higher damping) ---- */
  --pp-motion-duration-default: 200ms;
  --pp-motion-duration-emphasized: 320ms;
  --pp-motion-duration-instant: 0;
  --pp-motion-duration-quick: 100ms;
  --pp-motion-duration-slow: 520ms;
  --pp-motion-easing-accelerate: cubic-bezier(0.3, 0.0, 1.0, 1.0);
  --pp-motion-easing-emphasized: cubic-bezier(0.2, 0.0, 0.0, 1.0);
  --pp-motion-easing-linear: cubic-bezier(0, 0, 1, 1);
  --pp-motion-easing-standard: cubic-bezier(0.2, 0.0, 0.0, 1.0);
  --pp-motion-slide-reply: 200ms cubic-bezier(0.2, 0, 0, 1);

  /* ---- Radius (favor md/lg for a gentler hand) ---- */
  --pp-radius-lg: 16px;
  --pp-radius-md: 12px;
  --pp-radius-none: 0;
  --pp-radius-pill: 9999px;
  --pp-radius-sm: 8px;
  --pp-radius-xl: 28px;
  --pp-radius-xs: 4px;
  --pp-radius-two: 8px;

  /* ---- Space (invariant) ---- */
  --pp-space-0: 0;
  --pp-space-eight: 32px;
  --pp-space-five: 20px;
  --pp-space-four: 16px;
  --pp-space-half: 2px;
  --pp-space-one: 4px;
  --pp-space-six: 24px;
  --pp-space-ten: 40px;
  --pp-space-three: 12px;
  --pp-space-twelve: 48px;
  --pp-space-two: 8px;

  /* ---- Type: EB Garamond (display/serif) + Inter (body/sans) ---- */
  --pp-font-display: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --pp-font-body: "Inter", system-ui, -apple-system, sans-serif;

  --pp-type-body-large-font_family: "Inter", system-ui, -apple-system, sans-serif;
  --pp-type-body-large-letter_spacing_dp: 0px;
  --pp-type-body-large-line_height_dp: 28px;
  --pp-type-body-large-size_dp: 18px;
  --pp-type-body-large-weight: 400;
  --pp-type-body-medium-font_family: "Inter", system-ui, -apple-system, sans-serif;
  --pp-type-body-medium-letter_spacing_dp: 0px;
  --pp-type-body-medium-line_height_dp: 25px;
  --pp-type-body-medium-size_dp: 16px;
  --pp-type-body-medium-weight: 400;
  --pp-type-body-small-font_family: "Inter", system-ui, -apple-system, sans-serif;
  --pp-type-body-small-letter_spacing_dp: 0px;
  --pp-type-body-small-line_height_dp: 18px;
  --pp-type-body-small-size_dp: 13px;
  --pp-type-body-small-weight: 400;
  --pp-type-code-default-font_family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --pp-type-code-default-letter_spacing_dp: 0px;
  --pp-type-code-default-line_height_dp: 20px;
  --pp-type-code-default-size_dp: 14px;
  --pp-type-code-default-weight: 400;
  --pp-type-display-large-font_family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --pp-type-display-large-letter_spacing_dp: 0px;
  --pp-type-display-large-line_height_dp: 46px;
  --pp-type-display-large-size_dp: 40px;
  --pp-type-display-large-weight: 500;
  --pp-type-display-medium-font_family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --pp-type-display-medium-letter_spacing_dp: 0px;
  --pp-type-display-medium-line_height_dp: 38px;
  --pp-type-display-medium-size_dp: 32px;
  --pp-type-display-medium-weight: 500;
  --pp-type-display-small-font_family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --pp-type-display-small-letter_spacing_dp: 0px;
  --pp-type-display-small-line_height_dp: 34px;
  --pp-type-display-small-size_dp: 28px;
  --pp-type-display-small-weight: 500;
  --pp-type-heading-1-font_family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --pp-type-heading-1-letter_spacing_dp: 0px;
  --pp-type-heading-1-line_height_dp: 40px;
  --pp-type-heading-1-size_dp: 32px;
  --pp-type-heading-1-weight: 500;
  --pp-type-heading-2-font_family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --pp-type-heading-2-letter_spacing_dp: 0px;
  --pp-type-heading-2-line_height_dp: 32px;
  --pp-type-heading-2-size_dp: 24px;
  --pp-type-heading-2-weight: 500;
  --pp-type-heading-3-font_family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --pp-type-heading-3-letter_spacing_dp: 0px;
  --pp-type-heading-3-line_height_dp: 28px;
  --pp-type-heading-3-size_dp: 20px;
  --pp-type-heading-3-weight: 500;
  --pp-type-label-large-font_family: "Inter", system-ui, -apple-system, sans-serif;
  --pp-type-label-large-letter_spacing_dp: 0.1px;
  --pp-type-label-large-line_height_dp: 20px;
  --pp-type-label-large-size_dp: 14px;
  --pp-type-label-large-weight: 600;
  --pp-type-label-medium-font_family: "Inter", system-ui, -apple-system, sans-serif;
  --pp-type-label-medium-letter_spacing_dp: 0.3px;
  --pp-type-label-medium-line_height_dp: 16px;
  --pp-type-label-medium-size_dp: 13px;
  --pp-type-label-medium-weight: 600;
  --pp-type-label-small-font_family: "Inter", system-ui, -apple-system, sans-serif;
  --pp-type-label-small-letter_spacing_dp: 0.4px;
  --pp-type-label-small-line_height_dp: 16px;
  --pp-type-label-small-size_dp: 13px;
  --pp-type-label-small-weight: 600;
  --pp-type-mono-default-font_family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --pp-type-mono-default-letter_spacing_dp: 0px;
  --pp-type-mono-default-line_height_dp: 20px;
  --pp-type-mono-default-size_dp: 14px;
  --pp-type-mono-default-weight: 400;

  /* ---- Z (invariant) ---- */
  --pp-z-base: 0;
  --pp-z-drawer: 50;
  --pp-z-modal: 60;
  --pp-z-overlay: 80;
  --pp-z-popover: 40;
  --pp-z-rail: 10;
  --pp-z-sticky: 30;
  --pp-z-toast: 70;
  --pp-z-topbar: 20;

  color-scheme: light;
}

/* ============================================================== */
/* GLOBAL focus ring (theicxc-design-tokens-v1 §6.3 / P11 WCAG AA). */
/* A single :focus-visible rule applies the brass --pp-focus-*      */
/* tokens (2dp width, 2dp offset) to ALL interactive elements,      */
/* replacing the UA default outline. Theme flips --pp-focus-color   */
/* (brass on light, gold on dark) — both >=3:1 against their bg.    */
/* ============================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[role="link"]:focus-visible,
.o9k-rail-item:focus-visible,
.o9k-rail-compose:focus-visible,
.o9k-rail-avatar:focus-visible,
.o9k-mode-switch__item:focus-visible,
.o9k-bottom-tab__item:focus-visible,
.o9k-btn:focus-visible,
.o9k-linkbtn:focus-visible {
  outline: var(--pp-focus-width, 2px) var(--pp-focus-style, solid) var(--pp-focus-color, #9A7B2E);
  outline-offset: var(--pp-focus-offset, 2px);
  border-radius: var(--pp-radius-xs, 4px);
}

/* ============================================================== */
/* DARK "candlelit" (SECONDARY theme) — warm near-black, never #000 */
/* Activated by explicit data-theme="dark" OR prefers-color-scheme.  */
/* Flips ONLY color / elevation / focus-color groups (per §7).       */
/* ============================================================== */

[data-theme="dark"] {
  --pp-color-surface-background: #17130C;
  --pp-color-surface-sunken: #100D08;
  --pp-color-surface-raised: #221B11;
  --pp-color-surface-overlay: rgba(0,0,0,0.55);
  --pp-color-surface-scrim: rgba(0,0,0,0.72);
  --pp-color-surface-l0: #100D08;
  --pp-color-surface-l1: #1C160D;
  --pp-color-surface-l2: #221B11;
  --pp-color-surface-l3: #2A2113;
  --pp-color-surface-base: #17130C;
  --pp-color-surface-elevated: #221B11;
  --pp-color-surface-hover: #221B11;
  --pp-color-bg: #17130C;

  --pp-color-text-primary: #EEE6D4;
  --pp-color-text-secondary: #A99C81;
  --pp-color-text-tertiary: #7E7460;
  --pp-color-text-disabled: #5A5340;
  --pp-color-text-inverse: #17130C;
  --pp-color-text-link: #D9BA5E;
  --pp-color-text: #EEE6D4;
  --pp-color-text-dim: #A99C81;

  --pp-color-action-primary: #C9A84C;
  --pp-color-action-primary-seed: #C9A84C;
  --pp-color-action-primary-hover: #D9BA5E;
  --pp-color-action-primary-pressed: #B0903B;
  --pp-color-action-primary-disabled: #4A4128;
  --pp-color-action-secondary: #221B11;
  --pp-color-action-secondary-hover: #2A2113;
  --pp-color-action-secondary-pressed: #322817;
  --pp-color-action-destructive: #B5544A;
  --pp-color-action-destructive-hover: #C4655B;
  --pp-color-action-destructive-pressed: #9A3B2E;

  --pp-color-accent-gold: #D9BA5E;
  --pp-color-accent-soft: rgba(217,186,94,0.14);
  --pp-color-accent-liturgical: #B5544A;

  --pp-color-border-default: #322817;
  --pp-color-border-strong: #4A3D24;
  --pp-color-border-subtle: #261E12;
  --pp-color-border-focus: #D9BA5E;
  --pp-color-border: #322817;

  --pp-color-feedback-error: #B5544A;
  --pp-color-feedback-info: #7E96A8;
  --pp-color-feedback-success: #6E9A72;
  --pp-color-feedback-warning: #D9BA5E;

  --pp-color-stratum-s0: #100D08; --pp-color-stratum-s0-fg: #7E7460;
  --pp-color-stratum-s1: #1C160D; --pp-color-stratum-s1-fg: #A99C81;
  --pp-color-stratum-s2: #221B11; --pp-color-stratum-s2-fg: #C8BCA0;
  --pp-color-stratum-s3: #2A2113; --pp-color-stratum-s3-fg: #EEE6D4;
  --pp-color-stratum-s4: #3A2E18; --pp-color-stratum-s4-fg: #EEE6D4;
  --pp-color-stratum-s5: #4F3E1F; --pp-color-stratum-s5-fg: #FBF7EE;
  --pp-color-stratum-s6: #7A6128; --pp-color-stratum-s6-fg: #FBF7EE;
  --pp-color-stratum-s7: #C9A84C; --pp-color-stratum-s7-fg: #17130C;
  --pp-color-stratum-s8: #D9BA5E; --pp-color-stratum-s8-fg: #17130C;
  --pp-color-stratum-s9: #E3C977; --pp-color-stratum-s9-fg: #17130C;
  --pp-color-stratum-s10: #EED89A; --pp-color-stratum-s10-fg: #17130C;

  --pp-elevation-0-shadow: none;
  --pp-elevation-1-shadow: 0 1px 2px rgba(0,0,0,0.40), 0 2px 8px rgba(0,0,0,0.30);
  --pp-elevation-2-shadow: 0 2px 4px rgba(0,0,0,0.42), 0 4px 12px rgba(0,0,0,0.34);
  --pp-elevation-3-shadow: 0 4px 8px rgba(0,0,0,0.44), 0 8px 20px rgba(0,0,0,0.38);
  --pp-elevation-4-shadow: 0 6px 12px rgba(0,0,0,0.46), 0 12px 28px rgba(0,0,0,0.42);
  --pp-elevation-5-shadow: 0 8px 16px rgba(0,0,0,0.48), 0 16px 36px rgba(0,0,0,0.46);

  --pp-focus-color: #D9BA5E;

  color-scheme: dark;
}

/* Honor OS dark preference automatically when no explicit theme is set. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pp-color-surface-background: #17130C;
    --pp-color-surface-sunken: #100D08;
    --pp-color-surface-raised: #221B11;
    --pp-color-surface-overlay: rgba(0,0,0,0.55);
    --pp-color-surface-scrim: rgba(0,0,0,0.72);
    --pp-color-surface-l0: #100D08;
    --pp-color-surface-l1: #1C160D;
    --pp-color-surface-l2: #221B11;
    --pp-color-surface-l3: #2A2113;
    --pp-color-surface-base: #17130C;
    --pp-color-surface-elevated: #221B11;
    --pp-color-surface-hover: #221B11;
    --pp-color-bg: #17130C;

    --pp-color-text-primary: #EEE6D4;
    --pp-color-text-secondary: #A99C81;
    --pp-color-text-tertiary: #7E7460;
    --pp-color-text-disabled: #5A5340;
    --pp-color-text-inverse: #17130C;
    --pp-color-text-link: #D9BA5E;
    --pp-color-text: #EEE6D4;
    --pp-color-text-dim: #A99C81;

    --pp-color-action-primary: #C9A84C;
    --pp-color-action-primary-seed: #C9A84C;
    --pp-color-action-primary-hover: #D9BA5E;
    --pp-color-action-primary-pressed: #B0903B;
    --pp-color-action-primary-disabled: #4A4128;
    --pp-color-action-secondary: #221B11;
    --pp-color-action-secondary-hover: #2A2113;
    --pp-color-action-secondary-pressed: #322817;
    --pp-color-action-destructive: #B5544A;
    --pp-color-action-destructive-hover: #C4655B;
    --pp-color-action-destructive-pressed: #9A3B2E;

    --pp-color-accent-gold: #D9BA5E;
    --pp-color-accent-soft: rgba(217,186,94,0.14);
    --pp-color-accent-liturgical: #B5544A;

    --pp-color-border-default: #322817;
    --pp-color-border-strong: #4A3D24;
    --pp-color-border-subtle: #261E12;
    --pp-color-border-focus: #D9BA5E;
    --pp-color-border: #322817;

    --pp-color-feedback-error: #B5544A;
    --pp-color-feedback-info: #7E96A8;
    --pp-color-feedback-success: #6E9A72;
    --pp-color-feedback-warning: #D9BA5E;

    --pp-color-stratum-s0: #100D08; --pp-color-stratum-s0-fg: #7E7460;
    --pp-color-stratum-s1: #1C160D; --pp-color-stratum-s1-fg: #A99C81;
    --pp-color-stratum-s2: #221B11; --pp-color-stratum-s2-fg: #C8BCA0;
    --pp-color-stratum-s3: #2A2113; --pp-color-stratum-s3-fg: #EEE6D4;
    --pp-color-stratum-s4: #3A2E18; --pp-color-stratum-s4-fg: #EEE6D4;
    --pp-color-stratum-s5: #4F3E1F; --pp-color-stratum-s5-fg: #FBF7EE;
    --pp-color-stratum-s6: #7A6128; --pp-color-stratum-s6-fg: #FBF7EE;
    --pp-color-stratum-s7: #C9A84C; --pp-color-stratum-s7-fg: #17130C;
    --pp-color-stratum-s8: #D9BA5E; --pp-color-stratum-s8-fg: #17130C;
    --pp-color-stratum-s9: #E3C977; --pp-color-stratum-s9-fg: #17130C;
    --pp-color-stratum-s10: #EED89A; --pp-color-stratum-s10-fg: #17130C;

    --pp-elevation-1-shadow: 0 1px 2px rgba(0,0,0,0.40), 0 2px 8px rgba(0,0,0,0.30);
    --pp-elevation-2-shadow: 0 2px 4px rgba(0,0,0,0.42), 0 4px 12px rgba(0,0,0,0.34);
    --pp-elevation-3-shadow: 0 4px 8px rgba(0,0,0,0.44), 0 8px 20px rgba(0,0,0,0.38);
    --pp-elevation-4-shadow: 0 6px 12px rgba(0,0,0,0.46), 0 12px 28px rgba(0,0,0,0.42);
    --pp-elevation-5-shadow: 0 8px 16px rgba(0,0,0,0.48), 0 16px 36px rgba(0,0,0,0.46);

    --pp-focus-color: #D9BA5E;
    color-scheme: dark;
  }
}
