/* Panel světel — prezentační web, tmavé téma v modré jako displej krabičky */
:root {
  --bg-deep: #050609;
  --bg-surface: #0b0f18;
  --bg-card: #0e1524;
  --bg-card-hover: #132038;
  --border: #1e3a6e;
  --border-soft: #152a50;

  --blue: #3d8bff;
  --blue-light: #8fc6ff;
  --blue-dim: #4a79b8;
  --blue-glow: rgba(61, 139, 255, 0.22);
  --hot: #ff7043;

  --text-main: #f1f5fb;
  --text-dim: #9fb3d1;
  --text-muted: #6b7f9e;

  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 84px; }

body {
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-light); text-decoration: none; }
/* Název desky se nerozdělí na spojovnících (ESP32-S3-Touch-AMOLED-2.16) */
.nowrap { white-space: nowrap; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--font-mono); font-size: 0.92em; }
code {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  color: var(--blue-light);
}
pre {
  background: #070b13;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  color: var(--text-dim);
  line-height: 1.5;
}
pre code { background: none; border: 0; padding: 0; color: inherit; }
/* Barevná syntaxe bloků kódu (docs/highlight.js) */
.tok-com { color: #5f7397; font-style: italic; }
.tok-str { color: #a5d6a7; }
.tok-par { color: #c3a6ff; }
.tok-cmd { color: #8fc6ff; font-weight: 600; }
.tok-num { color: #f2c879; }
.tok-pre { color: #c3a6ff; }
.tok-kw { color: #6fb0ff; }
.tok-typ { color: #7fdbca; }
.tok-mac { color: #ffd68a; }
.tok-pun { color: #7186a8; }

.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
/* Obrázky a plátno 480 px nesmí roztáhnout sloupce mřížky nad šířku okna */
img, canvas { max-width: 100%; height: auto; }
.hero-grid > *, .sim-grid > *, .grid-2 > *, .grid-3 > *, .step-row > *, .power-list > *, .timeline > *, .gallery > *, .photos > * { min-width: 0; }

/* ─── Záře v pozadí ───────────────────────────────────────────────────────── */
.bg-glow { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow-orb { position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.45; }
.glow-1 { width: 620px; height: 620px; top: -220px; right: -160px; background: radial-gradient(circle, #1a4aa8 0%, transparent 70%); }
.glow-2 { width: 520px; height: 520px; bottom: 10%; left: -200px; background: radial-gradient(circle, #0f2a6a 0%, transparent 70%); }

/* ─── Hlavička ───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 6, 9, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; font-weight: 700; font-size: 1.05rem; color: var(--text-main); }
.brand:hover { text-decoration: none; }
.brand-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #0c2a5a, #3d8bff);
  display: grid; place-items: center;
  box-shadow: 0 0 18px var(--blue-glow);
}
.site-header nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-header nav a { color: var(--text-dim); font-size: 0.92rem; font-weight: 500; }
.site-header nav a:hover { color: var(--text-main); text-decoration: none; }
.gh-link {
  display: inline-flex; align-items: center; gap: 0.45rem;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0.4rem 0.9rem; font-size: 0.88rem; color: var(--text-main) !important;
}
.gh-link:hover { background: var(--bg-card); }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero { padding: 5rem 0 3rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--blue-light); border: 1px solid var(--border); border-radius: 999px;
  padding: 0.3rem 0.85rem; margin-bottom: 1.2rem; background: rgba(13, 42, 90, 0.35);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 10px var(--blue); }
h1 {
  font-family: var(--font-serif); font-weight: 600; font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  line-height: 1.1; letter-spacing: -0.01em; margin-bottom: 1.2rem;
}
h1 em { font-style: normal; color: var(--blue-light); }
.lead { font-size: 1.12rem; color: var(--text-dim); max-width: 36rem; margin-bottom: 1.8rem; }
.cta-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.3rem; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid var(--border); color: var(--text-main); background: var(--bg-card);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); background: var(--bg-card-hover); }
.btn-primary { background: linear-gradient(135deg, #1f5fd0, #3d8bff); border-color: transparent; box-shadow: 0 8px 28px var(--blue-glow); }
.btn-primary:hover { background: linear-gradient(135deg, #2a6ee0, #5a9dff); }
.hero-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; margin-top: 2rem; max-width: 36rem; }
.fact strong { display: block; font-size: 1.4rem; color: var(--blue-light); font-family: var(--font-serif); }
.fact span { font-size: 0.85rem; color: var(--text-muted); }

/* Rámeček krabičky kolem obrázku nebo plátna */
/* Šířka 508 px = 480 px displeje + 2 × 14 px rámečku: na desktopu se obrázek
   i plátno kreslí 1:1, bez převzorkování pixelové grafiky */
.device {
  position: relative; width: 100%; max-width: 508px; margin: 0 auto;
  aspect-ratio: 1 / 1; border-radius: 64px; background: #0a0b0f;
  padding: 14px; border: 1px solid #1a2033;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px var(--blue-glow), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.device img, .device canvas { display: block; width: 100%; height: 100%; border-radius: 52px; background: #000; }
.device a { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.device-buttons { position: absolute; top: -8px; left: 20%; right: 20%; display: flex; justify-content: space-between; pointer-events: none; }
.device-buttons span { width: 40px; height: 8px; border-radius: 4px 4px 0 0; background: #1c2233; border: 1px solid #2a3348; border-bottom: 0; }
.device-caption { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-top: 0.9rem; }

/* Fotka krabičky v úvodu */
.hero-photo { max-width: 520px; margin: 0 auto; }
.hero-photo a { display: block; cursor: zoom-in; }
.hero-photo img {
  display: block; width: 100%; height: auto; border-radius: 28px; background: #000;
  border: 1px solid #1a2033; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px var(--blue-glow);
}

/* ─── Obecné sekce ────────────────────────────────────────────────────────── */
section { padding: 4.5rem 0; }
.section-head { max-width: 42rem; margin-bottom: 2.4rem; }
.section-head .kicker { color: var(--blue); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.78rem; margin-bottom: 0.5rem; }
h2 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.15; margin-bottom: 0.8rem; }
h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.4rem; }
.section-head p { color: var(--text-dim); font-size: 1.02rem; }
/* Celý název desky v nadpisu na jeden řádek */
#hardware .section-head { max-width: none; }
.alt { background: linear-gradient(180deg, transparent, rgba(11, 15, 24, 0.9) 15%, rgba(11, 15, 24, 0.9) 85%, transparent); }

.card {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 16px; padding: 1.3rem 1.4rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--border); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.card p { color: var(--text-dim); font-size: 0.95rem; }
.card .icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(61, 139, 255, 0.12); border: 1px solid var(--border-soft); display: grid; place-items: center; margin-bottom: 0.9rem; color: var(--blue-light); }

/* ─── Simulátor ───────────────────────────────────────────────────────────── */
.sim-grid { display: grid; grid-template-columns: minmax(0, 508px) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.sim-panel { display: flex; flex-direction: column; gap: 1.2rem; }
.sim-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.hw-btn {
  width: 100%; text-align: center;
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600;
  background: #0d1424; color: var(--text-main); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.6rem 0.9rem; cursor: pointer; user-select: none;
  transition: background 0.1s ease, transform 0.05s ease;
}
.hw-btn:hover { background: var(--bg-card-hover); }
.hw-btn:active { transform: translateY(1px); background: #1a2c52; }
.hw-btn small { display: block; font-weight: 400; color: var(--text-muted); font-family: var(--font-sans); font-size: 0.75rem; }
.sim-options { display: flex; flex-direction: column; gap: 0.55rem; }
.sim-options label { display: flex; align-items: center; gap: 0.6rem; color: var(--text-dim); font-size: 0.93rem; cursor: pointer; }
.sim-options input { accent-color: var(--blue); width: 16px; height: 16px; }
.sim-log {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted);
  background: #070b13; border: 1px solid var(--border-soft); border-radius: 10px; padding: 0.7rem 0.9rem; min-height: 5.2rem;
  white-space: pre-wrap;
}
.sim-tips { color: var(--text-dim); font-size: 0.93rem; padding-left: 1.1rem; }
.sim-tips li { margin-bottom: 0.3rem; }
.sim-tips b { color: var(--text-main); font-weight: 600; }

/* ─── Časová osa chování ──────────────────────────────────────────────────── */
.timeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.8rem; counter-reset: step; }
.step { position: relative; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 14px; padding: 1.1rem 1rem 1rem; }
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue); color: #04101f; font-weight: 700; font-size: 0.85rem; margin-bottom: 0.7rem;
}
.step h3 { font-size: 0.98rem; }
.step p { color: var(--text-dim); font-size: 0.88rem; }

/* ─── Galerie ─────────────────────────────────────────────────────────────── */
/* Náhledy 240 px (přesná polovina displeje) se zobrazují 1:1; sloupce mají
   pevných 240 px, aby prohlížeč pixelovou grafiku nepřevzorkoval */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, 240px); justify-content: center; gap: 1.6rem 1.4rem; max-width: calc(3 * 240px + 2 * 1.4rem); margin: 0 auto; }
.shot { text-align: center; margin: 0; }
.shot a { display: block; cursor: zoom-in; }
.shot img { display: block; width: 240px; height: 240px; max-width: 100%; border-radius: 14%; border: 1px solid #1a2033; background: #000; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.shot a:hover img { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6), 0 0 24px var(--blue-glow); }
.shot figcaption { color: var(--text-dim); font-size: 0.88rem; margin-top: 0.6rem; }

/* ─── Fotky krabičky ──────────────────────────────────────────────────────── */
.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.photo { margin: 0; }
.photo a { display: block; cursor: zoom-in; }
.photo img {
  display: block; width: 100%; height: auto; border-radius: 22px; background: #000;
  border: 1px solid #1a2033; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.photo a:hover img { transform: translateY(-2px); box-shadow: 0 22px 56px rgba(0, 0, 0, 0.6), 0 0 28px var(--blue-glow); }
.photo figcaption { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.7rem; text-align: center; }

/* Kde koupit krabičku */
.buy {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem 2rem;
  margin-top: 2rem; padding: 1.3rem 1.5rem; border: 1px solid var(--border); border-radius: 16px;
  background: linear-gradient(135deg, rgba(13, 42, 90, 0.5), rgba(14, 21, 36, 0.92));
}
.buy h3 { font-size: 1.15rem; }
.buy p { color: var(--text-dim); font-size: 0.95rem; }

/* ─── Lightbox: obrazovka zvětšená na celý násobek, aby zůstala ostrá ────── */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  background: rgba(3, 4, 8, 0.9); backdrop-filter: blur(6px);
}
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; text-align: center; }
.lightbox img { display: block; margin: 0 auto; border-radius: 12%; background: #000; border: 1px solid #1a2033; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8), 0 0 80px var(--blue-glow); }
.lightbox img.crisp { image-rendering: pixelated; }
/* Fotka: plynule do okna, rozměry z obrázku */
.lightbox img.photo { width: auto; height: auto; max-width: 92vw; max-height: calc(100vh - 150px); border-radius: 18px; }
.lightbox figcaption { color: var(--text-dim); margin-top: 1rem; font-size: 0.95rem; }
.lightbox figcaption small { display: block; color: var(--text-muted); font-size: 0.8rem; margin-top: 0.25rem; }
.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(14, 21, 36, 0.9); color: var(--text-main);
  font-size: 1.8rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.lb-btn:hover { background: var(--bg-card-hover); border-color: var(--blue); }
.lb-prev { left: 1.2rem; }
.lb-next { right: 1.2rem; }
.lb-close { top: 1.2rem; right: 1.2rem; transform: none; font-size: 1.5rem; }
@media (max-width: 640px) {
  .lb-prev, .lb-next { top: auto; bottom: 1.2rem; transform: none; }
}

/* ─── Tabulky ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
th { color: var(--blue-light); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; background: rgba(13, 42, 90, 0.25); }
tr:last-child td { border-bottom: 0; }
td:first-child { color: var(--text-main); font-weight: 500; white-space: nowrap; }
td { color: var(--text-dim); }
.table-note { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.8rem; }
.table-gap { margin-top: 1.6rem; }
kbd {
  font-family: var(--font-mono); font-size: 0.8em; background: #0d1424; border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 6px; padding: 0.1em 0.45em; color: var(--text-main);
}

/* ─── Návod: kroky přes celou šířku, text vlevo, příkazy vpravo ───────────── */
.steps { display: grid; gap: 1.1rem; }
.step-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1.6rem; align-items: start; }
.step-row h3 { display: flex; align-items: center; gap: 0.6rem; font-size: 1.15rem; margin-bottom: 0.6rem; }
.step-row .num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--blue); color: #04101f; font-size: 0.9rem; font-weight: 700; flex: none; }
.step-text p + p { margin-top: 0.6rem; }
.step-aside pre { margin: 0; font-size: 0.86rem; }
.step-aside pre + pre { margin-top: 0.7rem; }
.step-aside > * + * { margin-top: 0.7rem; }
/* Cesta v aplikaci: kroky jako štítky, zalomí se po celých položkách */
.ui-path { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.45rem; font-size: 0.88rem; }
.ui-path span { background: #0d1424; border: 1px solid var(--border-soft); border-radius: 8px; padding: 0.3rem 0.6rem; color: var(--text-main); white-space: nowrap; }
.ui-path i { color: var(--blue-dim); font-style: normal; }
.note { border-left: 3px solid var(--blue); background: rgba(61, 139, 255, 0.07); padding: 0.9rem 1.1rem; border-radius: 0 12px 12px 0; color: var(--text-dim); font-size: 0.95rem; margin-top: 1.4rem; }
.note b { color: var(--text-main); }
.note pre { margin-top: 0.7rem; font-size: 0.86rem; }

/* ─── Spotřeba ────────────────────────────────────────────────────────────── */
.power-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.power-list .card h3 { color: var(--blue-light); }

/* ─── Patička ─────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border-soft); padding: 2.5rem 0 3rem; color: var(--text-muted); font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner a { color: var(--text-dim); }

/* ─── Responzivita ────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .sim-grid { grid-template-columns: minmax(0, 1fr); }
  .timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-row { grid-template-columns: minmax(0, 1fr); gap: 0.9rem; }
}
@media (max-width: 640px) {
  .site-header nav { display: none; }
  .timeline, .grid-3, .grid-2, .power-list, .photos { grid-template-columns: minmax(0, 1fr); }
  /* Na telefonu se příkazy raději zalomí, než aby byly useknuté za okrajem */
  pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  /* Ukázka C++ (secrets.h) by zalomením ztratila strukturu: posouvá se do strany */
  pre code[data-lang="cpp"] { white-space: pre; overflow-wrap: normal; }
  /* Na telefonu dva sloupce; srcset tam vybere originál 480 px pro displeje s vyšší hustotou */
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shot img { width: 100%; height: auto; }
  .hero-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
  .fact strong { font-size: 1.15rem; }
  .device { border-radius: 48px; padding: 10px; }
  /* Nadpis s celým názvem desky se na telefon vejde jen menším písmem */
  #hardware h2 { font-size: 1.35rem; }
  .device img, .device canvas { border-radius: 40px; }
  section { padding: 3.2rem 0; }
}
