:root {
  color-scheme: dark;
  --bg: #07090a;
  --surface: #121517;
  --surface-2: #1a1e20;
  --line: rgba(255, 255, 255, 0.13);
  --muted: #aeb4b8;
  --text: #f8f9f9;
  --accent: #e4ff19;
  --accent-soft: #f1ff75;
  --ink: #080a0b;
  --radius: 24px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 8%, rgba(228, 255, 25, 0.08), transparent 30rem),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: auto, 52px 52px, 52px 52px;
}

a { color: inherit; }
button { font: inherit; }
button, a { touch-action: manipulation; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 800;
}
.skip-link:focus { top: 1rem; }

.site-header, main, footer { width: min(1320px, calc(100% - 40px)); margin-inline: auto; }
.site-header {
  position: sticky;
  top: 14px;
  z-index: 20;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.24);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { display: block; width: 76px; height: 56px; object-fit: contain; }
.header-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero { padding: clamp(36px, 5vw, 72px) 0 clamp(80px, 9vw, 130px); }
#viewer, #tryby-ar { scroll-margin-top: 112px; }
.title-panel {
  width: min(1120px, 100%);
  margin: 0 auto clamp(28px, 4vw, 52px);
  padding: clamp(32px, 5vw, 62px) clamp(20px, 5vw, 64px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  text-align: center;
}
.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
h1, h2, p { text-wrap: pretty; }
h1 {
  display: flex;
  justify-content: center;
  gap: 0.22em;
  margin: 0;
  color: var(--text);
  font-size: clamp(2.65rem, 5.45vw, 5.25rem);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}
h1 span { display: block; }
.title-secondary { color: var(--text); }
.hero-lead {
  max-width: 720px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.6;
}

.viewer-shell {
  position: relative;
  width: min(1040px, 100%);
  margin-inline: auto;
  overflow: hidden;
  padding: 10px;
  border-radius: clamp(24px, 4vw, 40px);
  background: #f5f6f4;
  color: #0c0d0e;
  box-shadow: var(--shadow);
  contain: layout paint;
}
.viewer-shell::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: calc(clamp(24px, 4vw, 40px) - 8px);
}
.viewer-stage {
  position: relative;
  height: min(72svh, 760px);
  min-height: 520px;
  overflow: hidden;
  border-radius: calc(clamp(24px, 4vw, 40px) - 8px);
  background: #f5f6f4;
}
.viewer-topline {
  position: absolute;
  z-index: 6;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.73rem;
  font-weight: 700;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(179, 204, 0, 0.14); }
model-viewer { display: block; width: 100%; height: 100%; visibility: hidden; border-radius: inherit; background: #f5f6f4; --poster-color: #f5f6f4; }
.viewer-stage.is-ready model-viewer { visibility: visible; }
.viewer-placeholder { position: absolute; inset: 0; z-index: 3; overflow: hidden; border-radius: inherit; background: #f5f6f4; }
.viewer-placeholder picture, .viewer-placeholder img { display: block; width: 100%; height: 100%; }
.viewer-placeholder img { object-fit: contain; }
.load-model-button, .ar-button {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 7;
  transform: translateX(-50%);
  width: min(340px, calc(100% - 32px));
  min-height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}
.load-model-button:disabled { cursor: wait; opacity: 0.78; }
.ar-button span { margin-right: 6px; font-size: 1.35rem; }
.ar-hint { display: none; position: absolute; inset: auto 20px 96px; padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.8); color: #fff; text-align: center; }
model-viewer[ar-status="session-started"] .ar-hint { display: block; }
.viewer-caption { display: flex; justify-content: center; gap: 22px; padding: 11px 12px 5px; color: #62686c; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }

.viewer-actions { display: flex; justify-content: center; gap: 12px; margin-top: 26px; }
.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 13px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}
.button-primary { background: var(--accent); color: var(--ink); }
.button-ghost { border-color: var(--line); background: transparent; color: var(--text); }
.hero-specs { width: min(850px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 34px auto 0; }
.hero-specs div { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 255, 255, 0.03); text-align: center; }
.hero-specs dt { color: var(--muted); font-size: 0.66rem; letter-spacing: 0.09em; text-transform: uppercase; }
.hero-specs dd { margin: 7px 0 0; font-size: 1.08rem; font-weight: 800; }

.modes { padding: 0 0 clamp(90px, 10vw, 145px); }
.section-heading { max-width: 900px; margin: 0 auto 42px; text-align: center; }
h2 { margin: 0; font-size: clamp(2.35rem, 4.8vw, 5rem); line-height: 0.96; letter-spacing: -0.05em; text-transform: uppercase; }
.section-heading > p:last-child { max-width: 650px; margin: 20px auto 0; color: var(--muted); line-height: 1.65; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.mode-card:hover { transform: translateY(-4px); border-color: rgba(228, 255, 25, 0.55); }
.mode-card.is-active { border-color: var(--accent); }
.mode-card.is-active::after {
  content: "WYBRANO";
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.mode-label { min-height: 126px; display: grid; place-content: center; gap: 5px; margin: 0; padding: 22px 16px; background: var(--accent); color: var(--ink); text-align: center; text-transform: uppercase; }
.mode-label span { font-size: clamp(1.05rem, 1.7vw, 1.42rem); font-weight: 800; line-height: 1.1; }
.mode-label strong { font-size: clamp(1.65rem, 2.8vw, 2.65rem); line-height: 1; letter-spacing: -0.045em; }
.mode-card > p { min-height: 84px; margin: 0; padding: 24px 24px 10px; color: var(--muted); line-height: 1.55; text-align: center; }
.mode-meta { margin: 8px 24px 18px; padding: 13px 0; border-block: 1px solid var(--line); }
.mode-meta div { display: flex; justify-content: space-between; gap: 12px; }
.mode-meta dt { color: var(--muted); }
.mode-meta dd { margin: 0; font-weight: 800; }
.qr-block { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0 auto 20px; }
.qr-code { width: 176px; height: 176px; padding: 8px; border-radius: 15px; background: #fff; object-fit: contain; }
.qr-block span { color: var(--muted); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.mode-button { min-height: 54px; margin: auto 20px 20px; border: 0; border-radius: 12px; background: var(--accent); color: var(--ink); font-weight: 800; cursor: pointer; }

.how-it-works { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 60px; padding: clamp(60px, 8vw, 110px) clamp(24px, 5vw, 72px); border-radius: 32px; background: var(--accent); color: var(--ink); }
.how-it-works .eyebrow { color: #3b4300; }
.how-it-works h2 { font-size: clamp(2.5rem, 4.8vw, 4.8rem); }
.how-it-works ol { margin: 0; padding: 0; list-style: none; counter-reset: steps; }
.how-it-works li { counter-increment: steps; display: grid; grid-template-columns: 44px 1fr; gap: 4px 14px; padding: 20px 0; border-top: 1px solid rgba(0, 0, 0, 0.25); }
.how-it-works li::before { content: "0" counter(steps); grid-row: span 2; font-weight: 800; }
.how-it-works li strong { font-size: 1.12rem; }
.how-it-works li span { color: #454a09; }
.notice { display: flex; align-items: center; gap: 18px; margin: 22px 0 80px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 18px; color: var(--muted); }
.notice p { margin: 0; }
.notice strong { color: var(--text); }
.notice-mark { flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #252a2d; color: var(--accent); font-weight: 800; }

footer { min-height: 130px; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px 0 max(28px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); }
.brand-footer img { width: 86px; height: 62px; }
footer a { color: #fff; font-weight: 700; text-decoration: none; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

@media (max-width: 980px) {
  h1 { white-space: normal; flex-direction: column; gap: 0.02em; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { display: grid; grid-template-columns: minmax(220px, 0.7fr) 1fr auto; align-items: center; }
  .mode-label { height: 100%; min-height: 230px; }
  .mode-card > p, .mode-meta { grid-column: 2; }
  .mode-card > p { min-height: 0; padding-bottom: 0; }
  .qr-block { grid-column: 3; grid-row: 1 / span 3; margin: 20px; }
  .mode-button { grid-column: 2; margin-top: 0; }
}

@media (max-width: 720px) {
  .site-header, main, footer { width: min(100% - 24px, 1320px); }
  .site-header { top: 8px; min-height: 62px; margin-top: 8px; padding: 7px 10px; border-radius: 15px; }
  .brand img { width: 62px; height: 46px; }
  .header-action { min-height: 38px; padding: 0 12px; font-size: 0.64rem; }
  .hero { padding-top: 32px; }
  .title-panel { padding: 30px 16px; border-radius: 22px; }
  h1 { font-size: clamp(2.55rem, 13.3vw, 4.25rem); line-height: 0.92; }
  .hero-lead { margin-top: 20px; }
  .viewer-stage { height: 66svh; min-height: 460px; }
  .viewer-topline { top: 14px; left: 14px; max-width: calc(100% - 28px); font-size: 0.66rem; }
  .viewer-caption { gap: 10px; font-size: 0.55rem; }
  .viewer-actions { display: grid; }
  .hero-specs { grid-template-columns: 1fr; }
  .hero-specs div { display: flex; justify-content: space-between; align-items: center; text-align: left; }
  .hero-specs dd { margin: 0; }
  .section-heading { text-align: left; }
  .section-heading > p:last-child { margin-left: 0; }
  .mode-card { display: flex; align-items: stretch; }
  .mode-label { min-height: 112px; }
  .mode-card > p { min-height: 0; padding: 22px 20px 8px; }
  .mode-meta { margin-inline: 20px; }
  .qr-block { display: none; }
  .mode-button { width: auto; margin: 0 20px 20px; }
  .how-it-works { grid-template-columns: 1fr; gap: 34px; border-radius: 24px; }
  .notice { align-items: flex-start; }
  footer { flex-direction: column; align-items: flex-start; }
}

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