/* base.css — editorial cream theme for content pages.
   Mirrors calculator.css palette and typography. */

:root {
  --paper: #f7f4ec;
  --paper-elev: #fbf8f1;
  --card: #ffffff;
  --card-soft: #fefcf6;
  --ink: #161311;
  --ink-dim: #3d3832;
  --ink-soft: #5a544c;
  --ink-faint: #7a7269;
  --rule: #e8dfca;
  --rule-soft: #f0e9d8;

  --accent: #c8674a;
  --accent-deep: #a04e35;
  --accent-soft: rgba(200,103,74,0.10);

  --sage: #5b7a5e;
  --sage-soft: rgba(91,122,94,0.12);
  --rust: #b34842;
  --amber: #b8862d;

  --bg: var(--paper);
  --bg-card: var(--card);
  --bg-input: var(--card);
  --border: var(--rule);
  --border-soft: var(--rule-soft);
  --text: var(--ink);
  --text-dim: var(--ink-dim);
  --text-muted: var(--ink-soft);
  --green: var(--sage);
  --red: var(--rust);
  --blue: #4a6f8a;

  --radius: 14px;
  --radius-lg: 22px;
  --max-content: 720px;

  --serif: 'Fraunces', 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--paper);
  background-image:
    radial-gradient(800px 500px at 100% 0%, rgba(200,103,74,0.06), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(91,122,94,0.04), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01';
}

::selection { background: var(--accent-soft); color: var(--accent-deep); }

/* Layout */
.shell { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.prose { max-width: var(--max-content); margin: 0 auto; padding: 0 24px; }

/* Header */
.topbar {
  height: 64px;
  background: rgba(247, 244, 236, 0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-icon { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
.logo-text { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.topbar-nav { display: flex; gap: 2px; }
.topbar-link {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.18s, color 0.18s;
}
.topbar-link:hover, .topbar-link[aria-current="page"] {
  background: rgba(22,19,17,0.04);
  color: var(--ink);
}
.topbar-cta {
  background: var(--ink);
  color: var(--paper) !important;
  font-weight: 500;
}
.topbar-cta:hover { background: var(--accent-deep); color: var(--paper) !important; }

@media (max-width: 600px) {
  .topbar { padding: 0 16px; height: 58px; }
  .topbar-nav { display: none; }
}

/* Typography */
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.01em; font-family: var(--serif); color: var(--ink); }
h1 { font-size: clamp(36px, 6vw, 64px); font-weight: 600; margin-bottom: 18px; letter-spacing: -0.025em; }
h2 { font-size: clamp(26px, 3.6vw, 34px); font-weight: 600; margin-top: 56px; margin-bottom: 14px; }
h3 { font-family: var(--sans); font-size: 19px; font-weight: 600; margin-top: 32px; margin-bottom: 10px; letter-spacing: -0.005em; }
h4 { font-family: var(--sans); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
p { margin-bottom: 16px; color: var(--ink); }
.lead { font-family: var(--serif); font-style: italic; font-size: clamp(19px, 2vw, 22px); color: var(--ink-dim); margin-bottom: 28px; line-height: 1.5; font-weight: 400; }
a { color: var(--accent-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 0.15s; }
a:hover { color: var(--ink); }

ul, ol { margin: 0 0 16px 22px; }
li { margin-bottom: 6px; }
li::marker { color: var(--ink-faint); }

strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

code, kbd, samp {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--card-soft);
  border: 1px solid var(--rule-soft);
  padding: 1px 6px;
  border-radius: 4px;
}
pre {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 18px;
  font-family: var(--mono);
}
pre code { background: transparent; border: 0; padding: 0; }

blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1em;
  border-left: 2px solid var(--accent);
  padding: 6px 0 6px 22px;
  margin: 24px 0;
  color: var(--ink-dim);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14.5px;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule-soft);
}
th { background: var(--card-soft); font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--ink-soft); font-size: 13.5px; letter-spacing: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule-soft); border-radius: 12px; background: var(--card); margin: 20px 0; }
.table-wrap table { margin: 0; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

img, svg, video { max-width: 100%; height: auto; display: block; }
figure { margin: 24px 0; }
figcaption { font-family: var(--serif); font-style: italic; font-size: 13.5px; color: var(--ink-soft); margin-top: 8px; text-align: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  border: 0;
  cursor: pointer;
  min-height: 46px;
  transition: background 0.18s, transform 0.05s;
  font-family: var(--sans);
}
.btn:hover { background: var(--accent-deep); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}
.btn-secondary:hover { background: var(--card); color: var(--ink); border-color: var(--ink-faint); }

/* Cards / callouts */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 18px;
  box-shadow: 0 1px 0 rgba(22,19,17,0.03);
}
.callout {
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
  margin: 22px 0;
  font-size: 15.5px;
}
.callout-title {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--accent-deep);
}

/* Breadcrumbs */
.breadcrumb {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 18px 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 0;
}
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--ink-faint); font-style: normal; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--ink-soft); }

/* FAQ */
details {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 12px;
}
summary {
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  list-style: none;
  position: relative;
  padding-right: 28px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: -2px;
  font-size: 24px;
  color: var(--ink-soft);
  font-weight: 300;
  line-height: 1;
  font-family: var(--sans);
  transition: transform 0.2s;
}
details[open] summary::after { content: "−"; }
details > *:not(summary) { margin-top: 12px; }

/* Footer */
.footer {
  border-top: 1px solid var(--rule);
  margin-top: 100px;
  padding: 40px 24px;
  font-size: 14.5px;
  color: var(--ink-dim);
  background: var(--paper-elev);
}
.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 36px;
}
.footer h4 { font-family: var(--sans); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); margin-bottom: 14px; font-weight: 600; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 9px; }
.footer a { color: var(--ink-dim); text-decoration: none; }
.footer a:hover { color: var(--ink); text-decoration: underline; }
.footer-bottom { max-width: 1100px; margin: 28px auto 0; padding-top: 22px; border-top: 1px solid var(--rule-soft); font-size: 13px; color: var(--ink-soft); font-style: italic; font-family: var(--serif); }

/* Hero / landing */
.hero {
  padding: 80px 24px 48px;
  text-align: center;
  max-width: 920px;
  margin: 0 auto;
  position: relative;
}
.hero-eyebrow {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
  font-family: var(--serif);
  font-style: italic;
}
.hero h1 { font-size: clamp(44px, 8vw, 84px); letter-spacing: -0.03em; line-height: 1.02; font-weight: 600; }
.hero h1 em { font-style: italic; color: var(--accent-deep); font-weight: 500; }
.hero-cta { margin: 32px 0 36px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 32px 0;
}
.feature {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  display: block;
  text-decoration: none;
  color: inherit;
}
.feature:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.feature-icon { width: 36px; height: 36px; color: var(--accent); margin-bottom: 14px; }
.feature h3 { margin-top: 0; font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.feature p { color: var(--ink-dim); font-size: 14.5px; line-height: 1.55; margin-bottom: 12px; }
.feature-more {
  font-family: var(--serif); font-style: italic; font-size: 13.5px;
  color: var(--accent-deep); display: inline-block;
  border-bottom: 1px solid rgba(160,78,53,0.30); padding-bottom: 1px;
  transition: border-color 0.15s, color 0.15s;
}
.feature:hover .feature-more { color: var(--ink); border-bottom-color: var(--ink); }

/* Page header */
.page-header { padding: 40px 24px 16px; max-width: var(--max-content); margin: 0 auto; }
.page-header .lead { margin-bottom: 0; }

/* Content body */
.content { padding: 16px 24px 80px; }

/* Homepage comparison block: pairs at desktop, stack at mobile */
.cmp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* Mobile */
@media (max-width: 600px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  .cmp-row { grid-template-columns: 1fr; gap: 10px; }
  .comparison { padding: 22px 18px !important; }
  .feature { padding: 22px 20px; }
  body { font-size: 16px; line-height: 1.6; }
  .hero { padding: 48px 18px 28px; }
  .hero-cta { margin: 24px 0; }
  h1 { margin-bottom: 14px; }
  h2 { margin-top: 40px; }
  pre { font-size: 12.5px; padding: 14px; }
  table { font-size: 13.5px; }
  th, td { padding: 9px 11px; }
  details { padding: 16px 18px; }
  summary { font-size: 17px; }
}
