:root {
  --ink: #0E1420;
  --panel: #161E2E;
  --panel-raised: #1C2740;
  --line: #2A3550;
  --signal: #35D9C0;
  --signal-dim: #1F7A6E;
  --alert: #FF9B4D;
  --text: #E7ECF3;
  --muted: #8A95A8;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.wrap {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--signal);
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

a { color: var(--signal); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(14, 20, 32, 0.9);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.site-nav {
  display: flex;
  gap: 1.75rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--text); }

/* Language switcher */
.lang-switcher { position: relative; }
.lang-switcher-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
}
.lang-switcher-btn svg { flex-shrink: 0; }
.lang-switcher-btn:hover,
.lang-switcher-btn[aria-expanded="true"] {
  border-color: var(--signal);
  color: var(--text);
}
.lang-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  inset-inline-end: 0;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem;
  min-width: 150px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.lang-menu[hidden] { display: none; }
.lang-menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
}
.lang-menu a:hover { background: var(--panel); color: var(--text); }
.lang-menu a.is-current { color: var(--signal); font-weight: 600; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 3.5rem;
  align-items: center;
  padding-block: 3.5rem 4rem;
}

.kicker {
  font-family: var(--font-display);
  color: var(--signal);
  letter-spacing: 0.02em;
  font-size: 0.85rem;
  margin: 0 0 1rem;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 3rem);
  line-height: 1.12;
  margin: 0 0 1.1rem;
  max-width: 15ch;
  font-weight: 600;
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 46ch;
  margin: 0 0 1.75rem;
}

.trust-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.trust-row li {
  font-size: 0.92rem;
  color: var(--muted);
  border-left: 2px solid var(--signal-dim);
  padding-left: 0.75rem;
}
.trust-row strong {
  color: var(--text);
  font-family: var(--font-display);
}

/* Console */
.console {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

#wave {
  width: 100%;
  height: 130px;
  display: block;
  background: #0A0F1A;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.readout {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  color: var(--signal);
  font-size: 0.95rem;
  margin: 0.6rem 0.1rem 1.25rem;
  letter-spacing: 0.02em;
}

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.mode-btn svg { flex-shrink: 0; color: var(--muted); }
.mode-btn:hover { border-color: var(--signal-dim); color: var(--text); }
.mode-btn.is-active {
  border-color: var(--signal);
  color: var(--text);
  background: #172A2C;
}
.mode-btn.is-active svg { color: var(--signal); }

.start-btn {
  width: 100%;
  padding: 1rem;
  border-radius: 10px;
  border: none;
  background: var(--signal);
  color: #06231F;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}
.start-btn:hover { background: #4ee6cd; }
.start-btn:active { transform: scale(0.98); }
.start-btn.is-running {
  background: var(--alert);
  color: #2E1600;
}

.console-hint {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  margin: 0.9rem 0 0;
}
.console-status {
  text-align: center;
  font-size: 0.88rem;
  color: var(--signal);
  min-height: 1.2em;
  margin: 0.4rem 0 0;
}

/* Speaker test console */
.test-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.test-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 1.1rem 0.85rem;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.test-btn span.test-btn-sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
}
.test-btn:hover { border-color: var(--signal); }
.test-btn.is-active {
  border-color: var(--signal);
  background: #172A2C;
}
.test-btn.is-active svg { color: var(--signal); }
.test-btn-wide {
  grid-column: 1 / -1;
}
.test-stop-btn {
  width: 100%;
  padding: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.test-stop-btn:hover { border-color: var(--alert); color: var(--alert); }

/* Mic test panel */
.mic-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.25rem;
}
.mic-panel h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 0.4rem;
}
.mic-panel p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 1rem;
}
.mic-meter {
  height: 10px;
  background: #0A0F1A;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.mic-meter-fill {
  height: 100%;
  width: 0%;
  background: var(--signal);
  transition: width 0.08s linear;
}
.mic-test-btn {
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--signal);
  background: transparent;
  color: var(--signal);
  font-family: var(--font-display);
  font-size: 0.9rem;
  cursor: pointer;
}
.mic-test-btn:hover { background: #172A2C; }
.mic-test-btn:disabled { opacity: 0.5; cursor: default; }
.mic-test-status {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}
.mic-test-playback {
  width: 100%;
  margin-top: 0.75rem;
}

/* Diagnostic list (fix-my-speaker hub) */
.diagnose-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.diagnose-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.diagnose-item strong {
  font-family: var(--font-display);
  color: var(--text);
  font-size: 1rem;
}
.diagnose-item span {
  color: var(--muted);
  font-size: 0.88rem;
}
.diagnose-item:hover {
  border-color: var(--signal);
  background: #172A2C;
}

/* Bands */
.band {
  padding-block: 4rem;
  border-top: 1px solid var(--line);
}
.band.alt { background: var(--panel); }
.band h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 600;
  max-width: 20ch;
  margin: 0 0 0.9rem;
}
.band-lede {
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 2.5rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.two-col h2 { font-size: 1.3rem; }
.two-col p { color: var(--muted); }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.75rem;
}
.steps li {
  border-top: 2px solid var(--signal-dim);
  padding-top: 1rem;
}
.step-index {
  display: block;
  font-family: var(--font-display);
  color: var(--signal);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.steps h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}
.steps p { color: var(--muted); margin: 0; font-size: 0.92rem; }

/* FAQ */
.faq-list {
  border-top: 1px solid var(--line);
}
.faq-list details {
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
}
.faq-list summary {
  font-family: var(--font-display);
  font-weight: 500;
  cursor: pointer;
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  color: var(--signal);
  font-size: 1.3rem;
  flex-shrink: 0;
}
.faq-list details[open] summary::after { content: "−"; }
.faq-list p { color: var(--muted); margin: 0.75rem 0 0; max-width: 68ch; }

.cta-band { text-align: center; }
.cta-inner p { color: var(--muted); margin: 0 0 1.25rem; }
.cta-link {
  display: inline-block;
  border: 1px solid var(--signal);
  color: var(--signal);
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.92rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 3rem 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.footer-brand-col .brand { margin-bottom: 0.75rem; }
.footer-brand-col p {
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 32ch;
  margin: 0;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.footer-col-title {
  font-family: var(--font-display);
  color: var(--text);
  font-size: 0.85rem;
  margin: 0 0 0.3rem;
}
.footer-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.footer-col a:hover { color: var(--signal); }
.footer-bottom {
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
}

/* Blog */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 72ch;
}
.blog-item {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.blog-item:hover { border-color: var(--signal); }
.blog-item h2 {
  font-family: var(--font-display);
  color: var(--text);
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}
.blog-item p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 0.75rem;
}
.blog-date {
  color: var(--signal-dim);
  font-size: 0.8rem;
  font-family: var(--font-display);
}

/* Legal pages */
.legal {
  padding-block: 3rem 4rem;
}
.legal h1 {
  max-width: none;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
}
.legal .updated {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 2.5rem;
}
.legal-body {
  max-width: 72ch;
}
.legal-body h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2.25rem 0 0.75rem;
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body p, .legal-body li {
  color: var(--muted);
  font-size: 0.98rem;
}
.legal-body ul, .legal-body ol {
  padding-left: 1.25rem;
}
.legal-body a { color: var(--signal); }
.legal-body strong { color: var(--text); }
.legal-note {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--alert);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.legal-note p { margin: 0; color: var(--text); font-size: 0.92rem; }

.contact-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 32rem;
  margin-top: 1.5rem;
}
.contact-card a {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* Cookie consent banner */
.consent-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 560px;
  margin-inline: auto;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.consent-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}
.consent-banner p a { color: var(--signal); }
.consent-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}
.consent-actions button {
  font-family: var(--font-display);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 7px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}
.consent-actions .consent-accept {
  background: var(--signal);
  border-color: var(--signal);
  color: #06231F;
  font-weight: 600;
}
.consent-actions button:hover { border-color: var(--signal); color: var(--text); }
.consent-actions .consent-accept:hover { background: #4ee6cd; color: #06231F; }


/* RTL support (Arabic) */
[dir="rtl"] .skip-link {
  left: auto;
  right: -9999px;
}
[dir="rtl"] .skip-link:focus {
  right: 0;
}
[dir="rtl"] .trust-row li {
  border-left: none;
  border-right: 2px solid var(--signal-dim);
  padding-left: 0;
  padding-right: 0.75rem;
}
[dir="rtl"] .mode-btn {
  text-align: right;
}
[dir="rtl"] .legal-body ul,
[dir="rtl"] .legal-body ol {
  padding-left: 0;
  padding-right: 1.25rem;
}
[dir="rtl"] .legal-note {
  border-left: none;
  border-right: 3px solid var(--alert);
}
[dir="rtl"] .consent-actions {
  justify-content: flex-start;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-block: 2rem 2.5rem; }
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
  .steps { grid-template-columns: 1fr 1fr; }
  .site-nav { display: none; }
}

@media (max-width: 520px) {
  .modes { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  h1 { max-width: none; }
}
