/* LINX site. Colour, type, spacing and radius tokens come from the LINX Design System
   (Light and "Control room" themes). Keep names in step with its tokens.json. */
:root {
  --surface: #FFFFFF;
  --surface-alt: #F4F6F7;
  --line: #DCE3E7;
  --control-border: #5F727F;
  --ink: #15202B;
  --ink-muted: #5F727F;
  --logo-ink: #000000;
  --linx-blue: #3AB0E1;
  --action: #0A72A6;
  --action-hover: #085A83;
  --on-action: #FFFFFF;
  --action-tint: #E6F5FC;
  --night: #0F1C26;
  --night-line: #2A3C49;
  --on-night: #FFFFFF;
  --on-night-muted: #B7C7D1;
  --sos: #A8380A;
  --on-sos: #FFFFFF;
  --sos-tint: #FBE9E1;
  --online: #1E7D46;
  --online-tint: #E3F4EA;
  --focus: var(--action);
  --header-bg: rgba(255, 255, 255, 0.94);
  --shadow-device: 0 24px 48px -20px rgba(0, 0, 0, 0.6);

  --font-sans: "Open Sans", "Segoe UI", system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 3.6vw, 2.6rem);
  --step-4: clamp(2.4rem, 5.6vw, 4rem);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --space-8: 32px; --space-12: 48px; --space-16: 64px; --space-24: 96px;
  --radius-sm: 8px; --radius-md: 14px; --radius-lg: 32px; --radius-round: 999px;
  --rule: 1px; --rule-heavy: 3px;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max: 74rem;
  color-scheme: light;
}

/* Control room (dark): follows the device setting unless the visitor picks a theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #0F1C26; --surface-alt: #182A37; --line: #2A3C49; --control-border: #7A8D99;
    --ink: #EAF1F5; --ink-muted: #9FB2BE; --logo-ink: #FFFFFF;
    --action: #3AB0E1; --action-hover: #5CC2EC; --on-action: #000000; --action-tint: #10324A;
    --night: #050A0E; --night-line: #1E2E3A;
    --sos: #FF7A45; --on-sos: #000000; --sos-tint: #3A1A0C;
    --online: #3BC27A; --online-tint: #0E2E1D;
    --header-bg: rgba(15, 28, 38, 0.94);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #0F1C26; --surface-alt: #182A37; --line: #2A3C49; --control-border: #7A8D99;
  --ink: #EAF1F5; --ink-muted: #9FB2BE; --logo-ink: #FFFFFF;
  --action: #3AB0E1; --action-hover: #5CC2EC; --on-action: #000000; --action-tint: #10324A;
  --night: #050A0E; --night-line: #1E2E3A;
  --sos: #FF7A45; --on-sos: #000000; --sos-tint: #3A1A0C;
  --online: #3BC27A; --online-tint: #0E2E1D;
  --header-bg: rgba(15, 28, 38, 0.94);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { font-weight: 800; line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 0.5em; color: var(--logo-ink); text-wrap: balance; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); max-width: 22ch; }
h3 { font-size: var(--step-1); font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 1em; max-width: 64ch; }
a { color: var(--action); }
strong { font-weight: 700; color: var(--logo-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--linx-blue); color: #000000; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* Logo: black on light themes, white in Control room */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

/* Header */
.site-header { background: var(--header-bg); border-bottom: var(--rule) solid var(--line); position: sticky; top: 0; z-index: 5; backdrop-filter: saturate(1.2) blur(6px); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 4.5rem; gap: var(--space-4); }
.brand img { height: 36px; width: auto; }
.header-tools { display: flex; align-items: center; gap: var(--space-6); }
.nav { list-style: none; display: flex; gap: 1.8rem; margin: 0; padding: 0; align-items: center; }
.nav a { text-decoration: none; font-weight: 600; color: var(--ink); font-size: .98rem; }
.nav a:hover { color: var(--action); }
.nav .nav-cta { background: var(--action); color: var(--on-action); padding: .55rem 1.1rem; border-radius: var(--radius-sm); }
.nav .nav-cta:hover { background: var(--action-hover); color: var(--on-action); }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: var(--rule) solid var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--control-border); }
.theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (max-width: 760px) { .nav li:not(:last-child) { display: none; } .brand img { height: 30px; } .header-tools { gap: var(--space-3); } }

/* Buttons */
.btn { display: inline-block; font: 700 1rem/1 var(--font-sans); padding: 1rem 1.5rem; border-radius: var(--radius-sm); text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.btn-primary { background: var(--action); color: var(--on-action); }
.btn-primary:hover { background: var(--action-hover); }
.btn-ghost { border-color: var(--logo-ink); color: var(--logo-ink); }
.btn-ghost:hover { background: var(--logo-ink); color: var(--surface); }
.band-ink .btn-primary { background: var(--linx-blue); color: #000000; }
.band-ink .btn-primary:hover { background: #5CC2EC; }
.band-ink :focus-visible { outline-color: var(--linx-blue); }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: var(--space-2); font: 700 var(--step--1)/1 var(--font-sans); padding: 6px 12px 6px 10px; border-radius: var(--radius-sm); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-round); background: currentColor; }
.pill-online { background: var(--online-tint); color: var(--online); }
.pill-sos { background: var(--sos); color: var(--on-sos); }
.pill-sos::before { border-radius: 0; transform: rotate(45deg); }

/* Hero */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem); border-bottom: var(--rule) solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 4vw, 3.5rem); align-items: center; }
.hero h1 { max-width: 12ch; }
.lede { font-size: var(--step-1); color: var(--ink-muted); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: 1.8rem; }
.hero-media { margin: 0; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* Bands */
.band { padding: clamp(3.5rem, 8vw, var(--space-24)) 0; }
.band-quiet { background: var(--surface-alt); }
.band-ink { background: var(--night); color: var(--on-night); }
.band-ink h2, .band-ink h3, .band-ink strong { color: var(--on-night); }
.band-ink .section-lede { color: var(--on-night-muted); }
.section-lede { font-size: var(--step-1); color: var(--ink-muted); line-height: 1.55; max-width: 54ch; }

/* Push-to-talk demo */
.try { padding: clamp(3rem, 6vw, 4.5rem) 0; }
.try-grid { display: grid; grid-template-columns: 1fr auto; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
@media (max-width: 760px) { .try-grid { grid-template-columns: 1fr; } }

/* LINX app call screen, after the real app (colours sampled from it) */
.demo { margin: 0; justify-self: center; width: min(19.5rem, 100%); display: flex; flex-direction: column; gap: var(--space-3); }
.phone { background: #050A0E; border-radius: 2.4rem; padding: .7rem; box-shadow: 0 0 0 1px #263845, var(--shadow-device); }
.app {
  --app-navy: #303451; --app-teal: #0093B8; --app-tab: #3AC4DF;
  --ptt-idle: #5A78CD; --ptt-idle-shade: #455DA5;
  --ptt-talk: #2FA35B; --ptt-talk-shade: #23814A;
  --ptt-rx: #D64545; --ptt-rx-shade: #B03434;
  background: #FFFFFF; color: #5E6472; border-radius: 1.8rem; overflow: hidden;
  display: flex; flex-direction: column; min-height: 30rem;
}
.app-bar { background: var(--app-navy); color: #FFFFFF; display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1rem .5rem; }
.app-menu { color: #59C77A; flex: none; }
.app-title { font-size: 1.15rem; font-weight: 600; }
.app-tabs { background: var(--app-navy); display: grid; grid-template-columns: 1fr 1fr; text-align: center; font-size: .74rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: #C9CCDA; }
.app-tabs span { padding: .55rem 0 .5rem; border-bottom: 3px solid transparent; }
.app-tabs .is-active { color: var(--app-tab); border-bottom-color: var(--app-tab); }
.app-group { background: var(--app-teal); color: #FFFFFF; display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem; font-size: .82rem; font-variant: small-caps; letter-spacing: .02em; }
.app-group svg { background: #59C77A; border-radius: 3px; padding: 2px; flex: none; }
.app-group b { font-weight: 700; }
.app-body { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem; padding: 1.2rem 1rem 1.6rem; text-align: center; }
.app-speaker { position: absolute; top: .7rem; right: .8rem; color: #2B2F3A; }
.app-hint { margin: 0; font-size: .82rem; font-variant: small-caps; letter-spacing: .03em; color: #8A8F9C; max-width: 15rem; }
.app-ptt {
  position: relative; width: 9.5rem; height: 9.5rem; border-radius: var(--radius-round); border: 0; cursor: pointer; overflow: hidden;
  background: transparent; padding: 0;
  display: flex; align-items: center; justify-content: center;
  touch-action: none; user-select: none; -webkit-user-select: none;
  transition: background-color .12s ease, transform .08s ease;
}
.app-ptt svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ptt-face { fill: var(--ptt-idle); transition: fill .12s ease; }
.ptt-shade { fill: var(--ptt-idle-shade); transition: fill .12s ease; }
.ptt-mic { fill: #F2E5FD; }
.app[data-state="talking"] .app-ptt { transform: scale(.97); }
.app[data-state="talking"] .ptt-face { fill: var(--ptt-talk); }
.app[data-state="talking"] .ptt-shade { fill: var(--ptt-talk-shade); }
.app[data-state="receiving"] .ptt-face { fill: var(--ptt-rx); }
.app[data-state="receiving"] .ptt-shade { fill: var(--ptt-rx-shade); }
.app-ptt:focus-visible { outline: 3px solid var(--app-teal); outline-offset: 5px; }
.app-state { margin: 0; font-size: .95rem; font-variant: small-caps; letter-spacing: .03em; color: #6E7380; min-height: 1.5em; }
.app[data-state="talking"] .app-state { color: var(--ptt-talk-shade); font-weight: 700; }
.app[data-state="receiving"] .app-state { color: var(--ptt-rx-shade); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .app-ptt, .ptt-face, .ptt-shade { transition: none; } .app[data-state="talking"] .app-ptt { transform: none; } }

.demo-caption { background: var(--night-line); color: var(--on-night); border-radius: var(--radius-sm); padding: .7rem .9rem; font-size: .92rem; line-height: 1.4; min-height: 3.6rem; }
.demo-caption .who { display: block; font-size: .75rem; font-weight: 700; color: var(--linx-blue); margin-bottom: .1rem; }
.demo-note { margin: 0; font-size: .78rem; color: var(--on-night-muted); text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Feature columns and diamond lists */
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 3rem); margin-top: 2.6rem; }
.col h3 { padding-bottom: .6rem; margin-bottom: .3rem; border-bottom: var(--rule-heavy) solid var(--logo-ink); }
.col ul, .plain { list-style: none; margin: 0; padding: 0; }
.col li, .plain li { position: relative; padding: .6rem 0 .6rem 1.6rem; border-bottom: var(--rule) solid var(--line); }
.col li::before, .plain li::before {
  content: ""; position: absolute; left: .15rem; top: 1.1rem;
  width: .5rem; height: .5rem; border: 2.5px solid var(--linx-blue); transform: rotate(45deg);
}
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Safety alarms */
.alarm-example { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-6); }
.alarms { margin: 0; display: grid; }
.alarms div { padding: 1.1rem 0; border-bottom: var(--rule) solid var(--night-line); display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; align-items: baseline; }
.alarms div:first-child { border-top: var(--rule) solid var(--night-line); }
.alarms dt { font-size: var(--step-1); font-weight: 800; color: var(--linx-blue); }
.alarms dd { margin: 0; color: #D6E2E9; }
@media (max-width: 520px) { .alarms div { grid-template-columns: 1fr; gap: .25rem; } }

.note { margin-top: 2rem; font-weight: 600; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 2.4rem; border-top: var(--rule-heavy) solid var(--logo-ink); }
.plan { padding: 1.4rem 1.6rem 1.4rem 0; }
.plan + .plan { padding-left: 1.6rem; border-left: var(--rule) solid var(--line); }
.plan p { color: var(--ink-muted); margin: 0; }
.deploy-note { margin-top: 2rem; font-weight: 600; }
@media (max-width: 760px) {
  .plans { grid-template-columns: 1fr; }
  .plan, .plan + .plan { padding: 1.2rem 0; border-left: 0; border-bottom: var(--rule) solid var(--line); }
}

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tags li { background: var(--surface); border: var(--rule) solid var(--line); border-radius: var(--radius-sm); padding: .5rem 1rem; font-weight: 600; }

/* Form (always on a night band) */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: var(--step--1); color: var(--on-night); }
.field input, .field textarea { font: inherit; color: #15202B; background: #FFFFFF; border: 2px solid transparent; border-radius: var(--radius-sm); padding: .7rem .8rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--linx-blue); box-shadow: 0 0 0 3px rgba(58, 176, 225, 0.45); }
.field input[aria-invalid="true"] { border-color: #FF7A45; }
.hp { position: absolute; left: -9999px; }
.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.form-status { margin: 0; font-weight: 600; color: var(--on-night); }
.contact-alt a { color: var(--linx-blue); }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { padding: 2.8rem 0; font-size: var(--step--1); color: #9FB2BE; background: var(--night); border-top: var(--rule) solid var(--night-line); }
.site-footer a { color: #D6E2E9; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem; align-items: start; }
.footer-logo { height: 32px; width: auto; margin-bottom: .9rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.copy { margin: 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
