/* ============================================================================
   Platinum Media — design tokens and shared shell
   Style: Modern Dark (cinematic, layered, frosted) · brand: platinum on ink
   Type:  Bodoni Moda (display) / Jost (interface)
   ========================================================================== */

/* Prata for display, Jost for interface — the luxury didone pairing the design
   system called for. Bodoni Moda was the first choice and was dropped: as
   Google Fonts serves it, its hyphen and en dash render as blank glyphs, and
   this copy is full of "$800–900" and "Bi-weekly". */
@import url('https://fonts.googleapis.com/css2?family=Prata&family=Jost:wght@300;400;500;600&display=swap');

:root {
  color-scheme: dark;

  /* --- platinum ramp: the brand mark is metallic, so the accent is light --- */
  --pt-50:  #FFFFFF;
  --pt-100: #F3F2EF;
  --pt-200: #DFDDD8;
  --pt-300: #C4C1BA;
  --pt-400: #A5A199;
  --pt-500: #86827A;
  --pt-600: #66635C;

  /* --- ink ramp: never pure black, which smears on OLED --- */
  --ink-900: #0B0B0D;
  --ink-850: #101014;
  --ink-800: #15151A;
  --ink-750: #1B1B21;
  --ink-700: #232329;
  --ink-600: #2E2E36;

  /* --- semantic surfaces --- */
  --bg:         var(--ink-900);
  --surface:    #121216;
  --surface-2:  #17171C;
  --surface-3:  #1E1E25;
  --line:       rgba(255, 255, 255, .085);
  --line-2:     rgba(255, 255, 255, .17);
  --line-3:     rgba(255, 255, 255, .30);

  /* --- text: every value below is checked against --bg in scripts/check-contrast --- */
  --text:    #F3F2F0;   /* 17.6:1 */
  --text-2:  #B4B0A9;   /*  9.1:1 */
  --text-3:  #8F8B84;   /*  5.8:1 */
  --text-4:  #6E6A64;   /*  3.3:1 — hairlines and disabled glyphs only, never body text */

  /* --- accent: brushed platinum --- */
  --accent:      var(--pt-200);
  --accent-ink:  #0E0E10;
  --accent-soft: rgba(223, 221, 216, .10);
  --accent-line: rgba(223, 221, 216, .34);
  --metal: linear-gradient(135deg, #FFFFFF 0%, #E4E2DD 38%, #B9B5AD 68%, #EFEDE9 100%);
  --metal-dim: linear-gradient(135deg, #4A4A52 0%, #6E6B65 45%, #3A3A41 100%);

  /* --- status --- */
  --ok:      #77CFA0;
  --ok-soft: rgba(119, 207, 160, .12);
  --warn:      #E4BE79;
  --warn-soft: rgba(228, 190, 121, .12);
  --danger:      #F08A82;
  --danger-soft: rgba(240, 138, 130, .12);

  /* --- type --- */
  --f-display: 'Prata', 'Playfair Display', Georgia, serif;
  --f-ui: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-mono: ui-monospace, 'SF Mono', Menlo, monospace;

  /* --- space (density 4/10: standard) --- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --r-pill: 999px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --dur: 320ms;
  --dur-fast: 180ms;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 8px 24px -8px rgba(0,0,0,.65);
  --shadow-3: 0 24px 64px -20px rgba(0,0,0,.8);

  --z-bg: 0; --z-content: 10; --z-chrome: 20; --z-float: 30; --z-overlay: 40; --z-toast: 50;
}

/* ------------------------------------------------------------------ base -- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--f-ui);
  font-size: 16.5px;
  font-weight: 400;
  line-height: 1.62;
  letter-spacing: .003em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient light: two very slow platinum blooms behind everything. Fixed, so
   they never trigger layout, and paused entirely under reduced motion. */
body::before {
  content: '';
  position: fixed;
  inset: -20vmax;
  z-index: var(--z-bg);
  pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 18% 8%,  rgba(214, 211, 204, .055), transparent 62%),
    radial-gradient(44vmax 44vmax at 88% 92%, rgba(160, 172, 190, .045), transparent 64%);
  animation: drift 34s ease-in-out infinite alternate;
}

/* Fine grain, the thing that separates "dark theme" from "expensive dark". */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

h1, h2, h3 { margin: 0; font-weight: 400; color: var(--text); }
p { margin: 0; }
a { color: var(--text); text-decoration-color: var(--line-3); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* Two-tone ring: the dark inner edge keeps it visible on the platinum button,
   the light outer edge keeps it visible on ink. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 2px var(--ink-900);
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: rgba(223, 221, 216, .22); color: #fff; }

/* Scrollbar, so it doesn't read as a bright light-mode strip on the right. */
* { scrollbar-color: var(--ink-600) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-600); border-radius: var(--r-pill); border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-700); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------- typography - */
.display {
  font-family: var(--f-display);
  font-weight: 400;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -.01em;
}

.eyebrow {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

/* ---------------------------------------------------------------- brand --- */
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand img { width: 30px; height: 30px; object-fit: contain; }
.brand .wordmark {
  font-family: var(--f-display);
  font-size: 17px;
  letter-spacing: .03em;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}
.brand .wordmark small {
  display: block;
  font-family: var(--f-ui);
  font-size: 9.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-top: 4px;
}

/* --------------------------------------------------------------- buttons -- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-line: var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 26px;
  border: 1px solid var(--btn-line);
  border-radius: var(--r);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .012em;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.btn:hover { border-color: var(--line-3); background: rgba(255,255,255,.04); }
.btn:active { transform: scale(.985); }
.btn:disabled, .btn[aria-disabled='true'] {
  opacity: .38;
  cursor: not-allowed;
  transform: none;
}

/* Brushed platinum. The sheen sweeps once on hover — the only ornament that
   earns its place, because the brand mark is metal. */
.btn-primary {
  position: relative;
  overflow: hidden;
  border-color: transparent;
  background: var(--metal);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, var(--shadow-2);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(255,255,255,.85) 50%, transparent 68%);
  transform: translateX(-120%);
  transition: transform 620ms var(--ease);
}
.btn-primary:hover { background: var(--metal); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 10px 30px -10px rgba(223,221,216,.35); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:disabled::after { display: none; }

.btn-ghost { border-color: transparent; color: var(--text-3); padding-inline: 16px; }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.05); border-color: transparent; }

.btn-danger { border-color: rgba(240,138,130,.35); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: rgba(240,138,130,.55); }

.btn-sm { min-height: 38px; padding: 8px 15px; font-size: 13.5px; border-radius: var(--r-sm); }

.link {
  background: none;
  border: 0;
  padding: 4px 2px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 4px;
  transition: color var(--dur-fast) var(--ease);
}
.link:hover { color: var(--text); text-decoration-color: var(--accent); }

.kbd-hint { font-size: 12.5px; color: var(--text-4); }
kbd {
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  color: var(--text-2);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
}

/* ---------------------------------------------------------------- fields -- */
.field {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  font: inherit;
  font-size: 16.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.field::placeholder { color: var(--text-4); }
.field:hover { border-color: var(--line-2); }
.field:focus {
  outline: none;
  border-color: var(--accent-line);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(223, 221, 216, .10);
}
textarea.field { min-height: 168px; line-height: 1.65; resize: vertical; }
select.field { appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23B4B0A9' stroke-width='1.6'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; }

label.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

/* ----------------------------------------------------------------- cards -- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
/* A hairline of light along the top edge — the bevel a metal object would have. */
.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.13), transparent);
}
.card h3 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--s-4);
}

/* ------------------------------------------------------------------ tags -- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .04em;
  white-space: nowrap;
}
.tag-ok      { color: var(--ok);     border-color: rgba(119,207,160,.32); background: var(--ok-soft); }
.tag-warn    { color: var(--warn);   border-color: rgba(228,190,121,.32); background: var(--warn-soft); }
.tag-danger  { color: var(--danger); border-color: rgba(240,138,130,.32); background: var(--danger-soft); }
.tag-accent  { color: var(--pt-100); border-color: var(--accent-line);    background: var(--accent-soft); }

/* ---------------------------------------------------------------- alerts -- */
.alert {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--text-2);
}
.alert-danger { border-color: rgba(240,138,130,.34); background: var(--danger-soft); color: var(--danger); }
.alert-warn   { border-color: rgba(228,190,121,.34); background: var(--warn-soft);   color: var(--warn); }
.alert-ok     { border-color: rgba(119,207,160,.34); background: var(--ok-soft);     color: var(--ok); }

/* ----------------------------------------------------------------- toast -- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: var(--z-toast);
  transform: translate(-50%, 20px);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 460px);
  padding: 13px 20px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: rgba(24, 24, 29, .93);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-3);
  color: var(--text);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }

/* -------------------------------------------------------- plain pages ----- */
.pm-plain {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: var(--s-5);
}
.plain-card {
  position: relative;
  z-index: var(--z-content);
  max-width: 460px;
  text-align: center;
}
.plain-mark { margin: 0 auto var(--s-5); }
.plain-card h1 {
  font-family: var(--f-display);
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.15;
  margin-bottom: var(--s-3);
}
.plain-card p { color: var(--text-3); font-size: 15.5px; }

/* ------------------------------------------------------------ utilities --- */
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--text-3); }
.small { font-size: 13.5px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
