/* ============================================================
   THE SALES WORKSHOP — terminal editorial
   Light: "The Broadsheet"  ·  Dark: "The Wire Room"
   Token system shared with the Infra Play Database theme.
   ============================================================ */

/* ── Fonts (self-hosted, latin subset) ─────────────────────── */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic; font-weight: 400; font-display: swap;
  src: url('/fonts/plex-mono-400i.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/plex-mono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/plex-mono-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/playfair-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic; font-weight: 700; font-display: swap;
  src: url('/fonts/playfair-700i.woff2') format('woff2');
}

/* ── Tokens: light / "The Broadsheet" ──────────────────────── */
:root {
  color-scheme: light;

  --paper: #faf8f4;
  --paper-warm: #f5f2eb;
  --surface: #ffffff;
  --panel: #fdfcfa;
  --ink: #0b1f3e;

  --amber: #b45309;
  --primary-hover: #92400e;
  --amber-glow: rgba(180, 83, 9, 0.08);
  --teal: #0f766e;
  --teal-glow: rgba(13, 148, 136, 0.08);

  --border-color: #e8e6e0;
  --border-strong: #d4d2ca;
  --text-secondary: #4a4a45;
  --text-muted: #6b6b62;
  --text-dim: #6b6b62;

  --term-bg: #10131a;
  --term-ink: #e8e4da;
  --term-border: #262b35;

  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', ui-monospace, Menlo, monospace;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 4px;
}

/* ── Tokens: dark / "The Wire Room" ────────────────────────── */
.theme-dark {
  color-scheme: dark;

  --paper: #0a0c10;
  --paper-warm: #10131a;
  --surface: #12151c;
  --panel: #161a22;
  --ink: #e8e4da;

  --amber: #f0a840;
  --primary-hover: #f5bc66;
  --amber-glow: rgba(240, 168, 64, 0.14);
  --teal: #4dd0b5;
  --teal-glow: rgba(77, 208, 181, 0.14);

  --border-color: #262b35;
  --border-strong: #39404d;
  --text-secondary: #c9c3b5;
  --text-muted: #a49d8e;
  --text-dim: #8e8778;

  --term-bg: #05060a;
  --term-ink: #e8e4da;
  --term-border: #39404d;

  --shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.65);
}

/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* faint phosphor scanlines, dark theme only */
.theme-dark body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
}

h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10000;
  padding: 8px 12px;
  border: 2px solid var(--amber);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 700;
  transform: translateY(calc(-100% - 12px));
  transition: transform var(--transition);
}
.skip-link:focus { transform: translateY(0); }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

::selection { background: var(--amber); color: var(--paper); }

/* ── Shared type patterns ──────────────────────────────────── */
.eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--teal);
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-title em { color: var(--amber); font-style: italic; }

.section-head { margin-bottom: 40px; }

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

/* ── Status bar ────────────────────────────────────────────── */
.statusbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--border-strong);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.statusbar__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.statusbar__brand { font-weight: 700; color: var(--amber); }

.statusbar__item { color: var(--text-muted); white-space: nowrap; }
.statusbar__live { color: var(--teal); font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 var(--teal-glow);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--teal-glow); }
  60%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.statusbar__spacer { flex: 1; }

.statusbar__nav { display: flex; gap: 16px; }
.statusbar__nav a { color: var(--text-secondary); }
.statusbar__nav a:hover { color: var(--amber); text-decoration: none; }
.statusbar__nav a::before { content: '/'; color: var(--text-dim); margin-right: 2px; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1;
  padding: 5px 8px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.theme-toggle:hover { border-color: var(--amber); color: var(--amber); }

/* ── Hero ──────────────────────────────────────────────────── */
.hero { padding: 88px 0 64px; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.5vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 22px;
}
.hero__title em { color: var(--amber); font-style: italic; }

.hero__sub {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 44ch;
  margin-bottom: 34px;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* buttons */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 11px 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  transition:
    background-color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    color var(--transition);
}
.btn:hover { border-color: var(--amber); color: var(--amber); text-decoration: none; }

.btn--primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
}
.theme-dark .btn--primary { color: #14100a; }
.btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
  box-shadow: 0 0 20px var(--amber-glow);
}
.theme-dark .btn--primary:hover { color: #14100a; }

.btn--lg { font-size: 0.9375rem; padding: 13px 26px; }

/* ── Terminal window ───────────────────────────────────────── */
.terminal {
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-size: 0.8125rem;
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--term-border);
}

.terminal__dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #3a3f4a;
}
.terminal__dot:nth-child(1) { background: #ff5f57; }
.terminal__dot:nth-child(2) { background: #febc2e; }
.terminal__dot:nth-child(3) { background: #28c840; }

.terminal__title {
  margin-left: 8px;
  color: #8e8778;
  font-size: 0.71rem;
  letter-spacing: 0.04em;
}

.terminal__screen {
  padding: 18px 16px 16px;
  min-height: 300px;
  max-height: 340px;
  overflow-y: auto;
  color: var(--term-ink);
  line-height: 1.7;
  cursor: text;
}

.terminal__screen--compact { min-height: 0; }

.terminal__screen .t-line { white-space: pre-wrap; word-break: break-word; }
.terminal__screen .t-cmd { color: #e8e4da; }
.terminal__screen .t-cmd::before { content: '$ '; color: #f0a840; font-weight: 700; }
.terminal__screen .t-out { color: #a49d8e; }
.terminal__screen .t-accent { color: #f0a840; }
.terminal__screen .t-ok { color: #4dd0b5; }

.terminal__inputline { display: flex; align-items: baseline; gap: 8px; }
.terminal__inputline[hidden] { display: none; }
.terminal__prompt { color: #f0a840; font-weight: 700; }

.terminal__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #e8e4da;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0;
  caret-color: #f0a840;
}
.terminal__input::placeholder { color: #a49d8e; opacity: 1; }

.cursor {
  display: inline-block;
  color: var(--amber);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Ticker ────────────────────────────────────────────────── */
.ticker {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  background: var(--paper-warm);
  overflow: hidden;
  padding: 9px 0;
}

.ticker__track {
  display: flex;
  gap: 28px;
  width: max-content;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  animation: ticker 40s linear infinite;
}
.ticker__track span:nth-child(even) { color: var(--amber); }
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
}

/* ── Intro ─────────────────────────────────────────────────── */
.intro { padding: 72px 0 24px; }

.intro__lede {
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  line-height: 1.75;
  max-width: 62ch;
  color: var(--text-secondary);
}
.intro__lede strong { color: var(--ink); font-weight: 500; }

/* ── Services ──────────────────────────────────────────────── */
.services { padding: 72px 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  position: relative;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
  scroll-margin-top: 80px;
}
.card:hover {
  border-color: var(--amber);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card__index {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber);
  margin-bottom: 16px;
}

.card__title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin-bottom: 14px;
}

.card__body {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.card__list {
  list-style: none;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px dashed var(--border-strong);
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.card__list li { padding-left: 22px; position: relative; margin-bottom: 6px; }
.card__list li::before {
  content: '└─';
  position: absolute;
  left: 0;
  color: var(--teal);
}

/* ── Principles ────────────────────────────────────────────── */
.principles {
  padding: 72px 0;
  background: var(--paper-warm);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.principles .section-title { font-family: var(--font-mono); font-size: clamp(1.35rem, 3vw, 1.75rem); }

.principles__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 760px;
}

.principles__list li {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-color);
}
.principles__list li:last-child { border-bottom: none; }

.principles__key {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--amber);
}

.principles__val {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* ── Contact ───────────────────────────────────────────────── */
.contact { padding: 88px 0; }

.contact__panel {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: clamp(32px, 6vw, 56px);
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  scroll-margin-top: 80px;
}
.contact__panel .eyebrow { margin-bottom: 10px; }

.contact__body {
  color: var(--text-secondary);
  max-width: 50ch;
  margin: 18px auto 26px;
  font-size: 0.9375rem;
}

.contact__cmd {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border-strong);
  background: var(--paper-warm);
  padding: 52px 0 32px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 40px;
}

.footer__block p { margin-bottom: 6px; }

.footer__heading {
  color: var(--teal);
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.footer__name {
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-strong);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.footer__eof { letter-spacing: 0.05em; }

/* ── Not found page ────────────────────────────────────────── */
.notfound {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.notfound__panel {
  width: 100%;
  max-width: 560px;
}

.notfound__title {
  font-family: inherit;
  font-size: inherit;
  font-weight: 400;
  line-height: inherit;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { padding: 56px 0 48px; }
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .cards { grid-template-columns: 1fr; }
  .principles__list li { grid-template-columns: 1fr; gap: 6px; }
  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
  .statusbar__loc, .statusbar__clock { display: none; }
}

@media (max-width: 620px) {
  .statusbar__inner {
    flex-wrap: wrap;
    gap: 8px 12px;
  }
  .statusbar__nav {
    order: 1;
    flex: 0 0 100%;
    justify-content: space-between;
    gap: 8px;
    padding-top: 7px;
    border-top: 1px solid var(--border-color);
  }
  .terminal__screen { min-height: 240px; }
  .terminal__screen--compact { min-height: 0; }
}
