/* ==========================================================================
   Pamirel — design tokens
   Palette grounded in the product itself: a cool "LCD screen" blue-grey
   against warm paper, with an amber "heating element" accent for action.
   ========================================================================== */

:root {
  --ink: #14181a;
  --ink-soft: #4b5457;
  --paper: #efeeea;
  --panel: #e2e0d7;
  --panel-dark: #1b2124;
  --line: #c9c6bc;
  --line-dark: #333d40;
  --lcd: #4a7285;
  --lcd-bright: #6fa2b8;
  --heat: #d97a2b;
  --heat-bright: #ea9142;
  --white: #fbfaf7;

  --font-display: "Space Grotesk", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --radius: 3px;
  --max: 1180px;
}

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

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

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---- utility type ---- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lcd);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--heat);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 { font-size: clamp(38px, 5.4vw, 64px); }
h2 { font-size: clamp(28px, 3.6vw, 38px); }
h3 { font-size: 20px; }

p { color: var(--ink-soft); }

.mono { font-family: var(--font-mono); }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(239, 238, 234, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 26px; width: auto; }

nav.primary-nav { display: flex; align-items: center; gap: 34px; }

nav.primary-nav a {
  text-decoration: none;
  font-size: 14px;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}

nav.primary-nav a.current,
nav.primary-nav a:hover { color: var(--lcd); }

nav.primary-nav a.current::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--heat);
}

.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--heat); border-color: var(--heat); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--lcd); color: var(--lcd); }

.btn-small { padding: 9px 14px; font-size: 12px; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: 84px 0 96px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

.hero h1 { margin-bottom: 22px; }
.hero h1 span { color: var(--lcd); }

.hero-copy p { max-width: 44ch; font-size: 17px; margin-bottom: 34px; }

.hero-actions { display: flex; gap: 14px; margin-bottom: 44px; }

.hero-facts {
  display: flex;
  gap: 32px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.hero-facts div { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
.hero-facts strong {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  font-weight: 600;
}

/* ---- signature element: the LCD panel ---- */

.lcd-panel {
  background: var(--panel-dark);
  border-radius: 10px;
  padding: 30px;
  position: relative;
  box-shadow: 0 30px 60px -20px rgba(20, 24, 26, 0.45);
}

.lcd-panel::before {
  content: "PAMIREL · CH-01";
  position: absolute;
  top: 14px; left: 30px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #5c6a6e;
}

.lcd-screen {
  background: linear-gradient(160deg, #c9d8dc, #a9bfc4);
  border-radius: 4px;
  padding: 28px 26px 22px;
  margin-top: 26px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.18);
}

.lcd-row-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #33474d;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.lcd-readout {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 64px;
  color: #1c2e33;
  letter-spacing: 0.01em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.lcd-readout small { font-size: 22px; }

.lcd-caption {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #33474d;
  margin-top: 10px;
  min-height: 16px;
}

.lcd-modes {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.lcd-modes span {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 10px 0;
  border-radius: 3px;
  border: 1px solid var(--line-dark);
  color: #7d8b8f;
}

.lcd-modes span.active {
  background: var(--heat);
  color: var(--white);
  border-color: var(--heat);
}

/* ==========================================================================
   Spec strip
   ========================================================================== */

.spec-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.spec-strip .wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.spec-strip .spec {
  padding: 26px 28px;
  border-left: 1px solid var(--line);
}
.spec-strip .spec:first-child { border-left: none; }

.spec .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.spec .value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
}

/* ==========================================================================
   Sections
   ========================================================================== */

section { padding: 96px 0; }
section.tight { padding: 64px 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.section-head p { max-width: 52ch; margin: 12px 0 0; }

/* ---- product cards (index preview + full grid) ---- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.product-grid.full { grid-template-columns: repeat(3, 1fr); }

.product-card {
  background: var(--paper);
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.product-card .thumb {
  aspect-ratio: 4 / 4;
  overflow: hidden;
  background: var(--panel);
  margin-bottom: 18px;
  border-radius: 2px;
}

.product-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card .code {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--lcd);
  margin-bottom: 6px;
}

.product-card h3 { margin-bottom: 8px; }
.product-card p.desc { font-size: 14px; margin-bottom: 18px; flex-grow: 1; }

.spec-row {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-bottom: 18px;
}

.spec-row div { display: flex; justify-content: space-between; }
.spec-row span:last-child { color: var(--ink); }

.card-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- video ---- */

.video-section .wrap {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: center;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--panel-dark);
  border-radius: 6px;
  overflow: hidden;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-copy ul {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
}

.video-copy li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
}

.video-copy li span.n { color: var(--heat); }

/* ---- contact ---- */

.contact-section { background: var(--panel-dark); color: var(--white); }
.contact-section .eyebrow { color: var(--lcd-bright); }
.contact-section .eyebrow::before { background: var(--heat-bright); }
.contact-section p { color: #b6bfc2; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

.contact-card {
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 28px;
}

.contact-card .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7d8b8f;
  margin-bottom: 10px;
}

.contact-card a, .contact-card .val {
  font-family: var(--font-display);
  font-size: 20px;
  text-decoration: none;
  color: var(--white);
}

.contact-card + .contact-card { margin-top: 20px; }

/* ==========================================================================
   Product detail pages
   ========================================================================== */

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  padding: 22px 0 0;
}
.breadcrumb a { text-decoration: none; color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--lcd); }
.breadcrumb .sep { margin: 0 8px; color: var(--line); }
.breadcrumb .current { color: var(--ink); }

.product-hero {
  padding: 40px 0 72px;
}

.product-hero .wrap {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
  align-items: center;
}

.product-hero .thumb-large {
  aspect-ratio: 4 / 4.8;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0px;
  overflow: visible;
}
.product-hero .thumb-large img { width: 100%; height: 100%; object-fit: cover; }

.product-hero h1 { margin: 10px 0 18px; font-size: clamp(30px, 3.6vw, 44px); }
.product-hero .tagline { font-size: 17px; max-width: 52ch; margin-bottom: 28px; }
.product-hero .hero-actions { margin-bottom: 0; }

.todo-flag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--heat);
  border: 1px dashed var(--heat);
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 16px;
}

/* ---- diagram flow (command -> actuator -> devices) ---- */

.diagram-flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
}

.diagram-node {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 22px;
  min-width: 180px;
  flex: 1;
}

.diagram-node .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lcd);
  margin-bottom: 8px;
}

.diagram-node .title { font-family: var(--font-display); font-weight: 600; font-size: 17px; margin-bottom: 6px; }
.diagram-node .sub { font-size: 13px; color: var(--ink-soft); line-height: 1.4; }

.diagram-node.devices ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.diagram-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--heat);
  text-align: center;
  min-width: 90px;
  flex-direction: column;
  gap: 4px;
}
.diagram-arrow .line { width: 100%; height: 1px; background: var(--heat); position: relative; }
.diagram-arrow .line::after {
  content: "";
  position: absolute; right: 0; top: -3px;
  border-left: 6px solid var(--heat);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

@media (max-width: 760px) {
  .diagram-flow { flex-direction: column; }
  .diagram-arrow { min-width: 0; padding: 10px 0; flex-direction: row; }
  .diagram-arrow .line { height: 1px; width: 60%; }
}

/* ---- feature grid ---- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.feature-item {
  background: var(--paper);
  padding: 22px 24px;
}

.feature-item .n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--heat);
  display: block;
  margin-bottom: 8px;
}

.feature-item h4 { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.feature-item p { font-size: 14px; margin: 0; }

@media (max-width: 640px) {
  .feature-grid { grid-template-columns: 1fr; }
}

/* ---- full spec table ---- */

.spec-table-full {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}

.spec-table-full tr { border-top: 1px solid var(--line); }
.spec-table-full tr:first-child { border-top: none; }

.spec-table-full td {
  padding: 14px 18px;
  vertical-align: top;
}

.spec-table-full td:first-child {
  color: var(--ink-soft);
  width: 34%;
  letter-spacing: 0.02em;
}

.spec-table-full td:last-child { color: var(--ink); }

/* ---- downloads ---- */

.downloads-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px 20px;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  transition: border-color 0.15s ease;
}
.download-card:hover { border-color: var(--lcd); }
.download-card.disabled { opacity: 0.5; pointer-events: none; }

.download-card .dl-label { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.download-card .dl-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); margin-top: 4px; }
.download-card .dl-icon { font-family: var(--font-mono); font-size: 18px; color: var(--heat); }

@media (max-width: 640px) {
  .downloads-grid { grid-template-columns: 1fr; }
}

/* ---- technical diagram figures (real wiring/dimension images) ---- */

.diagram-figure {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 4px;
  padding: 22px;
  margin: 0;
}

.diagram-figure img {
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.diagram-figure figcaption {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.diagram-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 760px) {
  .diagram-two-col { grid-template-columns: 1fr; }
}

/* ---- stat row (icon-free number callouts, matches datasheet's 5-stat strip) ---- */

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  margin: 30px 0;
}

.stat-row .stat { min-width: 100px; }
.stat-row .stat .value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
}
.stat-row .stat .label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* ---- two-column feature list (control unit / actuator unit style) ---- */

.feature-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.feature-columns h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.feature-columns ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-columns li {
  font-size: 14px;
  color: var(--ink-soft);
  padding-left: 16px;
  position: relative;
}

.feature-columns li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--heat);
}

@media (max-width: 700px) {
  .feature-columns { grid-template-columns: 1fr; }
}

/* ---- compact product page variants ---- */

section.compact { padding: 40px 0; }

.product-hero.compact { padding: 28px 0 40px; }

.thumb-large.on-black { background: #000; }
.thumb-large.contain img { object-fit: contain; }

/* ---- tabbed section menu ---- */

.tab-section { padding: 8px 0 64px; }

.tab-menu {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-menu::-webkit-scrollbar { display: none; }

.tab-menu button {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: none;
  border: none;
  border-radius: 4px 4px 0 0;
  border-bottom: 3px solid transparent;
  padding: 14px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.tab-menu button:hover { color: var(--lcd); background: var(--panel); }

.tab-menu button.active {
  color: var(--white);
  background: var(--ink);
  border-bottom-color: var(--heat);
  font-weight: 600;
}

.tab-menu button.active:hover { color: var(--white); background: var(--ink); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: tab-fade 0.2s ease; }

@keyframes tab-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
  .tab-menu button { padding: 12px 14px; font-size: 11px; }
}


.diagram-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}

.diagram-grid-3 .diagram-figure { padding: 14px; }
.diagram-grid-3 figcaption { font-size: 11px; margin-top: 10px; padding-top: 10px; }

@media (max-width: 860px) {
  .diagram-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .diagram-grid-3 { grid-template-columns: 1fr; }
}

.spec-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 760px) {
  .spec-two-col { grid-template-columns: 1fr; }
}

.spec-two-col h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 10px;
  font-weight: 500;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

@media (max-width: 640px) {
  .related-grid { grid-template-columns: 1fr; }
}


footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}

footer .brand img { height: 18px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .spec-strip .wrap { grid-template-columns: repeat(2, 1fr); }
  .spec-strip .spec:nth-child(3) { border-left: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .video-section .wrap { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  nav.primary-nav { display: none; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .product-grid { grid-template-columns: 1fr; }
  .hero-facts { flex-wrap: wrap; row-gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--heat);
  outline-offset: 2px;
}


.product-section {
  display: none;
}

.product-section.active {
  display: block;
}

/* ==========================================================================
   Pamirel additions (site 8)
   ========================================================================== */

/* ---- 4-up product grid ---- */
.product-grid.four { grid-template-columns: repeat(4, 1fr); }
.product-grid.four .product-card { padding: 22px; }
@media (max-width: 1040px) { .product-grid.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .product-grid.four { grid-template-columns: 1fr; } }

.product-card .thumb.photo img { object-fit: cover; }
.product-card .thumb.drawing { background: var(--white); border: 1px solid var(--line); }
.product-card .thumb.drawing img { object-fit: contain; padding: 14px; }
.product-card .thumb img { transition: transform 0.35s ease; }
.product-card:hover .thumb.photo img { transform: scale(1.04); }
.related-grid.three { grid-template-columns: repeat(3, 1fr); }
.related-grid .product-card .thumb { aspect-ratio: 4 / 3; }
.product-card a.thumb { display: block; }
@media (max-width: 860px) { .related-grid.three { grid-template-columns: 1fr; } }

/* ---- product photo gallery ---- */
.gallery { display: flex; flex-direction: column; gap: 12px; }
.gallery-main {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--panel-dark);
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  padding: 0; border: none; display: block; width: 100%;
}
.gallery.portrait .gallery-main { aspect-ratio: 4 / 4.6; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.2s ease; }
.gallery.drawing .gallery-main { background: var(--white); border: 1px solid var(--line); }
.gallery.drawing .gallery-main img { object-fit: contain; padding: 22px; }
.gallery-main .zoom-hint {
  position: absolute; right: 12px; bottom: 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--white); background: rgba(20,24,26,0.6);
  padding: 5px 9px; border-radius: 3px; pointer-events: none;
}
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}
.gallery-thumbs button {
  padding: 0; border: 2px solid transparent; border-radius: 3px;
  background: var(--panel); cursor: pointer; aspect-ratio: 1 / 1; overflow: hidden;
  opacity: 0.7; transition: opacity 0.15s ease, border-color 0.15s ease;
}
.gallery-thumbs button:hover { opacity: 1; }
.gallery-thumbs button.active { border-color: var(--heat); opacity: 1; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery.drawing .gallery-thumbs button { background: var(--white); }
.gallery.drawing .gallery-thumbs img { object-fit: contain; }

.product-hero.with-gallery .wrap { grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 860px) {
  .product-hero.with-gallery .wrap { grid-template-columns: 1fr; gap: 32px; }
}

/* ---- lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(12, 14, 15, 0.94);
  display: none; align-items: center; justify-content: center;
  padding: 48px 72px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 3px; }
.lightbox button {
  position: absolute; background: none; border: 1px solid #4a5356; color: var(--white);
  font-family: var(--font-mono); font-size: 18px; width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer;
}
.lightbox button:hover { border-color: var(--heat); color: var(--heat-bright); }
.lightbox .lb-close { top: 18px; right: 18px; }
.lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 12px; color: #9aa5a8;
}
@media (max-width: 560px) { .lightbox { padding: 64px 12px; } }

/* ---- variant tab (e.g. LED display version) ---- */
.variant-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
  align-items: start;
}
.variant-layout h3 { font-size: 26px; margin-bottom: 14px; }
.variant-layout p { font-size: 15px; max-width: 46ch; }
.variant-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 0; }
.variant-tags span {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 3px; padding: 6px 10px; color: var(--ink);
}
.variant-tags span.swatch-black::before,
.variant-tags span.swatch-white::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 7px; vertical-align: -1px; border: 1px solid var(--ink-soft);
}
.variant-tags span.swatch-black::before { background: #111; }
.variant-tags span.swatch-white::before { background: #fff; }
.variant-photos { display: grid; grid-template-columns: 1.33fr 1fr; gap: 14px; }
.variant-photos button {
  padding: 0; border: none; background: var(--panel-dark); border-radius: 4px; overflow: hidden;
  cursor: zoom-in; display: block;
}
.variant-photos img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .variant-layout { grid-template-columns: 1fr; }
  .variant-photos { grid-template-columns: 1fr; }
}

/* ---- numbered steps + small tables inside tabs ---- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  font-size: 14px; color: var(--ink-soft);
  padding: 10px 0 10px 40px; position: relative;
  border-top: 1px solid var(--line);
}
.steps li:first-child { border-top: none; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 10px;
  font-family: var(--font-mono); font-size: 12px; color: var(--heat);
}
.steps li strong { color: var(--ink); font-weight: 600; }

.callout {
  border-left: 3px solid var(--heat);
  background: #f6ece2;
  padding: 14px 18px;
  font-size: 14px; color: var(--ink);
  border-radius: 0 4px 4px 0;
  margin: 0 0 24px;
}
.callout strong { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--heat); display: block; margin-bottom: 4px; }

.subhead {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft); margin: 36px 0 14px; font-weight: 500;
}
.subhead:first-child { margin-top: 0; }

.diagram-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.diagram-grid-2 .diagram-figure { padding: 14px; }
.diagram-grid-2 figcaption { font-size: 11px; margin-top: 10px; padding-top: 10px; }
@media (max-width: 760px) { .diagram-grid-2 { grid-template-columns: 1fr; } }
.diagram-figure.zoomable img { cursor: zoom-in; }

.led { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
.led.green { background: #3fbf5f; box-shadow: 0 0 6px #3fbf5f; }
.led.red { background: #e04a3a; box-shadow: 0 0 6px #e04a3a; }

.downloads-lang { margin-bottom: 14px; }
.downloads-lang .lang {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 10px;
}
.downloads-lang + .downloads-lang { margin-top: 26px; }
.downloads-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.downloads-grid.cols-1 { grid-template-columns: minmax(0, 420px); }
@media (max-width: 760px) { .downloads-grid.cols-3 { grid-template-columns: 1fr; } }

/* ---- comparison table (products page) ---- */
.compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--white); }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.compare th, .compare td { padding: 14px 18px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.compare thead th {
  border-top: none; font-family: var(--font-display); font-size: 16px; font-weight: 600;
  background: var(--panel);
}
.compare thead th a { text-decoration: none; }
.compare thead th a:hover { color: var(--lcd); }
.compare thead th small { display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--ink-soft); letter-spacing: 0.04em; margin-top: 2px; }
.compare tbody th { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--ink-soft); width: 18%; }
.compare td { color: var(--ink); font-family: var(--font-mono); font-size: 13px; }

/* ---- "how it works" flow on homepage ---- */
.flow-section { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.flow-section .diagram-node { background: var(--paper); }

/* ==========================================================================
   Hero: RF link animation (control unit -> LoRa -> actuator)
   ========================================================================== */
.rf-panel {
  background: var(--panel-dark);
  border-radius: 10px;
  padding: 26px 26px 20px;
  position: relative;
  box-shadow: 0 30px 60px -20px rgba(20, 24, 26, 0.45);
  color: #c8d0d2;
}
.rf-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; color: #6f7d81;
  text-transform: uppercase; margin-bottom: 8px;
}
.rf-panel-head .live { color: #7fd38f; display: inline-flex; align-items: center; gap: 6px; }
.rf-panel-head .live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #3fbf5f;
  box-shadow: 0 0 6px #3fbf5f; animation: rf-blink 1.6s ease-in-out infinite;
}
.rf-svg { width: 100%; height: auto; display: block; overflow: visible; }
.rf-svg text { font-family: var(--font-mono); }
.rf-svg .lcd-temp { font-family: var(--font-mono); font-weight: 600; }

/* ---- waves: control unit -> actuator (TX) and back (ACK) ---- */
.rf-wave { fill: none; stroke-linecap: round; opacity: 0; }
.rf-wave.tx { stroke: var(--heat-bright); stroke-width: 5; }
.rf-wave.rx { stroke: #7fd38f; stroke-width: 4; }
.rf-panel.tx .rf-wave.tx { animation: rf-wave-right 1.15s ease-in-out forwards; }
.rf-panel.tx .rf-wave.tx.w2 { animation-delay: 0.16s; }
.rf-panel.tx .rf-wave.tx.w3 { animation-delay: 0.32s; }
.rf-panel.ack .rf-wave.rx { animation: rf-wave-left 1s ease-in-out forwards; }
.rf-panel.ack .rf-wave.rx.w2 { animation-delay: 0.16s; }
@keyframes rf-wave-right {
  0%   { opacity: 0; transform: translateX(0) scale(0.55); }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(190px) scale(1.15); }
}
@keyframes rf-wave-left {
  0%   { opacity: 0; transform: translateX(0) scale(0.55); }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-190px) scale(1.1); }
}
.rf-wave { transform-box: fill-box; transform-origin: center; }

/* antenna symbol on the control unit flashes while sending */
.cu-antenna { fill: var(--heat-bright); opacity: 0; filter: blur(3px); transition: opacity 0.2s ease; }
.rf-panel.tx .cu-antenna { animation: cu-flash 0.9s ease-out; }
@keyframes cu-flash { 0%, 100% { opacity: 0; } 20%, 60% { opacity: 0.9; } }

/* actuator LEDs, laid over the LED symbols of the drawing */
.act-led { opacity: 0; fill: #2fd05a; mix-blend-mode: multiply; transition: opacity 0.25s ease; }
.act-glow { opacity: 0; fill: #46d067; filter: blur(6px); transition: opacity 0.25s ease; }
.act-led.rf { fill: #ff8a2a; }
.act-glow.rf { fill: #ffa04a; }
.act-led.on { opacity: 0.95; }
.act-glow.on { opacity: 0.75; }
.rf-label { fill: #8a979b; font-size: 19px; letter-spacing: 2px; }
.rf-dim { stroke: #3b474b; stroke-width: 1.5; }

.rf-log {
  margin-top: 6px;
  border-top: 1px solid var(--line-dark);
  padding-top: 12px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.7;
  min-height: 46px;
}
.rf-log .tx { color: var(--heat-bright); }
.rf-log .rx { color: #7fd38f; }
.rf-log span.dim { color: #6f7d81; }
.rf-foot {
  display: flex; gap: 10px; margin-top: 14px;
}
.rf-foot span {
  flex: 1; text-align: center;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em;
  padding: 9px 0; border-radius: 3px; border: 1px solid var(--line-dark); color: #8a979b;
}
.rf-foot span strong { color: var(--white); font-weight: 500; }
@keyframes rf-blink { 50% { opacity: 0.3; } }

@media (prefers-reduced-motion: reduce) {
  .rf-wave { display: none; }
}

/* ---- mobile navigation: nav drops to its own scrollable row ---- */
@media (max-width: 860px) {
  .site-header .wrap { flex-wrap: wrap; height: auto; padding-top: 14px; padding-bottom: 0; row-gap: 10px; }
  nav.primary-nav {
    display: flex; order: 3; width: 100%; gap: 24px;
    overflow-x: auto; scrollbar-width: none; padding: 4px 0 12px;
  }
  nav.primary-nav::-webkit-scrollbar { display: none; }
  nav.primary-nav a { white-space: nowrap; }
}
@media (max-width: 560px) {
  .spec .value { font-size: 19px; }
  .spec-strip .spec { padding: 20px 18px; }
  .hero { padding: 48px 0 64px; }
}

/* ---- language switcher ---- */
.header-actions { display: flex; align-items: center; gap: 14px; }
.lang-switch {
  display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em;
}
.lang-switch a {
  text-decoration: none; padding: 8px 10px; color: var(--ink-soft);
  border-left: 1px solid var(--line); transition: background 0.15s ease, color 0.15s ease;
}
.lang-switch a:first-child { border-left: none; }
.lang-switch a:hover { color: var(--lcd); background: var(--panel); }
.lang-switch a.current { background: var(--ink); color: var(--white); }
@media (max-width: 560px) {
  .header-actions { gap: 8px; }
  .header-actions .btn { display: none; }
}

/* ---- contact map ---- */
.contact-map {
  margin-top: 40px;
  border: 1px solid var(--line-dark); border-radius: 6px;
  background: #182022;
  padding: 18px 18px 14px;
}
.contact-map svg { width: 100%; height: auto; display: block; }
.contact-map .sl-land { fill: #26343a; stroke: var(--lcd-bright); stroke-width: 1.6; stroke-linejoin: round; }
.contact-map .nb-land { fill: #1e2729; stroke: #2f393c; stroke-width: 1; }
.contact-map .city { fill: #8a979b; }
.contact-map .city-label { fill: #8a979b; font-family: var(--font-mono); font-size: 17px; }
.contact-map .pin-label { fill: var(--white); font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.contact-map .pin-sub { fill: #b6bfc2; font-family: var(--font-mono); font-size: 15px; }
.contact-map .pin-pulse { fill: var(--heat); transform-box: fill-box; transform-origin: center; animation: pin-pulse 2.2s ease-out infinite; }
@keyframes pin-pulse { 0% { opacity: 0.6; transform: scale(0.4); } 100% { opacity: 0; transform: scale(2.6); } }
.contact-map .map-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line-dark);
  font-family: var(--font-mono); font-size: 12px; color: #8a979b;
}
.contact-map .map-foot a { color: var(--heat-bright); text-decoration: none; }
.contact-map .map-foot a:hover { text-decoration: underline; }

/* long compound words (German/Slovenian) must not widen the hero column */
.hero-copy, .product-hero .wrap > div { min-width: 0; }
h1, h2, h3 { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }

/* header logo at double size */
.site-header .brand img { height: 52px; }
