/*
 * theme.css — TicketDesk design-system values.
 * Corporate mood: small corners, one quiet shadow tier, plain lines.
 * Brand: one ink (#12213a), one signal blue (#2f5de3), a cool-grey canvas.
 */

:root {
  --canvas: #f5f6f8;
  --surface: #fbfbfc;
  --surface-2: #eceef2;
  --border: #dde1e8;
  --border-strong: #b9c0cd;
  --ink: #12213a;
  --muted: #5c6471;
  --accent: #2f5de3;
  --accent-hover: #2549bc;
  --accent-ink: #ffffff;
  --accent-text: #2f5de3;
  --accent-strong: #2b56d1;
  --accent-soft: #e6ecfc;
  --accent-border: #b9c9f7;
  --success: #157a4b;
  --success-ink: #ffffff;
  --success-soft: #dcefe4;
  --success-strong: #14683f;
  --warning: #a15a06;
  --warning-ink: #ffffff;
  --warning-soft: #f3e6d4;
  --warning-strong: #8f4f04;
  --danger: #b3261e;
  --danger-ink: #ffffff;
  --danger-soft: #f6dedb;
  --danger-strong: #9a201a;
  --chart-1: #2f5de3;
  --chart-2: #12213a;
  --chart-3: #5c6471;
  --chart-4: #7c9af0;
  --chart-5: #14683f;
  --chart-6: #8f4f04;

  --font-display: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 700;
  --display-tracking: -0.01em;
  --eyebrow-tracking: 0.04em;

  --radius-btn: 6px;
  --radius-card: 6px;
  --radius-input: 6px;
  --border-w: 1px;
  --border-strong-w: 1px;
  --shadow-card: 0 1px 2px rgba(18, 33, 58, 0.06);
  --shadow-raised: 0 4px 16px rgba(18, 33, 58, 0.12);
  --shadow-btn: none;
  --card-pad: 1.5rem;
  --caps: none;
  --caps-tracking: 0;
  --btn-weight: 600;
  --measure: 68ch;

  --x-band-ink: #12213a;
  --x-band-ink-text: #f5f6f8;
  --x-band-ink-muted: #a7b1c9;
  --x-band-ink-border: #26344f;
  --x-ticket-open: #b3261e;
  --x-ticket-pending: #a15a06;
  --x-ticket-resolved: #157a4b;
}

html[data-theme="dark"] {
  --canvas: #0f1930;
  --surface: #16223d;
  --surface-2: #1c2a48;
  --border: #2b3a58;
  --border-strong: #3d4e70;
  --ink: #eef1f7;
  --muted: #9aa5bc;
  --accent: #6f93f2;
  --accent-hover: #86a4f5;
  --accent-ink: #0f1930;
  --accent-text: #86a4f5;
  --accent-strong: #a9c0f8;
  --accent-soft: #202e50;
  --accent-border: #37477a;
  --success: #3fbd82;
  --success-ink: #06261a;
  --success-soft: #163126;
  --success-strong: #6fd6a2;
  --warning: #d99a4e;
  --warning-ink: #2b1a04;
  --warning-soft: #34260f;
  --warning-strong: #eab776;
  --danger: #e0685f;
  --danger-ink: #2b0906;
  --danger-soft: #38191a;
  --danger-strong: #ee8c85;
  --chart-1: #86a4f5;
  --chart-2: #eef1f7;
  --chart-3: #9aa5bc;
  --chart-4: #4a6bd0;
  --chart-5: #6fd6a2;
  --chart-6: #eab776;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-raised: 0 8px 24px rgba(0, 0, 0, 0.45);

  --x-band-ink: #060c1a;
  --x-band-ink-text: #eef1f7;
  --x-band-ink-muted: #8b96b0;
  --x-band-ink-border: #1c2740;
  --x-ticket-open: #e0685f;
  --x-ticket-pending: #d99a4e;
  --x-ticket-resolved: #3fbd82;
}

/*
 * public/app.css — TicketDesk's own rules. Everything no primitive covers:
 * the top bar, the hero ticket panel, the hairline feature grid, the steps
 * row, the tinted pricing panel, the quote band and the dark closing band.
 * Tokens only — no colour literal outside public/theme.css.
 */

/* ---------------------------------------------------------------------- */
/* Bar                                                                     */

.site-bar {
  border-bottom: var(--border-w, 1px) solid var(--border);
  background: var(--canvas);
}
.site-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.site-wordmark:hover { text-decoration: none; }
.site-wordmark-sm { font-size: 1rem; }
.site-mark {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-btn, 6px);
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---------------------------------------------------------------------- */
/* Type scale — tight tracking reserved for the hero and closing headline. */

.hero-headline {
  font-family: var(--font-display);
  font-weight: var(--display-weight, 700);
  letter-spacing: var(--display-tracking, -0.01em);
  line-height: 0.98;
  font-size: 2.75rem;
  text-wrap: balance;
}
@media (min-width: 768px) { .hero-headline { font-size: 3.75rem; } }
@media (min-width: 1024px) { .hero-headline { font-size: 4.25rem; } }

.hero-sub {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--muted);
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
  font-size: 1.875rem;
  color: var(--ink);
}
@media (min-width: 768px) { .section-heading { font-size: 2.5rem; } }

.section-lede {
  margin-top: 0.875rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--muted);
}

.closing-headline {
  font-family: var(--font-display);
  font-weight: var(--display-weight, 700);
  letter-spacing: var(--display-tracking, -0.01em);
  line-height: 1;
  font-size: 2.5rem;
  text-wrap: balance;
}
@media (min-width: 768px) { .closing-headline { font-size: 3.75rem; } }
@media (min-width: 1024px) { .closing-headline { font-size: 4.25rem; } }

/* ---------------------------------------------------------------------- */
/* Hero ticket panel — the only imagery on the page.                      */

.ticket-panel {
  border: var(--border-w, 1px) solid var(--border);
  border-radius: var(--radius-card, 6px);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.ticket-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.125rem;
  border-bottom: var(--border-w, 1px) solid var(--border);
  background: var(--surface-2);
}
.ticket-panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ink);
}
.ticket-live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent);
  animation: ticket-pulse 2.2s ease-in-out infinite;
}
.ticket-list { list-style: none; margin: 0; padding: 0; }
.ticket-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.125rem;
  border-bottom: var(--border-w, 1px) solid var(--border);
  opacity: 0;
  transform: translateY(10px);
}
.ticket-row:last-child { border-bottom: 0; }
.ticket-subject {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticket-dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; flex: none; }
.ticket-dot-open { background: var(--x-ticket-open); }
.ticket-dot-pending { background: var(--x-ticket-pending); }
.ticket-dot-resolved { background: var(--x-ticket-resolved); }
.ticket-badge-open { color: var(--x-ticket-open); border-color: color-mix(in srgb, var(--x-ticket-open) 45%, var(--border)); }
.ticket-badge-pending { color: var(--x-ticket-pending); border-color: color-mix(in srgb, var(--x-ticket-pending) 45%, var(--border)); }
.ticket-badge-resolved { color: var(--x-ticket-resolved); border-color: color-mix(in srgb, var(--x-ticket-resolved) 45%, var(--border)); }
.ticket-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.125rem;
  font-size: 0.8125rem;
  color: var(--muted);
  background: var(--surface-2);
  border-top: var(--border-w, 1px) solid var(--border);
}

@keyframes ticket-pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--success) 12%, transparent); }
}

/* Hero entrance targets — rested visible, offset until app.js reveals them. */
[data-anim="hero-text"], [data-anim="hero-panel"] { opacity: 0; transform: translateY(14px); }
[data-anim="hero-text"].is-revealed, [data-anim="hero-panel"].is-revealed {
  opacity: 1; transform: none;
  transition: opacity 500ms var(--ease-out, ease), transform 500ms var(--ease-out, ease);
}
.ticket-row.is-revealed {
  opacity: 1; transform: none;
  transition: opacity 420ms var(--ease-out, ease), transform 420ms var(--ease-out, ease);
}

html.reduced-motion [data-anim="hero-text"],
html.reduced-motion [data-anim="hero-panel"],
html.reduced-motion .ticket-row,
html.reduced-motion .feature-col {
  opacity: 1 !important;
  transform: none !important;
}

/* ---------------------------------------------------------------------- */
/* Features — hairline dividers, no cards.                                */

.feature-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}
@media (min-width: 768px) {
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
  .feature-col { padding: 0 2.5rem; border-left: var(--border-w, 1px) solid var(--border); }
  .feature-col:first-child { padding-left: 0; border-left: 0; }
}
.feature-col { opacity: 0; transform: translateY(14px); }
.feature-col.is-revealed {
  opacity: 1; transform: none;
  transition: opacity 480ms var(--ease-out, ease), transform 480ms var(--ease-out, ease);
}
.feature-metric { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; color: var(--accent-text); }
.feature-title { margin-top: 0.625rem; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--ink); }
.feature-text { margin-top: 0.625rem; font-size: 0.9375rem; line-height: 1.6; color: var(--muted); }

/* ---------------------------------------------------------------------- */
/* How it works — a single connected row.                                 */

.steps-row {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  position: relative;
}
@media (min-width: 768px) {
  .steps-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
  .steps-row::before {
    content: "";
    position: absolute;
    top: 0.75rem;
    left: 8.5%;
    right: 8.5%;
    height: var(--border-w, 1px);
    background: var(--border);
  }
}
.step { position: relative; }
.step-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--canvas);
  padding-right: 0.75rem;
}
.step-title { margin-top: 0.75rem; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--ink); }
.step-text { margin-top: 0.5rem; font-size: 0.9375rem; line-height: 1.6; color: var(--muted); max-width: 30ch; }

/* ---------------------------------------------------------------------- */
/* Pricing                                                                 */

.billing-toggle { gap: 0.75rem; }
.billing-label { font-size: 0.875rem; color: var(--muted); transition: color 150ms; }
.billing-label.is-active { color: var(--ink); font-weight: 600; }

.pricing-panel {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border: var(--border-w, 1px) solid var(--border);
  border-radius: 0;
  background: var(--surface-2);
  overflow: hidden;
}
@media (min-width: 900px) { .pricing-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.pricing-card {
  padding: 2rem;
  background: var(--surface);
  border-top: var(--border-w, 1px) solid var(--border);
  display: flex;
  flex-direction: column;
}
@media (min-width: 900px) {
  .pricing-card { border-top: 0; border-left: var(--border-w, 1px) solid var(--border); }
  .pricing-card:first-child { border-left: 0; }
}
.pricing-card-popular { position: relative; border-top: 3px solid var(--accent); background: var(--surface); }
@media (min-width: 900px) { .pricing-card-popular { border-top: 3px solid var(--accent); } }
.pricing-popular-tag {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--accent-text);
  background: var(--accent-soft);
  border: var(--border-w, 1px) solid var(--accent-border);
  border-radius: var(--radius-btn, 6px);
  padding: 0.125rem 0.5rem;
}
.pricing-name { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--ink); }
.pricing-sub { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.55; color: var(--muted); min-height: 2.6rem; }
.pricing-price { margin-top: 1.25rem; font-family: var(--font-display); font-weight: 700; font-size: 2.25rem; color: var(--ink); }
.pricing-period { font-family: var(--font-body); font-weight: 400; font-size: 0.9375rem; color: var(--muted); }
.pricing-list { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.625rem; flex: 1 1 auto; }
.pricing-list li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--ink); }
.pricing-list li .icon { color: var(--accent-text); flex: none; }

/* ---------------------------------------------------------------------- */
/* Testimonials                                                           */

.quote-band { background: var(--surface-2); border-top: var(--border-w, 1px) solid var(--border); border-bottom: var(--border-w, 1px) solid var(--border); }
.quote-grid { margin-top: 2.5rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
@media (min-width: 768px) {
  .quote-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
  .quote-card { padding: 0 2.25rem; border-left: var(--border-w, 1px) solid var(--border); }
  .quote-card:first-child { padding-left: 0; border-left: 0; }
}
.quote-card blockquote { margin: 0; font-size: 1.0625rem; line-height: 1.6; color: var(--ink); }
.quote-card figcaption { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.125rem; font-family: var(--font-mono); }
.quote-name { font-size: 0.8125rem; font-weight: 500; color: var(--ink); }
.quote-role { font-size: 0.75rem; color: var(--muted); }
.quote-metric { margin-top: 0.875rem; font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; color: var(--accent-text); }

/* ---------------------------------------------------------------------- */
/* Closing band — a fixed dark ink ground, independent of light/dark mode. */

.closing-band { background: var(--x-band-ink); color: var(--x-band-ink-text); }
.closing-band .closing-headline { color: var(--x-band-ink-text); }
.closing-sub { margin-top: 1.25rem; font-size: 1.0625rem; line-height: 1.6; color: var(--x-band-ink-muted); max-width: 42ch; margin-inline: auto; }

.signup-wrap { margin-top: 2.5rem; }
.signup-form { max-width: 34rem; margin-inline: auto; text-align: left; }
.signup-fields {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1.25rem;
  border: var(--border-w, 1px) solid var(--x-band-ink-border);
  border-radius: var(--radius-card, 6px);
  background: color-mix(in srgb, var(--x-band-ink-text) 4%, transparent);
}
@media (min-width: 640px) {
  .signup-fields { flex-direction: row; align-items: flex-end; }
  .signup-submit { flex: none; }
}
.signup-label { color: var(--x-band-ink-muted); }
.signup-input { background: var(--surface); }
.signup-fine { margin-top: 1rem; font-size: 0.8125rem; color: var(--x-band-ink-muted); }
.signup-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--danger-strong);
  background: var(--danger-soft);
  border-radius: var(--radius-btn, 6px);
  padding: 0.625rem 0.875rem;
}

.signup-success {
  max-width: 30rem;
  margin-inline: auto;
  padding: 2rem;
  border: var(--border-w, 1px) solid var(--x-band-ink-border);
  border-radius: var(--radius-card, 6px);
  background: color-mix(in srgb, var(--x-band-ink-text) 4%, transparent);
  text-align: center;
}
.signup-success-icon {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success-strong);
  margin-bottom: 0.75rem;
}
.signup-success-title { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--x-band-ink-text); }
.signup-success-text { margin-top: 0.5rem; font-size: 0.9375rem; line-height: 1.55; color: var(--x-band-ink-muted); }

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */

.footer-bar { border-top: var(--border-w, 1px) solid var(--border); background: var(--canvas); }
