/*
 * style.css — the Iskarel site.
 * Two tones and one colour, after the Starwake style flipped to its white version: the light page,
 * near-black ink, ash for what is quiet, the flare only for people and what they make. Square heavy
 * caps (Bahnschrift, Barlow on machines without it), spaced caps for labels, a humanist sans for
 * statements. The marker is the style's wiped bar: text under it takes the other tone.
 */
:root {
  --ground: #f4f3ef;
  --ink: #0b0b0e;
  --night: #0a0a0c;
  --ash: #8f8d96;
  --ash-night: #6f6d76;
  --faint: #dad8d1;
  --flare: #ff5a24;
  --display: Bahnschrift, "Barlow", "DIN Alternate", "Segoe UI", sans-serif;
  --sans: "Segoe UI Variable Display", "Segoe UI", "Barlow", system-ui, -apple-system, sans-serif;
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
html.still { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 18px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--ground); padding: 8px 14px; border-radius: 8px; z-index: 30; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--flare); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.02; margin: 0; }
h2 { font-size: clamp(34px, 5vw, 64px); }
h3 { font-size: clamp(22px, 2.4vw, 30px); }
h4 { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; font-size: 13px; color: var(--ash); margin: 26px 0 8px; }
.label, .eyebrow { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.22em; font-size: 13px; color: var(--ash); margin: 0 0 14px; }
p { margin: 0 0 1em; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(244, 243, 239, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--faint); }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; font-size: 18px; }
.brand .star { width: 18px; height: 22px; fill: var(--flare); }
/* the company name in running text: i18n.js wraps every "Iskarel" in a span of this class (Adam, 2026-11-01) */
.brand-name { color: var(--flare); font-weight: 600; }
.top nav { display: flex; align-items: center; gap: 22px; }
.top nav a { white-space: nowrap; text-decoration: none; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; color: var(--ink); }
.top nav a:hover { color: var(--flare); }
.top nav .nav-cta { background: var(--ink); color: var(--ground); padding: 9px 14px; border-radius: 999px; white-space: nowrap; }
.top nav .nav-cta:hover { color: var(--ground); background: var(--flare); }
/* EN / PL: the language switch at the end of the bar (stays on small screens) */
.lang-toggle { display: inline-flex; border: 1px solid var(--faint); border-radius: 999px; padding: 3px; }
.lang-toggle button { font-family: var(--display); font-weight: 600; letter-spacing: 0.12em; font-size: 11px; border: 0; background: transparent; color: var(--ash); padding: 6px 9px; border-radius: 999px; cursor: pointer; }
.lang-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.lang-toggle button:hover { color: var(--ink); }
.lang-toggle button[aria-pressed="true"]:hover { color: var(--ground); }

/* ---------- buttons ---------- */
.btn { display: inline-block; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; font-size: 14px; text-decoration: none; background: var(--ink); color: var(--ground); padding: 15px 22px; border-radius: 12px; border: 1.5px solid var(--ink); transition: background 0.2s, color 0.2s, border-color 0.2s; }
.btn:hover { background: var(--flare); border-color: var(--flare); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--ground); border-color: var(--ink); }

/* ---------- plates ---------- */
.plate { margin: 0; }
.plate canvas { display: block; width: 100%; }

/* ---------- hero: the white "sun will die" plate ---------- */
/* the copy is in the flow below a band for the sun (the scene centres the sun in that band), so a
   short screen makes the hero taller instead of cutting the buttons off */
.hero { position: relative; min-height: max(640px, calc(100svh - 64px)); overflow: hidden; background: var(--ground); display: flex; flex-direction: column; justify-content: center; padding: clamp(150px, 24svh, 260px) 0 clamp(40px, 7svh, 80px); }
.hero-plate { position: absolute; inset: 0; }
.hero-plate canvas { height: 100%; }
.hero-copy { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 var(--gutter); }
.hero .eyebrow { color: var(--ash); }
.hero-title { font-size: clamp(46px, min(7.6vw, 10.5svh), 132px); line-height: 0.98; letter-spacing: 0.03em; max-width: 13ch; }
/* the Polish headline has a long middle word („przestanie”): a little more measure keeps it to two lines */
html[lang="pl"] .hero-title { max-width: 16ch; }
.hero .word { display: inline-block; opacity: 0; transform: translateY(0.3em); transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.2, 1.5, 0.4, 1); transition-delay: calc(var(--i) * 0.18s); }
.hero.b1 .word { opacity: 1; transform: none; }
.hero-strip { margin: 26px 0 0; }
.hero-strip span { display: inline-block; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: clamp(16px, 2.1vw, 30px); background: var(--ink); color: var(--ground); padding: 0.28em 0.55em; border-radius: 0.2em; text-wrap: balance; opacity: 0; transform: rotate(-1.6deg) scale(1.35); transition: opacity 0.12s, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1); }
.hero.b3 .hero-strip span { opacity: 1; transform: rotate(-1.6deg) scale(1); }
.hero .lede { max-width: 640px; margin: 30px auto 0; font-size: clamp(17px, 1.5vw, 20px); color: var(--ink); }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.hero .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.hero.b4 .reveal { opacity: 1; transform: none; }
.hero.b4 .cta.reveal { transition-delay: 0.2s; }
/* the beat: the frame's two tones swapped, on a hard cut */
.hero.is-flipped { background: var(--night); color: var(--ground); }
.hero.is-flipped .eyebrow { color: var(--ash-night); }
.hero.is-flipped .hero-strip span { background: var(--ground); color: var(--ink); }
html.still .hero .word, html.still .hero .reveal, html.still .hero-strip span { opacity: 1; transform: none; transition: none; }
html.still .hero-strip span { transform: rotate(-1.6deg); }

/* ---------- the marker: the wiped bar, text under it in the other tone ---------- */
.marker { position: relative; display: inline-block; padding: 0 0.16em; }
.marker::before { content: ""; position: absolute; left: 0; right: 0; top: 0.06em; bottom: 0.02em; border-radius: 0.12em; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s; }
.marker > span { position: relative; color: #fff; mix-blend-mode: difference; }
.marker.on::before { transform: scaleX(1); }
.night .marker::before { background: var(--ground); }

/* ---------- why: the night ---------- */
.night { background: var(--night); color: var(--ground); padding: clamp(72px, 10vw, 130px) 0 clamp(56px, 8vw, 100px); }
.night .label { color: var(--ash-night); }
.night-head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 56px); align-items: end; margin-bottom: clamp(24px, 4vw, 44px); }
.night-text p { font-size: 18px; margin: 0 0 18px; }
.night .big { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(30px, 3.9vw, 54px); line-height: 1.05; margin: 14px 0 28px; letter-spacing: 0.02em; }
.night .big .marker { white-space: nowrap; }
.night .source { color: var(--ash-night); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: clamp(48px, 7vw, 84px); padding-top: 32px; border-top: 1px solid #26252b; }
.stat .num { font-family: var(--display); font-weight: 700; font-size: clamp(38px, 4.4vw, 58px); line-height: 1; margin: 0 0 12px; letter-spacing: 0.02em; }
.stat p:last-child { color: #bdbbb4; font-size: 16px; }
/* protect / provide: the two halves of the promise, under the plate */
.twin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); margin-top: clamp(36px, 5vw, 60px); }
.twin h3 { font-size: clamp(24px, 2.8vw, 36px); margin: 10px 0 12px; }
.twin p:last-child { font-size: 17px; color: #bdbbb4; margin: 0; }

/* ---------- step pills under a demo ---------- */
.steps { margin-top: 14px; }
.steps-bar { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.play, .pills button { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; line-height: 1; border-radius: 999px; padding: 9px 13px; cursor: pointer; background: transparent; }
.play { border: 1.5px solid currentColor; color: inherit; min-width: 74px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pills button { border: 1px solid var(--faint); color: var(--ash); }
.pills button:hover { color: var(--ink); border-color: var(--ink); }
.pills button.on { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.pills .n { opacity: 0.55; margin-right: 2px; }
.step-text { margin: 14px 0 0; min-height: 3.3em; font-size: 16px; max-width: 64ch; }
.step-text b { font-weight: 600; }
.night .pills button { border-color: #2c2b31; color: var(--ash-night); }
.night .pills button:hover { color: var(--ground); border-color: var(--ground); }
.night .pills button.on { background: var(--ground); color: var(--ink); border-color: var(--ground); }

/* ---------- how it works ---------- */
.how { padding: clamp(56px, 8vw, 110px) 0 clamp(40px, 6vw, 80px); }
/* two labelled rows of three: the civil defence row, the critical-infrastructure row (Adam, 2026-10-31) */
.pieces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
.pieces-row { grid-column: 1 / -1; margin: 0; }
.pieces-row:not(:first-child) { margin-top: 24px; }
.piece canvas { display: block; width: 100%; aspect-ratio: 8 / 5; border: 1px solid var(--faint); border-radius: 14px; margin-bottom: 16px; }
.piece h3 { font-size: 20px; letter-spacing: 0.1em; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.piece h3::before { content: ""; width: 12px; height: 15px; background: var(--ink); clip-path: path("M6 0Q7.2 6.3 12 7.5Q7.2 8.7 6 15Q4.8 8.7 0 7.5Q4.8 6.3 6 0Z"); flex: none; }
.piece p { font-size: 16px; color: #3a3940; }
/* small glyphs with their names: what a piece is for (the sensor's drones and rockets) */
.glyphs { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -4px 0 0; }
.glyph { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; color: var(--ink); }
.glyph svg { width: 44px; height: 22px; fill: var(--ink); flex: none; }
.glyph svg .flame { fill: var(--flare); }
.secure { margin-top: 48px; padding: 30px 32px; border: 1px solid var(--faint); border-radius: 20px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: start; }
.secure h3 { font-size: clamp(22px, 2.6vw, 32px); }
.secure canvas { display: block; width: 100%; max-width: 300px; aspect-ratio: 8 / 5; margin-top: 18px; }
.secure p { margin: 0; font-size: 17px; }

/* ---------- levels ---------- */
.levels { padding: clamp(56px, 8vw, 100px) 0 clamp(30px, 5vw, 60px); }
.section-head { max-width: 760px; margin-bottom: clamp(24px, 4vw, 40px); }
.section-head h2 { margin-bottom: 18px; text-wrap: balance; }
.nowrap { white-space: nowrap; }
/* kept on one line where it fits (it would overflow a phone's width) */
@media (min-width: 721px) { .nowrap-wide { white-space: nowrap; } }
.section-head p:last-child { font-size: 18px; color: #3a3940; }
.level { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 8px clamp(28px, 5vw, 72px); align-items: start; padding: clamp(48px, 6vw, 80px) 0; border-top: 1px solid var(--faint); }
.level .plate { grid-column: 1 / -1; margin-top: clamp(20px, 3vw, 32px); }
.level-side h4:first-child { margin-top: 6px; }
.level-n { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.22em; font-size: 14px; color: var(--ash); margin: 0 0 14px; display: flex; align-items: baseline; gap: 14px; }
.level-n span { font-family: var(--display); font-weight: 700; font-size: 52px; line-height: 0.9; letter-spacing: 0.02em; color: var(--ink); }
.level h3 { font-size: clamp(26px, 3vw, 40px); margin-bottom: 18px; }
.uses { margin: 0; padding: 0; list-style: none; }
.uses li { position: relative; padding-left: 24px; margin-bottom: 6px; font-size: 16px; }
.uses li::before { content: ""; position: absolute; left: 2px; top: 0.42em; width: 10px; height: 12px; background: var(--ink); clip-path: path("M5 0Q6 5 10 6Q6 7 5 12Q4 7 0 6Q4 5 5 0Z"); }
.status { margin-top: 22px; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; color: var(--ink); display: inline-flex; gap: 10px; align-items: center; border: 1px solid var(--faint); border-radius: 18px; padding: 8px 14px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--flare); flex: none; }
.plate.demo canvas { border: 1px solid var(--faint); border-radius: 22px; background: var(--ground); }

/* ---------- when ---------- */
.when { padding: clamp(56px, 8vw, 100px) 0; border-top: 1px solid var(--faint); }
.infra { padding: clamp(56px, 8vw, 100px) 0 clamp(30px, 5vw, 60px); border-top: 1px solid var(--faint); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { border: 1px solid var(--faint); border-radius: 20px; padding: 14px 18px 18px; }
.card canvas { display: block; width: 100%; aspect-ratio: 8 / 5; border-radius: 12px; margin-bottom: 10px; }
.card h3 { font-size: 20px; letter-spacing: 0.08em; margin-bottom: 8px; }
.card p { font-size: 16px; color: #3a3940; margin-bottom: 0; }

/* ---------- status ---------- */
.status-sec { padding: clamp(56px, 8vw, 100px) 0 clamp(30px, 4vw, 50px); border-top: 1px solid var(--faint); }

/* ---------- demo call ---------- */
.demo-call { padding: clamp(72px, 10vw, 140px) 0; text-align: center; border-top: 1px solid var(--faint); }
.demo-call h2 { margin-bottom: 20px; }
.demo-call p { max-width: 620px; margin-left: auto; margin-right: auto; font-size: 18px; }
.demo-call .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--faint); }
.foot-row { display: flex; justify-content: space-between; align-items: center; padding-top: 26px; padding-bottom: 26px; gap: 16px; }
.foot p { margin: 0; font-family: var(--display); text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; color: var(--ash); }

/* ---------- narrow screens ---------- */
@media (max-width: 1240px) {
}
@media (max-width: 960px) {
  .night-head, .level, .secure { grid-template-columns: minmax(0, 1fr); }
  .pieces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* the bar keeps the call and the language switch; the section links go first (the Polish ones are longer) */
@media (max-width: 1210px) {
  .top nav a:not(.nav-cta) { display: none; }
}
@media (max-width: 720px) {
  .stats, .twin { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 520px) {
  body { font-size: 17px; }
  .pieces { grid-template-columns: minmax(0, 1fr); }
  .secure { padding: 22px; }
  .level-n span { font-size: 42px; }
  /* the bar on a phone: logo, the call and EN / PL on one line, also with the longer Polish call */
  .top-row { gap: 10px; }
  .top nav { gap: 8px; }
  .brand { font-size: 16px; gap: 8px; letter-spacing: 0.1em; }
  .top nav .nav-cta { font-size: 11px; letter-spacing: 0.06em; padding: 8px 10px; }
  .lang-toggle button { padding: 6px 7px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marker::before { transition: none; }
}
