/* ════════════════════════════════════════════════════════════════════
   Button.css — canonical Button for @playhead/ui

   Treatment: "INK" (selected from the button explorations). A warm
   near-black body with an ember label and a fine gold hairline; the
   gold reads as an accent, not a fill. The most restrained of the
   directions — calm and clear, per the brand brief.

   Tokens come from styles/tokens.css (the DS source of truth). Only the
   bespoke ink-gradient stops are literal hex — they have no token.

   Class shape (DS `.ds-` convention; was bare `.btn`/`.btn.primary`):
     .ds-btn            base = SECONDARY (outlined / neutral)
     .ds-btn--primary   ink body, ember label, gold hairline
     .ds-btn--ghost     text-only, quiet
     .ds-btn--danger    ink body, terracotta label
     .ds-btn--sm        small size
   ════════════════════════════════════════════════════════════════════ */

/* ── Base = SECONDARY (outlined / neutral) ─────────────────────────── */
.ds-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  padding:9px 18px; line-height:1.1;
  border:1px solid var(--line-strong); border-radius:var(--r-sm);
  font-family:var(--f-sans); font-weight:500; font-size:12.5px; letter-spacing:0.02em;
  background:transparent; color:var(--fg); cursor:pointer; white-space:nowrap;
  transition:background 140ms ease, border-color 140ms ease, color 140ms ease,
             box-shadow 160ms ease, transform 90ms ease;
}
.ds-btn svg{ width:14px; height:14px; display:block; }
.ds-btn:hover{
  background:color-mix(in srgb, var(--gold-6) 7%, transparent);
  border-color:color-mix(in srgb, var(--gold-6) 30%, transparent);
  color:var(--gold-5);
}
.ds-btn:active{ transform:translateY(0.5px); }
.ds-btn:focus-visible{
  outline:none;
  box-shadow:0 0 0 2px var(--bg-canvas), 0 0 0 3px var(--ember);
}

/* ── PRIMARY — ink body, ember label, gold hairline ────────────────── */
.ds-btn--primary{
  background:linear-gradient(180deg,#242017 0%,#1B180F 100%);
  color:var(--gold-6);
  border-color:color-mix(in srgb, var(--gold-6) 34%, transparent);
  box-shadow:0 1px 2px rgba(0,0,0,0.45);
  font-weight:600;
}
.ds-btn--primary:hover{
  background:linear-gradient(180deg,#2D2718 0%,#232014 100%);
  color:var(--gold-5);
  border-color:color-mix(in srgb, var(--gold-6) 62%, transparent);
  box-shadow:0 2px 9px rgba(0,0,0,0.5);
}
.ds-btn--primary:active{ background:#19160E; box-shadow:inset 0 1px 3px rgba(0,0,0,0.32); }

/* ── GHOST — text-only, quiet ──────────────────────────────────────── */
.ds-btn--ghost{ background:transparent; border-color:transparent; color:var(--fg-2); box-shadow:none; }
.ds-btn--ghost:hover{ background:color-mix(in srgb, var(--gold-6) 6%, transparent); border-color:transparent; color:var(--fg); }

/* ── DESTRUCTIVE — same ink construction, terracotta label ─────────── */
.ds-btn--danger{
  background:linear-gradient(180deg,#231711 0%,#1C130E 100%);
  color:#D98A7E;
  border-color:rgba(201,112,100,0.34);
  box-shadow:0 1px 2px rgba(0,0,0,0.45);
  font-weight:600;
}
.ds-btn--danger:hover{
  background:linear-gradient(180deg,#2C1B14 0%,#231711 100%);
  color:#E29B90;
  border-color:rgba(201,112,100,0.60);
  box-shadow:0 2px 9px rgba(0,0,0,0.5);
}
.ds-btn--danger:active{ transform:translateY(0.5px); box-shadow:inset 0 1px 3px rgba(0,0,0,0.32); }

/* ── Small size ────────────────────────────────────────────────────── */
.ds-btn--sm{ padding:6px 12px; font-size:11.5px; gap:6px; }
.ds-btn--sm svg{ width:13px; height:13px; }

/* ── Disabled (variant-agnostic; never brightens on hover) ─────────── */
.ds-btn:disabled, .ds-btn[disabled]{
  opacity:0.34; cursor:not-allowed;
  box-shadow:none !important; filter:none !important; transform:none !important;
}
.ds-btn--primary:disabled, .ds-btn--primary[disabled]{
  background:linear-gradient(180deg,#242017 0%,#1B180F 100%);
  color:var(--gold-6); border-color:color-mix(in srgb, var(--gold-6) 34%, transparent);
}
.ds-btn--danger:disabled, .ds-btn--danger[disabled]{
  background:linear-gradient(180deg,#231711 0%,#1C130E 100%);
  color:#D98A7E; border-color:rgba(201,112,100,0.34);
}
.ds-btn:not(.ds-btn--primary):not(.ds-btn--danger):disabled{ background:transparent; }

/* ════════════════════════════════════════════════════════════════════
   FTUE Setup additions (2026-08-10) — appended from Button.delta.css.
     .ds-btn--ember        solid-gold CTA (the inverse of --primary)
     .ds-btn--lg           40px decision size
     .ds-btn--block        full width
     .ds-btn--ghost-quiet  the quieter ghost, for declines
   ⚠ Order is load-bearing: ember's disabled slab sits BELOW the family
   disabled rules above so it overrides the 34% opacity wash.
   ════════════════════════════════════════════════════════════════════ */

/* ── EMBER — solid gold fill, ink label ────────────────────────────────
   The one loud button in the system, and deliberately rare: it marks a
   decision the user came here to make (create the account, grant
   access, enter the app). The --primary variant is the Ink treatment —
   a dark body with an ember LABEL — and it stays the default main
   action for ordinary views. Ember is for a full-width moment of
   commitment.

   The gradient is two stops of the same hue, one mixed lighter, so the
   face reads as lit metal rather than flat paint. The inset top
   highlight is what makes it feel pressed in relief; without it the
   button reads as a coloured rectangle. */
.ds-btn--ember {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--gold-5) 45%, var(--gold-6)),
    var(--gold-6)
  );
  border: 0;
  border-radius: var(--r-md);
  color: #1A1305;               /* near-black warm ink — literal, no
                                   token: this is the only place in the
                                   system where text sits ON gold */
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.4);
  transition:
    filter 150ms var(--ease-out),
    box-shadow 250ms var(--ease-out),
    transform 90ms var(--ease-out);
}
/* Hover BRIGHTENS rather than shifting hue — a gold button that changes
   colour on hover reads as a different button. The bloom is the same
   ember at low alpha, so the button appears to warm its surroundings. */
.ds-btn--ember:hover {
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 18px rgba(214, 165, 92, 0.22);
}
.ds-btn--ember:active {
  transform: translateY(0.5px);
  filter: brightness(0.98);
}
.ds-btn--ember:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--bg-canvas),
    0 0 0 3px var(--ember),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* ── EMBER, disabled — a neutral slab, NOT 34% gold ───────────────────
   The family disabled rule is opacity 0.34 with the resting fill held.
   On a solid gold face that produces a sickly translucent yellow-grey
   which reads as broken rather than unavailable. So ember substitutes a
   real disarmed state: ink slab, hairline, dim label.

   This is a deliberate divergence from the family and it must survive
   ports. Consumers pair it with a title attribute naming what is
   missing — a disarmed CTA that does not say why is a dead end. */
.ds-btn--ember:disabled,
.ds-btn--ember[disabled] {
  opacity: 1;
  background: #201F1C;
  border: 1px solid rgba(247, 237, 221, 0.1);
  color: var(--fg-4);
  box-shadow: none;
  filter: none;
  cursor: not-allowed;
}

/* ── LG — the 40px decision size ──────────────────────────────────────
   md is ~34px and is chrome-scale. lg is what a full-width primary
   decision wants: 40px tall, 13px/600, radius --r-md to match the
   ember face. */
.ds-btn--lg {
  height: 40px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-md);
  gap: 8px;
}
.ds-btn--lg svg { width: 15px; height: 15px; }

/* ── BLOCK — full width ───────────────────────────────────────────────
   Replaces the inline width:100% that every stacked-CTA call site was
   passing. */
.ds-btn--block {
  width: 100%;
  display: flex;
}

/* Outer silhouette, from the DS: `shape="pill"`. This copy predates it. */
.ds-btn--pill { border-radius: 9999px; }

/* ── GHOST-QUIET — the quieter ghost ──────────────────────────────────
   The --ghost variant rests at --fg-2 and warms to --fg with a 6% gold
   wash on hover: a quiet action that still invites. --ghost-quiet rests
   a step lower (--fg-4) and gains no wash at all — it lifts only to
   --fg-2.

   It exists for actions the design does NOT want to encourage but must
   offer: "Skip for now" beside "Allow system access", "Skip anyway" in
   the consequence dialog. Declining should be findable, unambiguous and
   completely unpersuasive. In the FTUE capture this lived as a
   page-level override on .ds-btn--ghost, which meant it travelled with
   the page instead of the system. */
.ds-btn--ghost-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--fg-4);
  box-shadow: none;
}
.ds-btn--ghost-quiet:hover {
  background: transparent;
  border-color: transparent;
  color: var(--fg-2);
}

/* ════════════════════════════════════════════════════════════════════
   Button.delta.css — APPEND-ONLY block, Plugin Integrations round
   (2026-08-31). Paste at the END of components/Button/Button.css.

   Adds ONE variant: .ds-btn--ember-wash. Nothing existing is touched.
   ════════════════════════════════════════════════════════════════════ */

/* ── variant="ember-wash" ────────────────────────────────────────────
   The third gold treatment, and the quietest. Where "primary" is the Ink
   treatment (dark body, ember label) and "ember" is a solid gold face,
   this is the WASH: a gold hairline over a 10% ember film with a gold-5
   label — the button reads as lit rather than as filled.

   It exists for invitations: the setup splash's "Enable plug-in
   integrations" and the command menu's "Set up integrations". Those sit
   on their own dark stage with nothing to out-rank, where a solid gold
   slab reads as an alarm and the Ink treatment disappears into the
   background it is printed on.

   Physics note (GUARDRAILS §7): a 10% flat film + 1px hairline, no
   gradient — nothing to band. */
.ds-btn--ember-wash {
  border: 1px solid color-mix(in srgb, var(--gold-6) 45%, transparent);
  background: var(--ember-wash);
  color: var(--gold-5);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.ds-btn--ember-wash:hover:not(:disabled) {
  background: color-mix(in srgb, var(--gold-6) 26%, transparent);
  border-color: color-mix(in srgb, var(--gold-6) 65%, transparent);
  color: var(--gold-3);
}

.ds-btn--ember-wash:active:not(:disabled) { filter: brightness(0.98); }

/* Disabled: the family's own treatment. Unlike --ember (which needs its
   own slab because a gold face can't be dimmed by opacity alone), a wash
   dims honestly. */
.ds-btn--ember-wash:disabled { opacity: 0.34; }
