/* Tech Scout Guide: editorial, Caribbean palette, mobile first. */
:root {
  --bg: #f4fafb;
  --bg-2: #e6f5f4;
  --surface: #ffffff;
  --surface-2: #f2f9fa;
  --ink: #0b2a3c;
  --ink-soft: #2d4a5c;
  --muted: #45616f;
  --line: #cfe3e6;
  --accent: #0a6f78;
  --accent-strong: #075861;
  --accent-ink: #ffffff;
  --aqua: #3cc4c4;
  --seafoam: #d6f1ec;
  --ocean: #1b6fa8;
  --coral: #b8402c;
  --tag-bg: #dff3f1;
  --tag-ink: #075861;
  --nav-bg: rgba(255, 255, 255, 0.82);
  --shadow: 0 1px 2px rgba(11, 42, 60, 0.06), 0 8px 24px rgba(11, 42, 60, 0.07);
  --shadow-lift: 0 2px 4px rgba(11, 42, 60, 0.08), 0 14px 34px rgba(11, 42, 60, 0.12);
  --highlight: #fff4d6;
  --focus: #0a6f78;
  --radius: 1rem;
  --gutter: 1rem;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Archivo", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #061a24;
  --bg-2: #0a2531;
  --surface: #0d2a38;
  --surface-2: #10313f;
  --ink: #e7f5f7;
  --ink-soft: #c6dfe4;
  --muted: #a6c3cb;
  --line: #1f4757;
  --accent: #5fd6d4;
  --accent-strong: #8de6e3;
  --accent-ink: #062029;
  --aqua: #3cc4c4;
  --seafoam: #123b44;
  --ocean: #7cc1f0;
  --coral: #ff9a85;
  --tag-bg: #12404a;
  --tag-ink: #bff0ec;
  --nav-bg: rgba(6, 26, 36, 0.82);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 14px 34px rgba(0, 0, 0, 0.4);
  --highlight: #23424a;
  --focus: #8de6e3;
  color-scheme: dark;
}

html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[data-font-size="md"] { font-size: 112.5%; }
html[data-font-size="lg"] { font-size: 125%; }
html[data-font-size="xl"] { font-size: 137.5%; }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 30rem at 85% -10%, var(--bg-2), transparent 70%),
    radial-gradient(40rem 24rem at -10% 20%, var(--bg-2), transparent 70%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 0.1875rem solid var(--focus); outline-offset: 0.125rem; border-radius: 0.375rem; }
button { font: inherit; color: inherit; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 0.75rem; top: -3rem; z-index: 50; padding: 0.5rem 0.875rem; border-radius: 0.5rem; background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.skip:focus { top: calc(0.75rem + env(safe-area-inset-top)); color: var(--accent-ink); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .nav { background: var(--nav-bg); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
}
.nav-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0.5rem 1rem;
  padding: 0.625rem var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: 0.625rem; text-decoration: none; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-mark {
  flex: none; display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 0.75rem;
  background: #0a6f78;
  background: linear-gradient(135deg, #0a6f78, #1b6fa8);
  color: #ffffff; font-family: var(--serif); font-weight: 700; font-size: 1.15rem;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.brand-text strong { font-family: var(--serif); font-weight: 700; font-size: 1rem; }
.brand-text span { font-size: 0.75rem; color: var(--muted); }
.nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 0.5rem; }
.nav-links a { padding: 0.375rem 0.625rem; border-radius: 999px; text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; }
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--accent-strong); background: var(--tag-bg); }
.prefs { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; }
.sizes { display: inline-flex; align-items: flex-end; gap: 0.125rem; padding: 0.1875rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.size-btn {
  min-width: 2rem; height: 2rem; padding: 0 0.375rem; border: 0; border-radius: 999px;
  background: transparent; cursor: pointer; font-weight: 700; color: var(--ink-soft); line-height: 1;
}
.size-btn.s1 { font-size: 0.75rem; }
.size-btn.s2 { font-size: 0.875rem; }
.size-btn.s3 { font-size: 1rem; }
.size-btn.s4 { font-size: 1.15rem; }
.size-btn:hover { background: var(--surface-2); }
.size-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.theme-btn {
  display: inline-flex; align-items: center; gap: 0.375rem; height: 2.375rem; padding: 0 0.875rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 600; font-size: 0.875rem;
}
.theme-btn:hover { background: var(--surface-2); }
.theme-btn svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: block; }
:root[data-theme="dark"] .theme-btn .i-sun { display: none; }

/* ---------- Masthead ---------- */
.masthead { padding: 2.5rem var(--gutter) 1.75rem; text-align: center; }
.masthead-inner { display: flex; flex-direction: column; align-items: center; gap: 0.875rem; }
.kicker { margin: 0; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-strong); }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
.masthead h1 { font-size: clamp(2.1rem, 1.4rem + 3.2vw, 4rem); font-weight: 700; max-width: 18ch; }
.deck { margin: 0; font-size: 1.1rem; color: var(--ink-soft); max-width: 46rem; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.625rem; margin-top: 0.25rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.5rem 1.25rem;
  border-radius: 999px; font-weight: 700; text-decoration: none; border: 1.5px solid transparent; font-size: 0.95rem;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn.primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn.ghost { background: var(--surface); border-color: var(--accent); color: var(--accent-strong); }
.btn.ghost:hover { background: var(--tag-bg); color: var(--accent-strong); }
.notice { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--muted); max-width: 46rem; }

/* ---------- Toolbar ---------- */
.toolbar-wrap { padding: 0 var(--gutter); }
.toolbar {
  display: flex; flex-direction: column; align-items: stretch; gap: 0.75rem;
  padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.search { position: relative; display: flex; align-items: center; min-width: 0; }
.search svg { position: absolute; left: 0.875rem; width: 1.1rem; height: 1.1rem; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input {
  width: 100%; min-width: 0; min-height: 2.75rem; padding: 0.5rem 1rem 0.5rem 2.6rem;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit;
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 0.1875rem var(--tag-bg); }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
.filter-btn {
  min-height: 2.25rem; padding: 0.3rem 0.85rem; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-soft); font-weight: 600; font-size: 0.875rem;
}
.filter-btn:hover { border-color: var(--accent); color: var(--ink); }
.filter-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.count { margin: 0; text-align: center; font-size: 0.85rem; color: var(--muted); }

/* ---------- Entries ---------- */
.entries { padding: 1.5rem var(--gutter) 3rem; min-height: 100vh; min-height: 100svh; outline: none; }
.loading, .empty { text-align: center; color: var(--muted); }
.section-block { margin: 0 0 2.5rem; }
.section-head { text-align: center; margin-bottom: 1.25rem; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.section-head h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); }
.section-head p { margin: 0; color: var(--ink-soft); max-width: 44rem; }
.rule { display: block; width: 3.5rem; height: 0.25rem; border-radius: 999px; background: #3cc4c4; background: linear-gradient(90deg, var(--accent), var(--aqua)); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.card {
  min-width: 0; display: flex; flex-direction: column; gap: 0.75rem;
  padding: 1.25rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  text-align: center; scroll-margin-top: var(--nav-h, 5rem);
  transition: box-shadow 0.2s ease, background-color 0.4s ease;
}
.card:hover { box-shadow: var(--shadow-lift); }
.card.is-highlight { background: var(--highlight); box-shadow: 0 0 0 0.1875rem var(--accent), var(--shadow-lift); }
.tag { align-self: center; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--tag-bg); color: var(--tag-ink); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.card h3 { font-size: 1.3rem; font-weight: 600; }
.summary { margin: 0; color: var(--ink-soft); }
.facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; margin: 0; }
.fact { min-width: 0; padding: 0.55rem 0.75rem; border-radius: 0.75rem; background: var(--surface-2); border: 1px solid var(--line); }
.fact dt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.fact dd { margin: 0.1rem 0 0; font-weight: 600; color: var(--ink); }
.toggle {
  align-self: center; display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.35rem 0.25rem;
  border: 0; background: none; color: var(--accent-strong); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em;
}
.toggle:hover { color: var(--ink); }
.full { display: flex; flex-direction: column; gap: 0.75rem; padding-top: 0.25rem; border-top: 1px solid var(--line); }
.full[hidden] { display: none; }
.full p { margin: 0; }
.sources h4 { margin: 0.25rem 0 0.35rem; font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sources ul { margin: 0; padding-left: 1.2rem; text-align: left; }
.sources li { margin: 0.2rem 0; }
.ask {
  align-self: center; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.5rem; padding: 0.4rem 1rem;
  border-radius: 999px; background: var(--seafoam); color: var(--accent-strong); font-weight: 700; font-size: 0.9rem; text-decoration: none; border: 1.5px solid var(--accent);
}
.ask:hover { background: var(--accent); color: var(--accent-ink); }
.ask svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 1.5rem var(--gutter) calc(1.5rem + env(safe-area-inset-bottom)); text-align: center; }
.footer-inner { display: flex; flex-direction: column; gap: 0.4rem; }
.footer p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.footer-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 0.6rem; }

@media (max-width: 699px) {
  .nav-row { gap: 0.4rem 0.6rem; padding: 0.45rem 0.75rem; }
  .nav-links a { padding: 0.3rem 0.55rem; font-size: 0.85rem; }
}

/* ---------- Larger screens ---------- */
@media (min-width: 700px) {
  :root { --gutter: 1.75rem; }
  .masthead { text-align: left; padding-top: 3.5rem; }
  .masthead-inner { align-items: flex-start; }
  .cta-row { justify-content: flex-start; }
  .nav-row { justify-content: space-between; }
  .toolbar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .search { flex: 1 1 18rem; }
  .filters { flex: 1 1 100%; justify-content: flex-start; order: 3; }
  .count { order: 2; text-align: right; }
  .section-head { text-align: left; align-items: flex-start; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { text-align: left; }
  .tag, .toggle, .ask { align-self: flex-start; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer { text-align: left; }
  .footer-inner { flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
}
@media (min-width: 1100px) {
  :root { --gutter: 2.5rem; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { flex: 1 1 auto; order: 2; }
  .count { order: 3; }
}
@media (min-width: 1700px) {
  :root { --gutter: 3.5rem; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
