/* afterfive.work — shared design tokens & primitives (landing + app)
   Dark-first: the product lives at 5 AM and after 5 PM. */

:root {
  color-scheme: dark;

  /* ink & surfaces */
  --bg: #07080f;
  --bg-2: #0b0d18;
  --bg-3: #111423;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-3: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);

  /* text */
  --text: #f3f0ea;
  --text-2: #bdb9c9;
  --text-3: #85829a;
  --text-inv: #0b0c14;

  /* the two fives */
  --dawn-0: #0d1330;
  --dawn-1: #1d2a66;
  --dawn-2: #7083ff;
  --dawn-3: #b9c3ff;
  --dawn-4: #ffc2a8;
  --dusk-0: #1a0d26;
  --dusk-1: #4a1d4f;
  --dusk-2: #f0703e;
  --dusk-3: #ffb35c;
  --dusk-4: #ffd89a;

  --am: #9aa8ff;
  --pm: #ffb35c;
  --accent: var(--pm);
  --accent-2: var(--dusk-2);
  --accent-ink: #1a1006;
  --accent-glow: rgba(255, 179, 92, 0.35);

  --ok: #7be0b0;
  --warn: #ffc266;
  --danger: #ff7a6b;

  /* type */
  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  /* shape */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;
  --r-pill: 999px;

  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 30px 80px -30px rgba(0, 0, 0, 0.8);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-side="am"] {
  --accent: var(--am);
  --accent-2: var(--dawn-2);
  --accent-ink: #0a0f2b;
  --accent-glow: rgba(154, 168, 255, 0.35);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

.serif {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.serif em,
em.serif {
  font-style: italic;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--text-2);
}

.faint {
  color: var(--text-3);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- buttons ---------- */
.btn {
  --_bg: var(--surface-2);
  --_fg: var(--text);
  --_bd: var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 48px;
  padding: 0 1.25em;
  border-radius: var(--r-pill);
  border: 1px solid var(--_bd);
  background: var(--_bg);
  color: var(--_fg);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: transform 0.18s var(--ease), background 0.2s var(--ease), border-color 0.2s, box-shadow 0.25s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  --_bg: var(--surface-3);
  --_bd: var(--line-2);
}

.btn:active {
  transform: scale(0.97);
}

.btn[disabled],
.btn.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.btn svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.btn--primary {
  --_bg: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --_fg: var(--accent-ink);
  --_bd: transparent;
  background: var(--_bg);
  box-shadow: 0 10px 34px -10px var(--accent-glow), 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

.btn--primary:hover {
  --_bg: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 14px 44px -10px var(--accent-glow), 0 1px 0 rgba(255, 255, 255, 0.45) inset;
  transform: translateY(-1px);
}

.btn--light {
  --_bg: var(--text);
  --_fg: var(--text-inv);
  --_bd: transparent;
}

.btn--light:hover {
  --_bg: #fff;
}

.btn--ghost {
  --_bg: transparent;
  --_bd: transparent;
}

.btn--ghost:hover {
  --_bg: var(--surface);
  --_bd: transparent;
}

.btn--lg {
  min-height: 56px;
  padding: 0 1.6em;
  font-size: 1.04rem;
}

.btn--sm {
  min-height: 38px;
  padding: 0 0.95em;
  font-size: 0.88rem;
}

.btn--icon {
  width: 44px;
  min-height: 44px;
  padding: 0;
}

.btn--block {
  width: 100%;
}

/* ---------- surfaces ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.32em 0.8em;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  flex: none;
}

.dot--live {
  background: var(--ok);
  animation: af-pulse 2.4s infinite;
}

@keyframes af-pulse {
  0% { box-shadow: 0 0 0 0 rgba(123, 224, 176, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(123, 224, 176, 0); }
  100% { box-shadow: 0 0 0 0 rgba(123, 224, 176, 0); }
}

.eyebrow {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.grad-text {
  background: linear-gradient(100deg, var(--dawn-3) 0%, var(--dawn-4) 45%, var(--dusk-3) 70%, var(--dusk-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.03em;
  font-size: 1.12rem;
}

.logo svg {
  width: 28px;
  height: 28px;
}

.logo span small {
  color: var(--text-3);
  font-weight: 500;
}

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