/* PioTronic Pigo — modern premium direction (v3).
   Base: Loft Charcoal (RAL 7016). Accent: signal green — the per-lane LED
   colour of the antenna. Editorial layout, full-bleed hero, hairline rules. */
:root {
  --bg: #191d1f;
  --bg-2: #1e2225;
  --panel: #23282b;
  --line: #2e3438;
  --line-soft: #262b2f;
  --text: #f4f4f2;
  --muted: #a7b0b3;
  --accent: #35d07f;
  --accent-soft: rgba(53, 208, 127, 0.12);
  --accent-ink: #7ce8a8;
  --live: #35d07f;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  line-height: 1.8;
  direction: rtl;
}

a { color: var(--accent); }
img { max-width: 100%; display: block; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header: transparent over hero, solid on scroll ---------- */
header.site {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
header.site.solid {
  background: rgba(25, 29, 31, 0.96);
  border-bottom-color: var(--line);
}
header.site .wrap {
  display: flex; align-items: center; gap: 20px;
  padding-top: 14px; padding-bottom: 14px;
}
.brand { font-size: 1.35rem; font-weight: 800; letter-spacing: 0.5px; white-space: nowrap; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.brand span { color: var(--accent); }
nav.main { margin-inline-start: auto; display: flex; gap: 20px; flex-wrap: wrap; }
nav.main a { color: rgba(244, 244, 242, 0.85); text-decoration: none; font-size: 0.95rem; font-weight: 600; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
nav.main a:hover { color: var(--accent); }
.badge {
  background: rgba(35, 40, 43, 0.8); border: 1px solid var(--line);
  color: var(--muted); border-radius: 999px; padding: 2px 12px;
  font-size: 0.85rem; white-space: nowrap;
}

/* ---------- Hero: full viewport, full-bleed, ken-burns ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover;
  animation: kenburns 26s ease-in-out infinite alternate;
}
@keyframes kenburns {
  from { transform: scale(1.02); }
  to { transform: scale(1.12) translate(-1.2%, -1%); }
}
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(25, 29, 31, 0.62) 0%,
    rgba(25, 29, 31, 0.18) 38%,
    rgba(25, 29, 31, 0.55) 68%,
    rgba(25, 29, 31, 0.96) 100%);
}
.hero-content { position: relative; padding-top: 120px; padding-bottom: 44px; }
.eyebrow {
  display: inline-block; margin: 0 0 18px;
  color: var(--accent-ink); font-weight: 800; font-size: 0.98rem;
  letter-spacing: 0.5px;
  border-inline-start: 3px solid var(--accent); padding-inline-start: 12px;
}
.hero h1 {
  font-size: clamp(2.9rem, 8.5vw, 5.4rem);
  line-height: 1.12; margin: 0 0 18px; font-weight: 800;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
  animation: heroIn 0.9s ease both;
}
.hero h1 span { color: var(--accent); }
.hero p.lead {
  color: rgba(244, 244, 242, 0.92); font-size: 1.25rem;
  max-width: 640px; margin: 0 0 26px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 34px; }
.chip {
  background: rgba(25, 29, 31, 0.72); border: 1px solid rgba(244, 244, 242, 0.35);
  border-radius: 999px; padding: 6px 18px; font-size: 0.95rem; font-weight: 700;
  backdrop-filter: blur(4px);
}
.hero-facts {
  display: flex; gap: 0; flex-wrap: wrap;
  border-top: 1px solid rgba(244, 244, 242, 0.28);
  padding-top: 20px; margin-bottom: 18px;
}
.hf { padding-inline-end: 32px; margin-inline-end: 32px; border-inline-end: 1px solid rgba(244, 244, 242, 0.28); }
.hf:last-child { border-inline-end: none; margin-inline-end: 0; padding-inline-end: 0; }
.hf strong { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--accent); font-weight: 800; }
.hf span { color: rgba(244, 244, 242, 0.85); font-size: 0.92rem; }
.scroll-hint { color: rgba(244, 244, 242, 0.75); font-size: 0.95rem; margin: 0; animation: bob 2.4s ease-in-out infinite; }

@keyframes heroIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ---------- Ticker ---------- */
.ticker {
  overflow: hidden; direction: ltr;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg-2); padding: 12px 0;
}
.ticker-track {
  display: inline-flex; gap: 0; white-space: nowrap;
  animation: marquee 32s linear infinite;
}
.ticker-track span {
  direction: rtl; font-weight: 700; font-size: 1rem; color: var(--muted);
  padding: 0 14px;
}
.ticker-track i { color: var(--accent); font-style: normal; align-self: center; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Sections: editorial headers ---------- */
section.block { padding: 88px 0; }
.kicker {
  color: var(--accent); font-weight: 800; font-size: 0.95rem;
  letter-spacing: 2px; margin: 0 0 10px;
}
section.block h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.25;
  margin: 0 0 12px; font-weight: 800;
}
section.block .intro { color: var(--muted); max-width: 780px; font-size: 1.12rem; }

/* ---------- Stats band: hairline dividers, no cards ---------- */
.stats { padding: 64px 0 20px; }
.stats-band {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: 30px 22px; border-inline-start: 1px solid var(--line); }
.stat:first-child { border-inline-start: none; }
.stat .num { font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat .label { font-size: 1.15rem; font-weight: 800; margin: 8px 0 6px; }
.stat p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.65; }
.stats-note { color: var(--muted); font-size: 0.88rem; text-align: center; margin: 18px 0 0; }

/* ---------- Antenna showcase ---------- */
.antenna { background: var(--bg-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.showcase {
  margin: 34px 0 0; border-radius: var(--radius); overflow: hidden;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
}
.showcase img { width: 100%; }
.showcase figcaption, .detail figcaption, .plan figcaption {
  color: var(--muted); font-size: 0.92rem; padding: 12px 16px;
  background: var(--panel); text-align: start;
}
.antenna-grid {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px;
  margin-top: 28px; align-items: start;
}
.antenna-specs h3 { margin: 0 0 14px; font-size: 1.25rem; color: var(--accent); }
.antenna-specs dl { margin: 0; }
.antenna-specs dl div {
  display: grid; grid-template-columns: 130px 1fr; gap: 14px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.antenna-specs dt { font-weight: 800; color: var(--text); }
.antenna-specs dd { margin: 0; color: var(--muted); }
.detail {
  margin: 0; border-radius: var(--radius); overflow: hidden;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}
.detail img { width: 100%; }
.plan {
  margin: 28px 0 0; border-radius: var(--radius); overflow: hidden;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}
.plan img { width: 100%; }

/* ---------- Live feed (green) ---------- */
.live-panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 28px 22px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35); margin-top: 26px;
}
.live-head { text-align: center; }
.live-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); border: 1px solid rgba(53, 208, 127, 0.45);
  color: var(--accent-ink);
  border-radius: 999px; padding: 4px 16px; font-weight: 800; font-size: 1rem;
}
.live-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--live);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(53, 208, 127, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(53, 208, 127, 0); }
}
.live-note { color: var(--muted); font-size: 0.92rem; margin: 14px 0 18px; }
.live-meta { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-bottom: 18px; }
.meta-item {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 18px; text-align: center; min-width: 150px;
}
.meta-label { display: block; color: var(--muted); font-size: 0.85rem; }
.meta-value { display: block; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.meta-ok { color: var(--accent); font-size: 1.05rem; }
.feed { display: flex; flex-direction: column; gap: 8px; min-height: 248px; }
.feed-row {
  display: grid; grid-template-columns: 110px 1fr auto auto; gap: 12px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px;
  animation: rowIn 0.45s ease both;
}
@keyframes rowIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.feed-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.feed-uid { font-weight: 700; letter-spacing: 1px; font-size: 1.05rem; }
.feed-lane { color: var(--accent); font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.feed-ok { color: var(--accent); font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.live-foot { color: var(--muted); font-size: 0.92rem; text-align: center; margin: 16px 0 0; }

/* ---------- System: numbered rows ---------- */
.device-rows { margin-top: 30px; border-top: 1px solid var(--line); }
.device-row {
  display: grid; grid-template-columns: 90px 1fr; gap: 20px;
  padding: 30px 0; border-bottom: 1px solid var(--line);
}
.dev-num {
  font-size: 2.6rem; line-height: 1; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums; opacity: 0.9;
}
.device-row h3 { margin: 0 0 2px; font-size: 1.5rem; }
.dev-sub { color: var(--accent); font-weight: 700; font-size: 1rem; margin: 0 0 10px; }
.device-row ul { margin: 0; padding-inline-start: 18px; color: var(--muted); font-size: 0.99rem; }
.device-row li { margin-bottom: 6px; }

/* ---------- Steps timeline ---------- */
.steps-timeline {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 30px;
}
.steps-timeline .step { border-top: 2px solid var(--accent); padding-top: 18px; }
.steps-timeline .step .num {
  font-size: 2.2rem; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.steps-timeline .step h3 { margin: 10px 0 6px; font-size: 1.2rem; }
.steps-timeline .step p { margin: 0; color: var(--muted); font-size: 0.99rem; }

/* ---------- Features: minimal, hairline ---------- */
.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 32px; margin-top: 30px;
}
.feature { border-top: 1px solid var(--line); padding-top: 18px; }
.feature h3 { margin: 0 0 6px; font-size: 1.15rem; color: var(--accent); }
.feature p { margin: 0; color: var(--muted); font-size: 0.98rem; }

/* ---------- Race-day band ---------- */
.raceday {
  position: relative; min-height: 72svh;
  display: flex; align-items: flex-end; overflow: hidden;
}
.raceday-media { position: absolute; inset: 0; }
.raceday-media img {
  width: 100%; height: 100%; object-fit: cover;
  animation: kenburns 30s ease-in-out infinite alternate;
}
.raceday-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(25, 29, 31, 0.55) 0%,
    rgba(25, 29, 31, 0.15) 45%,
    rgba(25, 29, 31, 0.92) 100%);
}
.raceday-content { position: relative; padding-top: 80px; padding-bottom: 56px; }
.raceday-content h2 {
  font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.2; margin: 0 0 12px; font-weight: 800;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}
.raceday-content p { color: rgba(244, 244, 242, 0.92); font-size: 1.15rem; max-width: 620px; margin: 0; }
.raceday-cap { color: var(--muted) !important; font-size: 0.9rem !important; margin-top: 14px !important; }

/* ---------- Poster finale ---------- */
.poster { text-align: center; }
.poster img {
  width: 100%; max-width: 560px; margin: 0 auto;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* ---------- Footer ---------- */
footer.site {
  border-top: 1px solid var(--line); background: var(--panel);
  padding: 30px 0; margin-top: 20px; text-align: center;
}
footer.site .brand { font-size: 1.2rem; text-shadow: none; }
footer.site p { color: var(--muted); font-size: 0.95rem; margin: 6px 0; }
footer.site a { color: var(--accent); text-decoration: none; }
.note { font-size: 0.88rem; color: var(--muted); }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .stats-band { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-inline-start: none; }
  .stat { border-top: 1px solid var(--line); }
  .stat:nth-child(-n+2) { border-top: none; }
  .antenna-grid { grid-template-columns: 1fr; }
  .steps-timeline { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .device-row { grid-template-columns: 64px 1fr; }
}
@media (max-width: 640px) {
  section.block { padding: 60px 0; }
  nav.main { display: none; }
  .hero h1 { font-size: 2.4rem; }
  .hero-facts { gap: 0; }
  .hf { padding-inline-end: 18px; margin-inline-end: 18px; }
  .hf strong { font-size: 1.5rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .feed-row { grid-template-columns: 92px 1fr auto; }
  .feed-ok { display: none; }
  .meta-item { min-width: 120px; }
  .device-row { grid-template-columns: 1fr; gap: 4px; }
  .dev-num { font-size: 1.8rem; }
  .antenna-specs dl div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-media img, .raceday-media img, .hero h1, .scroll-hint, .live-dot, .feed-row, .ticker-track { animation: none; }
}
