/* SP7TEAM EMCOM site. Colours are the radio's: housing greys, the LCD black and the
   firmware state colours (RX green, TX red, SCAN amber, info blue). */
:root {
  --housing: #1d211b;
  --panel: #262b23;
  --panel-2: #2e3429;
  --line: #3a4235;
  --ink: #e9eee7;
  --mut: #a1ab9d;
  --lcd: #0b0e0c;
  --rx: #3bd16f;
  --tx: #ff3b30;
  --scan: #ffb000;
  --info: #5ac8fa;
  --night: #d22a2a;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--housing);
  color: var(--ink);
  font: 400 17px/1.6 'Barlow', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html[data-lang="pl"] [data-l="en"],
html[data-lang="en"] [data-l="pl"] { display: none !important; }

h1, h2, h3 {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.005em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(44px, 7vw, 84px); }
h2 { font-size: clamp(32px, 4.2vw, 46px); }
h3 { font-size: 24px; font-weight: 600; }
p { margin: 0 0 1em; max-width: 68ch; }
a { color: var(--info); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
code, kbd, pre { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.86em; }
code { background: var(--panel-2); padding: 0.1em 0.35em; border-radius: 3px; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; padding: 0 0.35em; border-radius: 4px; background: var(--panel); }
:focus-visible { outline: 2px solid var(--scan); outline-offset: 3px; }

/* ---- top bar ---- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--housing) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
  font: 600 20px/1 'Barlow Condensed', sans-serif; letter-spacing: 0.02em; }
.brand svg { width: 26px; height: 26px; color: var(--rx); }
.brand b { color: var(--rx); font-weight: 700; }
nav { display: flex; align-items: center; gap: clamp(10px, 2.5vw, 26px); }
nav a { color: var(--mut); text-decoration: none; font-weight: 500; }
nav a:hover { color: var(--ink); }
nav .nav-flash { color: var(--scan); }
.lang { font: 600 14px/1 'Barlow', sans-serif; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px; cursor: pointer; }
@media (max-width: 520px) { nav a:not(.nav-flash) { display: none; } }

main > section { max-width: var(--wrap); margin: 0 auto; padding: clamp(56px, 9vw, 110px) var(--gutter) 0; }
.section-lead { color: var(--mut); font-size: 19px; margin-bottom: 32px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 17px/1 'Barlow', sans-serif; text-decoration: none; cursor: pointer;
  color: var(--ink); background: var(--panel-2); border: 1px solid var(--line);
  padding: 13px 20px; border-radius: 6px;
}
.btn:hover { border-color: var(--mut); color: var(--ink); }
.btn.primary { background: var(--scan); border-color: var(--scan); color: #1a1405; }
.btn.primary:hover { background: #ffc233; }
.btn.big { font-size: 19px; padding: 16px 26px; }
.btn.small { font-size: 15px; padding: 9px 14px; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.btn.file:focus-within { outline: 2px solid var(--scan); outline-offset: 3px; }

/* ---- hero ---- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: clamp(32px, 5vw, 64px);
  align-items: center; padding-top: clamp(40px, 7vw, 90px) !important;
}
.lead { font-size: 20px; color: #cdd5c9; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 18px; }
.release-line { color: var(--mut); font-size: 15px; }
.release-line b { color: var(--ink); font-weight: 600; }

.radio { margin: 0; }
/* the display window of the RT3S front panel */
.bezel {
  padding: clamp(12px, 2vw, 20px);
  background: linear-gradient(160deg, #343a31, #22271f 55%, #1a1e17);
  border-radius: 18px 18px 26px 26px;
  border: 1px solid #454d40;
  box-shadow: inset 0 1px 0 #4d5647, inset 0 -2px 0 #11140f;
}
.lcd {
  display: block; width: 100%; height: auto;
  image-rendering: pixelated;
  background: var(--lcd);
  border-radius: 4px;
}
.bezel .lcd { border-radius: 3px; box-shadow: 0 0 0 1px #0a0c09, inset 0 0 0 1px #000; }
.states { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.states button {
  font: 600 15px/1 'Barlow Condensed', sans-serif; letter-spacing: 0.03em;
  color: var(--mut); background: transparent; border: 1px solid var(--line);
  padding: 7px 11px; border-radius: 3px; cursor: pointer;
}
.states button:hover { color: var(--ink); }
.states button[aria-pressed="true"] { color: #08110b; border-color: transparent; background: var(--ink); }
.states button[aria-pressed="true"][data-state="rx"] { background: var(--rx); }
.states button[aria-pressed="true"][data-state="tx"] { background: var(--tx); color: #fff; }
.states button[aria-pressed="true"][data-state="scan"] { background: var(--scan); }
.states button[aria-pressed="true"][data-state="night"] { background: var(--night); color: #fff; }
#heroScreen { transition: opacity 0.12s; }
#heroScreen.swap { opacity: 0.25; }

/* ---- about ---- */
.about { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); }
.specs { margin: 0; border-top: 1px solid var(--line); }
.specs div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--mut); }
.specs dd { margin: 0; }

/* ---- features ---- */
.feature { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.feature.reverse > img { order: 2; }

.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.tool-grid article { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 6px; }
.tool-grid h3 { margin: 16px 4px 6px; }
.tool-grid p { margin: 0 4px 12px; color: #cdd5c9; font-size: 16px; }

/* ---- gallery ---- */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px 18px; }
.shots figure { margin: 0; }
.shots figcaption { color: var(--mut); font-size: 15px; margin-top: 8px; line-height: 1.35; }
.shots button { all: unset; display: block; cursor: zoom-in; width: 100%; border-radius: 4px; }
.shots button:focus-visible { outline: 2px solid var(--scan); outline-offset: 3px; }

dialog.zoom { border: 0; padding: 0; background: transparent; max-width: min(960px, 94vw); }
dialog.zoom::backdrop { background: rgba(6, 8, 6, 0.86); }
dialog.zoom img { width: 100%; }
dialog.zoom p { color: var(--ink); text-align: center; margin: 10px auto 0; }

/* ---- flasher ---- */
.notice { border: 1px solid var(--scan); background: color-mix(in srgb, var(--scan) 10%, var(--panel)); border-radius: 8px; padding: 16px 18px 2px; margin-bottom: 26px; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps > li {
  counter-increment: step; position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 22px 24px 22px 76px;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 22px; top: 18px;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font: 700 22px/1 'Barlow Condensed', sans-serif; color: var(--housing); background: var(--mut);
}
.steps ul { margin: 0; padding-left: 1.1em; }
.steps ul li { margin-bottom: 6px; max-width: 72ch; }

.form { display: grid; grid-template-columns: 12em minmax(0, 1fr); gap: 16px 20px; align-items: start; max-width: 860px; }
.form > label, .form > .label { padding-top: 10px; color: var(--mut); }
select {
  font: inherit; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 9px 12px; width: 100%; max-width: 420px;
}
.donor-state { margin: 8px 0 10px; }
.ok { color: var(--rx); }
.warn { color: var(--scan); }
.bad { color: #ff6b61; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
details summary { cursor: pointer; color: var(--info); margin-top: 12px; }
details p { margin-top: 10px; color: #cdd5c9; font-size: 16px; }
.advanced { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 4px; }
.own-state { margin-top: 10px; font-size: 16px; }

.summary { color: #cdd5c9; }
.progress { margin-top: 22px; max-width: 640px; }
.bar { height: 12px; border-radius: 6px; background: var(--lcd); border: 1px solid var(--line); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--rx); transition: width 0.2s linear; }
.progress.erasing .bar > div { background: var(--scan); }
.progress p { margin-top: 8px; color: var(--mut); font-variant-numeric: tabular-nums; }
.result { margin-top: 16px; font-weight: 500; }
.result:empty { display: none; }

.trouble { margin-top: 28px; }
.trouble dl { margin: 14px 0 0; }
.trouble dt { font-weight: 600; margin-top: 16px; }
.trouble dd { margin: 4px 0 0; color: #cdd5c9; max-width: 72ch; }

/* ---- downloads ---- */
.files { list-style: none; padding: 0; margin: 0 0 24px; border-top: 1px solid var(--line); max-width: 860px; }
.files li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.files .meta { color: var(--mut); font-size: 15px; }
.cli { background: var(--lcd); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; overflow-x: auto; max-width: 860px; color: #cdd5c9; }
.cli code { background: none; padding: 0; }

footer { max-width: var(--wrap); margin: clamp(70px, 10vw, 120px) auto 0; padding: 28px var(--gutter) 48px; border-top: 1px solid var(--line); color: var(--mut); font-size: 15px; }

/* ---- small screens ---- */
@media (max-width: 960px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .hero, .about, .feature { grid-template-columns: minmax(0, 1fr); }
  .feature.reverse > img { order: 0; }
  .feature > img { max-width: 480px; }
  .form { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .form > label, .form > .label { padding-top: 12px; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  .steps > li { padding: 64px 18px 18px; }
  .steps > li::before { left: 18px; }
  .specs div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

.choice { display: grid; gap: 8px; padding-top: 8px; }
.choice label { display: flex; align-items: baseline; gap: 10px; cursor: pointer; }
.choice input { accent-color: var(--scan); }
