/* Optics Boom — precision optics theme (typography-led; no image dependency). */

:root {
  --ink: #0e1a2b;
  --ink-2: #16263c;
  --ink-3: #20344f;
  --paper: #f6f8fb;
  --white: #ffffff;
  --amber: #f5a524;
  --amber-dark: #d98c0e;
  --teal: #18b6a6;
  --text: #24313f;
  --muted: #5b6675;
  --line: #e3e8ef;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14, 26, 43, 0.05), 0 10px 28px rgba(14, 26, 43, 0.08);
  --max: 1120px;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 700; margin-top: 1.6em; }
h3 { font-size: 1.15rem; font-weight: 700; margin-top: 1.4em; }
h4 { font-size: 1rem; font-weight: 700; }

p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 248, 251, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 66px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.25rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; position: relative;
  background: radial-gradient(circle at 30% 30%, #274a6e, var(--ink));
  flex: none;
}
.brand-mark::before,
.brand-mark::after { content: ""; position: absolute; background: var(--amber); }
.brand-mark::before { left: 50%; top: 3px; bottom: 3px; width: 2px; transform: translateX(-50%); border-radius: 1px; }
.brand-mark::after { top: 50%; left: 3px; right: 3px; height: 2px; transform: translateY(-50%); border-radius: 1px; }
.brand-text em { font-style: normal; color: var(--amber); }

.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.site-nav a { color: var(--ink-2); font-weight: 600; font-size: 0.95rem; padding: 6px 0; }
.site-nav a:hover { color: var(--teal); text-decoration: none; }

.nav-toggle { display: none; margin-left: auto; background: none; border: 0; cursor: pointer; padding: 10px; }
.nav-toggle-bar { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }

/* ------------------------------------------------------------------ footer */
.site-footer { background: var(--ink); color: #c8d3e0; margin-top: 64px; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
  padding-top: 48px; padding-bottom: 32px;
}
.footer-brand .brand { color: #fff; margin-bottom: 14px; }
.footer-brand p { color: #9fb0c2; max-width: 42ch; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h2 { color: #fff; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 6px; }
.footer-col a { color: #9fb0c2; font-size: 0.95rem; }
.footer-col a:hover { color: var(--amber); text-decoration: none; }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 18px 20px; }
.footer-legal p { color: #7e8ea0; font-size: 0.82rem; margin: 0; }

/* -------------------------------------------------------------------- hero */
.hero {
  color: #dbe5f0;
  background:
    radial-gradient(circle at 85% 20%, rgba(24, 182, 166, 0.16), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(245, 165, 36, 0.14), transparent 42%),
    linear-gradient(160deg, #0e1a2b, #16263c);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: 0.05; pointer-events: none;
  background-image:
    linear-gradient(var(--amber) 1px, transparent 1px),
    linear-gradient(90deg, var(--amber) 1px, transparent 1px);
  background-size: 48px 48px;
}
.hero-inner { position: relative; padding: 72px 20px 64px; max-width: var(--max); margin: 0 auto; }
.hero-kicker { color: var(--amber); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; margin: 0 0 16px; }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 5vw, 3.4rem); margin-bottom: 18px; }
.hero-text { color: #c3d0df; font-size: 1.15rem; max-width: 60ch; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px;
  border-radius: 10px; font-weight: 700; font-size: 0.98rem; border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--amber); color: #231503; box-shadow: 0 6px 18px rgba(245, 165, 36, 0.3); }
.btn-primary:hover { background: var(--amber-dark); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.3); color: #fff; background: rgba(255, 255, 255, 0.04); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.hero-stats { list-style: none; display: flex; gap: 40px; padding: 0; margin: 0 0 26px; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { color: #fff; font-size: 1.9rem; font-weight: 800; }
.hero-stats span { color: #93a6ba; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.hero-note { color: #93a6ba; font-size: 0.88rem; max-width: 60ch; margin: 0; }

/* ----------------------------------------------------------------- sections */
.section { margin-top: 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.section-link { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }

/* -------------------------------------------------------------------- cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; position: relative;
  display: flex; flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--teal), var(--amber)); }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(14, 26, 43, 0.12); }
.card-body { padding: 22px 22px 20px; display: flex; flex-direction: column; flex: 1; }
.card-cat { color: var(--teal); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.card-title { font-size: 1.1rem; margin: 0 0 10px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--teal); text-decoration: none; }
.card-excerpt { color: var(--muted); font-size: 0.94rem; margin: 0 0 16px; flex: 1; }
.card-more { font-weight: 700; font-size: 0.9rem; }

/* ----------------------------------------------------------------- listings */
.listing-main { padding-top: 40px; }
.listing-header { margin-bottom: 28px; }
.listing-header h1 { margin-bottom: 12px; }
.listing-intro { color: var(--muted); max-width: 68ch; font-size: 1.05rem; }
.listing-count { color: var(--muted); font-size: 0.9rem; }

.pagination { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 32px; }
.pagination a, .pagination .page-num {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--white); color: var(--ink-2); font-weight: 600; font-size: 0.9rem;
}
.pagination a:hover { text-decoration: none; border-color: var(--teal); color: var(--teal); }
.pagination .is-current { background: var(--ink); color: #fff; border-color: var(--ink); }


/* ------------------------------------------------------------------ article */
.post-main, .page-main { padding-top: 32px; }
.breadcrumbs { font-size: 0.86rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--teal); }

.post, .page { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(24px, 5vw, 56px); }

.post-header { margin-bottom: 24px; }
.eyebrow { display: inline-block; color: var(--teal); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px; }
.post-header h1 { margin-bottom: 12px; }
.page .post-header h1 { margin-bottom: 8px; }
.post-meta { color: var(--muted); font-size: 0.9rem; margin: 0; }
.page-intro { color: var(--muted); font-size: 1.05rem; margin-top: 8px; }

.post-disclosure {
  background: #eef6f5; border: 1px solid #d6ebe8; border-left: 4px solid var(--teal);
  padding: 14px 18px; border-radius: 10px; font-size: 0.92rem; margin-bottom: 24px;
}
.post-disclosure strong { color: var(--ink); }

.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; align-items: start; }
.post-body { min-width: 0; }
.post-body > *:first-child { margin-top: 0; }

/* Table of contents */
.toc-aside { position: sticky; top: 90px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.toc-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px; color: var(--muted); }
.toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.toc-list a { color: var(--ink-2); font-size: 0.9rem; line-height: 1.35; }
.toc-list a:hover { color: var(--teal); text-decoration: none; }
.toc-h3 a { padding-left: 12px; color: var(--muted); font-size: 0.85rem; }
.toc-mobile { display: none; margin-bottom: 20px; }

/* -------------------------------------------------------------------- prose */
.post-body p, .page-body p { color: var(--text); }
.post-body h2 { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.post-body ul, .post-body ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.post-body li { margin-bottom: 0.35em; }

/* Comparison / spec tables */
.post-body table, .page-body table {
  border-collapse: separate; border-spacing: 0; width: 100%; margin: 1.4em 0;
  font-size: 0.92rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.post-body th, .post-body td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.post-body thead th {
  background: var(--ink); color: #fff; font-weight: 700; border-bottom: none;
  white-space: nowrap;
}
.post-body thead th:first-child { border-top-left-radius: 11px; }
.post-body thead th:last-child { border-top-right-radius: 11px; }
.post-body tbody tr:nth-child(even) { background: #f3f6fa; }
.post-body tbody tr:last-child td { border-bottom: none; }
.post-body td:first-child, .post-body th:first-child { font-weight: 600; color: var(--ink-2); }

/* Amazon affiliate links */
.post-body a[data-search], .page-body a[data-search], .post-body a[data-asin] {
  color: #b26b00; font-weight: 600; border-bottom: 2px solid rgba(245, 165, 36, 0.5);
}
.post-body a[data-search]:hover, .post-body a[data-asin]:hover { border-bottom-color: var(--amber-dark); text-decoration: none; }
.btn-amazon {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--amber); color: #231503 !important; font-weight: 700;
  padding: 12px 20px; border-radius: 10px; border-bottom: none !important;
}
.btn-amazon:hover { background: var(--amber-dark); text-decoration: none; }

/* Related */
.related { margin-top: 48px; }
.related h2 { margin-bottom: 20px; }

/* -------------------------------------------------------------------- pages */
.error-page { text-align: center; padding-top: 56px; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--line); margin: 0; line-height: 1; }
.error-links { list-style: none; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; padding: 0; }

.sitemap-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.sitemap-group h2 { font-size: 1.1rem; margin: 0 0 12px; }
.sitemap-count { display: inline-block; background: var(--paper); border: 1px solid var(--line); color: var(--muted); border-radius: 20px; font-size: 0.78rem; padding: 1px 10px; margin-left: 6px; vertical-align: middle; }
.sitemap-group ul { list-style: none; padding: 0; margin: 0; }
.sitemap-group li { margin-bottom: 7px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; }
  .toc-aside { display: none; }
  .toc-mobile { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 20px;
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { width: 100%; padding: 10px 0; border-bottom: 1px solid var(--paper); }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
  .post-body table { display: block; overflow-x: auto; }
}

