/* ============================================================
   SEO-Prices.com — HYBRID
   Editorial data desk (Direction 01) as the shell.
   Part 1: tokens, base, masthead, ticker, hero, landscape, data table.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT,WONK@0,9..144,400..900,0..100,0..1&family=Inter+Tight:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ---------- Tokens ---------- */
:root {
  --paper: #F7F4ED;
  --paper-2: #FFFFFF;
  --ink: #12100E;
  --ink-soft: color-mix(in oklab, var(--ink) 58%, var(--paper));
  --ink-faint: color-mix(in oklab, var(--ink) 40%, var(--paper));
  --signal: #E4572E;
  --signal-dark: #C7441F;
  --signal-wash: rgba(228, 87, 46, 0.10);
  --up: #0F7B4F;
  --down: #C0392B;

  --rule: rgba(18, 16, 14, 0.16);
  --rule-soft: rgba(18, 16, 14, 0.08);
  --rule-hard: var(--ink);

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --gut: clamp(20px, 4.5vw, 64px);
  --max: 1360px;
  --nav-h: 62px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 420ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
svg { display: block; }
figure { margin: 0; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
mark { background: var(--signal-wash); color: inherit; padding: 0 0.15em; box-decoration-break: clone; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Typography ---------- */
.display {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 1;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
h1 { font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 1; }
h2 { font-variation-settings: 'opsz' 90, 'SOFT' 0, 'WONK' 1; }
h3 { font-variation-settings: 'opsz' 40, 'SOFT' 0, 'WONK' 1; }

.balance { text-wrap: balance; }
.pretty { text-wrap: pretty; }
.num { font-variant-numeric: tabular-nums; }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mono--dim { color: var(--ink-soft); }
.mono--signal { color: var(--signal); }

.lede {
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 48ch;
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.rule-top { border-top: 1px solid var(--rule-hard); }

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }

.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--signal); border-color: var(--signal); color: #fff; }

.btn--signal { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn--signal:hover { background: var(--signal-dark); border-color: var(--signal-dark); color: #fff; }

.btn--block { width: 100%; }
.btn--sm { padding: 10px 16px; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--signal);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.link:hover { border-bottom-color: var(--signal); }
.link svg { transition: transform var(--dur) var(--ease); }
.link:hover svg { transform: translateX(3px); }

/* ============================================================
   MASTHEAD
   ============================================================ */
.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--paper);
  border-bottom: 1px solid var(--rule-hard);
}
.masthead__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: var(--nav-h);
}
@media (min-width: 1000px) {
  .masthead__row { grid-template-columns: auto 1fr auto auto; gap: 32px; }
}

.wordmark {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.03em;
  font-variation-settings: 'SOFT' 0, 'WONK' 1;
  white-space: nowrap;
}
.wordmark i { font-style: normal; color: var(--signal); }

.masthead__nav { display: none; gap: 26px; }
@media (min-width: 1000px) { .masthead__nav { display: flex; } }
.masthead__nav a {
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.masthead__nav a:hover { color: var(--ink); border-bottom-color: var(--signal); }

.composite { display: flex; align-items: baseline; gap: 10px; justify-self: end; }
@media (min-width: 1000px) { .composite { justify-self: center; } }
.composite__value {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) { .composite__label { display: none; } }

.delta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; }
.delta--up { color: var(--up); }
.delta--down { color: var(--down); }

.masthead__cta { display: none; }
@media (min-width: 1000px) { .masthead__cta { display: block; } }

/* Mobile menu */
.menu-toggle {
  justify-self: end;
  border: 1px solid var(--ink);
  padding: 10px 12px;
  display: flex;
}
@media (min-width: 1000px) { .menu-toggle { display: none; } }
.menu-toggle__x { display: none; }
.menu-toggle[aria-expanded="true"] .menu-toggle__burger { display: none; }
.menu-toggle[aria-expanded="true"] .menu-toggle__x { display: block; }

.mobile-nav {
  border-bottom: 1px solid var(--rule-hard);
  background: var(--paper-2);
}
.mobile-nav[hidden] { display: none; }
.mobile-nav ul { display: flex; flex-direction: column; }
.mobile-nav a {
  padding: 16px var(--gut);
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mobile-nav a:hover { background: var(--signal-wash); }

/* ============================================================
   TICKER
   ============================================================ */
.ticker {
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
  overflow: hidden;
}
.ticker__track {
  display: flex;
  width: max-content;
  animation: tickerSlide 52s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
@keyframes tickerSlide { to { transform: translateX(-50%); } }

.tick {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 9px 24px;
  border-right: 1px solid var(--rule-soft);
  white-space: nowrap;
}
.tick__city { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.tick__val {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   CHAPTER — the repeating editorial unit
   ============================================================ */
.chapter { padding: clamp(48px, 7vw, 92px) 0; }
.chapter--tight { padding: clamp(36px, 5vw, 64px) 0; }

.chapter__head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding-bottom: clamp(24px, 3vw, 36px);
  border-bottom: 1px solid var(--rule-hard);
  margin-bottom: clamp(28px, 4vw, 48px);
}
@media (min-width: 940px) {
  .chapter__head { grid-template-columns: 76px minmax(0, 1fr) 300px; gap: 40px; align-items: end; }
}

.chapter__marker {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 0.78;
  letter-spacing: -0.05em;
  color: var(--signal);
  font-variation-settings: 'SOFT' 0, 'WONK' 1;
}

.kicker {
  display: inline-block;
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
}

.chapter__title { font-size: clamp(30px, 5.2vw, 60px); }
.chapter__title--sm { font-size: clamp(26px, 3.8vw, 42px); }
.chapter__standfirst { margin-top: 18px; }

.chapter__aside {
  border-top: 1px solid var(--rule);
  padding-top: 12px;
  line-height: 1.75;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
}
.chapter__aside strong { color: var(--ink); font-weight: 500; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: clamp(44px, 7vw, 88px) 0 clamp(30px, 4vw, 52px); }

.hero__eyebrow { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); }
.hero__pip {
  width: 6px; height: 6px; background: var(--signal);
  animation: pip 2.6s var(--ease) infinite;
}
@keyframes pip { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.hero__title {
  font-size: clamp(42px, 9vw, 116px);
  line-height: 0.94;
  letter-spacing: -0.045em;
  max-width: 15ch;
  margin-top: 22px;
}
.hero__title em { font-style: italic; font-variation-settings: 'opsz' 144, 'SOFT' 60, 'WONK' 1; }

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  margin-top: clamp(32px, 4vw, 52px);
  align-items: start;
}
@media (min-width: 1000px) { .hero__grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 56px; } }

.hero__facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule-hard);
  border-bottom: 1px solid var(--rule-hard);
  margin-top: 36px;
}
.hero__fact { padding: 18px 16px 18px 0; border-right: 1px solid var(--rule); }
.hero__fact:last-child { border-right: 0; }
.hero__fact b {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.hero__fact span { display: block; margin-top: 4px; color: var(--ink-soft); }

/* ---------- Quick estimate (ruled panel) ---------- */
.quick {
  border: 1px solid var(--rule-hard);
  background: var(--paper-2);
  padding: clamp(20px, 2.4vw, 28px);
}
.quick__title { font-size: 22px; margin-top: 10px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-top: 18px; }

.field__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field__label svg { flex-shrink: 0; }

.input, .select {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 12px 13px;
  font-size: 14px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.input:focus, .select:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--paper-2);
  box-shadow: inset 2px 0 0 var(--signal);
}
.select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 36px; }
.select-wrap { position: relative; }
.select-wrap__icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  pointer-events: none;
}
.input-icon { position: relative; }
.input-icon > svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  pointer-events: none;
  z-index: 1;
}
.input-icon .input, .input-icon .select { padding-left: 40px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 7px 13px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.quick__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 22px; }

.quick__result[hidden] { display: none; }
.quick__range {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: -0.035em;
  color: var(--signal);
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}
.quick__note { font-size: 13.5px; color: var(--ink-soft); margin-top: 12px; }

.form-error { color: var(--down); font-size: 12px; margin-top: 7px; }
.form-ok { color: var(--up); font-size: 12.5px; margin-top: 7px; }

/* ============================================================
   LANDSCAPE — the one canvas moment
   ============================================================ */
.landscape { padding: clamp(44px, 6vw, 76px) 0 clamp(24px, 3vw, 40px); }

.landscape__panel { border: 1px solid var(--rule-hard); background: var(--paper-2); }
.landscape__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
}
#landscape {
  display: block;
  width: 100%;
  height: clamp(250px, 33vw, 380px);
  cursor: crosshair;
}
.landscape__legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  border-top: 1px solid var(--rule);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-right: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
  cursor: default;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.legend-item.is-active { background: var(--signal-wash); color: var(--ink); }
.legend-item__bar {
  width: 14px;
  height: 2px;
  background: var(--ink-faint);
  flex-shrink: 0;
  transition: background 0.3s var(--ease), height 0.3s var(--ease);
}
.legend-item.is-active .legend-item__bar { background: var(--signal); height: 4px; }
.legend-item b { margin-left: auto; padding-left: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ============================================================
   DATA TABLE
   ============================================================ */
.ledger thead th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 400;
  text-align: left;
  padding: 0 16px 11px 0;
  border-bottom: 1px solid var(--rule-hard);
  white-space: nowrap;
}
.ledger th:last-child, .ledger td:last-child { padding-right: 0; text-align: right; }

.ledger tbody tr {
  position: relative;
  border-bottom: 1px solid var(--rule-soft);
  transition: background var(--dur) var(--ease);
}
.ledger tbody tr:hover { background: var(--signal-wash); }
.ledger tbody tr.is-active { background: var(--signal-wash); }
.ledger tbody tr:hover::before,
.ledger tbody tr.is-active::before { transform: scaleY(1); }
.ledger tbody tr::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--signal);
  transform: scaleY(0);
  transition: transform var(--dur) var(--ease);
}
.ledger tbody tr:hover::before { transform: scaleY(1); }

.ledger td { padding: 17px 16px 17px 0; vertical-align: middle; font-size: 15px; }

.c-city {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 30, 'SOFT' 0;
  white-space: nowrap;
}
.c-city em {
  display: block;
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 3px;
}
.c-range {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.c-comp { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.bars { display: flex; gap: 2px; }
.bars i { width: 4px; height: 13px; background: var(--rule); display: block; }
.bars i.on { background: var(--ink); }
.c-time { color: var(--ink-soft); white-space: nowrap; }
.c-spark { width: 92px; height: 26px; justify-self: end; }
.c-spark polyline { fill: none; stroke: var(--up); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.c-spark polyline.down { stroke: var(--down); }

@media (max-width: 880px) {
  .ledger thead { display: none; }
  .ledger tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 16px;
    padding: 17px 0;
  }
  .ledger td { padding: 0; }
  .ledger td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 4px;
  }
  .ledger td.c-spark-cell { grid-column: 1 / -1; }
  .c-spark { width: 100%; }
}

/* ============================================================
   SIGNAL STATS
   ============================================================ */
.signals {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--rule-hard);
  border-bottom: 1px solid var(--rule-hard);
}
@media (min-width: 780px) { .signals { grid-template-columns: repeat(3, 1fr); } }

.signal { padding: 30px 0; border-bottom: 1px solid var(--rule-soft); }
@media (min-width: 780px) {
  .signal { padding: 40px 32px; border-bottom: 0; border-right: 1px solid var(--rule); }
  .signal:first-child { padding-left: 0; }
  .signal:last-child { border-right: 0; padding-right: 0; }
}
.signal__value {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(32px, 4.2vw, 50px);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'opsz' 100, 'SOFT' 0, 'WONK' 1;
}
.signal__note { margin-top: 10px; font-size: 13.5px; color: var(--ink-soft); max-width: 32ch; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
html:not(.js) .reveal { opacity: 1; transform: none; }

.reveal[data-delay="1"] { transition-delay: 70ms; }
.reveal[data-delay="2"] { transition-delay: 140ms; }
.reveal[data-delay="3"] { transition-delay: 210ms; }
.reveal[data-delay="4"] { transition-delay: 280ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker__track, .hero__pip { animation: none; }
  .reveal { opacity: 1; transform: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
