/* =============================================================================
   RideshareMath — editorial financial publication aesthetic
   Parchment + ink + a single hot accent. Fraunces display, Inter Tight body.
   ========================================================================== */

:root {
  --paper:    #f4ede0;
  --paper-2:  #ece2cf;
  --ink:      #1a1612;
  --ink-soft: #4a4036;
  --line:     #d8c8a8;
  --accent:   #d44a1c;       /* signal-orange — used sparingly */
  --accent-2: #2a4d3a;       /* deep evergreen for secondary */
  --gold:     #b8862e;
  --serif:    "Fraunces", "Times New Roman", serif;
  --sans:     "Inter Tight", system-ui, sans-serif;
  --mono:     "JetBrains Mono", ui-monospace, monospace;
  --shadow:   0 1px 0 rgba(26, 22, 18, 0.08), 0 8px 24px -12px rgba(26, 22, 18, 0.18);
}

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(212, 74, 28, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(42, 77, 58, 0.05) 0%, transparent 55%);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
}

/* Subtle film grain */
.grain {
  pointer-events: none;
  position: fixed; inset: 0;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.1, 0 0 0 0 0.08, 0 0 0 0 0.05, 0 0 0 0.18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

main, header, footer { position: relative; z-index: 2; }

/* ---------- header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px max(24px, 5vw);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  display: grid; place-items: center;
}
.brand-name {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 14;
}
.brand-name span { color: var(--accent); font-style: italic; font-weight: 500; }
.brand-tag {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 2px 0 0;
  letter-spacing: 0.02em;
}
.site-nav { display: flex; gap: 28px; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color .2s;
}
.site-nav a:hover { border-color: var(--accent); }

/* ---------- main layout ---------- */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px max(24px, 5vw) 80px;
}

/* ---------- hero ---------- */
.hero {
  margin-bottom: 64px;
  max-width: 760px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 0 0 20px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  font-variation-settings: "opsz" 144;
}
.hero-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
  font-variation-settings: "opsz" 144;
}
.hero-sub {
  font-size: 18px;
  line-height: 1.55;
  max-width: 620px;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- section titles ---------- */
.section-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.015em;
  margin: 0 0 28px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- ad slots ---------- */
.ad-slot {
  margin: 48px 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.3);
  text-align: center;
  min-height: 100px;
}
.ad-slot--top { margin-top: 0; }
.ad-fallback {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  margin: 8px 0 0;
  opacity: 0.6;
}

/* ---------- calculator grid ---------- */
.calc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.calc-header .section-title { margin: 0; flex: 1; }
.ghost-btn {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: all .15s;
  margin-left: 16px;
}
.ghost-btn:hover { background: var(--ink); color: var(--paper); }

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  border: 0;
}

.card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px 22px;
  margin: 0;
  box-shadow: var(--shadow);
  position: relative;
}
.card legend {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 8px;
  margin-left: -4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 100px;
}

.card label {
  display: block;
  margin: 16px 0 0;
}
.card label > span {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.card label > span small {
  font-weight: 400;
  color: var(--ink-soft);
  opacity: 0.7;
}
.card input, .card select {
  width: 100%;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.card input:focus, .card select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 74, 28, 0.15);
}
.card select {
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
}

.hint {
  font-size: 12px;
  color: var(--ink-soft);
  font-style: italic;
  margin: 14px 0 0;
  line-height: 1.5;
}

.computed {
  margin: 18px 0 0;
  padding: 14px 16px;
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* Paired weekly/monthly cost rows */
.cost-hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 14px 0 4px;
  font-style: italic;
}
.cost-hint strong {
  font-style: normal;
  color: var(--accent);
}
.cost-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.cost-row:first-of-type {
  border-top: none;
  padding-top: 4px;
}
.cost-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.cost-label small {
  font-weight: 400;
  color: var(--ink-soft);
  opacity: 0.75;
}
.cost-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cost-pair label {
  margin: 0;
}
.cost-pair label > span {
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.cost-pair input {
  font-size: 14px;
  padding: 8px 10px;
}
.computed strong {
  font-family: var(--mono);
  font-size: 17px;
  color: var(--ink);
  margin-left: 4px;
}
.computed .sub {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.75;
}

/* ---------- results ---------- */
.results {
  margin-top: 80px;
  padding: 48px max(24px, 4vw);
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.results .section-title { color: var(--paper); }
.results .section-title::after { background: rgba(244, 237, 224, 0.2); }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.metric {
  padding: 24px 22px;
  background: rgba(244, 237, 224, 0.06);
  border: 1px solid rgba(244, 237, 224, 0.12);
  border-radius: 6px;
}
.metric-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(244, 237, 224, 0.65);
  margin-bottom: 8px;
}
.metric-label small {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 11px;
  opacity: 0.7;
}
.metric-value {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.015em;
}
.metric-monthly {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(244, 237, 224, 0.55);
  margin-top: 6px;
}
.metric-foot {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(244, 237, 224, 0.7);
  margin-top: 4px;
}
.metric--hero {
  grid-column: 1 / -1;
  background: var(--accent);
  border-color: var(--accent);
  padding: 32px 28px;
}
.metric--hero .metric-label { color: rgba(255, 255, 255, 0.85); }
.metric--hero .metric-value {
  font-size: 56px;
  color: var(--paper);
  font-style: italic;
  font-weight: 900;
}
.metric--hero .metric-monthly {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}
.metric--hero .metric-foot { color: rgba(255, 255, 255, 0.85); font-size: 14px; }

.breakdown {
  margin-top: 32px;
  border-top: 1px solid rgba(244, 237, 224, 0.15);
  padding-top: 24px;
}
.breakdown summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(244, 237, 224, 0.7);
  list-style: none;
}
.breakdown summary::before { content: "▸ "; }
.breakdown[open] summary::before { content: "▾ "; }
.bd-table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
  font-size: 14px;
}
.bd-table td {
  padding: 10px 0;
  border-bottom: 1px solid rgba(244, 237, 224, 0.1);
}
.bd-table td:last-child {
  text-align: right;
  font-family: var(--mono);
}
.bd-table tr.hl td { font-weight: 600; color: var(--paper); }
.bd-table tr.total td {
  border-top: 2px solid var(--accent);
  border-bottom: none;
  padding-top: 16px;
  font-size: 18px;
  font-family: var(--serif);
}
.bd-table tr.total td:last-child { color: var(--accent); font-weight: 700; }

.export-row {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.primary-btn {
  background: var(--paper);
  color: var(--ink);
  border: none;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.primary-btn--alt {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--paper);
}
.primary-btn--alt:hover { background: var(--paper); color: var(--ink); }

/* ---------- guide / faq ---------- */
.guide {
  margin-top: 80px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  margin-bottom: 24px;
}
.guide article h4 {
  font-family: var(--serif);
  font-size: 19px;
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
}
.guide article p {
  font-size: 14px;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}
.disclaimer {
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 32px;
}

.faq { margin-top: 64px; }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: -0.005em;
}
.faq summary::after {
  content: "+";
  font-family: var(--sans);
  font-weight: 300;
  font-size: 24px;
  color: var(--accent);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px max(24px, 5vw);
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}
.site-footer p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .site-header { padding: 20px 18px; }
  .site-nav { gap: 18px; }
  .site-nav a { font-size: 13px; }
  main { padding: 32px 18px 60px; }
  .hero { margin-bottom: 40px; }
  .hero-sub { font-size: 16px; }
  .calc-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .calc-header .section-title { width: 100%; }
  .ghost-btn { margin-left: 0; }
  .results { padding: 28px 20px; margin-top: 56px; }
  .metric--hero .metric-value { font-size: 40px; }
  .metric { padding: 18px 16px; }
  .export-row { flex-direction: column; }
  .primary-btn { width: 100%; }
}
