/* =========================================================
   VK3AAX — site styles  (v1.0)
   Dark mode = lights off (switch lever UP)
   Light mode = lights on (switch lever DOWN)
   ========================================================= */

:root {
  /* Dark ("lights off") — default */
  --bg: #0c0e11;
  --bg-2: #12161b;
  --panel: #161b21;
  --panel-2: #1c2229;
  --line: #2a323b;
  --text: #ece6da;
  --muted: #9b968c;
  --amber: #ffb347;
  --amber-dim: #c98a30;
  --blue: #4aa3ff;          /* the SDR Station highlight blue */
  --green: #5fd38a;
  --yellow: #ffd34d;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --glow: 0 0 24px rgba(255, 179, 71, .18);
  --radius: 14px;
  --mono: "IBM Plex Mono", ui-monospace, "DejaVu Sans Mono", monospace;
  --sans: "IBM Plex Sans", system-ui, "Segoe UI", Ubuntu, sans-serif;
  color-scheme: dark;
}

html[data-theme="light"] {
  /* Light ("lights on") — warm, like a lamp-lit shack */
  --bg: #f5efe3;
  --bg-2: #efe7d7;
  --panel: #fffaf1;
  --panel-2: #f8f1e3;
  --line: #ddd2bd;
  --text: #1f1b16;
  --muted: #6c645a;
  --amber: #b3621a;
  --amber-dim: #8f4e15;
  --blue: #1f6fc4;
  --green: #2d8a52;
  --yellow: #a97a00;
  --shadow: 0 10px 28px rgba(80, 60, 30, .12);
  --glow: 0 0 0 transparent;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .45s ease, color .45s ease;
}

a { color: var(--amber); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }
img { max-width: 100%; display: block; }

.wrap { width: min(1100px, 100% - 40px); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--amber); color: #000; padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip:focus { left: 12px; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background-color .45s ease, border-color .45s ease;
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  min-height: 68px;
}
.logo {
  font-family: var(--mono); font-weight: 700; font-size: 1.35rem; letter-spacing: .08em;
  color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 10px;
}
.logo .dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 500;
  padding: 8px 14px; border-radius: 10px; transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--amber); }

/* ---------------- Bakelite light switch ---------------- */
.light-switch {
  background: none; border: 0; padding: 0; cursor: pointer;
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  -webkit-tap-highlight-color: transparent;
}
.light-switch svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)); }
html[data-theme="light"] .light-switch svg { filter: drop-shadow(0 3px 4px rgba(60,40,20,.3)); }
.light-switch .lever {
  transform-box: view-box;
  transform-origin: 32px 32px;
  transition: transform .16s cubic-bezier(.5, 1.8, .6, 1);
}
/* Australian convention: lever UP = off (dark), lever DOWN = on (light) */
html[data-theme="light"] .light-switch .lever { transform: scaleY(-1); }
.light-switch:hover svg { transform: scale(1.04); }
.light-switch svg { transition: transform .2s ease; }

/* ---------------- Waterfall ---------------- */
.waterfall-wrap { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: #05070a; }
html[data-theme="light"] .waterfall-wrap { background: #e9dfcc; }
.waterfall { display: block; width: 100%; height: 100%; }
.waterfall-wrap.slim { height: 46px; }
.waterfall-wrap.slim::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--bg));
  pointer-events: none;
}

.hero { height: clamp(320px, 52vh, 480px); }
.hero-overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  background:
    linear-gradient(to top, var(--bg) 2%, color-mix(in srgb, var(--bg) 55%, transparent) 45%, transparent 85%);
  pointer-events: none;
}
.hero-content { padding-bottom: 42px; pointer-events: auto; }
.hero h1 {
  font-family: var(--mono); font-weight: 700; margin: 0;
  font-size: clamp(3rem, 10vw, 6.2rem); letter-spacing: .06em; line-height: 1;
  text-shadow: 0 2px 30px rgba(0,0,0,.6);
}
html[data-theme="light"] .hero h1 { text-shadow: 0 2px 20px rgba(255,250,240,.9); }
.hero .tagline { margin: 14px 0 0; color: var(--muted); font-size: 1.1rem; }
.on-air {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 18px;
  font-family: var(--mono); font-size: .9rem; color: var(--text);
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px;
}
.on-air .led {
  width: 9px; height: 9px; border-radius: 50%; background: #ff4d4d;
  box-shadow: 0 0 8px #ff4d4d; animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .on-air .led { animation: none; } }

/* ---------------- Sections ---------------- */
main { display: block; }
.section { padding: 64px 0; }
.section + .section { padding-top: 8px; }
.eyebrow {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--amber); margin: 0 0 10px;
}
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); line-height: 1.2; margin: 0 0 18px; letter-spacing: -.01em; }
h3 { font-size: 1.2rem; margin: 0 0 8px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }

.page-head { padding: 48px 0 8px; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 10px; line-height: 1.15; }

/* Bio */
.bio { display: grid; grid-template-columns: 260px 1fr; gap: 44px; align-items: start; }
.bio p { margin: 0 0 16px; max-width: 64ch; }
.bio .signoff { font-family: var(--mono); color: var(--amber); font-size: 1.3rem; margin-top: 6px; }
@media (max-width: 760px) { .bio { grid-template-columns: 1fr; gap: 24px; } .bio .placeholder { max-width: 260px; } }

/* Placeholders for photos/screenshots */
.placeholder {
  aspect-ratio: var(--ratio, 4 / 3);
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  background:
    repeating-linear-gradient(135deg, transparent 0 12px, color-mix(in srgb, var(--line) 35%, transparent) 12px 13px),
    var(--panel);
  display: grid; place-items: center; text-align: center; padding: 16px;
  color: var(--muted); font-family: var(--mono); font-size: .82rem;
}
.placeholder span::before { content: "▣ "; color: var(--amber); }
figure { margin: 0; }
figcaption { color: var(--muted); font-size: .9rem; margin-top: 10px; }

/* ---------------- Project cards ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 28px; }
.chip {
  font: 500 .9rem var(--sans); color: var(--muted); cursor: pointer;
  background: var(--panel); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px; transition: all .2s;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--amber); border-color: var(--amber); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.card {
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background-color .45s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--amber-dim); box-shadow: var(--shadow), var(--glow); color: inherit; }
.card .thumb { --ratio: 16 / 9; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 1.3rem; margin: 0; }
.card p { margin: 0; color: var(--muted); }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; }
.badge {
  font: 600 .75rem var(--mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid currentColor;
}
.badge.active { color: var(--green); }
.badge.planning { color: var(--yellow); }
.badge.complete { color: var(--blue); }
.version { font: 500 .8rem var(--mono); color: var(--text); background: var(--panel-2); padding: 4px 9px; border-radius: 6px; }
.tag { font-size: .8rem; color: var(--muted); }
.tag::before { content: "#"; color: var(--amber-dim); }
.card .more { font-weight: 600; color: var(--amber); }
.empty { color: var(--muted); font-style: italic; }

/* ---------------- Project detail page ---------------- */
.project-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 40px 0 20px; }
@media (max-width: 860px) { .project-hero { grid-template-columns: 1fr; } }
.project-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 6px 0 14px; line-height: 1.1; }
.quote {
  font-size: 1.25rem; border-left: 3px solid var(--amber); padding: 4px 0 4px 18px; margin: 18px 0;
  color: var(--text); font-style: italic;
}
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 18px; }
.fact { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.fact b { display: block; font-family: var(--mono); color: var(--amber); font-size: 1.15rem; }
.fact small { color: var(--muted); }

.toc {
  position: sticky; top: 68px; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); margin-bottom: 10px;
}
.toc ul { list-style: none; margin: 0; padding: 10px 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.toc a { white-space: nowrap; text-decoration: none; color: var(--muted); font-size: .92rem; padding: 6px 12px; border-radius: 8px; }
.toc a:hover { color: var(--text); background: var(--panel); }

.station-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.station-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.station-item h3 { font-size: 1.05rem; color: var(--amber); font-family: var(--mono); }
.station-item p { margin: 0; color: var(--muted); font-size: .95rem; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.feature {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: .95rem;
}
.feature::before { content: "▸"; color: var(--blue); font-weight: 700; }

.highlight {
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center;
  padding: 34px 0; border-top: 1px solid var(--line);
}
.highlight:nth-of-type(even) .hl-media { order: -1; }
.highlight p { margin: 0 0 12px; }
.highlight .callout {
  background: var(--panel-2); border-left: 3px solid var(--blue); padding: 12px 16px; border-radius: 0 10px 10px 0;
  font-size: .95rem; color: var(--muted); margin-top: 14px;
}
.highlight .callout b { color: var(--text); }
@media (max-width: 860px) {
  .highlight { grid-template-columns: 1fr; gap: 18px; }
  .highlight:nth-of-type(even) .hl-media { order: 0; }
}
.warn { color: var(--yellow); font-weight: 600; }
.crit { color: #ff5c5c; font-weight: 600; }

.roadmap { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.roadmap li {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 16px 52px; position: relative;
}
.roadmap li::before {
  content: ""; position: absolute; left: 20px; top: 22px; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--yellow);
}
.roadmap b { display: block; }
.roadmap span { color: var(--muted); font-size: .95rem; }

.thanks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.thanks a, .thanks div {
  display: block; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; transition: border-color .2s;
}
.thanks a:hover { border-color: var(--amber-dim); }
.thanks b { display: block; font-family: var(--mono); color: var(--amber); }
.thanks small { color: var(--muted); }

.back { display: inline-flex; gap: 6px; text-decoration: none; color: var(--muted); font-size: .95rem; }
.back:hover { color: var(--amber); }

/* ---------------- Contact ---------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.contact-card h3 { font-family: var(--mono); color: var(--amber); }
.contact-card p { margin: 0; color: var(--muted); }
form { display: grid; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
label { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; }
label small { color: var(--muted); font-weight: 400; }
input, textarea {
  font: inherit; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; transition: border-color .2s;
}
input:focus, textarea:focus { outline: none; border-color: var(--amber); }
textarea { min-height: 150px; resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }
.btn {
  justify-self: start; font: 600 1rem var(--sans); cursor: pointer;
  background: var(--amber); color: #1a1208; border: 0; border-radius: 10px; padding: 12px 22px;
  transition: transform .15s, filter .2s;
}
html[data-theme="light"] .btn { color: #fffaf1; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.form-note { color: var(--muted); font-size: .88rem; margin: 0; }
.form-status { font-size: .95rem; margin: 0; color: var(--green); min-height: 1.4em; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 30px 0 40px; color: var(--muted); font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 14px 30px; justify-content: space-between; align-items: center; }
.site-footer .call { font-family: var(--mono); color: var(--text); font-weight: 700; letter-spacing: .06em; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--amber); }

/* ---------------- Small screens ---------------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-inner { gap: 8px; min-height: 60px; }
  .logo { font-size: 1.1rem; }
  .logo .dot { display: none; }
  .nav a { padding: 7px 9px; font-size: .95rem; }
  .light-switch { width: 44px; height: 44px; }
  .toc { top: 60px; }
  .section { padding: 44px 0; }
}

/* =========================================================
   v1.1 additions
   ========================================================= */

/* Status badges */
.badge.in-the-making { color: var(--yellow); }
.badge.on-the-back-burner { color: var(--muted); }
.card-new {
  margin: 0; font: 600 .78rem var(--mono); letter-spacing: .04em; color: var(--yellow);
}
.card.status-in-the-making { border-style: dashed; }
.card.status-on-the-back-burner .thumb { filter: saturate(.4); opacity: .8; }
.card .thumb { position: relative; }
.tux-mark {
  position: absolute; top: 10px; right: 10px; width: 26px; height: auto;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); opacity: .9;
}
.chip-status { font-weight: 600; }
.chip-gap { width: 1px; align-self: stretch; background: var(--line); margin: 0 6px; }

/* Linux Only / Free Software badge */
.linux-badge {
  position: relative; display: inline-block; width: 170px; aspect-ratio: 1; flex: none;
}
.linux-badge .badge-ring { width: 100%; height: 100%; display: block; overflow: visible; }
.linux-badge .ring-outer { fill: var(--panel-2); stroke: var(--amber); stroke-width: 3; }
.linux-badge .ring-inner { fill: var(--bg); stroke: var(--amber-dim); stroke-width: 1.5; }
.linux-badge .ring-text { fill: var(--amber); font: 700 17px var(--mono); letter-spacing: 3px; }
.linux-badge .ring-star { fill: var(--amber); font-size: 12px; }
.linux-badge .badge-tux {
  position: absolute; left: 50%; top: 50%; width: 46%; transform: translate(-50%, -52%);
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.35));
}
html[data-theme="light"] .linux-badge .ring-inner { fill: #fffdf7; }
.linux-badge.small { width: 46px; }
.linux-badge.small .ring-text, .linux-badge.small .ring-star { display: none; }
.linux-badge.small .ring-outer { stroke-width: 6; }
.linux-badge.small .badge-tux { width: 60%; }

.footer-linux { display: inline-flex; align-items: center; gap: 12px; }
.footer-linux small { display: block; line-height: 1.35; }

/* Project pages */
.intro-with-badge { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; }
@media (max-width: 640px) { .intro-with-badge { grid-template-columns: 1fr; } .intro-with-badge .linux-badge { width: 140px; } }
.prose p { max-width: 68ch; margin: 0 0 16px; }
.prose h3 { margin-top: 26px; color: var(--amber); font-family: var(--mono); font-size: 1.05rem; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.group { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.group h3 { font-family: var(--mono); color: var(--amber); font-size: 1.02rem; }
.group p { margin: 0; color: var(--muted); }
.notice {
  display: flex; gap: 14px; align-items: flex-start;
  background: color-mix(in srgb, var(--yellow) 10%, var(--panel)); border: 1px dashed var(--yellow);
  border-radius: 12px; padding: 16px 20px; margin: 22px 0; max-width: 68ch;
}
.notice b { color: var(--yellow); }
.notice.parked { background: var(--panel); border-color: var(--muted); }
.notice.parked b { color: var(--text); }
.notice .icon { font-size: 1.4rem; line-height: 1.2; }
.follow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.follow a {
  text-decoration: none; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 16px; color: var(--text);
}
.follow a:hover { border-color: var(--amber-dim); color: var(--amber); }
.card .thumb .tux-mark { width: 26px; height: auto; object-fit: contain; }
.project-hero .linux-badge { width: 140px; }

/* =========================================================
   v1.2 additions
   ========================================================= */
/* On Air states */
.on-air[data-state="off"] .led { background: var(--muted); box-shadow: none; animation: none; opacity: .6; }
.on-air[data-state="qrl"] .led { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.on-air[data-state="qrx"] .led { background: var(--amber); box-shadow: 0 0 6px var(--amber); animation: none; }
.on-air[data-state="qrv"] { border-color: color-mix(in srgb, #ff4d4d 50%, var(--line)); }
.on-air { max-width: 100%; flex-wrap: nowrap; }
.on-air-text { white-space: normal; }

/* What's changed */
.changelog { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--line); max-width: 760px; }
.changelog li { position: relative; padding: 0 0 22px 18px; }
.changelog li::before {
  content: ""; position: absolute; left: -30px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--amber);
}
.changelog li:first-child::before { background: var(--amber); }
.cl-when { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.cl-date { font: 600 .85rem var(--mono); color: var(--amber); }
.changelog p { margin: 0; }

/* Drop me a line */
.drop-line {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px;
}
.drop-line p { margin: 0; font-size: 1.1rem; }
.drop-line .btn { text-decoration: none; }
.thanks div b { color: var(--text); }

/* =========================================================
   v1.3 additions
   ========================================================= */
.badge.proof-of-concept { color: var(--blue); }
.placeholder.has-img { padding: 0; display: block; background: var(--panel-2); }
.placeholder.has-img img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.mockup-tag, .shot-tag {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  font: 600 .72rem var(--mono); letter-spacing: .06em; text-transform: uppercase;
  background: rgba(10,12,15,.82); color: var(--yellow); border: 1px dashed var(--yellow);
  padding: 3px 9px; border-radius: 999px;
}
.shot { position: relative; margin: 0; }
.shot img {
  width: 100%; height: auto; display: block; border-radius: 12px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.shot.small img { max-width: 340px; }
.shot figcaption { margin-top: 10px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.related { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.related a {
  text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 14px;
}
.related a:hover { border-color: var(--amber-dim); color: var(--amber); }
.related a::after { content: " →"; color: var(--amber); }

/* =========================================================
   v1.4 additions
   ========================================================= */
@font-face {
  font-family: "Bonum";
  src: url("../fonts/texgyrebonum-bold.woff") format("woff");
  font-weight: 700; font-style: normal; font-display: swap;
}
:root { --head: #f3e6cf; --block-bg: #4a2e19; --block-fg: #f6eedb; --block-edge: #c98a30;
  --display: "Bonum", "TeX Gyre Bonum", "URW Bookman", "Bookman Old Style", Georgia, serif; }
html[data-theme="light"] { --head: #4a2e19; --block-bg: #fffaf1; --block-fg: #4a2e19; --block-edge: #4a2e19; }

/* Headings in Bookman (TeX Gyre Bonum) */
h1, h2, h3, .card h3, .page-head h1, .project-hero h1 {
  font-family: var(--display); font-weight: 700; color: var(--head); letter-spacing: 0;
}
.group h3, .station-item h3, .contact-card h3, .prose h3 { font-family: var(--display); }

/* Block logo */
.blocks { display: inline-flex; gap: var(--bgap, 8px); perspective: 700px; vertical-align: middle; }
.blocks .slot { display: block; }
.blocks .blk { display: block; width: var(--bw); height: calc(var(--bw) * 1.11); position: relative; transform-style: preserve-3d; cursor: pointer; }
.blocks .face {
  position: absolute; inset: 0; border-radius: calc(var(--bw) * .2);
  display: flex; align-items: center; justify-content: center; backface-visibility: hidden;
  font-family: var(--display); font-weight: 700; font-size: calc(var(--bw) * .68); line-height: 1;
  background: var(--block-bg); color: var(--block-fg); border: max(1.5px, calc(var(--bw) * .03)) solid var(--block-edge);
  transition: background-color .45s ease, color .45s ease, border-color .45s ease;
}
.blocks .back { transform: rotateY(180deg); }
.blocks .back svg { width: 52%; height: 52%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.blocks .back img { width: 56%; height: auto; }
.blocks.big { --bw: clamp(44px, 10.5vw, 86px); --bgap: clamp(5px, 1.2vw, 11px); }
.blocks.small { --bw: 25px; --bgap: 3px; }
.logo { gap: 0; }
.hero h1.hero-logo { margin: 0 0 4px; line-height: 1; text-shadow: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 640px) { .blocks.small { --bw: 21px; --bgap: 2px; } }
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; row-gap: 2px; padding: 8px 0 6px; }
  .light-switch { margin-left: auto; }
  .nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .nav a { padding: 6px 8px; }
  .toc { top: 98px; }
}
@media (max-width: 420px) {
  .nav { gap: 0; }
  .nav a { padding: 6px 5px; font-size: .88rem; }
}

/* =========================================================
   v1.7 additions: "Creative Technologies" nameplate
   Home: a Bakelite nameplate under the six blocks, with a brass
   screw at each end. It slides in once the blocks have landed
   (first page of a visit) and then sits still.
   Header: a small line under the blocks, desktop only.
   ========================================================= */
.lockup { display: inline-flex; flex-direction: column; align-items: stretch; vertical-align: middle; }
.lockup.big { --bw: clamp(44px, 10.5vw, 86px); }

.nameplate {
  position: relative; display: flex; align-items: center; justify-content: center;
  margin-top: calc(var(--bw) * .2);
  height: max(24px, calc(var(--bw) * .42));
  padding: 0 calc(var(--bw) * .42);
  border-radius: calc(var(--bw) * .11);
  background: var(--block-bg); color: var(--block-fg);
  border: max(1.5px, calc(var(--bw) * .03)) solid var(--block-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 3px 10px rgba(0, 0, 0, .28);
  font-family: var(--display); font-weight: 700; line-height: 1; white-space: nowrap;
  font-size: max(10px, calc(var(--bw) * .19)); letter-spacing: .26em; text-transform: uppercase;
  opacity: 0;   /* shown by main.js, so it can't appear before the blocks do */
  transition: background-color .45s ease, color .45s ease, border-color .45s ease;
}
.nameplate span { margin-right: -.26em; }   /* keeps the words centred despite the letter spacing */
.lockup.ready .nameplate { opacity: 1; }
/* the two brass screws */
.nameplate::before, .nameplate::after {
  content: ""; position: absolute; top: 50%;
  width: max(5px, calc(var(--bw) * .085)); height: max(5px, calc(var(--bw) * .085)); border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f6dfa8, var(--block-edge) 58%, #5a3a14);
  transform: translateY(-50%);
}
.nameplate::before { left: calc(var(--bw) * .16); }
.nameplate::after { right: calc(var(--bw) * .16); }
html[data-theme="light"] .nameplate { box-shadow: 0 2px 8px rgba(80, 60, 30, .14); }

/* Header: a small line under the blocks, desktop only */
.lockup.small { align-items: center; }
.lockup-line {
  margin-top: 3px; font-family: var(--display); font-weight: 700; line-height: 1; white-space: nowrap;
  font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--head); opacity: .85;
  transition: color .45s ease;
}
@media (max-width: 640px) { .lockup-line { display: none; } }

/* v1.7.1: on the Home page the big nameplate already says it, so the small header line steps aside */
body.home .lockup-line { display: none; }

/* v1.7.3: a full-width Highlight (World map): big picture, text in two columns, small gallery underneath */
.highlight.hl-wide { grid-template-columns: 1fr; gap: 22px; align-items: start; }
.hl-wide > div > p:last-child { margin-bottom: 0; }
.hl-wide .hl-cols { columns: 2 340px; column-gap: 36px; }
.hl-wide .hl-cols p { break-inside: avoid; }
.hl-wide .callout { margin-top: 0; }
.hl-wide .gallery { margin-top: 4px; }

/* v1.7.5: On Air in the agreed colours, its new home in the Contact card,
   and the little status dot on the SDR Station card */
:root { --red: #ff5a52; }
html[data-theme="light"] { --red: #c8322b; }
.on-air[data-state] .led { animation: none; opacity: 1; }
.on-air[data-state="qrv"] .led { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2.4s ease-in-out infinite; }
.on-air[data-state="qrv"] { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); }
.on-air[data-state="qrl"] .led { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 2.4s ease-in-out infinite; }
.on-air[data-state="qrx"] .led { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.on-air[data-state="off"] .led { background: var(--red); box-shadow: 0 0 5px color-mix(in srgb, var(--red) 60%, transparent); }
.contact-card .on-air { margin-top: 14px; font-size: .85rem; }

.onair-dot {
  display: inline-block; width: 11px; height: 11px; margin-left: 8px; vertical-align: middle;
  border-radius: 50%; box-sizing: border-box; border: 2px solid var(--muted); background: transparent;
  position: relative; top: -2px; opacity: .75;
}
.onair-dot[data-state="qrv"] { border-color: var(--green); background: var(--green); box-shadow: 0 0 8px var(--green); opacity: 1; animation: pulse 2.4s ease-in-out infinite; }
.onair-dot[data-state="qrl"] { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 8px var(--amber); opacity: 1; animation: pulse 2.4s ease-in-out infinite; }
.onair-dot[data-state="qrx"] { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 6px var(--amber); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .on-air .led, .onair-dot { animation: none !important; } }

/* v1.7.5: Thanks & links on the About page, the SDR page's pointer to it, and illustrations */
.thanks-group { font-size: 1.05rem; margin: 26px 0 12px; color: var(--muted); letter-spacing: .02em; }
.thanks-group:first-of-type { margin-top: 0; }
.thanks-pointer { margin: 0; color: var(--muted); }
.shot.illustration object, .shot.illustration img { display: block; width: 100%; height: auto; border-radius: 12px; }
.card .thumb.has-img img[src$=".svg"] { object-fit: contain; background: #15171b; }
/* v1.7.5: contact form sends directly */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#contact-form { position: relative; }
.callsign-field { max-width: calc(50% - 8px); }
@media (max-width: 560px) { .callsign-field { max-width: none; } }
#contact-form button[disabled] { opacity: .6; cursor: wait; }
.form-status a { color: var(--amber); }

/* v1.7.6: "On the drawing board" status, with its light bulb */
.badge.on-the-drawing-board { color: var(--amber); display: inline-flex; align-items: center; gap: 6px; }
.bulb { display: inline-block; width: 11px; height: 15px; line-height: 0; }
.bulb svg { width: 100%; height: 100%; overflow: visible; }
.bulb .glass { fill: #ffcf5a; filter: drop-shadow(0 0 3px rgba(255, 196, 70, .85)); }
.bulb .base { fill: var(--muted); }
html[data-theme="light"] .bulb .glass { fill: #f0a81e; filter: drop-shadow(0 0 2px rgba(240, 160, 20, .7)); }
.bulb.flick { animation: bulb-wobble 1.5s ease-out both; transform-origin: 50% 90%; }
.bulb.flick .glass { animation: bulb-flicker 1.5s linear both; }
@keyframes bulb-flicker {
  0%   { opacity: 1; }
  8%   { opacity: .12; }
  20%  { opacity: .12; }
  24%  { opacity: .75; }
  29%  { opacity: .15; }
  36%  { opacity: .55; }
  40%  { opacity: .12; }
  52%  { opacity: .12; }
  56%  { opacity: 1; }
  100% { opacity: 1; }
}
@keyframes bulb-wobble {
  0%, 55% { transform: rotate(0) scale(1); }
  62%  { transform: rotate(-12deg) scale(1.15); }
  72%  { transform: rotate(9deg) scale(1.08); }
  82%  { transform: rotate(-5deg); }
  92%  { transform: rotate(2deg); }
  100% { transform: rotate(0) scale(1); }
}
.notice.drawing-board .icon .bulb { width: 14px; height: 19px; }
/* v1.7.6: phone-screen mockups stay phone-sized */
.shot.phone { max-width: 300px; margin-left: auto; margin-right: auto; position: relative; }
.gallery.phones { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; }
.gallery.phones .shot.phone { flex: 0 1 280px; margin: 0; }
.card .thumb.has-img { overflow: hidden; }
.card .thumb.has-img img { position: absolute; inset: 0; }

.shot.phone { padding-top: 30px; }
.shot.phone .mockup-tag { top: 0; left: 0; }

/* v1.7.8: "Up and running": complete and working, still gaining features */
.badge.up-and-running { color: #10190f; background: var(--green); border-color: var(--green); }
html[data-theme="light"] .badge.up-and-running { color: #fff; }
