/* ==========================================================================
   PhoneCodex — Site Stylesheet (v2 "Pit Lane" design)
   Light mode only. Loaded by every page EXCEPT index.html, which inlines its
   own copy of the shell so the homepage has no render-blocking stylesheet
   (same convention as AutoTimegist).
   Sections: tokens, base, shell (ticker/header/drawer/footer), post cards,
   spec page, responsive.
   ========================================================================== */

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

:root {
    color-scheme: light;

    --ink: #111110;
    --ink-soft: #43423d;
    --paper: #f5f2ea;
    --surface: #ffffff;
    --line: #e2ddcd;
    --accent: #45c8ff;
    --accent-ink: #052330;
    --accent-deep: #0a6f9c;
    --signal: #ff4e2a;
    --muted: #8a877d;
    --radius: 3px;
    --maxw: 1320px;
    --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Paints the strip behind a phone's status bar so content cannot scroll up
   under it. Inner pages open with the sticky header, so this matches the
   header; the homepage opens with the ink ticker and paints its own in --ink. */
body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: env(safe-area-inset-top, 0px);
    z-index: 1100;
    background: var(--paper);
}

img { display: block; max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }

.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding-left: max(2rem, env(safe-area-inset-left, 0px));
    padding-right: max(2rem, env(safe-area-inset-right, 0px));
}

.wrap-narrow { max-width: 1040px; }

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.01em; text-wrap: balance; }

.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.125em; flex: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.6rem;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: translateY(-2px); }
.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-accent:hover { background: var(--ink); color: var(--accent); border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: none; }

/* ---------- Top ticker ---------- */
.topbar { background: var(--ink); color: var(--paper); overflow: hidden; font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.03em; }
.topbar-inner { display: flex; align-items: stretch; }

.topbar-tag {
    flex-shrink: 0;
    background: var(--signal);
    color: var(--ink);
    padding: 0.5rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
}

.ticker { flex: 1; overflow: hidden; display: flex; align-items: center; position: relative; min-width: 0; }
.ticker-track { display: flex; gap: 3rem; white-space: nowrap; animation: ticker-scroll 38s linear infinite; padding-left: 1rem; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track a { text-decoration: none; color: var(--paper); opacity: 0.85; }
.ticker-track a:hover { color: var(--accent); opacity: 1; }

@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 1000;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    transition: box-shadow 0.2s ease;
}

.site-header.is-scrolled { box-shadow: 0 6px 20px rgba(17,17,16,0.08); }

.header-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding-block: 1.1rem;
    padding-left: max(2rem, env(safe-area-inset-left, 0px));
    padding-right: max(2rem, env(safe-area-inset-right, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--ink); flex: none; }
.brand-mark { background: var(--ink); color: var(--accent); padding: 0.15rem 0.5rem; border-radius: var(--radius); font-size: 1.3rem; }

.main-nav { display: flex; gap: 2.1rem; list-style: none; }
.main-nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.92rem; position: relative; padding-bottom: 0.3rem; white-space: nowrap; }
.main-nav a::after { content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 3px; background: var(--accent); transition: width 0.2s ease; }
.main-nav a:hover::after, .main-nav a.is-active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 1rem; }

.icon-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--ink);
    font-size: 0.95rem;
}

.icon-btn:hover { border-color: var(--ink); }
.mobile-toggle { display: none; }

/* ---------- Hamburger ---------- */
.nav-toggle-box { position: relative; display: block; width: 18px; height: 12px; }

.nav-toggle-bar {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.16s ease, top 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-toggle-bar:nth-child(1) { top: 0; }
.nav-toggle-bar:nth-child(2) { top: 5px; }
.nav-toggle-bar:nth-child(3) { top: 10px; width: 72%; }

.mobile-toggle.is-open { background: var(--ink); border-color: var(--ink); color: var(--accent); }
.mobile-toggle.is-open .nav-toggle-bar:nth-child(1) { top: 5px; transform: rotate(45deg); }
.mobile-toggle.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; transform: scaleX(0.3); }
.mobile-toggle.is-open .nav-toggle-bar:nth-child(3) { top: 5px; width: 100%; transform: rotate(-45deg); }

/* ---------- Mobile drawer ---------- */
.nav-scrim { position: fixed; inset: 0; background: rgba(17,17,16,0.55); opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; z-index: 1200; }
.nav-scrim.is-open { opacity: 1; visibility: visible; }

.mobile-nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(370px, 87vw);
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border-left: 1px solid var(--line);
    box-shadow: -20px 0 55px rgba(17,17,16,0.20);
    transform: translateX(101%);
    visibility: hidden;
    transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.34s ease;
    z-index: 1300;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

.mobile-nav.is-open { transform: translateX(0); visibility: visible; }

.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 2; }
.drawer-head .brand { font-size: 1.25rem; }
.drawer-head .brand-mark { font-size: 1.1rem; }

.drawer-nav { display: flex; flex-direction: column; }

.drawer-nav a {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.25rem 0.8rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    position: relative;
    transition: background 0.15s ease, padding-left 0.15s ease;
}

.drawer-nav a::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); transform: scaleY(0); transition: transform 0.2s ease; }
.drawer-nav a:hover, .drawer-nav a:focus-visible { background: var(--surface); padding-left: 1.45rem; }
.drawer-nav a:hover::before, .drawer-nav a:focus-visible::before, .drawer-nav a.is-active::before { transform: scaleY(1); }
.drawer-nav a.is-active { background: var(--surface); }

.dn-main { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.dn-sub { grid-column: 1; font-size: 0.78rem; color: var(--muted); line-height: 1.3; }
.drawer-nav .i { grid-row: 1 / span 2; color: var(--muted); font-size: 0.95rem; }
.drawer-nav a:hover .i { color: var(--signal); }

.drawer-foot { margin-top: auto; padding: 1.25rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.9rem; background: var(--surface); }
.drawer-foot .btn { justify-content: center; width: 100%; }
.drawer-note { font-size: 0.76rem; color: var(--muted); text-align: center; }

/* ---------- Section heads ---------- */
.section { padding-top: 3rem; padding-bottom: 1rem; }

.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1.6rem; flex-wrap: wrap; gap: 1rem; }
.section-title { font-size: 1.6rem; font-weight: 700; }
.section-title small { display: block; font-family: var(--font-body); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--signal); margin-bottom: 0.4rem; }

.section-link { font-weight: 700; font-size: 0.88rem; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 0.5rem; border-bottom: 2px solid var(--ink); padding-bottom: 0.15rem; }
.section-link:hover { color: var(--signal); border-color: var(--signal); }

/* ---------- Device artwork placeholders ----------
   Drawn in CSS so pages are complete before any photography exists. Swap a
   .dev span for <img src="src/your-image.webp" alt="..."> when you have one. */
.devthumb { position: relative; display: grid; place-items: center; height: 230px; background: var(--tint, #e4e0d2); overflow: hidden; }

.dev { width: 86px; height: 168px; border-radius: 13px; background: var(--surface); border: 2px solid var(--ink); box-shadow: 0 10px 24px rgba(17,17,16,0.20); position: relative; }
.dev::before { content: ''; position: absolute; inset: 5px; border-radius: 9px; background: linear-gradient(170deg, rgba(17,17,16,0.05), rgba(17,17,16,0.18)); }
.dev::after { content: ''; position: absolute; top: 10px; left: 10px; width: 24px; height: 17px; border-radius: 5px; background: var(--ink); }

/* ---------- Thumbnail tints ----------
   A fixed palette, applied as a class. Two reasons this beats a hex in a
   style attribute on every card: the artwork stays consistent site-wide
   instead of drifting into one-off colours, and template {{TOKENS}} stay out
   of inline CSS — an editor parses a style attribute as CSS, reads "{{" as the
   start of a rule, and reports errors on a file that is actually fine. */
.tint-blue       { --tint: #d3e7f2; }
.tint-peach      { --tint: #f2dfd3; }
.tint-sage       { --tint: #dce6d6; }
.tint-lilac      { --tint: #e2dcee; }
.tint-sand       { --tint: #e8e3d2; }
.tint-teal       { --tint: #d6e4e8; }
.tint-rose       { --tint: #f0dde6; }
.tint-mint       { --tint: #dde8df; }
.tint-stone      { --tint: #e5dfd0; }
.tint-blush      { --tint: #e8d7da; }
.tint-periwinkle { --tint: #dde4ee; }
.tint-sea        { --tint: #d9e8e2; }

/* ---------- Post cards ---------- */
.post-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.5rem; }

.post-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 1.1rem; align-items: start; padding: 1.15rem 0; border-bottom: 1px solid var(--line); position: relative; }
.post-row.is-card { background: var(--surface); border: 1px solid var(--line); padding: 0.9rem; transition: border-color 0.15s ease; }
.post-row.is-card:hover { border-color: var(--ink); }

.post-thumb { position: relative; line-height: 0; background: var(--line); overflow: hidden; }
.post-thumb .devthumb { height: 120px; }
.post-thumb img { width: 100%; height: 120px; object-fit: cover; display: block; }
.post-thumb .dev { width: 54px; height: 98px; border-radius: 9px; border-width: 2px; box-shadow: 0 6px 14px rgba(17,17,16,0.18); }
.post-thumb .dev::before { inset: 4px; border-radius: 6px; }
.post-thumb .dev::after { width: 16px; height: 11px; top: 6px; left: 6px; border-radius: 4px; }

.post-body { min-width: 0; display: flex; flex-direction: column; }
.post-title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1.35; margin-bottom: 0.55rem; }
.post-title a { text-decoration: none; color: inherit; }
.post-row:hover .post-title a { color: var(--signal); }

.post-specs { font-family: var(--font-display); font-size: 0.76rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-soft); margin-bottom: 0.45rem; }
.post-meta { margin-top: auto; font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.post-meta a { color: inherit; text-decoration: none; }
.post-meta a:hover { color: var(--ink); }
.post-meta .sep { opacity: 0.55; }
.post-meta time { font-variant-numeric: tabular-nums; }

.post-badge { position: absolute; top: 0.5rem; left: 0.5rem; background: var(--ink); color: var(--accent); font-family: var(--font-display); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; padding: 0.22rem 0.5rem; border-radius: var(--radius); line-height: 1.4; z-index: 2; }
.post-badge.is-versus, .post-badge.is-breaking { background: var(--signal); color: var(--ink); }

.score-ring { position: absolute; right: 0.7rem; bottom: 0.7rem; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); border: 3px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 0.92rem; font-variant-numeric: tabular-nums; box-shadow: 0 4px 14px rgba(17,17,16,0.22); z-index: 3; }
.post-row.has-score .post-meta { padding-right: 3.4rem; }

/* ==========================================================================
   Phone specification page
   ========================================================================== */

/* ---------- Page width ----------
   A spec page is a document: one label, one value, read top to bottom. At the
   site's full 1320px a row holding "GSM / HSPA / LTE / 5G" strands the value
   half a screen from its label. Narrowing it keeps the pair in one glance.

   Done by overriding --maxw on <body> rather than adding a modifier class to
   every .wrap, so the header, content and footer keep the same left edge.
   Index pages (homepage, brands) stay wide — they are grids, and grids use
   the room. */
body.page-spec { --maxw: 1080px; }

/* ---------- Breadcrumb ---------- */
.crumbs { background: var(--surface); border-bottom: 1px solid var(--line); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding-block: 0.7rem; font-size: 0.8rem; color: var(--muted); }
.crumbs a { text-decoration: none; color: var(--ink-soft); }
.crumbs a:hover { color: var(--signal); }
.crumbs li::after { content: '/'; margin-left: 0.5rem; opacity: 0.5; }
.crumbs li:last-child::after { content: none; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* ---------- Device masthead ---------- */
.device-head { padding-block: 2rem 0; }
.device-eyebrow { font-family: var(--font-display); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--signal); margin-bottom: 0.5rem; }
.device-title { font-size: clamp(1.9rem, 4.2vw, 2.9rem); font-weight: 700; line-height: 1.05; }
.device-sub { color: var(--ink-soft); margin-top: 0.6rem; max-width: 60ch; }

.device-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 2rem; align-items: start; margin-top: 1.8rem; }

/* front + back panels, the way a product shot is normally staged */
.device-art { background: var(--surface); border: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: center; gap: 1rem; padding: 1.8rem 1.4rem 0; min-height: 330px; overflow: hidden; }

.dev-panel { position: relative; border: 2px solid var(--ink); border-bottom: none; border-radius: 18px 18px 0 0; box-shadow: 0 -4px 30px rgba(17,17,16,0.14); }
.dev-panel.is-back { width: 104px; height: 212px; background: linear-gradient(160deg, #3a4fa8, #1b2a6b); }
.dev-panel.is-front { width: 120px; height: 248px; background: linear-gradient(165deg, #4a6ad4, #16205a); }
.dev-panel.is-front::before { content: ''; position: absolute; inset: 7px 7px 0; border-radius: 12px 12px 0 0; background: linear-gradient(150deg, rgba(69,200,255,0.55), rgba(17,17,16,0.5) 70%); }
.dev-panel.is-back::before { content: ''; position: absolute; top: 12px; left: 12px; width: 44px; height: 58px; border-radius: 10px; background: rgba(17,17,16,0.55); border: 1px solid rgba(245,242,234,0.22); }
.dev-panel.is-back::after { content: ''; position: absolute; top: 20px; left: 20px; width: 13px; height: 13px; border-radius: 50%; background: #0b1020; box-shadow: 0 20px 0 #0b1020, 0 0 0 2px rgba(245,242,234,0.25), 0 20px 0 2px rgba(245,242,234,0.25); }

.device-side { min-width: 0; }

/* ---------- Quick specs ---------- */
.quick-specs { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.quick-specs li { background: var(--surface); padding: 0.95rem 1rem; display: flex; gap: 0.75rem; align-items: flex-start; min-width: 0; }
.quick-specs .i { font-size: 1.35rem; color: var(--muted); margin-top: 0.15rem; }
.qs-main { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.qs-sub { display: block; font-size: 0.8rem; color: var(--muted); line-height: 1.35; margin-top: 0.1rem; }

/* ---------- Action list ---------- */
.device-actions { list-style: none; margin-top: 1.2rem; border: 1px solid var(--line); background: var(--surface); }
.device-actions li + li { border-top: 1px solid var(--line); }

.device-actions a {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    position: relative;
    transition: background 0.15s ease, padding-left 0.15s ease;
}

.device-actions a::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); transform: scaleY(0); transition: transform 0.2s ease; }
.device-actions a:hover { background: var(--paper); padding-left: 1.2rem; }
.device-actions a:hover::before { transform: scaleY(1); }
.device-actions .i { font-size: 1.15rem; color: var(--muted); }
.device-actions a:hover .i { color: var(--ink); }
.device-actions .chev { font-size: 0.95rem; color: var(--signal); }
.device-actions .count { font-family: var(--font-body); font-weight: 600; font-size: 0.8rem; color: var(--muted); text-transform: none; letter-spacing: 0; }

/* ---------- Spec tables ----------
   <dl> rather than <table>: a spec is a name/value pair, and a label with
   several values (Charging, Protection) is exactly what multiple <dd> are for.
   Grid pins <dt> to column 1 and every <dd> to column 2, so continuation rows
   line up under the first value with no empty cells in the markup. --------- */
.spec-block { border: 1px solid var(--line); background: var(--surface); margin-bottom: 1.1rem; }

.spec-head {
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.spec-head .i { color: var(--accent); font-size: 0.95rem; }

.spec-list { display: grid; grid-template-columns: 178px minmax(0, 1fr); }

.spec-list dt {
    grid-column: 1;
    padding: 0.7rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
}

.spec-list dd {
    grid-column: 2;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--line);
    min-width: 0;
    overflow-wrap: anywhere;
}

.spec-list dt:last-of-type, .spec-list dd:last-child { border-bottom: none; }
.spec-list dd b { font-weight: 700; }
.spec-list .num { font-variant-numeric: tabular-nums; }

/* a value worth pulling out of the run of grey text */
.spec-list .hero-value { font-family: var(--font-display); font-weight: 700; }

/* ==========================================================================
   Compare
   One grid shape — label | A | B — reused by the device header and every
   row, so the three columns stay locked together all the way down.
   ========================================================================== */
.cmp-pickers { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 0.9rem; align-items: end; margin-top: 1.6rem; }
.cmp-pick label { display: block; font-family: var(--font-display); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.cmp-pick select {
    width: 100%; font-family: var(--font-body); font-size: 0.95rem;
    padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--ink);
}
.cmp-swap { margin-bottom: 0.15rem; }

.cmp-mode { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; margin: 1.6rem 0 0.4rem; }
.cmp-mode-label { font-family: var(--font-display); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin-right: 0.3rem; }
.cmp-mode-btn {
    font-family: var(--font-display); font-weight: 700; font-size: 0.8rem;
    padding: 0.4rem 0.85rem; border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-soft); border-radius: var(--radius); cursor: pointer;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.cmp-mode-btn:hover { border-color: var(--ink); color: var(--ink); }
.cmp-mode-btn.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.cmp-mode-n { font-variant-numeric: tabular-nums; font-size: 0.72rem; background: var(--signal); color: var(--ink); padding: 0.02rem 0.35rem; border-radius: 10px; }
.cmp-mode-btn.is-active .cmp-mode-n { background: var(--accent); color: var(--accent-ink); }

/* device header — sticky so you still know which column is which 60 rows down */
.cmp-devices {
    display: grid; grid-template-columns: 178px minmax(0,1fr) minmax(0,1fr);
    gap: 0; margin-top: 1.2rem;
    position: sticky; top: calc(env(safe-area-inset-top, 0px) + 4.2rem);
    z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line);
}
.cmp-device { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.9rem; text-decoration: none; color: var(--ink); min-width: 0; }
.cmp-device:hover .cmp-device-name { color: var(--signal); }
.cmp-device .devthumb { width: 44px; height: 54px; flex: none; }
.cmp-device .dev { width: 22px; height: 40px; border-radius: 5px; border-width: 1.5px; box-shadow: none; }
.cmp-device .dev::after { width: 7px; height: 5px; top: 3px; left: 3px; border-radius: 2px; }
.cmp-device-name { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; line-height: 1.25; }

.cmp-block { margin-top: 1.4rem; border: 1px solid var(--line); background: var(--surface); }
.cmp-head {
    background: var(--ink); color: var(--paper);
    font-family: var(--font-display); font-weight: 700; font-size: 0.76rem;
    letter-spacing: 0.12em; text-transform: uppercase; padding: 0.55rem 0.9rem;
}

.cmp-row { display: grid; grid-template-columns: 178px minmax(0,1fr) minmax(0,1fr); border-bottom: 1px solid var(--line); }
.cmp-row:last-child { border-bottom: none; }

/* A difference is marked even in "Everything" mode — that is the whole
   reason someone opened this page. */
.cmp-row.is-diff { background: #fdf7f3; box-shadow: inset 3px 0 0 var(--signal); }

.cmp-label { padding: 0.65rem 0.9rem; font-size: 0.8rem; font-weight: 700; color: var(--muted); border-right: 1px solid var(--line); }
.cmp-val { padding: 0.65rem 0.9rem; font-size: 0.88rem; min-width: 0; overflow-wrap: anywhere; border-right: 1px solid var(--line); }
.cmp-val:last-child { border-right: none; }
.cmp-none { color: var(--muted); }

.state { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }

@media (max-width: 760px) {
    .cmp-pickers { grid-template-columns: minmax(0,1fr); }
    .cmp-swap { justify-self: center; margin: 0; }

    /* Label moves to its own full-width row so the two values keep enough
       measure to stay readable rather than wrapping every other word. */
    .cmp-devices, .cmp-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
    .cmp-devices > div:first-child { display: none; }
    .cmp-label {
        grid-column: 1 / -1; border-right: none; border-bottom: 1px solid var(--line);
        background: var(--paper); padding: 0.45rem 0.8rem; font-size: 0.74rem;
        letter-spacing: 0.05em; text-transform: uppercase;
    }
    .cmp-val { padding: 0.55rem 0.8rem; font-size: 0.84rem; }
    .cmp-devices { top: calc(env(safe-area-inset-top, 0px) + 3.9rem); }
}

/* ---------- Opinions ----------
   Anatomy follows the convention readers already know from the big specs
   sites: name on the left, time and place pushed to the right edge, body
   below, Reply tucked into the bottom-right. Each comment is its own card
   so a long thread stays scannable instead of becoming a wall of text. */
.opinion {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 0.95rem 1.1rem;
    margin-bottom: 0.7rem;
    transition: border-color 0.15s ease;
}

.opinion:hover { border-color: #d4ceba; }

.opinion-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.9rem;
    margin-bottom: 0.55rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.opinion-author {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ink);
}

/* pushed to the right edge, which is what makes the row read as a header
   rather than a run-on line of metadata */
.opinion-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.opinion-head .meta { display: inline-flex; align-items: center; gap: 0.3rem; }
.opinion-head .meta .i { font-size: 0.9rem; opacity: 0.8; }
.opinion-head time { font-variant-numeric: tabular-nums; }

.opinion-place {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
}

.opinion-place .i { font-size: 0.85rem; color: var(--muted); }

.opinion-body {
    font-size: 0.95rem;
    max-width: 74ch;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.opinion-foot {
    margin-top: 0.8rem;
    display: flex;
    justify-content: flex-end;
}

.reply-btn { background: none; border: 1px solid var(--line); color: var(--ink-soft); font-family: var(--font-display); font-weight: 700; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.42rem 0.9rem; border-radius: var(--radius); cursor: pointer; }
.reply-btn:hover { border-color: var(--ink); color: var(--ink); }

.opinion-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.2rem; }

/* replies sit one level in behind an accent rail, so a thread still reads as
   one conversation rather than a second list */
.opinion-replies {
    margin: -0.2rem 0 0.7rem 1.5rem;
    padding-left: 1.1rem;
    border-left: 2px solid var(--line);
}

.opinion.is-reply { background: var(--paper); padding: 0.8rem 0.95rem; }
.opinion.is-reply .opinion-author { font-size: 0.88rem; }
.opinion.is-replying { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }

.opinion[aria-busy="true"], [aria-busy="true"] { opacity: 0.55; }

.comment-empty { padding: 1.4rem 0; font-size: 0.92rem; color: var(--muted); }

.link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--accent-deep);
    text-decoration: underline;
    cursor: pointer;
}

.link-btn:hover { color: var(--signal); }

/* ---------- Comment form ---------- */
.comment-form {
    margin-top: 1.6rem;
    padding: 1.3rem;
    border: 1px solid var(--line);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.comment-form h3 { font-size: 1.1rem; font-weight: 700; }

.comment-field { display: flex; flex-direction: column; gap: 0.35rem; }

.comment-field label {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}

.comment-field input[type="text"],
.comment-field textarea {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.7rem 0.8rem;
    width: 100%;
    min-width: 0;
}

.comment-field textarea { resize: vertical; min-height: 7rem; line-height: 1.5; }
.comment-field input:focus, .comment-field textarea:focus { outline: 2px solid var(--accent-deep); outline-offset: 1px; border-color: var(--accent-deep); }
.comment-hint { font-size: 0.76rem; color: var(--muted); }

.comment-form-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.comment-form-row .btn { flex: none; }

/* Honeypot. Moved off-screen rather than display:none, because a bot that
   skips hidden inputs would also skip a display:none one — and this only
   works if the bot actually fills it in. */
.comment-trap {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.comment-notice {
    font-size: 0.88rem;
    padding: 0.7rem 0.9rem;
    border-left: 3px solid var(--muted);
    background: var(--paper);
}

.comment-notice.is-ok    { border-color: var(--accent-deep); }
.comment-notice.is-held  { border-color: var(--signal); }
.comment-notice.is-error { border-color: var(--signal); color: var(--signal); }
.comment-notice.is-busy  { border-color: var(--line); color: var(--muted); }

.replying-to {
    font-size: 0.85rem;
    color: var(--ink-soft);
    padding: 0.55rem 0.8rem;
    background: var(--paper);
    border-left: 3px solid var(--accent);
}

.comment-more { margin-top: 1.2rem; }

/* ---------- Horizontal rails ---------- */
.rail { display: flex; gap: 1.1rem; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 0.6rem; -webkit-overflow-scrolling: touch; }
.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.rail::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.rail-card { flex: 0 0 168px; scroll-snap-align: start; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); transition: border-color 0.15s ease, transform 0.15s ease; }
.rail-card:hover { border-color: var(--ink); transform: translateY(-3px); }
.rail-card .devthumb { height: 168px; }
.rail-card .dev { width: 62px; height: 118px; border-radius: 10px; }
.rail-card .dev::after { width: 18px; height: 13px; top: 8px; left: 8px; }
.rail-name { font-family: var(--font-display); font-weight: 700; font-size: 0.88rem; line-height: 1.3; padding: 0.7rem 0.75rem; text-align: center; }

.rail-news { flex: 0 0 240px; scroll-snap-align: start; text-decoration: none; color: var(--ink); }
.rail-news .devthumb { height: 132px; }
.rail-news time { display: block; font-family: var(--font-display); font-size: 0.74rem; color: var(--muted); margin: 0.6rem 0 0.25rem; font-variant-numeric: tabular-nums; }
.rail-news h3 { font-size: 0.95rem; font-weight: 700; line-height: 1.35; }
.rail-news:hover h3 { color: var(--signal); }

/* ---------- Disclosure note ---------- */
.source-note { margin-top: 1.4rem; padding: 0.9rem 1rem; border-left: 3px solid var(--accent); background: var(--surface); font-size: 0.82rem; color: var(--ink-soft); }

/* ---------- Newsletter ---------- */
.newsletter-band { background: var(--ink); color: var(--paper); margin-top: 3rem; padding: 3.5rem 0; }
.newsletter-inner { max-width: var(--maxw); margin: 0 auto; padding-left: max(2rem, env(safe-area-inset-left, 0px)); padding-right: max(2rem, env(safe-area-inset-right, 0px)); display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center; }
.newsletter-band h2 { font-size: 1.8rem; margin-bottom: 0.6rem; }
.newsletter-band p { color: rgba(245,242,234,0.7); max-width: 460px; }
.newsletter-form { display: flex; gap: 0; border-bottom: 2px solid var(--accent); }
.newsletter-form input { flex: 1; min-width: 0; background: none; border: none; color: var(--paper); padding: 0.9rem 0.2rem; font-size: 1rem; outline: none; font-family: var(--font-body); }
.newsletter-form input::placeholder { color: rgba(245,242,234,0.5); }
.newsletter-form button { background: none; border: none; color: var(--accent); font-family: var(--font-display); font-weight: 700; cursor: pointer; padding: 0 0.4rem; font-size: 0.95rem; display: inline-flex; align-items: center; gap: 0.4rem; }
.newsletter-form button:hover { color: var(--paper); }
.newsletter-note { margin-top: 0.8rem; font-size: 0.82rem; color: var(--accent); min-height: 1.2em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--paper); border-top: 1px solid var(--line); padding: 3.5rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.footer-brand { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin-bottom: 0.8rem; }
.footer-about { color: var(--ink-soft); max-width: 320px; font-size: 0.92rem; }
.footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1rem; color: var(--muted); }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a { text-decoration: none; color: var(--ink); font-size: 0.92rem; }
.footer-col a:hover { color: var(--signal); }
.footer-col a.is-copied { color: var(--accent-deep); }

.footer-bottom { max-width: var(--maxw); margin: 0 auto; padding-block: 1.5rem 0; padding-left: max(2rem, env(safe-area-inset-left, 0px)); padding-right: max(2rem, env(safe-area-inset-right, 0px)); display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--muted); flex-wrap: wrap; gap: 0.8rem; }

/* ---------- Search overlay (built by main.js) ---------- */
.search-overlay { position: fixed; inset: 0; background: rgba(17,17,16,0.75); z-index: 2000; display: none; padding: 8vh 1.25rem 2rem; overflow-y: auto; }
.search-overlay.is-open { display: block; }
.search-panel { max-width: 680px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.search-bar { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.search-bar .i { color: var(--muted); font-size: 1.1rem; }
.search-input { flex: 1; border: none; background: none; outline: none; font-family: var(--font-body); font-size: 1.05rem; color: var(--ink); min-width: 0; }
.search-close { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 1.1rem; padding: 0.2rem 0.4rem; display: flex; }
.search-close:hover { color: var(--ink); }
.search-results { max-height: 62vh; overflow-y: auto; }
.search-hint { padding: 1.4rem 1.3rem; font-size: 0.9rem; color: var(--muted); }
.search-hit { display: block; padding: 0.9rem 1.3rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.search-hit:last-child { border-bottom: none; }
.search-hit:hover { background: var(--surface); }
.search-hit-cat { display: block; font-family: var(--font-display); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--signal); margin-bottom: 0.25rem; }
.search-hit-title { font-weight: 600; font-size: 0.95rem; line-height: 1.4; }
.search-hit-title mark { background: var(--accent); color: var(--accent-ink); padding: 0 0.1em; }
.icon-btn.is-copied { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Back to top ---------- */
.to-top {
    position: fixed;
    right: calc(1.5rem + env(safe-area-inset-right, 0px));
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease, background 0.2s ease, color 0.2s ease;
    z-index: 900;
    font-size: 1rem;
}

.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--accent); color: var(--accent-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .main-nav { gap: 1.35rem; }
    .main-nav a { font-size: 0.88rem; }
    .post-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .device-grid { grid-template-columns: minmax(0, 1fr); }
    .device-art { min-height: 300px; }
}

@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-toggle { display: flex; }
    .header-actions { gap: 0.6rem; }
    .wrap { padding-left: max(1.25rem, env(safe-area-inset-left, 0px)); padding-right: max(1.25rem, env(safe-area-inset-right, 0px)); }
    .header-inner { padding-block: 1rem; padding-left: max(1.25rem, env(safe-area-inset-left, 0px)); padding-right: max(1.25rem, env(safe-area-inset-right, 0px)); }
    .newsletter-inner { grid-template-columns: 1fr; padding-left: max(1.25rem, env(safe-area-inset-left, 0px)); padding-right: max(1.25rem, env(safe-area-inset-right, 0px)); }
    .footer-bottom { padding-left: max(1.25rem, env(safe-area-inset-left, 0px)); padding-right: max(1.25rem, env(safe-area-inset-right, 0px)); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .section { padding-top: 2.2rem; }
    .section-title { font-size: 1.35rem; }

    /* the spec label column narrows but never collapses — a value without its
       label beside it is unreadable on a spec sheet */
    .spec-list { grid-template-columns: 108px minmax(0, 1fr); }
    .spec-list dt { padding: 0.6rem 0.65rem; font-size: 0.76rem; }
    .spec-list dd { padding: 0.6rem 0.75rem; font-size: 0.86rem; }

    .quick-specs { grid-template-columns: minmax(0, 1fr); }
    .device-art { min-height: 260px; padding: 1.4rem 1rem 0; }
    .dev-panel.is-back { width: 84px; height: 170px; }
    .dev-panel.is-front { width: 98px; height: 200px; }

    .post-row { grid-template-columns: 116px minmax(0, 1fr); gap: 0.85rem; padding: 0.95rem 0; }
    .post-thumb .devthumb { height: 86px; }
    .post-thumb img { height: 86px; }
    .post-thumb .dev { width: 40px; height: 70px; border-radius: 7px; }
    .post-title { font-size: 0.95rem; }

    .rail-card { flex-basis: 146px; }
    .rail-card .devthumb { height: 146px; }
    .rail-news { flex-basis: 212px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .btn:hover, .rail-card:hover { transform: none; }
}
