*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #FAF7F2;
  --bg-alt: #F3EDE4;
  --bg-deep: #EBE3D7;
  --surface: #FFFFFF;
  --text: #2C2417;
  --text-2: #6B5D4F;
  --text-3: #9C8E7E;
  --border: #DDD5C9;
  --border-light: #EDE7DD;
  --green: #2D8A4E;
  --green-bg: #E8F5E9;
  --amber: #C47F17;
  --amber-bg: #FFF8E1;
  --red: #C62828;
  --red-bg: #FFEBEE;
  --link: #8B5E3C;
  --link-hover: #6B4226;
  --sidebar-width: 260px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2rem);
}

a { color: var(--link); transition: color 0.15s; }
a:hover { color: var(--link-hover); }

h1, h2, h3 {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); margin-bottom: 1rem; }
h2 { font-size: 1.375rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.125rem; margin: 1.5rem 0 0.5rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

section {
  padding: 2rem 0;
  border-top: 1px solid var(--border-light);
}

/* ─── Sidebar ─── */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border-light);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: 1.5rem 0;
  font-family: 'DM Sans', sans-serif;
}
.sidebar--open { transform: translateX(0); }
.sidebar__header {
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0.75rem;
}
.sidebar__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: block;
}
.sidebar__title:hover { color: var(--link); }
.sidebar__subtitle {
  font-size: 0.6875rem;
  color: var(--text-3);
  margin-top: 0.125rem;
}
.sidebar__items { list-style: none; padding: 0; }
.sidebar__item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 1.25rem;
  text-decoration: none;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.sidebar__item a:hover {
  background: var(--bg-alt);
  color: var(--text);
}
.sidebar__item--active a {
  background: var(--bg-alt);
  color: var(--text);
  font-weight: 600;
  border-left-color: var(--link);
}
.sidebar__emoji { font-size: 1.125rem; }
.sidebar__item-info { display: flex; flex-direction: column; }
.sidebar__item-title { line-height: 1.3; }
.sidebar__item-date {
  font-size: 0.6875rem;
  color: var(--text-3);
  font-weight: 400;
}
.sidebar__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 199;
}
.sidebar--open ~ .sidebar__overlay { display: block; }

.sidebar-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 201;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  color: var(--text-2);
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  line-height: 1;
}
.sidebar-toggle:hover {
  background: var(--bg-alt);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

@media (min-width: 1080px) {
  .sidebar { transform: translateX(0); }
  .sidebar__overlay { display: none !important; }
  .sidebar-toggle { display: none; }
  .page-content { margin-left: var(--sidebar-width); }
}

/* ─── Sticky bar ─── */

.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.sticky-bar--visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.sticky-bar__inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px clamp(0.75rem, 3vw, 1.25rem);
  display: flex;
  gap: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
}
.sticky-bar__pick {
  flex: 1;
  text-align: center;
  padding: 6px 8px;
  text-decoration: none;
  color: var(--text-2);
  border-radius: 6px;
  transition: background 0.15s;
  font-weight: 500;
}
.sticky-bar__pick:hover { background: var(--bg-alt); color: var(--text); }
.sticky-bar__label { font-weight: 700; color: var(--text); }

/* ─── Hero ─── */

.hero {
  padding: clamp(2.5rem, 7vw, 4rem) 0 2rem;
  border-top: none;
}
.hero__meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}
.hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-2);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ─── Pick card (hero only) ─── */

.pick-card {
  background: var(--surface);
  border-left: 4px solid var(--green);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
  margin-bottom: 1.5rem;
}
.pick-card__name {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.pick-card__specs {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--text-2);
  margin-bottom: 0.75rem;
}
.pick-card__verdict { font-size: 0.9375rem; margin-bottom: 1rem; }
.pick-card__availability {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  color: var(--green);
  font-weight: 500;
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.btn--green { background: var(--green); color: #fff; }
.btn--green:hover { background: #236B3D; color: #fff; transform: translateY(-1px); }
.btn--amber { background: var(--amber); color: #fff; }
.btn--amber:hover { background: #a86a0f; color: #fff; transform: translateY(-1px); }
.btn--outline { background: none; border: 1.5px solid var(--border); color: var(--text-2); }
.btn--outline:hover { background: var(--bg-alt); color: var(--text); }
.pick-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.hero__context {
  font-size: 0.875rem;
  color: var(--text-3);
}

/* ─── Criteria list ─── */

.criteria-list { margin-bottom: 1.5rem; }
.criteria-list li { margin-bottom: 0.75rem; }
.criteria-list li strong { color: var(--text); }

/* ─── Myths ─── */

.myths {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.myths h3 { margin-top: 0; }
.myth-item { margin-bottom: 1rem; }
.myth-item:last-child { margin-bottom: 0; }
.myth-name {
  font-weight: 600;
  text-decoration: line-through;
  text-decoration-color: var(--text-3);
  color: var(--text-2);
}
.myth-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--amber-bg);
  color: var(--amber);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: 2px;
}
.myth-item p {
  font-size: 0.9375rem;
  color: var(--text-2);
  margin: 0.25rem 0 0;
}

.aside {
  font-style: italic;
  color: var(--text-2);
  border-left: 3px solid var(--amber);
  padding-left: 1rem;
  margin: 1.5rem 0;
}

/* ─── Recommendation blocks ─── */

.rec {
  background: var(--surface);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  border-left: 4px solid var(--border);
  scroll-margin-top: 56px;
}
.rec--best { border-left-color: var(--green); }
.rec--budget { border-left-color: #4A6741; }
.rec--premium { border-left-color: #5C4B8A; }

.rec__tier {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 0.25rem;
}
.rec h3 { margin-top: 0; font-size: 1.1875rem; }
.rec__meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--text-2);
  margin-bottom: 0.75rem;
}
.rec__meta .price {
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text);
}
.rec__status {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
}
.rec__status--green { color: var(--green); }
.rec__status--red { color: var(--red); }

.rec__warning {
  background: var(--red-bg);
  border-radius: 4px;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--red);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.pros-cons { margin: 1rem 0; font-size: 0.9375rem; }
.pros-cons ul { padding-left: 0; list-style: none; margin: 0.25rem 0 0.75rem; }
.pros-cons li { padding-left: 1.25rem; position: relative; margin-bottom: 0.375rem; color: var(--text-2); line-height: 1.5; }
.pros-cons li::before { position: absolute; left: 0; font-weight: 700; }
.pros-cons .pros li::before { content: '+'; color: var(--green); }
.pros-cons .cons li::before { content: '\2212'; color: var(--amber); }
.pros-cons-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.rec__actions { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 8px; }
.rec__runner-up {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-light);
  font-size: 0.9375rem;
  color: var(--text-2);
}
.rec__runner-up strong { color: var(--text); }

/* ─── Tradeoffs ─── */

.tradeoff {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.tradeoff__header {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.tradeoff p { font-size: 0.9375rem; color: var(--text-2); margin-bottom: 0.5rem; }

/* ─── Ruled out ─── */

.ruled-out-item { margin-bottom: 1.25rem; }
.ruled-out-item h3 { display: inline; font-size: 1rem; }
.avoid-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: 2px;
}
.avoid-tag--red { background: var(--red-bg); color: var(--red); }
.avoid-tag--amber { background: var(--amber-bg); color: var(--amber); }
.ruled-out-item p { font-size: 0.9375rem; color: var(--text-2); margin-top: 0.25rem; }

/* ─── Evidence drawers ─── */

.evidence-drawers { display: flex; flex-direction: column; gap: 6px; margin-top: 1rem; }

details.drawer {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}
details.drawer summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  transition: background 0.15s;
}
details.drawer summary::-webkit-details-marker { display: none; }
details.drawer summary:hover { background: var(--bg-alt); }
details.drawer summary::before {
  content: '\25B8';
  font-size: 0.7rem;
  transition: transform 0.2s;
  color: var(--text-3);
}
details.drawer[open] > summary::before { transform: rotate(90deg); }
.drawer__hint {
  margin-left: auto;
  font-weight: 400;
  font-size: 0.6875rem;
  color: var(--text-3);
}
.drawer__body {
  padding: 1rem 1.25rem 1.25rem;
  background: var(--bg-deep);
  border-top: 1px solid var(--border-light);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-2);
}
.drawer__body h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  margin: 1.25rem 0 0.5rem;
}
.drawer__body h4:first-child { margin-top: 0; }
.drawer__body p { margin-bottom: 0.625rem; }
.drawer__body ul, .drawer__body ol { padding-left: 1.25rem; margin-bottom: 0.625rem; }
.drawer__body li { margin-bottom: 0.375rem; }
.drawer__body blockquote {
  border-left: 3px solid var(--amber);
  padding: 0.375rem 0 0.375rem 0.875rem;
  margin: 0.5rem 0;
  font-style: italic;
}
.drawer__body blockquote cite {
  display: block;
  margin-top: 0.25rem;
  font-family: 'DM Sans', sans-serif;
  font-style: normal;
  font-size: 0.6875rem;
  color: var(--text-3);
}
.drawer__body .source-link { font-family: 'DM Sans', sans-serif; font-size: 0.75rem; }
.drawer__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.75rem;
  font-family: 'DM Sans', sans-serif;
}
.drawer__body th {
  text-align: left;
  padding: 6px 8px;
  background: var(--bg-alt);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
}
.drawer__body td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-light);
}

/* ─── Footer ─── */

footer {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--text-3);
  line-height: 1.6;
}
footer p { margin-bottom: 0.375rem; }
footer .made-with { font-style: italic; color: var(--text-2); margin-top: 0.5rem; }

/* ─── Directory page ─── */

.directory { padding: clamp(3rem, 8vw, 5rem) 0 2rem; }
.directory__subtitle {
  font-size: 1.0625rem;
  color: var(--text-2);
  margin-bottom: 2rem;
}
.directory__grid {
  display: grid;
  gap: 1rem;
}
.research-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.research-card:hover {
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  color: var(--text);
}
.research-card__emoji { font-size: 1.75rem; flex-shrink: 0; padding-top: 2px; }
.research-card__info { flex: 1; }
.research-card__title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1.0625rem;
  margin-bottom: 0.25rem;
}
.research-card__summary {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}
.research-card__date {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  color: var(--text-3);
}

/* ─── Print ─── */

@media print {
  .sticky-bar, .sidebar, .sidebar-toggle, .sidebar__overlay { display: none !important; }
  .page-content { margin-left: 0 !important; }
  body { background: #fff; font-size: 10pt; }
  .hero { padding-top: 0.5rem; }
  .btn { display: none; }
  .pick-card, .rec { box-shadow: none; border: 1px solid #ccc; }
  .drawer__body { display: block !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.65em; color: #666; word-break: break-all; }
  .rec { page-break-inside: avoid; }
}

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