/* ============================================================
   Canary — 基礎樣式(純手寫、響應式、現代外觀)
   設計 token 集中在 :root,之後 Phase 1 沿用擴充。
   ============================================================ */

:root {
  /* 色彩 */
  --bg: #0b0f17;
  --bg-elev: #121826;
  --bg-card: #161d2e;
  --border: #24304a;
  --text: #e7ecf5;
  --text-dim: #9aa7bd;
  --accent: #ffd23f;         /* canary 黃 */
  --accent-strong: #f5b800;
  --brand: #4f8cff;
  --success: #34d399;
  --danger: #f87171;

  /* 排版 */
  --font: "Inter", "Segoe UI", "PingFang TC", "Microsoft JhengHei",
    system-ui, -apple-system, sans-serif;
  --maxw: 1080px;
  --radius: 14px;
  --radius-sm: 10px;

  /* 陰影 */
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(79, 140, 255, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11, 15, 23, 0.72);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
}

.brand-mark {
  font-size: 1.4rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 1.5rem);
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--accent);
  color: #1a1400;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: #cfe0ff;
}

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(3rem, 10vw, 6rem);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}

.hero-title {
  font-size: clamp(1.9rem, 6vw, 3.4rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.accent {
  color: var(--accent);
}

.hero-sub {
  max-width: 620px;
  margin: 0 auto 2rem;
  color: var(--text-dim);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
}

.hero-tagline {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

/* ---------- Generic sections ---------- */
.section {
  padding-block: clamp(2.5rem, 7vw, 4.5rem);
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 1.25rem;
}

.section-sub {
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.center {
  text-align: center;
}

.section-title.center {
  margin-inline: auto;
}

/* Problem list */
.problem-list {
  list-style: none;
  display: grid;
  gap: 0.85rem;
  max-width: 760px;
}

.problem-list li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--text-dim);
}

.problem-list li::before {
  content: "✕";
  position: absolute;
  left: 0;
  color: var(--danger);
  font-weight: 700;
}

.section-note {
  margin-top: 1.75rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1400;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

.step h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.step p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  font-size: 0.9rem;
  color: var(--text);
}

/* Radar hook banner */
.radar-hook {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.12), rgba(255, 210, 63, 0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.25rem);
}

.radar-hook-text {
  flex: 1;
  min-width: 260px;
}

.radar-hook-text .section-title {
  margin-bottom: 0.6rem;
}

.radar-hook-text p {
  color: var(--text-dim);
}

/* Pricing */
.pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.plan {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.plan-featured {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.plan-badge {
  position: absolute;
  top: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #1a1400;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}

.plan-name {
  font-size: 1.1rem;
  color: var(--text-dim);
}

.plan-price {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 0.25rem 0 1.25rem;
}

.plan-price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-dim);
}

.plan-features {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.plan-features li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.plan-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 0.9rem 1.75rem;
  font-size: 1.05rem;
}

/* FAQ */
.faq {
  max-width: 760px;
  margin-inline: auto;
  display: grid;
  gap: 0.75rem;
}

.faq details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  float: right;
  color: var(--text-dim);
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  margin-top: 0.75rem;
  color: var(--text-dim);
}

.closing .section-title {
  margin-bottom: 1.5rem;
}

/* ---------- Radar page ---------- */
.models-status {
  color: var(--text-dim);
}

.models-status.error {
  color: var(--danger);
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.provider-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.provider-name {
  font-size: 1rem;
  margin-bottom: 0.9rem;
  color: var(--accent);
}

.model-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--border);
}

.model-row:first-of-type {
  border-top: none;
}

.model-name {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.model-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}

.model-badge.ok {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.1);
}

.model-badge.warn {
  color: var(--accent);
  border-color: rgba(255, 210, 63, 0.4);
  background: rgba(255, 210, 63, 0.1);
}

.model-badge.danger {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.1);
}

.model-badge.muted {
  color: var(--text-dim);
  border-color: var(--border);
  background: var(--bg-elev);
}

.model-note {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.model-extra {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.model-extra strong {
  color: var(--text);
  font-weight: 600;
}

.model-countdown {
  color: var(--accent);
  font-weight: 700;
}

.model-source {
  color: var(--brand);
  text-decoration: none;
}

.model-source:hover {
  text-decoration: underline;
}

/* Highlight rows with an active shutdown countdown */
.model-row.status-retiring {
  border-left: 2px solid var(--accent);
  padding-left: 0.6rem;
  margin-left: -0.6rem;
}

.model-row.status-retired .model-name {
  color: var(--text-dim);
  text-decoration: line-through;
}

/* Subscribe form */
.subscribe-card {
  max-width: 640px;
  margin-inline: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.25rem);
}

.radar-form {
  display: grid;
  gap: 1.5rem;
}

.form-field {
  display: grid;
  gap: 0.5rem;
  border: none;
}

.form-field label,
.form-field legend {
  font-weight: 600;
  font-size: 0.95rem;
}

.form-field input[type="email"] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

.form-field input[type="email"]:focus {
  outline: none;
  border-color: var(--brand);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.checkbox-group {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.checkbox-group-label {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-dim);
  cursor: pointer;
}

.checkbox-item input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}

.form-message {
  font-size: 0.95rem;
  min-height: 1.2em;
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--danger);
}

/* ---------- Founding Supporter (coffee) ---------- */
.founding-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(255, 210, 63, 0.14), rgba(245, 184, 0, 0.06));
  border: 1px solid rgba(255, 210, 63, 0.35);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.25rem);
}

.founding-text {
  flex: 1;
  min-width: 260px;
}

.founding-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255, 210, 63, 0.12);
  border: 1px solid rgba(255, 210, 63, 0.3);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.founding-text .section-title {
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  margin-bottom: 0.6rem;
}

.founding-text p {
  color: var(--text-dim);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem 1.75rem;
  animation: modal-in 0.15s ease-out;
}

@keyframes modal-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

.modal-title {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.modal-sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.modal input[type="email"] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 0.85rem;
}

.modal input[type="email"]:focus {
  outline: none;
  border-color: var(--brand);
}

.coffee-upsell-text {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 1rem 0;
}

.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- 響應式 ---------- */
@media (max-width: 860px) {
  .steps,
  .pricing,
  .models-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
  .nav-link {
    display: none; /* 平板/手機收起文字導覽,保留主要 CTA */
  }
}

@media (max-width: 480px) {
  .header-inner {
    height: 56px;
  }
  .hero-cta {
    flex-direction: column;
  }
  .hero-cta .btn {
    width: 100%;
  }
  .radar-hook {
    flex-direction: column;
    align-items: flex-start;
  }
}
