/* Phos UI system v1 (20 Nov 2026) — the choices from the "Phos UI Consistency" canvas.
   One source for the landing, the editor Home and the editor. Copies live beside each app; edit this file, then copy.
   01 Shape A · 02 Glass A (Frost) · 03 Buttons A · 04 Segmented A · 05 App bar (Editor label B, search A)
   06 Toolbar A · 07 Kelvin bar B (fixed) · 08 Fields A · 09 Glow A · 10 Fractal A (provisional) · 11 Icons B (Plot)
   Behaviour (rim light + rising glow) comes from phos-ui.js; icons from phos-icons.js. */

:root {
  /* colour */
  --pu-blackout: #0A0A0B; --pu-duvetyne: #1F1F22; --pu-diffusion: #F4F4F5; --pu-bounce: #FFFFFF; --pu-key: #FF5A1F; --pu-on-key: #0A0A0B;
  --pu-ink: #FFFFFF; --pu-ink-soft: #D4D4D8; --pu-ink-sub: #A1A1AA; --pu-ink-faint: #71717A;
  /* 01 shape: pills for every control and bar, 24 for surfaces, 12 for rows inside a surface, 0 for the full-width app bar */
  --pu-r-pill: 999px; --pu-r-panel: 24px; --pu-r-row: 12px; --pu-pad-panel: 24px;
  /* 02 glass: Frost, one flat fill. Dense = the same glass, more opaque, for overlays that hold text over busy content */
  --pu-frost: rgba(32, 32, 36, 0.46);
  --pu-frost-dense: rgba(24, 24, 27, 0.84);
  --pu-blur: blur(28px) saturate(150%);
  --pu-edge: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  --pu-drop: 0 22px 44px -24px rgba(0, 0, 0, 0.9);
  /* washes */
  --pu-wash: rgba(255, 255, 255, 0.10);       /* selected */
  --pu-wash-hover: rgba(255, 255, 255, 0.06); /* hovered */
  --pu-tint: rgba(255, 90, 31, 0.10); --pu-tint-edge: rgba(255, 90, 31, 0.30);
  --pu-tint-on: rgba(255, 90, 31, 0.14); --pu-tint-on-edge: rgba(255, 90, 31, 0.55);
  --pu-focus: inset 0 0 0 1px rgba(255, 90, 31, 0.8), 0 0 0 4px rgba(255, 90, 31, 0.14);
  /* the Kelvin bar: starts on deep red and ends on blue so both ends stay visible (07 B, fixed) */
  --pu-kelvin: linear-gradient(90deg, #7A1405 0%, #E2351C 12%, #FF5A1F 26%, #FF961F 38%, #FFD64A 48%, #FFF6DC 58%, #FFFFFF 64%, #7FE6FF 76%, #2BB4FF 88%, #2A45D0 100%);
  /* motion */
  --pu-ease: cubic-bezier(0.23, 1, 0.32, 1);
  /* type */
  --pu-sans: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --pu-mono: "Geist Mono", ui-monospace, monospace;
}

/* ── 02 + 09 · Glass: flat Frost, rim light that follows the pointer, light rising from the bottom edge.
   phos-ui.js sets --mx/--my (rim, px), --gx (glow, % on x; y locked) and --gf (0→1, eased) on the element under the pointer. */
.pu-glass {
  position: relative; isolation: isolate;
  /* each glass element starts dark: the light values never inherit from the panel around it */
  --gf: 0; --gx: 50%; --grx: initial; --gry: initial; --mx: 50%; --my: 0px; --eg: 0.55;
  /* glow size: 110% x 80% of the element (pills 90% x 130%); phos-ui.js turns it into px (--grx/--gry)
     and caps the ellipse at 2.2:1 wide and 1.2:1 tall so it never stretches on long bars or tall drawers */
  --pu-gw: 1.1; --pu-gh: 0.8;
  --pu-gsize: var(--grx, 110%) var(--gry, 80%);
  background:
    radial-gradient(var(--pu-gsize) at var(--gx) 100%, rgba(255, 150, 80, calc(var(--pu-ga, 0.42) * var(--gf))) 0%, rgba(255, 90, 31, calc(var(--pu-gb, 0.2) * var(--gf))) var(--pu-gm, 38%), rgba(255, 90, 31, 0) var(--pu-ge, 82%)),
    var(--pu-glass-fill, var(--pu-frost));
  -webkit-backdrop-filter: var(--pu-blur); backdrop-filter: var(--pu-blur);
  box-shadow: var(--pu-edge), var(--pu-drop);
}
/* pills: a narrower, softer light under the pointer (panels keep the wide one) */
.pu-btn, .pu-chip, .pu-seg, .pu-toolbar, .pu-field, .pab-cta, .pu-pill { --pu-gw: 0.9; --pu-gh: 1.3; --pu-gsize: var(--grx, 90%) var(--gry, 130%); --pu-ga: 0.32; --pu-gb: 0.1; --pu-gm: 45%; --pu-ge: 80%; }
.pu-glass.pu-dense { --pu-glass-fill: var(--pu-frost-dense); }
.pu-glass::after, .pu-rim::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
  background: radial-gradient(var(--pu-rim-r, 240px) circle at var(--mx, 50%) var(--my, 0px), rgba(255, 242, 228, 0.95), rgba(255, 150, 90, 0.5) 38%, rgba(255, 255, 255, 0) 72%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: var(--eg, 0.55);
}

/* ── 03 · Buttons: four roles, all pills */
.pu-btn {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border: 0; border-radius: var(--pu-r-pill);
  font: 500 15px/1 var(--pu-sans); color: var(--pu-ink); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .2s var(--pu-ease), color .2s var(--pu-ease), box-shadow .2s var(--pu-ease), transform .16s var(--pu-ease);
  --pu-rim-r: 90px;
}
.pu-btn svg { width: 16px; height: 16px; flex: none; }
.pu-btn:active { transform: scale(0.97); }
.pu-btn:focus-visible { outline: 2px solid var(--pu-key); outline-offset: 3px; }
.pu-btn.pu-sm { height: 36px; padding: 0 14px; font-size: 14px; }
/* primary: Frost glass that turns Key with black text on hover; the rim light stays and keeps following */
.pu-btn.pu-primary:hover, .pu-btn.pu-primary:active { background: var(--pu-key); color: var(--pu-on-key); }
/* secondary: the same glass, no Key */
/* accent: Key-tinted pill — Upgrade, badges, active tags */
.pu-btn.pu-accent { background: var(--pu-tint); box-shadow: inset 0 0 0 1px var(--pu-tint-edge); color: var(--pu-key); }
.pu-btn.pu-accent:hover { background: var(--pu-tint-on); box-shadow: inset 0 0 0 1px var(--pu-tint-on-edge); }
/* quiet: text, grey wash on hover */
.pu-btn.pu-quiet { background: transparent; color: var(--pu-ink-sub); }
.pu-btn.pu-quiet:hover { background: var(--pu-wash-hover); color: var(--pu-ink); }
/* solid Key: only the waitlist form's submit */
.pu-btn.pu-submit { background: var(--pu-key); color: var(--pu-on-key); }
.pu-btn.pu-submit:hover { background: #FF6E3A; }

/* ── Chips and tags (accent look when on) */
.pu-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: var(--pu-r-pill); flex: none;
  font: 500 12px/1 var(--pu-mono); letter-spacing: 0.1em; text-transform: uppercase; color: #E4E4E7; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); transition: background-color .16s var(--pu-ease), box-shadow .16s var(--pu-ease), transform .16s var(--pu-ease); }
.pu-chip:active { transform: scale(0.97); }
.pu-chip.on, .pu-chip[aria-pressed="true"] { background: var(--pu-tint-on); box-shadow: inset 0 0 0 1px var(--pu-tint-on-edge); color: var(--pu-ink); }
.pu-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--pu-key); flex: none; }

/* ── 04 · Segmented control: Frost track, selected tab a grey pill */
.pu-seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--pu-r-pill); }
.pu-seg-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: var(--pu-r-pill);
  background: transparent; color: var(--pu-ink-sub); font: 500 14px/1 var(--pu-sans); cursor: pointer; transition: background-color .2s var(--pu-ease), color .2s var(--pu-ease); }
.pu-seg-btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--pu-ink); }
.pu-seg-btn.on, .pu-seg-btn[aria-selected="true"] { background: var(--pu-wash); color: var(--pu-ink); }

/* ── 06 · Toolbar: Frost pill, selected tool a grey pill */
.pu-toolbar { display: inline-flex; align-items: center; gap: 2px; padding: 5px; border-radius: var(--pu-r-pill); }
.pu-tool { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; min-width: 38px; padding: 0 11px; border: 0; border-radius: var(--pu-r-pill);
  background: transparent; color: var(--pu-ink-soft); font: 500 14px/1 var(--pu-sans); cursor: pointer; }
.pu-tool:hover { background: var(--pu-wash-hover); color: var(--pu-ink); }
.pu-tool.on, .pu-tool[aria-pressed="true"] { background: rgba(255, 255, 255, 0.12); color: var(--pu-ink); }

/* ── Panels, menus and rows: 24 outside, 12 inside, 12–24 padding */
.pu-panel { border-radius: var(--pu-r-panel); padding: var(--pu-pad-panel); }
.pu-menu { border-radius: var(--pu-r-panel); padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.pu-row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--pu-r-row); background: transparent; color: var(--pu-ink-soft); font: 400 14px/1.2 var(--pu-sans); text-align: left; cursor: pointer; transition: background-color .15s var(--pu-ease); }
.pu-row:hover, .pu-row.on, .pu-row[aria-current] { background: var(--pu-wash-hover); color: var(--pu-ink); }
.pu-row.on, .pu-row[aria-current] { background: var(--pu-wash); }

/* ── 07 · Kelvin bar (B): the Kelvin gradient as a hairline on the top edge, fading in and out at both ends,
   with a spill of the same colours under it that fades out within 30 px so it never reaches the text */
.pu-kelvin { position: relative; --eg: 0; }
.pu-kelvin::before {
  content: ""; position: absolute; z-index: 1; left: 16px; right: 16px; top: 0; height: 30px; pointer-events: none;
  background: var(--pu-kelvin);
  -webkit-mask: linear-gradient(180deg, #000 0, #000 1.5px, rgba(0, 0, 0, 0.2) 1.5px, rgba(0, 0, 0, 0.07) 12px, rgba(0, 0, 0, 0) 30px), linear-gradient(90deg, rgba(0, 0, 0, 0) 0, #000 16%, #000 84%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-composite: source-in;
  mask: linear-gradient(180deg, #000 0, #000 1.5px, rgba(0, 0, 0, 0.2) 1.5px, rgba(0, 0, 0, 0.07) 12px, rgba(0, 0, 0, 0) 30px), linear-gradient(90deg, rgba(0, 0, 0, 0) 0, #000 16%, #000 84%, rgba(0, 0, 0, 0) 100%);
  mask-composite: intersect;
}
.pu-kelvin.pu-glass { --pu-glass-fill: var(--pu-frost-dense); }

/* ── 08 · Fields: Frost pill, Key rim and halo on focus */
.pu-field { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 20px; border-radius: var(--pu-r-pill); --pu-rim-r: 140px; transition: box-shadow .2s var(--pu-ease); }
.pu-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--pu-ink); font: 400 15px var(--pu-sans); }
.pu-field input::placeholder { color: #8E8E93; }
/* a field inside a glass panel sits on it: the edge only, no drop shadow under it */
.pu-glass .pu-field.pu-glass, .pu-glass .pu-area.pu-glass { box-shadow: var(--pu-edge); }
.pu-field:focus-within, .pu-field.pu-bad { box-shadow: var(--pu-focus); }
.pu-msg { margin: 0; padding: 0 20px; font: 400 10.5px/16px var(--pu-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--pu-key); }

/* ── Icons (11 · Plot): 48 grid, 2 px line at 24 px, round ends; key colour only on the key light */
.pu-i { display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.pu-i .s { fill: currentColor; stroke: none; }
:where(.pu-i:not([width])) { width: 24px; height: 24px; }


/* ── v1.1 additions (24 Nov 2026): accounts and creator forms. Same shapes, glass and roles as above. */
/* labels above fields: Geist Mono caps, ink-sub */
.pu-label { display: block; margin: 0 0 8px 20px; font: 500 11px/16px var(--pu-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--pu-ink-sub); }
.pu-label b { font-weight: 500; color: var(--pu-key); }
.pu-hint { margin: 8px 0 0 20px; font: 400 13px/18px var(--pu-sans); color: var(--pu-ink-sub); }
/* 08 · multi-line field: a surface, so 24 (not a pill); Key rim + halo on focus like the pill field */
.pu-area { display: block; border-radius: var(--pu-r-panel); padding: 14px 20px; --pu-rim-r: 160px; transition: box-shadow .2s var(--pu-ease); }
.pu-area textarea { display: block; width: 100%; min-height: 96px; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--pu-ink); font: 400 15px/1.5 var(--pu-sans); }
.pu-area textarea::placeholder { color: #8E8E93; }
.pu-glass .pu-area.pu-glass:focus-within, .pu-glass .pu-area.pu-glass.pu-bad, .pu-area:focus-within, .pu-area.pu-bad, .pu-glass .pu-field.pu-glass:focus-within, .pu-glass .pu-field.pu-glass.pu-bad { box-shadow: var(--pu-focus); }
.pu-field select { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--pu-ink); font: 400 15px var(--pu-sans); appearance: none; cursor: pointer; }
.pu-field select option { background: var(--pu-duvetyne); }
.pu-field.pu-ro { color: var(--pu-ink-sub); }
.pu-field.pu-ro input { color: var(--pu-ink-soft); }
/* checkbox: a 20 px square-ish pill box, Key only for the tick */
.pu-check { display: flex; align-items: flex-start; gap: 12px; font: 400 14px/20px var(--pu-sans); color: var(--pu-ink-soft); cursor: pointer; }
.pu-check input { appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); cursor: pointer; display: grid; place-items: center; transition: background-color .15s var(--pu-ease), box-shadow .15s var(--pu-ease); }
.pu-check input::after { content: ""; width: 10px; height: 6px; border: solid var(--pu-on-key); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .15s var(--pu-ease); }
.pu-check input:checked { background: var(--pu-key); box-shadow: none; }
.pu-check input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.pu-check input:focus-visible { outline: 2px solid var(--pu-key); outline-offset: 3px; }
/* "or" divider */
.pu-or { display: flex; align-items: center; gap: 14px; font: 500 11px/16px var(--pu-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--pu-ink-faint); }
.pu-or::before, .pu-or::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.09); }
/* avatar: the Google photo, or initials on Duvetyne */
.pu-avatar { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: var(--pu-duvetyne); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); color: var(--pu-ink); font: 600 13px/1 var(--pu-sans); letter-spacing: -0.01em; }
.pu-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pu-avatar.pu-lg { width: 64px; height: 64px; font-size: 24px; }
/* static badge: the accent look, not clickable (plan, role, status) */
.pu-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--pu-r-pill); background: var(--pu-tint); box-shadow: inset 0 0 0 1px var(--pu-tint-edge); color: var(--pu-key); font: 500 10.5px/1 var(--pu-mono); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.pu-badge.pu-neutral { background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); color: var(--pu-ink-soft); }
.pu-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* stepper: numbered steps, done = grey wash, current = accent; one row that scrolls on phones */
.pu-steps { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.pu-steps::-webkit-scrollbar { display: none; }
.pu-step { flex: none; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; height: 36px; padding: 0 14px 0 6px; border: 0; border-radius: var(--pu-r-pill); background: transparent; color: var(--pu-ink-sub); font: 500 13px/1 var(--pu-sans); cursor: pointer; transition: background-color .15s var(--pu-ease), color .15s var(--pu-ease); }
.pu-step span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); font: 500 10.5px/1 var(--pu-mono); letter-spacing: 0.04em; }
.pu-step:hover { background: var(--pu-wash-hover); color: var(--pu-ink); }
.pu-step.done { color: var(--pu-ink-soft); }
.pu-step.done span { background: var(--pu-wash); }
.pu-step[aria-current="step"] { background: var(--pu-tint-on); box-shadow: inset 0 0 0 1px var(--pu-tint-on-edge); color: var(--pu-ink); }
.pu-step[aria-current="step"] span { background: var(--pu-key); color: var(--pu-on-key); }
.pu-step:disabled { cursor: default; opacity: 0.5; }
.pu-step em { font-style: normal; }
/* narrow screens: only the current step keeps its name */
@media (max-width: 760px) { .pu-step:not([aria-current]) em { display: none; } .pu-step:not([aria-current]) { padding-right: 6px; } }
/* inline note on a surface (beta, warnings): a 12 row with a Kelvin-free neutral wash */
.pu-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--pu-r-row); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); font: 400 13px/19px var(--pu-sans); color: var(--pu-ink-soft); }
.pu-note svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--pu-ink-sub); }
/* destructive text action: quiet until hovered, then a red wash; never Key */
.pu-btn.pu-danger { background: transparent; color: #F87171; }
.pu-btn.pu-danger:hover { background: rgba(248, 113, 113, 0.1); }

/* switch: a 44 x 26 pill; on = Key with an on-key knob (settings that apply right away) */
.pu-switch { position: relative; width: 44px; height: 26px; padding: 0; border: 0; border-radius: var(--pu-r-pill); background: rgba(255, 255, 255, 0.12); cursor: pointer; transition: background-color .2s var(--pu-ease); flex: none; }
.pu-switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--pu-ease); }
.pu-switch.on, .pu-switch[aria-checked="true"] { background: var(--pu-key); }
.pu-switch.on i, .pu-switch[aria-checked="true"] i { transform: translateX(18px); background: var(--pu-on-key); }
.pu-switch:disabled { opacity: 0.4; cursor: default; }
.pu-switch:focus-visible { outline: 2px solid var(--pu-key); outline-offset: 3px; }

/* A glass element that holds other glass (a bar with a menu, a toolbar with a popover) draws its blur on ::before:
   a backdrop-filter on the parent itself would stop the children's blur at the parent (backdrop root). */
.pu-host { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.pu-host::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; -webkit-backdrop-filter: var(--pu-blur); backdrop-filter: var(--pu-blur); }
/* content always sits above the glass light */
:where(.pu-glass) > :where(*) { position: relative; z-index: 1; }

/* ── Access */
@media (prefers-reduced-transparency: reduce) {
  .pu-glass { background: var(--pu-duvetyne) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
@media (prefers-contrast: more) {
  .pu-glass { background: var(--pu-duvetyne) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6) !important; }
}
@media (prefers-reduced-motion: reduce) {
  .pu-btn, .pu-chip, .pu-seg-btn, .pu-row, .pu-step, .pu-check input, .pu-check input::after { transition: none; }
}
