/* ==========================================================================
   Termethos portal: dark "instrument panel" theme
   ========================================================================== */

:root {
   --bg: #070b12;
   --bg-alt: #0a101a;
   --surface: #0f1723;
   --surface-2: #142032;
   --border: #1d2a3d;
   --border-strong: #2a3b55;
   --text: #e6edf6;
   --muted: #8fa0b6;
   --faint: #5d6e86;

   --accent: #39e6b0;          /* signal green */
   --accent-ink: #04261b;
   --blue: #4da3ff;
   --info: #5aa9ff;
   --warn: #ffb547;
   --err: #ff5d6c;
   --changed: #ffe45c;

   --radius: 14px;
   --radius-sm: 8px;
   --shadow: 0 20px 60px -20px rgba(0, 0, 0, .7), 0 0 0 1px var(--border);
   --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
   --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
   --container: 1180px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
   margin: 0;
   background: var(--bg);
   color: var(--text);
   font-family: var(--font);
   font-size: 16px;
   line-height: 1.6;
   -webkit-font-smoothing: antialiased;
   text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
code, pre, .mono { font-family: var(--mono); }
:not(pre) > code {
   font-size: .88em;
   padding: .12em .4em;
   border-radius: 5px;
   background: var(--surface-2);
   border: 1px solid var(--border);
   color: #cfe3ff;
   white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(57, 230, 176, .3); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 860px; }
.center { text-align: center; }
.mt-lg { margin-top: 40px; }
.pt-0 { padding-top: 0 !important; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---------- Icons & buttons ---------- */
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

.btn {
   display: inline-flex; align-items: center; justify-content: center; gap: .55em;
   font: 600 15px/1 var(--font);
   padding: 12px 18px;
   border-radius: 10px;
   border: 1px solid transparent;
   cursor: pointer;
   white-space: nowrap;
   transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-sm { padding: 9px 14px; font-size: 14px; }
.btn-lg { padding: 15px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary {
   background: var(--accent); color: var(--accent-ink);
   box-shadow: 0 0 0 1px rgba(57, 230, 176, .4), 0 8px 30px -8px rgba(57, 230, 176, .55);
}
.btn-primary:hover { background: #5cf0c2; }
.btn-secondary { background: var(--blue); color: #021327; box-shadow: 0 8px 30px -10px rgba(77, 163, 255, .6); }
.btn-secondary:hover { background: #6fb5ff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--muted); background: rgba(255, 255, 255, .03); }

.link-arrow { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; color: var(--accent); }
.link-arrow .icon { transition: transform .15s ease; }
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
   position: sticky; top: 0; z-index: 50;
   background: rgba(7, 11, 18, .78);
   backdrop-filter: saturate(160%) blur(14px);
   -webkit-backdrop-filter: saturate(160%) blur(14px);
   border-bottom: 1px solid var(--border);
}
.nav-bar { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand-by { font: 500 11px/1 var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .08em; padding-top: 4px; }

.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav ul a {
   display: block; padding: 8px 12px; border-radius: 8px;
   color: var(--muted); font-weight: 500; font-size: 15px;
}
.site-nav ul a:hover { color: var(--text); background: rgba(255, 255, 255, .04); text-decoration: none; }
.site-nav ul a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.nav-toggle {
   display: none; background: none; border: 1px solid var(--border-strong); color: var(--text);
   width: 42px; height: 42px; border-radius: 10px; cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle .icon { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-open .nav-toggle .icon-open { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }

@media (max-width: 900px) {
   .brand-by { display: none; }
   .nav-toggle { display: inline-flex; }
   .site-nav {
      position: absolute; top: 68px; left: 0; right: 0;
      flex-direction: column; align-items: stretch; gap: 12px;
      padding: 16px 24px 24px;
      background: rgba(7, 11, 18, .97);
      border-bottom: 1px solid var(--border);
      display: none;
   }
   .nav-open .site-nav { display: flex; }
   .site-nav ul { flex-direction: column; }
   .site-nav ul a { padding: 12px; font-size: 16px; }
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; }
.section-head p { color: var(--muted); font-size: 18px; }
.kicker {
   font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em;
   color: var(--accent); margin-bottom: 14px;
}
.lead { font-size: 19px; color: var(--muted); max-width: 640px; }

.page-hero { padding: 72px 0 48px; position: relative; }
.page-hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; max-width: 820px; }
.page-hero::before {
   content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
   background: radial-gradient(600px 260px at 15% 0%, rgba(77, 163, 255, .12), transparent 70%);
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 80px 0 96px; }
.hero-glow {
   position: absolute; inset: -20% -10% auto; height: 760px; pointer-events: none;
   background:
      radial-gradient(520px 340px at 78% 30%, rgba(57, 230, 176, .14), transparent 70%),
      radial-gradient(600px 400px at 20% 10%, rgba(77, 163, 255, .16), transparent 70%);
}
.hero::after {
   content: ""; position: absolute; inset: 0; pointer-events: none;
   background-image:
      linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
   background-size: 44px 44px;
   mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
   -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1.08fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.2vw, 62px); font-weight: 800; letter-spacing: -0.035em; }
.grad { background: linear-gradient(90deg, var(--blue), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.eyebrow {
   display: inline-flex; align-items: center; gap: 8px;
   font: 500 13px/1 var(--mono); color: var(--muted);
   padding: 8px 12px; border-radius: 999px;
   border: 1px solid var(--border-strong); background: rgba(15, 23, 35, .7);
   margin-bottom: 24px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 24px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: 14px; }
.hero-meta li { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta .icon { color: var(--accent); }

@media (max-width: 980px) {
   .hero { padding: 48px 0 72px; }
   .hero-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* ---------- Termethos app window (mirrors the real desktop UI) ---------- */
.app-window {
   --app-blue: #4682b4;
   --app-blue-dark: #2f5f8a;
   --app-tan: #dcb689;
   --app-pale: #f0f8ff;
   --app-field: #87cefa;
   --app-courier: "Courier New", Courier, monospace;
   background: var(--app-blue);
   border: 2px solid #3a6f9f;
   border-radius: 6px;
   overflow: hidden;
   color: #000;
   font-family: Arial, Helvetica, sans-serif;
   box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .8), 0 0 90px -30px rgba(77, 163, 255, .5);
   user-select: none;
}
.hero-app { min-width: 0; }

.app-titlebar { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: var(--app-tan); }
.app-logo { width: 22px; height: 22px; flex: none; }
.app-title {
   flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
   font: 700 15px/1.2 var(--app-courier); color: #2b4fd8; letter-spacing: .02em;
}
.app-winbtns { display: inline-flex; gap: 3px; }
.app-winbtns svg {
   width: 21px; height: 19px; flex: none; border-radius: 2px;
   background: linear-gradient(#fbfbfb, #e2e2e2); border: 1px solid #a3a3a3;
}

.app-toolbar { display: flex; align-items: center; gap: 3px; padding: 4px 6px; background: var(--app-blue); overflow: hidden; }
.tb {
   flex: none; position: relative; width: 19px; height: 19px; border-radius: 3px;
   display: inline-flex; align-items: center; justify-content: center;
   background: linear-gradient(#fbfdff, #cfdcea); border: 1px solid #2d5a85;
   font: 700 14px/1 Arial, sans-serif; color: #222;
}
.tb-gear { background: radial-gradient(circle, #9aa4ad 35%, #c9d0d6 37% 55%, #9aa4ad 57%); }
.tb-plug::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #b6f27a, #2c8d14); }
.tb-play::before { content: ""; border-left: 8px solid #4a90e2; border-top: 5px solid transparent; border-bottom: 5px solid transparent; margin-left: 2px; }
.tb-erase::before { content: ""; width: 9px; height: 6px; background: linear-gradient(90deg, #8fd0ff 50%, #fff 50%); border: 1px solid #4b84b9; transform: rotate(-35deg); }
.tb-clr::before { content: "\2716"; color: #e0242b; font-size: 11px; }
.tb-dash::before { content: ""; width: 11px; height: 10px; border: 1px solid #3b4fb5; background: linear-gradient(#a9b8ff 0 30%, #e2e8ff 30%); }
.tb-dash-x::after { content: "\2716"; position: absolute; right: 2px; bottom: 1px; font-size: 7px; color: #e0242b; }
.tb-cog::before { content: ""; width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle, #fff 0 18%, #a5121b 22% 62%, transparent 64%), repeating-conic-gradient(#a5121b 0 20deg, transparent 20deg 45deg); }
.tb-info { font: italic 700 14px/1 Georgia, serif; color: #2b3fd8; }
.tb-console::before { content: ""; width: 11px; height: 8px; background: linear-gradient(#2a54c8 0 40%, #fff 40% 55%, #2a54c8 55%); border-radius: 1px; }
.tb-select {
   flex: 0 1 150px; min-width: 60px; display: flex; justify-content: space-between; align-items: center;
   height: 19px; padding: 0 5px; background: #a9cfe6; border: 1px solid #2d5a85; color: #4b6377; font-size: 13px;
}
.tb-select span { font-size: 9px; }
.tb-sep { flex: none; width: 2px; height: 18px; margin: 0 5px; background: #e8f1fa; border-right: 1px solid #2d5a85; }

.app-dash {
   display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
   padding: 5px 5px 6px; background: var(--app-pale); border-bottom: 3px solid var(--app-blue);
}
.app-field {
   display: flex; gap: 2px; padding: 2px; border: 2px solid #3d8ee6; border-radius: 6px; background: #fff;
   font: 700 13px/1.25 "Times New Roman", Times, serif; min-width: 0;
}
.app-field .idx { flex: 0 0 auto; min-width: 20px; padding: 0 3px; text-align: center; background: #d6d6d6; border-radius: 4px 0 0 4px; }
.app-field .val { flex: 1; min-width: 0; text-align: center; background: var(--app-field); border-radius: 0 4px 4px 0; transition: background-color .25s ease; overflow: hidden; }
.app-field.changed .val { background: #ffff00; }

.app-main { display: grid; grid-template-columns: 1fr 132px; gap: 4px; background: var(--app-blue); }
.app-left { min-width: 0; display: flex; flex-direction: column; }
.app-trace {
   height: 215px; overflow: hidden; background: #fff;
   display: flex; flex-direction: column; justify-content: flex-end;
   font: 13px/19.5px var(--app-courier); border-bottom: 4px solid var(--app-blue);
}
.app-trace.static { height: auto; justify-content: flex-start; border-bottom: 0; padding-bottom: 6px; }
.app-trace .ln { flex: none; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #000; }
.app-trace .ln:nth-child(odd) { background: #f6f6f6; }
.app-trace .ln-info { color: #0000ee; }
.app-trace .ln-warn { color: #ff8c00; }
.app-trace .ln-err { color: #ff0000; background: #ffff00 !important; }
.app-trace .ln-box { align-self: flex-start; margin: 4px 6px; padding: 1px 16px; width: fit-content; min-width: min(46%, 240px); max-width: calc(100% - 12px); text-align: center; border: 1.5px solid #000; background: #fff !important; }
.app-trace .ln.enter { animation: line-in .25s ease-out; }
@keyframes line-in { from { opacity: 0; transform: translateY(6px); } }

.app-history { height: 70px; overflow: hidden; padding: 3px 6px; background: var(--app-pale); font: 15px/1.35 var(--app-courier); color: #444; display: flex; flex-direction: column; justify-content: flex-end; }
.app-history div { flex: none; }

.app-side { display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--app-blue); border: 1px solid #d6a54a; }
.app-side span {
   padding: 3px 4px; text-align: center; font-size: 12px; color: #000;
   background: linear-gradient(#fafafa, #dcdcdc); border: 1px solid #a8a8a8; border-radius: 2px;
   transition: background .15s ease;
}
.app-side span.press { background: linear-gradient(#cfe6ff, #9fc8f0); border-color: #3a6f9f; }

.app-input { display: flex; align-items: center; gap: 4px; padding: 4px; background: var(--app-blue); }
.app-cmd {
   position: relative; flex: 1; min-width: 0; height: 22px; display: flex; align-items: center;
   padding: 0 6px; background: #fff; border: 1px solid #2d5a85; font: 14px Arial, sans-serif; color: #000;
}
.app-cmd .ph { color: #8a8a8a; }
.app-cmd .caret { width: 1px; height: 15px; background: #000; animation: blink 1s steps(1) infinite; }
.app-cmd.typing .ph { display: none; }
.app-cmd:not(.typing) .caret { position: absolute; left: 6px; }
@keyframes blink { 50% { opacity: 0; } }

.app-status { display: flex; gap: 6px; padding: 2px 4px 4px; background: var(--app-blue); font: 700 11px/1.5 var(--app-courier); color: #fff; }
.app-status span { padding: 0 6px; border: 1px solid var(--app-blue-dark); box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .25); }
.app-status span:first-child { flex: 0 0 34%; }
.app-status span:last-child { flex: 1; }
.app-status .ok { color: #7cfc00; }

.app-mini .app-dash { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 560px) {
   .app-dash { grid-template-columns: repeat(4, 1fr); }
   .app-dash .app-field:nth-child(n+9) { display: none; }
   .app-main { grid-template-columns: 1fr; }
   .app-side { display: none; }
   .app-title { font-size: 13px; }
   .app-toolbar .tb-sep ~ .tb-sep ~ * { display: none; }
}

/* ---------- Pillars & features ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pillar {
   position: relative; padding: 32px; border-radius: var(--radius);
   background: linear-gradient(180deg, var(--surface), var(--bg));
   border: 1px solid var(--border);
   overflow: hidden;
}
.pillar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--tone); opacity: .8; }
.pillar h3 { font-size: 24px; }
.pillar p { color: var(--muted); margin: 0; }
.pillar-icon {
   display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center;
   border-radius: 12px; margin-bottom: 20px; color: var(--tone);
   background: color-mix(in srgb, var(--tone) 12%, transparent);
   border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent);
}
.pillar-icon .icon { width: 24px; height: 24px; }
.tone-info { --tone: var(--info); }
.tone-accent { --tone: var(--accent); }
.tone-warn { --tone: var(--warn); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.feature { display: flex; gap: 16px; padding: 28px; background: var(--bg); transition: background-color .2s ease; }
.feature:hover { background: var(--surface); }
.feature h3 { font-size: 17px; margin-bottom: 6px; letter-spacing: -0.01em; }
.feature p { color: var(--muted); font-size: 15px; margin: 0; }
.feature-icon {
   flex: none; display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center;
   border-radius: 10px; color: var(--accent); background: rgba(57, 230, 176, .08); border: 1px solid rgba(57, 230, 176, .2);
}
.feature-icon .icon { width: 20px; height: 20px; }

@media (max-width: 980px) {
   .pillars { grid-template-columns: 1fr; }
   .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
   .feature-grid { grid-template-columns: 1fr; }
   .section { padding: 72px 0; }
}

/* ---------- Code cards ---------- */
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.code-card { border-radius: var(--radius); background: #0b111b; box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.code-head {
   display: flex; justify-content: space-between; align-items: center;
   padding: 9px 14px; border-bottom: 1px solid var(--border); background: #111926;
   font: 500 12px/1 var(--mono); color: var(--muted);
}
.code-card pre, pre {
   margin: 0; padding: 18px; overflow-x: auto;
   font-size: 13.5px; line-height: 1.75; color: #d6e1f0;
}
pre .c { color: #6b7d96; font-style: italic; }
pre .s { color: #9fe8c9; }
pre mark, .faq-answer pre mark {
   background: rgba(255, 228, 92, .16); color: var(--changed);
   padding: 1px 3px; border-radius: 4px; font-weight: 700;
}

.copy-btn {
   font: 500 11px/1 var(--mono); color: var(--muted); background: transparent;
   border: 1px solid var(--border-strong); border-radius: 6px; padding: 5px 9px; cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--muted); }
.copy-btn.done { color: var(--accent); border-color: var(--accent); }

/* ---------- Screenshot frames ---------- */
.shot {
   margin: 0; padding: 10px; border-radius: calc(var(--radius) + 6px);
   background: linear-gradient(140deg, rgba(77, 163, 255, .35), rgba(57, 230, 176, .25) 50%, rgba(255, 255, 255, .04));
   box-shadow: 0 40px 100px -40px rgba(77, 163, 255, .45);
}
.shot img { border-radius: var(--radius); width: 100%; }
.shot-light img { background: #fff; }

/* ---------- CTA band ---------- */
.cta-band {
   display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
   padding: 48px; border-radius: 20px;
   background:
      radial-gradient(500px 200px at 90% 0%, rgba(57, 230, 176, .18), transparent 70%),
      radial-gradient(500px 240px at 0% 100%, rgba(77, 163, 255, .18), transparent 70%),
      var(--surface);
   border: 1px solid var(--border-strong);
}
.cta-band h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 800; }
.cta-band p { color: var(--muted); margin: 0; max-width: 560px; }
.cta-band .cta-row { margin: 0; }
@media (max-width: 620px) { .cta-band { padding: 32px 24px; } }

/* ---------- UI tour ---------- */
.region-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; }
.region-group { padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.region-title { font-size: 20px; display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.region-title .mono { font-size: 12px; color: var(--accent); padding: 4px 7px; border-radius: 6px; background: rgba(57, 230, 176, .1); }
.region-list { margin: 0; display: grid; gap: 16px; }
.region-item dt { font-weight: 600; margin-bottom: 2px; }
.region-item dd { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 980px) { .region-groups { grid-template-columns: 1fr; } }

/* ---------- How to ---------- */
.ref-card { padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); margin-bottom: 72px; }
.ref-card h2 { font-size: 20px; margin-bottom: 16px; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ref-table th { text-align: left; font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 0 12px 12px 0; }
.ref-table td { padding: 12px 12px 12px 0; border-top: 1px solid var(--border); color: var(--muted); }
.ref-table td:first-child { width: 44%; }
.ref-table code.tone-info { color: var(--info); }
.ref-table code.tone-warn { color: var(--warn); }
.ref-table code.tone-err { color: var(--err); }

.howto-list { display: grid; gap: 88px; }
.howto { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.howto:nth-child(even) .howto-text { order: 2; }
.howto-num { color: var(--accent); font-size: 13px; margin-bottom: 8px; }
.howto h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
.howto-text > p { color: var(--muted); font-size: 17px; }
.howto .code-card { margin-top: 24px; }
.howto-shot { margin: 0; padding: 8px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.howto-shot img { border-radius: 8px; width: 100%; }
@media (max-width: 900px) {
   .howto { grid-template-columns: 1fr; gap: 28px; }
   .howto:nth-child(even) .howto-text { order: 0; }
}

.callout {
   display: flex; gap: 18px; align-items: flex-start; margin-top: 80px;
   padding: 24px 28px; border-radius: var(--radius);
   background: rgba(77, 163, 255, .06); border: 1px solid rgba(77, 163, 255, .25);
}
.callout h3 { font-size: 18px; margin-bottom: 4px; }
.callout p { margin: 0; color: var(--muted); }
.callout-icon { color: var(--blue); padding-top: 2px; }
.callout-icon .icon { width: 24px; height: 24px; }

/* ---------- FAQ ---------- */
.search {
   display: flex; align-items: center; gap: 10px; margin-top: 32px;
   padding: 0 16px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface);
   color: var(--faint); transition: border-color .15s ease, box-shadow .15s ease;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(57, 230, 176, .12); }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: 16px var(--font); padding: 15px 0; min-width: 0; }
.search input::placeholder { color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 14px; background: var(--bg-alt); }
.chip:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }

.faq-group { margin-bottom: 40px; }
.faq-subject { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 14px; }
.faq-subject span { color: var(--faint); text-transform: none; letter-spacing: 0; }
.faq-item { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 10px; transition: border-color .15s ease; }
.faq-item[open] { border-color: var(--border-strong); }
.faq-item summary {
   list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
   padding: 18px 20px; font-weight: 600; font-size: 16.5px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: #fff; }
.faq-item .chevron { color: var(--faint); transition: transform .2s ease; }
.faq-item[open] .chevron { transform: rotate(90deg); color: var(--accent); }
.faq-answer { padding: 0 20px 20px; color: var(--muted); white-space: pre-line; }
.faq-answer pre {
   white-space: pre; margin-top: 12px; border-radius: 10px;
   background: #0b111b; border: 1px solid var(--border); font-size: 13px; line-height: 1.6;
}
.faq-img { margin-top: 12px; max-height: 110px; width: auto; border-radius: 8px; border: 1px solid var(--border); }
.faq-empty { color: var(--muted); text-align: center; padding: 32px 0; }
.faq-item.is-hidden, .faq-group.is-hidden { display: none; }

/* ---------- Download ---------- */
.download-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.dl-card {
   display: flex; flex-direction: column; gap: 4px;
   padding: 36px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border);
}
.dl-card-primary {
   background: radial-gradient(500px 220px at 100% 0%, rgba(57, 230, 176, .14), transparent 70%), var(--surface);
   border-color: rgba(57, 230, 176, .35);
}
.dl-card h2 { display: flex; align-items: center; gap: 10px; font-size: 24px; }
.dl-card > p { color: var(--muted); }
.dl-card form { margin-top: auto; }
.dl-card .btn-block { margin-top: auto; }
.dl-step { font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; margin-bottom: 10px; }
.dl-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 24px; }
.tag { font-size: 12px; padding: 5px 9px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
.price { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 24px; }
.price .amount { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; }
.price .per { color: var(--muted); }
.fine { font-size: 14px; color: var(--faint); margin: 16px 0 0; }

.steps { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { display: flex; gap: 16px; padding: 24px; border-radius: var(--radius); border: 1px dashed var(--border-strong); }
.steps .mono { color: var(--accent); font-size: 14px; padding-top: 2px; }
.steps h3 { font-size: 17px; margin-bottom: 4px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 900px) {
   .download-grid, .steps { grid-template-columns: 1fr; }
   .dl-card { padding: 28px 24px; }
}

/* ---------- Forum ---------- */
.forum-card { padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); min-height: 320px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 56px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 32px; }
.footer-brand p { color: var(--muted); max-width: 320px; margin-top: 10px; font-size: 15px; }
.site-footer h4 { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer ul a { color: var(--muted); font-size: 15px; display: inline-flex; align-items: center; gap: 8px; word-break: break-all; }
.site-footer ul a:hover { color: var(--text); text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); }
.footer-bottom p { margin: 0; color: var(--faint); font-size: 13px; }
.footer-bottom .mono { color: var(--accent); opacity: .7; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
   *, *::before, *::after { animation: none !important; transition: none !important; }
   html { scroll-behavior: auto; }
}

/* Grid children may not grow past their track (long no-wrap terminal lines). */
.hero-grid > *, .split > *, .howto > *, .download-grid > *, .region-groups > * { min-width: 0; }
