/* =========================================================
   STANDOUT — Shared Design Tokens
   Inferred from the live product (cream + dark forest green,
   editorial serif italic display, clean sans body)
   ========================================================= */

:root {
  /* Palette — sourced from client/src/index.css (SPA tokens). */
  --color-bg: #f4f1ea;
  --color-surface: #faf8f2;
  --color-surface-2: #ffffff;
  --color-surface-offset: #ece7dc;
  --color-border: #ddd6c6;
  --color-divider: #e7e0d0;
  --color-text: #14201a;
  --color-text-muted: #5a6660;
  --color-text-faint: #93998f;
  --color-text-inverse: #f6f4ee;
  --color-primary: #0b3d2e;
  --color-primary-hover: #0a4f3a;
  --color-primary-active: #062a1f;
  --color-primary-soft: #d6e2d7;
  --color-accent: #cdf04a;
  --color-accent-soft: #eaf6c5;
  --color-warn: #b6531a;

  /* Bundle aliases — keep the rest of tokens.css and tools.css working. */
  --bg:            var(--color-bg);
  --bg-soft:       var(--color-surface-offset);
  --surface:       var(--color-surface);
  --surface-2:     var(--color-surface-2);
  --hairline:      var(--color-divider);
  --hairline-2:    var(--color-border);

  --ink:           var(--color-text);
  --ink-2:         var(--color-text);
  --green:         var(--color-primary);
  --green-hover:   var(--color-primary-hover);
  --green-soft:    var(--color-primary-soft);
  --moss:          var(--color-text-muted);
  --lime:          var(--color-accent);
  --olive:         var(--color-accent);

  --text:          var(--color-text);
  --text-muted:    var(--color-text-muted);
  --text-faint:    var(--color-text-faint);
  --text-warn:     var(--color-warn);
  --text-on-dark:  var(--color-text-inverse);

  /* --- Type — mirrors SPA --- */
  --font-display:  'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body:     'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, monospace;

  /* Container widths — mirror client/src/index.css */
  --content-narrow:  640px;
  --content-default: 1040px;
  --content-wide:    1240px;

  /* size scale — webapp clamp */
  --text-xs:    11px;
  --text-sm:    13px;
  --text-base:  15px;
  --text-md:    16px;
  --text-lg:    18px;
  --text-xl:    22px;
  --text-2xl:   28px;
  --text-3xl:   42px;
  --text-hero:  64px;

  /* --- Spacing (8pt-ish, slightly generous) --- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;
  --s-10: 72px;

  /* --- Radius --- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* --- Shadow (very subtle on cream) --- */
  --shadow-1: 0 1px 0 rgba(20, 36, 29, 0.04), 0 1px 2px rgba(20, 36, 29, 0.04);
  --shadow-2: 0 4px 14px rgba(20, 36, 29, 0.06), 0 1px 2px rgba(20, 36, 29, 0.04);
  --shadow-3: 0 14px 40px rgba(20, 36, 29, 0.10);

  /* --- Motion --- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --d-1: 120ms;
  --d-2: 220ms;
  --d-3: 360ms;
}

/* The standalone SEO tool/landing pages are intentionally LIGHT-ONLY: they
   carry the Standout brand (cream + forest) and must look identical for every
   visitor regardless of OS dark-mode preference. We previously flipped tokens
   via prefers-color-scheme to mirror the SPA, but that made the tool pages
   render dark for users whose OS is in dark mode — inconsistent with the brand
   and flagged in review. We now pin the brand light theme below. */
:root { color-scheme: light; }

/* =========================================================
   Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* Utility: tracked-out uppercase label */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* =========================================================
   Components — used across all variants
   ========================================================= */

/* --- Pill button (primary) --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  background: var(--green);
  color: var(--text-on-dark);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background var(--d-1) var(--ease), transform var(--d-1) var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--green-hover); }
.btn:active { transform: translateY(1px); }
.btn .arrow { transition: transform var(--d-2) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline-2);
}
.btn-ghost:hover { background: var(--bg-soft); }

.btn-sm { padding: 8px 14px; font-size: var(--text-xs); }

/* --- Welcome header --- */
.welcome {
  padding: var(--s-8) 0 var(--s-6);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  flex-wrap: wrap;
}
.welcome h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 8px 0 6px;
}
.welcome h1 em {
  font-style: italic;
  font-weight: 400;
}
.welcome .sub {
  color: var(--text-muted);
  font-size: var(--text-md);
}

/* --- Plan / usage card --- */
.plan-card {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: var(--s-6) var(--s-7);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-3) var(--s-6);
  align-items: center;
  box-shadow: var(--shadow-1);
}
.plan-card .plan-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.plan-card .plan-count {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-top: 4px;
}
.plan-card .plan-meta {
  text-align: right;
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.plan-card .progress {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--hairline);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.plan-card .progress > span {
  display: block;
  height: 100%;
  width: 7.5%;
  background: linear-gradient(90deg, var(--green-soft) 0%, var(--olive) 60%, var(--lime) 100%);
  border-radius: 99px;
}

/* --- Kanban --- */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s-4);
  margin-top: var(--s-7);
}
.col {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: var(--s-5);
  min-height: 380px;
}
.col.active {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green) inset;
}
.col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px dashed var(--hairline-2);
}
.col-head .name {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.col.active .name { color: var(--green); }
.col-head .count {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text-muted);
  font-weight: 400;
}
.col.active .count { color: var(--green); }
.col-empty {
  font-size: var(--text-md);
  color: var(--text-faint);
  text-align: center;
  padding-top: var(--s-7);
}

.app-card {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: var(--s-4);
  margin-bottom: var(--s-3);
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  transition: border-color var(--d-1), transform var(--d-1) var(--ease), box-shadow var(--d-1);
}
.app-card:hover {
  border-color: var(--hairline-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}
.app-card .avatar {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 99px;
  background: var(--green-soft);
  color: var(--text-on-dark);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.app-card .role {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}
.app-card .company {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}
.app-card .flag {
  margin-top: 8px;
  font-size: var(--text-xs);
  color: var(--text-warn);
}

/* --- Theme toggle (sun/moon) --- */
.theme-toggle {
  width: 32px; height: 32px;
  border-radius: 99px;
  border: 1px solid var(--hairline-2);
  display: grid; place-items: center;
  color: var(--ink);
  transition: background var(--d-1);
}
.theme-toggle:hover { background: var(--bg-soft); }

/* --- Variant page chrome --- */
.variant-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 239, 226, 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.variant-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px var(--s-7);
  display: flex; align-items: center; gap: var(--s-4);
  font-size: var(--text-sm);
}
.variant-bar a.back {
  color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.variant-bar a.back:hover { color: var(--ink); }
.variant-bar .pip {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink);
  font-size: var(--text-md);
}
.variant-bar .swap {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 4px;
}
.variant-bar .swap a {
  font-size: var(--text-xs);
  padding: 6px 10px;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  font-weight: 500;
}
.variant-bar .swap a.is {
  background: var(--green);
  color: var(--text-on-dark);
}

/* --- Page container --- */
.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--s-7) var(--s-9);
}

/* --- Logo wordmark --- */
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.brand svg { width: 28px; height: 28px; align-self: center; }

/* --- Variant note pill (top-right of each variant) --- */
.note-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 40;
  background: var(--ink);
  color: var(--text-on-dark);
  padding: 14px 18px;
  border-radius: var(--r-md);
  max-width: 320px;
  box-shadow: var(--shadow-3);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.note-pill strong { color: var(--lime); font-weight: 600; }

/* Skip-to-content for a11y */
.sr {
  position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
}

@media (max-width: 1100px) {
  .kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  /* Variant bar collapses on mobile */
  .variant-bar-inner { padding: 8px var(--s-4); flex-wrap: wrap; gap: 8px; }
  .variant-bar-inner .pip { font-size: var(--text-sm); }
  .variant-bar-inner .swap { margin-left: 0; width: 100%; justify-content: space-between; }
  .variant-bar-inner .swap a { padding: 5px 10px; }

  /* Plan card stacks */
  .plan-card { grid-template-columns: 1fr; padding: var(--s-5); }
  .plan-card .plan-meta { text-align: left; align-items: flex-start !important; }
  .plan-card .plan-count { font-size: 24px; }
  .plan-card .plan-count > span { font-size: 14px !important; }

  .welcome { padding: var(--s-6) 0 var(--s-5); }
  .welcome h1 { font-size: 38px; }

  .note-pill { left: 16px; right: 16px; bottom: 16px; max-width: none; padding: 12px 14px; font-size: var(--text-xs); }
}
@media (max-width: 640px) {
  .kanban { grid-template-columns: 1fr; }
  .page { padding: 0 var(--s-4) var(--s-7); }
}
