/* ==========================================================
   gRPC website stylesheet
   Light theme · Poppins · 1140px layout width
   ========================================================== */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-400.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/poppins-500.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700.woff") format("woff"); }

:root {
  --ink: #183642;
  --ink-soft: #4a6470;
  --brand: #244b5a;
  --teal: #00807d;
  --teal-bright: #00b4b0;
  --teal-pale: #e3f4f3;
  --line: #dbe7ea;
  --bg: #f5f9fa;
  --white: #ffffff;
  --code-bg: #182028;
  --danger: #b4483a;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --shadow-s: 0 2px 10px rgba(24, 54, 66, .06);
  --shadow-m: 0 14px 34px rgba(24, 54, 66, .10);
  --wrap: 1140px;
  --header-h: 74px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Poppins", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-soft);
  background: var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { font-family: "Poppins", Arial, sans-serif; color: var(--ink); line-height: 1.25; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -.015em; }
h3 { font-size: 1.15rem; font-weight: 500; }
p { margin: 0 0 1em; }
button { font-family: inherit; }
code, pre { font-family: "Poppins", Arial, sans-serif; }
pre code, .code-panel code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "DejaVu Sans Mono", monospace; }
:focus-visible { outline: 3px solid var(--teal-bright); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 14px; z-index: 200; border-radius: var(--radius-s); }
.skip-link:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
@media (min-width: 1180px) { .wrap { padding: 0; } }

.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 500; font-size: 1rem; line-height: 1;
  padding: 15px 26px; border-radius: 999px; border: 2px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
  cursor: pointer; white-space: nowrap;
}
.btn .icon { width: 20px; height: 20px; }
.btn-primary { background: var(--teal); color: var(--white); box-shadow: 0 8px 20px rgba(0, 128, 125, .25); }
.btn-primary:hover { background: var(--brand); color: var(--white); transform: translateY(-2px); }
.btn-ghost { background: var(--white); color: var(--brand); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }

/* ---------------- Header ---------------- */
#site-header { display: block; min-height: var(--header-h); }
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid transparent; transition: box-shadow .25s ease, border-color .25s ease; }
.site-header.is-scrolled { box-shadow: var(--shadow-s); border-bottom-color: var(--line); }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: var(--header-h); gap: 20px; }
.brand { display: inline-flex; align-items: center; }
.brand img { height: 44px; width: auto; }
.main-nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 8px 14px; border-radius: 999px; color: var(--ink); font-weight: 500; font-size: .95rem; }
.main-nav a:hover, .main-nav a.is-active { background: var(--teal-pale); color: var(--teal); }
.header-cta { justify-self: end; display: flex; align-items: center; gap: 10px; }
.header-cta .btn { padding: 12px 20px; font-size: .95rem; }
.menu-toggle { display: none; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--white); color: var(--ink); align-items: center; justify-content: center; cursor: pointer; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 991px) {
  .header-inner { grid-template-columns: auto 1fr; }
  .menu-toggle { display: inline-flex; }
  .header-cta .btn { display: none; }
  .main-nav { position: fixed; left: 0; right: 0; top: var(--header-h); background: var(--white); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-m); padding: 14px 20px 22px; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s ease, transform .2s ease, visibility .2s; max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
  .main-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav a { padding: 12px 16px; border-radius: 12px; }
  .main-nav .nav-cta { display: flex; margin-top: 12px; justify-content: center; }
}
@media (min-width: 992px) { .main-nav .nav-cta { display: none; } }

/* ---------------- Sections (shared) ---------------- */
.section { padding: 88px 0; }
.section + .section { padding-top: 24px; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 48px; }
.section-head .eyebrow { display: inline-block; font-size: .8rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: 10px; }
.section-head h2 { margin-bottom: 14px; }
.section-head p { font-size: 1.05rem; margin: 0; }

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------------- 1. Hero ---------------- */
.hero { padding: 56px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: 48px; align-items: center; }
.hero-tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-size: .85rem; color: var(--brand); font-weight: 500; margin-bottom: 18px; }
.hero-tag span { background: var(--teal-pale); color: var(--teal); border-radius: 999px; padding: 2px 10px; }
.hero h1 { margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--teal); }
.hero-lead { font-size: 1.1rem; max-width: 540px; margin-bottom: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 10px 26px; list-style: none; padding: 0; margin: 0; font-size: .9rem; color: var(--ink); }
.hero-trust li { display: inline-flex; align-items: center; gap: 8px; }
.hero-trust .icon { width: 20px; height: 20px; color: var(--teal); }
.hero-visual img { width: 100%; border-radius: var(--radius-l); }

/* ---------------- 2. About (split + fact rail) ---------------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
.about-media img { border-radius: var(--radius-l); }
.about-copy p { font-size: 1.02rem; }
.fact-rail { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 26px; border-top: 1px solid var(--line); }
.fact-rail div { padding: 18px 18px 0 0; }
.fact-rail div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.fact-rail strong { display: block; color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.fact-rail span { font-size: .88rem; }

/* ---------------- 3. Features (open grid, divider lines) ---------------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.feature { padding: 34px 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background-color .25s ease; }
.feature:hover { background: var(--white); }
.feature-icon { display: inline-flex; width: 52px; height: 52px; border-radius: 16px; align-items: center; justify-content: center; background: var(--teal-pale); color: var(--teal); margin-bottom: 18px; transition: transform .25s ease, background-color .25s ease, color .25s ease; }
.feature:hover .feature-icon { transform: translateY(-4px); background: var(--teal); color: var(--white); }
.feature h3 { margin-bottom: 8px; }
.feature p { margin: 0; font-size: .95rem; }

/* ---------------- 4. How it works (connected track) ---------------- */
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; position: relative; }
.track::before { content: ""; position: absolute; top: 34px; left: 12%; right: 12%; height: 2px; background: repeating-linear-gradient(90deg, var(--teal-bright) 0 10px, transparent 10px 18px); }
.track li { text-align: center; position: relative; }
.track-node { position: relative; z-index: 1; width: 70px; height: 70px; margin: 0 auto 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--white); color: var(--teal); border: 2px solid var(--teal-bright); box-shadow: 0 0 0 8px var(--bg); }
.track-node .icon { width: 28px; height: 28px; }
.track small { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--teal); font-weight: 500; margin-bottom: 4px; }
.track h3 { margin-bottom: 8px; }
.track p { font-size: .94rem; margin: 0; }
.track code { background: var(--teal-pale); color: var(--brand); padding: 1px 6px; border-radius: 6px; font-size: .88em; }

/* ---------------- 5. Compatibility (language matrix) ---------------- */
.matrix { background: var(--white); border-radius: var(--radius-l); box-shadow: var(--shadow-s); overflow: hidden; }
.matrix-row { display: grid; grid-template-columns: 1.1fr 1.3fr 1.6fr; gap: 20px; padding: 16px 30px; align-items: center; border-bottom: 1px solid var(--line); transition: background-color .2s ease; }
.matrix-row:last-child { border-bottom: 0; }
.matrix-row:not(.matrix-head):hover { background: #f9fcfc; }
.matrix-head { background: var(--brand); color: var(--white); font-weight: 500; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.matrix-lang { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 500; }
.matrix-lang .icon { color: var(--teal); }
.matrix-row code { font-size: .88rem; color: var(--brand); background: var(--teal-pale); padding: 3px 9px; border-radius: 6px; word-break: break-word; }
.matrix-note { text-align: center; font-size: .9rem; margin: 22px auto 0; max-width: 760px; }

/* ---------------- 6. Use cases (vertical tabs) ---------------- */
.uc { display: grid; grid-template-columns: 340px 1fr; gap: 40px; align-items: start; }
.uc-tabs { display: flex; flex-direction: column; gap: 6px; border-left: 2px solid var(--line); }
.uc-tab { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-left: -2px; border: 0; border-left: 2px solid transparent; background: none; text-align: left; font-size: 1rem; color: var(--ink-soft); font-weight: 500; cursor: pointer; transition: color .2s ease, border-color .2s ease, background-color .2s ease; border-radius: 0 12px 12px 0; }
.uc-tab:hover { color: var(--ink); background: var(--white); }
.uc-tab[aria-selected="true"] { color: var(--teal); border-left-color: var(--teal); background: var(--white); }
.uc-tab .icon { color: currentColor; }
.uc-panel { padding: 8px 0 0; }
.uc-panel[hidden] { display: none; }
.uc-panel h3 { font-size: 1.5rem; font-weight: 700; }
.uc-panel .uc-points { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
.uc-panel .uc-points li { position: relative; padding-left: 26px; font-size: .95rem; }
.uc-panel .uc-points li::before { content: ""; position: absolute; left: 0; top: .62em; width: 12px; height: 12px; border-radius: 3px; background: var(--teal-bright); transform: rotate(45deg); }

/* ---------------- 7. Benefits (accent ruled list) ---------------- */
.benefits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 64px; }
.benefit { display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 26px 0; border-bottom: 1px dashed var(--line); transition: transform .25s ease; }
.benefit:hover { transform: translateX(6px); }
.benefit .icon { width: 30px; height: 30px; color: var(--brand); margin-top: 2px; }
.benefit:hover .icon { color: var(--teal); }
.benefit h3 { margin-bottom: 4px; }
.benefit p { margin: 0; font-size: .95rem; }

/* ---------------- 8. Installation (tabbed terminal) ---------------- */
.install { display: grid; grid-template-columns: 1fr 1.15fr; gap: 46px; align-items: start; }
.install-steps { list-style: none; margin: 0; padding: 0; }
.install-steps li { display: grid; grid-template-columns: 46px 1fr; gap: 16px; padding-bottom: 24px; position: relative; }
.install-steps li:not(:last-child)::after { content: ""; position: absolute; left: 22px; top: 50px; bottom: 6px; width: 2px; background: var(--line); }
.install-steps .step-ic { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: var(--white); display: flex; align-items: center; justify-content: center; }
.install-steps .step-ic .icon { width: 22px; height: 22px; }
.install-steps h3 { margin: 8px 0 4px; }
.install-steps p { margin: 0; font-size: .95rem; }
.code-panel { background: var(--code-bg); border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow-m); }
.code-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 10px 0; background: #222d37; }
.code-tab { border: 0; background: none; color: #b8c6d1; padding: 9px 16px; border-radius: 10px 10px 0 0; font-size: .9rem; font-weight: 500; cursor: pointer; }
.code-tab:hover { color: var(--white); }
.code-tab[aria-selected="true"] { background: var(--code-bg); color: var(--teal-bright); }
.code-body { position: relative; }
.code-body pre { margin: 0; padding: 22px 24px; color: #dce4eb; font-size: .9rem; line-height: 1.75; overflow-x: auto; min-height: 230px; }
.code-body pre[hidden] { display: none; }
.code-body .c { color: #8b949e; }
.code-body .p { color: #7ee787; }
.copy-btn { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #3a4855; background: #222d37; color: #dce4eb; font-size: .8rem; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.copy-btn:hover { border-color: var(--teal-bright); color: var(--white); }
.copy-btn .icon { width: 16px; height: 16px; }

/* ---------------- 9. Download (wide panel) ---------------- */
.download-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; padding: 50px; border-radius: 32px; background: var(--bg); border: 1px solid var(--line); box-shadow: inset 0 0 0 6px rgba(0, 180, 176, .06); }
.download-panel img { border-radius: var(--radius-l); }
.download-copy h3 { font-size: 1.6rem; font-weight: 700; margin-bottom: 12px; }
.download-meta { list-style: none; padding: 0; margin: 18px 0 26px; display: grid; gap: 12px; }
.download-meta li { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; }
.download-meta .icon { color: var(--teal); width: 22px; height: 22px; margin-top: 3px; }
.download-copy .btn { font-size: 1.05rem; padding: 17px 30px; }
.download-copy .fine { display: block; margin-top: 14px; font-size: .85rem; }

/* ---------------- 10. Safety (inline strip) ---------------- */
.safety-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.safety-item { padding: 6px 28px; text-align: center; }
.safety-item + .safety-item { border-left: 1px dotted #b8cdd3; }
.safety-item .icon { width: 36px; height: 36px; color: var(--teal); margin: 0 auto 12px; display: block; }
.safety-item h3 { font-size: 1.05rem; }
.safety-item p { font-size: .93rem; margin: 0; }

/* ---------------- 11. Pros & cons (split ledger) ---------------- */
.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; }
.ledger-col { background: var(--white); border-radius: var(--radius-m); padding: 30px 32px; box-shadow: var(--shadow-s); border-top: 5px solid var(--teal); transition: transform .25s ease, box-shadow .25s ease; }
.ledger-col.cons { border-top-color: var(--danger); }
.ledger-col:hover { transform: translateY(-4px); box-shadow: var(--shadow-m); }
.ledger-col h3 { font-size: 1.35rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.ledger-col ul { list-style: none; padding: 0; margin: 0; }
.ledger-col li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .96rem; }
.ledger-col li:last-child { border-bottom: 0; }
.ledger-col li .icon { width: 22px; height: 22px; margin-top: 3px; }
.pros .icon { color: var(--teal); }
.cons .icon { color: var(--danger); }

/* ---------------- 12. Release history (centre timeline) ---------------- */
.timeline { position: relative; list-style: none; margin: 0; padding: 0; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--teal-bright), var(--line)); transform: translateX(-1px); }
.timeline li { position: relative; width: 50%; padding: 0 44px 34px 0; text-align: right; }
.timeline li:nth-child(even) { margin-left: 50%; padding: 0 0 34px 44px; text-align: left; }
.timeline li::after { content: ""; position: absolute; top: 6px; right: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); border: 4px solid var(--teal); }
.timeline li:nth-child(even)::after { right: auto; left: -9px; }
.timeline time, .timeline .tl-label { display: inline-block; font-weight: 700; color: var(--teal); font-size: 1.1rem; margin-bottom: 4px; }
.timeline h3 { margin-bottom: 4px; }
.timeline p { margin: 0; font-size: .95rem; }

/* ---------------- 13. Troubleshooting (symptom → fix rows) ---------------- */
.fixes { border-top: 2px solid var(--brand); }
.fix-row { display: grid; grid-template-columns: 1fr 40px 1.3fr; gap: 20px; align-items: center; padding: 22px 6px; border-bottom: 1px solid var(--line); }
.fix-problem { display: flex; gap: 14px; align-items: center; }
.fix-problem .icon { width: 34px; height: 34px; padding: 6px; border-radius: 10px; background: #fbeceb; color: var(--danger); }
.fix-problem h3 { margin: 0; font-size: 1.02rem; }
.fix-arrow { color: var(--teal-bright); }
.fix-row p { margin: 0; font-size: .95rem; }
.fix-row code, .faq-a code, .download-copy code { background: var(--teal-pale); color: var(--brand); padding: 1px 6px; border-radius: 5px; font-size: .88em; }

/* ---------------- 14. Guides preview (magazine) ---------------- */
.mag { display: grid; grid-template-columns: 1.15fr 1fr; gap: 30px; }
.mag-lead, .mag-item { background: var(--white); border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow-s); transition: transform .25s ease, box-shadow .25s ease; }
.mag-lead:hover, .mag-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-m); }
.mag-lead img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
.mag-lead .mag-body { padding: 24px 28px 28px; }
.mag-lead h3 { font-size: 1.35rem; font-weight: 700; }
.mag-side { display: grid; gap: 18px; }
.mag-item { display: grid; grid-template-columns: 170px 1fr; align-items: center; }
.mag-item img { height: 100%; width: 100%; object-fit: cover; aspect-ratio: 16 / 10; }
.mag-item .mag-body { padding: 14px 18px; }
.mag-item h3 { font-size: 1rem; margin-bottom: 4px; }
.mag-item p { font-size: .86rem; margin: 0; }
.mag a { color: inherit; }
.mag h3 a { color: var(--ink); }
.mag h3 a:hover { color: var(--teal); }
.read-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--teal); }
.read-more .icon { width: 18px; height: 18px; transition: transform .2s ease; }
.read-more:hover .icon { transform: translateX(4px); }
.center-cta { text-align: center; margin-top: 36px; }

/* ---------------- 15. FAQ (two category columns) ---------------- */
.faq-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.faq-cat { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; }
.faq-cat .icon { color: var(--teal); width: 28px; height: 28px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; background: none; border: 0; text-align: left; cursor: pointer; font-size: 1rem; font-weight: 500; color: var(--ink); }
.faq-q:hover { color: var(--teal); }
.faq-q .icon { width: 22px; height: 22px; color: var(--teal); transition: transform .25s ease; }
.faq-q[aria-expanded="true"] .icon { transform: rotate(45deg); }
.faq-a { overflow: hidden; }
.faq-a[hidden] { display: none; }
.faq-a p { padding: 0 34px 18px 0; margin: 0; font-size: .95rem; }

/* ---------------- Footer ---------------- */
.site-footer { margin-top: 90px; background: var(--white); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding: 60px 20px 40px; }
@media (min-width: 1180px) { .footer-grid { padding-left: 0; padding-right: 0; } }
.footer-brand img { height: 44px; width: auto; margin-bottom: 16px; }
.footer-brand p { font-size: .94rem; max-width: 360px; }
.footer-col h2 { font-size: 1rem; margin-bottom: 14px; letter-spacing: .02em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.footer-col a, .footer-bottom a { color: var(--ink-soft); text-decoration: none; font-size: .93rem; }
.footer-col a:hover, .footer-bottom a:hover { color: var(--teal); }
.footer-bottom { border-top: 1px solid var(--line); padding: 22px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 30px; font-size: .88rem; }
.footer-bottom p { margin: 0; }
.footer-bottom a { font-weight: 500; color: var(--teal); }

.to-top { position: fixed; right: 22px; bottom: 22px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--teal); color: var(--white); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-m); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .25s ease, transform .25s ease, visibility .25s; z-index: 90; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--brand); }

/* ---------------- Inner pages ---------------- */
.page-hero { padding: 42px 0 10px; }
.crumbs { font-size: .88rem; margin-bottom: 14px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: #9fb3ba; }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--teal); }
.page-hero h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 10px; }
.page-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .9rem; }
.page-meta span { display: inline-flex; align-items: center; gap: 6px; }
.page-meta .icon { width: 18px; height: 18px; color: var(--teal); }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 50px; align-items: start; padding-top: 28px; }
.article-figure { margin: 0 0 30px; }
.article-figure img { border-radius: var(--radius-l); width: 100%; }
.prose { font-size: 1.04rem; color: #3f5864; }
.prose h2 { font-size: 1.6rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.4em; font-weight: 700; }
.prose ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--teal); }
.prose code { overflow-wrap: anywhere; background: var(--teal-pale); color: var(--brand); padding: 1px 6px; border-radius: 5px; font-size: .9em; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.prose pre { background: var(--code-bg); color: #dce4eb; border-radius: var(--radius-m); padding: 20px 22px; overflow-x: auto; font-size: .88rem; line-height: 1.7; margin: 0 0 1.4em; }
.prose pre code { overflow-wrap: normal; background: none; color: inherit; padding: 0; font-size: inherit; }
.table-wrap { overflow-x: auto; margin: 0 0 1.4em; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--white); }
.prose table { width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 520px; }
.prose th { background: var(--brand); color: var(--white); text-align: left; padding: 12px 16px; font-weight: 500; }
.prose td { padding: 11px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.prose tr:nth-child(even) td { background: #f9fcfc; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.sidebar { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 22px; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #b8cdd3 transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #b8cdd3; border-radius: 6px; }
.side-box { background: var(--white); border-radius: var(--radius-m); padding: 22px 22px; border: 1px solid var(--line); }
.side-box h2 { font-size: 1rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.side-box h2 .icon { color: var(--teal); width: 20px; height: 20px; }
.toc ul, .side-links { list-style: none; margin: 0; padding: 0; }
.toc li a { display: block; padding: 7px 0 7px 14px; border-left: 2px solid var(--line); color: var(--ink-soft); font-size: .9rem; line-height: 1.45; }
.toc li a:hover, .toc li a.is-active { border-left-color: var(--teal); color: var(--teal); }
.side-links li + li { border-top: 1px solid var(--line); }
.side-links a { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px 0; color: var(--ink); font-size: .88rem; line-height: 1.45; font-weight: 500; }
.side-links img { border-radius: 8px; aspect-ratio: 16 / 10; object-fit: cover; }
.side-links a:hover { color: var(--teal); }
.side-cta { background: linear-gradient(140deg, var(--brand), #1b6a73); color: #d8ecee; border: 0; }
.side-cta h2 { color: var(--white); }
.side-cta p { font-size: .9rem; }
.side-cta .btn { width: 100%; justify-content: center; background: var(--white); color: var(--brand); box-shadow: none; }
.side-cta .btn:hover { background: var(--teal-pale); color: var(--brand); }

.related { margin-top: 50px; }
.related h2 { font-size: 1.4rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.post-card { background: var(--white); border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow-s); display: flex; flex-direction: column; transition: transform .25s ease, box-shadow .25s ease; }
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-m); }
.post-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.post-card .pc-body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--teal); }
.post-card p { font-size: .9rem; margin-bottom: 14px; }
.post-card .read-more { margin-top: auto; }
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding-top: 30px; }

.contact-line { display: flex; align-items: center; gap: 14px; font-size: 1.15rem; color: var(--ink); font-weight: 500; margin: 10px 0 24px; }
.contact-line .icon { width: 30px; height: 30px; color: var(--teal); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .uc { grid-template-columns: 280px 1fr; }
  .article-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 34px; }
}
@media (max-width: 991px) {
  .section { padding: 64px 0; }
  .hero-grid, .about-grid, .install, .download-panel, .mag { grid-template-columns: 1fr; }
  .hero { padding-top: 34px; }
  .hero-visual { max-width: 620px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .track { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .track::before { display: none; }
  .uc { grid-template-columns: 1fr; }
  .uc-tabs { flex-direction: row; overflow-x: auto; border-left: 0; border-bottom: 2px solid var(--line); }
  .uc-tab { margin: 0 0 -2px; border-left: 0; border-bottom: 2px solid transparent; border-radius: 12px 12px 0 0; white-space: nowrap; }
  .uc-tab[aria-selected="true"] { border-bottom-color: var(--teal); }
  .safety-strip { grid-template-columns: repeat(2, 1fr); row-gap: 30px; }
  .safety-item:nth-child(3) { border-left: 0; }
  .download-panel { padding: 34px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; max-height: none; overflow: visible; }
  .blog-grid, .related-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline::before { left: 9px; }
  .timeline li, .timeline li:nth-child(even) { width: auto; margin-left: 0; padding: 0 0 30px 44px; text-align: left; }
  .timeline li::after, .timeline li:nth-child(even)::after { left: 0; right: auto; }
}
@media (max-width: 767px) {
  .benefits, .ledger, .faq-cols { grid-template-columns: 1fr; }
  .faq-cols { gap: 30px; }
  .matrix-row { grid-template-columns: 1fr; gap: 6px; padding: 16px 20px; }
  .matrix-head { display: none; }
  .fix-row { grid-template-columns: 1fr; gap: 10px; }
  .fix-arrow { display: none; }
  .uc-panel .uc-points { grid-template-columns: 1fr; }
  .mag-item { grid-template-columns: 120px 1fr; }
  .fact-rail { grid-template-columns: 1fr; }
  .fact-rail div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .fact-rail div { padding: 14px 0; }
}
@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .feature-grid, .track, .safety-strip, .blog-grid, .related-grid, .footer-grid { grid-template-columns: 1fr; }
  .safety-item + .safety-item { border-left: 0; border-top: 1px dotted #b8cdd3; padding-top: 26px; }
  .feature { padding: 26px 22px; }
  .download-panel { padding: 24px 20px; border-radius: 22px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .download-copy .btn { width: 100%; justify-content: center; white-space: normal; }
  .brand img { height: 38px; }
  .ledger-col { padding: 24px 20px; }
}
@media (max-width: 380px) {
  .mag-item { grid-template-columns: 1fr; }
  .mag-item img { aspect-ratio: 16 / 9; }
  .code-tab { padding: 8px 10px; font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Mobile menu CTA keeps button styling */
.main-nav .nav-cta a.btn { display: inline-flex; color: var(--white); background: var(--teal); padding: 14px 28px; border-radius: 999px; }
.main-nav .nav-cta a.btn:hover { background: var(--brand); color: var(--white); }

/* Performance: contain below-the-fold layouts and respect reduced motion */
@media (prefers-reduced-motion: reduce){html{scroll-behavior:auto!important}*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
img{height:auto;max-width:100%}

/* Uniform image system: all editorial visuals share a 16:9 frame. */
.hero-visual img, .about-media img, .download-panel img,
.article-figure img, .post-card img, .mag-lead img,
.mag-item img, .side-links img {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  object-position: center;
}
.hero-visual img, .about-media img, .download-panel img, .article-figure img {
  height: auto;
}
.mag-item img { height: 100%; min-height: 100%; }
