/* ==========================================================
   SquawkDesk marketing site
   Theme: controlled via html[data-theme="dark" | "light"]
   Set by inline <script> in <head> before first paint.
   ========================================================== */

/* ---------- TOKENS: DARK (default on <html data-theme="dark">) ---------- */
:root {
  color-scheme: dark;

  --bg:            #0d1117;
  --panel:         #161b22;
  --panel-2:       #21262d;
  --panel-3:       #0d1117;
  --border:        #30363d;
  --border-strong: #484f58;
  --text:          #e6edf3;
  --muted:         #8b949e;
  --brand:         #58a6ff;
  --green:         #3fb950;
  --red:           #f85149;
  --amber:         #d29922;

  --header-bg:         rgba(13, 17, 23, 0.95);
  --btn-primary-bg:    #238636;
  --btn-primary-fg:    #ffffff;
  --btn-primary-bdr:   #2ea043;
  --feed-strong-bg:    rgba(88, 166, 255, 0.06);
  --ring:              rgba(88, 166, 255, 0.45);

  --radius-lg: 8px;
  --radius-sm: 4px;
  --max-w:     960px;
  --t:         160ms ease;
}

/* ---------- TOKENS: LIGHT ---------- */
html[data-theme="light"] {
  color-scheme: light;

  --bg:            #ffffff;
  --panel:         #f6f8fa;
  --panel-2:       #ffffff;
  --panel-3:       #f6f8fa;
  --border:        #d0d7de;
  --border-strong: #8c959f;
  --text:          #1f2328;
  --muted:         #57606a;
  --brand:         #0969da;
  --green:         #1a7f37;
  --red:           #d1242f;
  --amber:         #9a6700;

  --header-bg:         rgba(255, 255, 255, 0.95);
  --btn-primary-bg:    #1f883d;
  --btn-primary-fg:    #ffffff;
  --btn-primary-bdr:   #1a7f37;
  --feed-strong-bg:    rgba(9, 105, 218, 0.05);
  --ring:              rgba(9, 105, 218, 0.4);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
p { margin-top: 0; }
ul { margin: 0; }
h1, h2, h3 { margin-top: 0; }
strong { color: inherit; }

/* ---------- PAGE SHELL ---------- */
.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* Constrain header, sections, footer */
.site-header,
.section,
.site-footer {
  width: min(calc(100% - 2rem), var(--max-w));
  margin-inline: auto;
}

/* ---------- HEADER ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  position: relative;
  z-index: 10;
}

/* Blurred header backing — extends edge-to-edge */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 -1rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  z-index: -1;
}

/* ---------- BRAND ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.93rem;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 700;
  transition: border-color var(--t);
}

.brand:hover .brand-mark,
.brand:focus-visible .brand-mark { border-color: var(--brand); }

/* ---------- NAV ---------- */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------- THEME TOGGLE ---------- */
.theme-toggle {
  appearance: none;
  margin: 0;
  padding: 0;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color var(--t), border-color var(--t), background var(--t);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--text);
  border-color: var(--border-strong);
  outline: none;
}

/* Show sun in dark → user clicks to go light */
html[data-theme="dark"] .icon-moon { display: none; }
/* Show moon in light → user clicks to go dark */
html[data-theme="light"] .icon-sun { display: none; }

/* ---------- BUTTONS ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.86rem;
  font-family: inherit;
  cursor: pointer;
  transition: filter var(--t), border-color var(--t), background var(--t);
  white-space: nowrap;
}

.button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.button-primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bdr);
  color: var(--btn-primary-fg);
}
.button-primary:hover,
.button-primary:focus-visible { filter: brightness(1.12); }

.button-secondary {
  background: var(--panel-2);
  color: var(--text);
}
.button-secondary:hover,
.button-secondary:focus-visible { border-color: var(--border-strong); }

.nav-cta { font-size: 0.84rem; }

/* ---------- SECTIONS ---------- */
.section { padding: 2rem 0; }

/* ---------- TYPOGRAPHY ---------- */
.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 600;
}

h1 {
  margin-bottom: 0.7rem;
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

h2 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* ---------- HERO ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding-top: 0.5rem;
}

.hero-text {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 30rem;
  margin-bottom: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 0.6rem;
}

.hero-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- HERO VISUAL ---------- */
.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

#demo { scroll-margin: 2rem; }

.visual-caption {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
}

/* ---------- APP PANEL (mock) ---------- */
.app-panel {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--panel-3);
  overflow: hidden;
}

/* Highlight ring animation for "What's inside" button */
@keyframes demo-ring {
  0%   { box-shadow: 0 0 0 0 var(--ring); }
  35%  { box-shadow: 0 0 0 4px var(--ring); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.app-panel.demo-panel-highlight { animation: demo-ring 1.1s ease-out 1; }
@media (prefers-reduced-motion: reduce) {
  .app-panel.demo-panel-highlight {
    animation: none !important;
    outline: 2px solid var(--border-strong);
    outline-offset: 2px;
  }
}

.app-panel-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
}

.app-panel-status { color: var(--green); font-weight: 400; font-size: 0.74rem; }

/* 5-tab grid */
.app-panel-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  overflow-x: auto;
}

.tab-btn {
  appearance: none;
  margin: 0;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  padding: 0.48rem 0.3rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t), background var(--t);
}
.tab-btn:last-child { border-right: 0; }
.tab-btn:hover,
.tab-btn:focus-visible { color: var(--text); outline: none; }
.tab-btn:focus-visible { box-shadow: inset 0 0 0 1px var(--border-strong); }
.tab-btn.is-active { color: var(--text); background: var(--panel-3); font-weight: 600; }

/* ---------- TAB PANELS ---------- */
.tab-panels { position: relative; min-height: 12.5rem; }

.tab-panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity var(--t), transform var(--t);
}
.tab-panel.is-active {
  position: relative;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ---------- FEED ROWS ---------- */
.app-panel-list { padding: 0.2rem 0 0.1rem; }

.feed-row {
  display: grid;
  grid-template-columns: 56px 50px 1fr;
  gap: 0.45rem;
  align-items: center;
  padding: 0.58rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.feed-row:last-child { border-bottom: 0; }
.feed-row-strong { background: var(--feed-strong-bg); }

.row-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
}

.row-tag {
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.tag-high   { color: var(--red); }
.tag-med    { color: var(--amber); }
.tag-low    { color: var(--muted); }
.tag-open   { color: var(--green); font-weight: 400; text-transform: none; }
.tag-closed { color: var(--muted); font-weight: 400; text-transform: none; }
.tag-up     { color: var(--green); }
.tag-down   { color: var(--red); }
.tag-voice  { color: var(--brand); font-size: 0.82rem; text-transform: none; letter-spacing: 0; }

.row-text { color: var(--text); }
.row-dim   { color: var(--muted); font-style: italic; font-size: 0.75rem; }
.row-surprise { color: var(--red); font-size: 0.74rem; font-weight: 700; }

/* ---------- PILLARS ---------- */
.pillars { padding-top: 0; }

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.pillar-label {
  margin: 0 0 0.25rem;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text);
}

.pillar-text {
  margin: 0;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- TRIAL / PRICING ---------- */
.trial-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.trial-copy p { color: var(--muted); font-size: 0.9rem; margin-bottom: 0; }

.trial-list {
  padding-left: 1.1rem;
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
}
.trial-list li { color: var(--muted); margin-bottom: 0.2rem; }

.trial-cta { width: 100%; }

/* ---------- FOOTER ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.site-footer p { margin: 0; color: var(--muted); }

.site-footer a:hover { color: var(--text); }

/* ---------- HERO LEDE ---------- */
.hero-lede {
  color: var(--text);
  font-size: 0.97rem;
  font-style: italic;
  margin-bottom: 0.55rem;
  max-width: 30rem;
  line-height: 1.5;
}

/* ---------- PULSE CALLOUT ---------- */
.callout-section { padding-top: 0; }

.callout-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  background: var(--panel);
}

.callout-label {
  margin: 0 0 0.2rem;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text);
}

.callout-text {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- FAQ ---------- */
.faq { padding-top: 0; }

.faq > .eyebrow { margin-bottom: 0.85rem; }

.faq-list { border-top: 1px solid var(--border); }

details {
  border-bottom: 1px solid var(--border);
}

summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  gap: 1rem;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1;
}

details[open] > summary::after { content: "−"; }

details > summary:hover { color: var(--brand); }
details > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }

.faq-answer {
  padding: 0 0 0.85rem;
}

.faq-answer p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 52rem;
}

/* ---------- TRIAL FLOW NOTE ---------- */
.trial-flow {
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
  .hero,
  .trial-card {
    grid-template-columns: 1fr;
  }

  .pillar-grid {
    grid-template-columns: 1fr;
    gap: 1.1rem 0;
  }

  .pillar { border-top: 1px solid var(--border); padding-top: 1.1rem; }
  .pillar:first-child { border-top: none; padding-top: 0; }

  .site-footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .site-header,
  .section,
  .site-footer {
    width: min(calc(100% - 1rem), var(--max-w));
  }

  .site-header::before { inset: 0 -0.5rem; }

  .hero-actions { flex-direction: column; }
  .button { width: 100%; justify-content: center; }

  .feed-row {
    grid-template-columns: 48px 42px 1fr;
    gap: 0.3rem;
    padding: 0.5rem 0.6rem;
  }
}
