/* PopCode Signal — navy foundation, coral actions, ice-blue data accents. */
html[data-theme] {
  color-scheme: dark;
  --brand-coral: #ff6f61;
  --brand-ink: #1f2340;
  --signal-blue: #7bdde8;
  --text-muted: #a9b4cc;
  --color-bg: #090d1a;
  --color-surface: #121a2d;
  --color-text: #f2f5ff;
  --color-accent: #ff6f61;
  --color-accent-2: #7bdde8;
  --color-divider: #ffffff1c;
  --color-accent-100: #261d2b;
  --color-accent-200: #ffd2c9;
  --color-accent-300: #ffae9f;
  --color-accent-400: #ff9788;
  --color-accent-500: #ff8374;
  --color-accent-600: #ffa393;
  --color-accent-700: #ff9c8d;
  --color-accent-800: #ffd2c9;
  --color-accent-900: #11172a;
  --color-accent-2-100: #122937;
  --color-accent-2-200: #c7f6f8;
  --color-accent-2-300: #a0e9ef;
  --color-accent-2-400: #7bdde8;
  --color-accent-2-500: #68c9d7;
  --color-accent-2-600: #83dce6;
  --color-accent-2-700: #a0e9ef;
  --color-accent-2-800: #c7f6f8;
  --color-accent-2-900: #101e30;
  --color-neutral-100: #141c2e;
  --color-neutral-200: #1b263b;
  --color-neutral-300: #c6cde0;
  --color-neutral-400: #a8b3ca;
  --color-neutral-500: #8490ac;
  --color-neutral-600: #606c88;
  --color-neutral-700: #39445e;
  --color-neutral-800: #212c42;
  --color-neutral-900: #060a14;
  --font-heading: "Avenir Next", "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Inter", "Avenir Next", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-heading-weight: 650;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 16px #00000020;
  --shadow-md: 0 16px 40px #00000030;
  --shadow-lg: 0 28px 80px #00000050;
}

html[data-theme] body {
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}
html[data-theme] h1,
html[data-theme] h2,
html[data-theme] h3 { font-weight: 650; text-wrap: balance; }
html[data-theme] a { text-underline-offset: 5px; }
html[data-theme] :focus-visible { outline: 2px solid var(--signal-blue); outline-offset: 5px; }
html[data-theme] ::selection { color: #fff; background: #ac4038; }

/* Navigation and shared controls. */
html[data-theme] .nav {
  min-height: 72px;
  background: #090d1aeb !important;
  border-bottom: 1px solid var(--color-divider);
  backdrop-filter: blur(20px) saturate(140%) !important;
}
html[data-theme] .brand-logo { width: 170px; height: 36px; }
html[data-theme] .nav-brand { margin-right: 0; }
html[data-theme] [data-nav] { font-size: 13px; font-weight: 550; padding-block: 12px; }
html[data-theme] [data-submenu] {
  background: #11182af5;
  border-radius: 14px;
  padding: 8px;
  min-width: 284px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}
html[data-theme] [data-subitem] { border-radius: 8px; padding: 12px; }
html[data-theme] [data-subitem]:hover { background: #ff6f6112; color: #fff; }
html[data-theme] .seg { border-radius: 10px; padding: 3px; background: #ffffff05; }
html[data-theme] [data-langbtn] { border: 0; border-radius: 6px; font-size: 11px; padding: 5px 8px; }
html[data-theme] [data-burger],
html[data-theme] [data-drawer-x] { border-radius: 9px; }
html[data-theme] [data-drawer] { background: #0e1527 !important; border-right: 1px solid var(--color-divider); }
html[data-theme] #scroll-bar { background: linear-gradient(90deg, #ff6f61, #ffb299) !important; box-shadow: 0 0 12px #ff6f6170; }

html[data-theme] .btn {
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .01em;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .2s;
}
html[data-theme] .btn-primary,
html[data-theme] [data-btn="paper"] {
  background: var(--brand-coral);
  border-color: var(--brand-coral);
  color: #171b30;
  box-shadow: 0 6px 24px #ff6f6122, inset 0 1px 0 #ffffff30;
}
html[data-theme] .btn-primary:hover,
html[data-theme] [data-btn="paper"]:hover {
  color: #171b30;
  background: #ff9282;
  border-color: #ff9282;
  box-shadow: 0 8px 32px #ff6f6138;
  text-decoration: none;
}
html[data-theme] .btn-secondary,
html[data-theme] [data-btn="wire"] {
  color: var(--color-text);
  background: #ffffff04;
  border-color: #ffffff30;
}
html[data-theme] .btn-secondary:hover,
html[data-theme] [data-btn="wire"]:hover { background: #ffffff0b; border-color: #ffffff60; text-decoration: none; }
html[data-theme] .nav .btn { min-height: 38px; padding: 9px 16px; font-size: 13px; }

/* Hero: luminous workbench with the existing animated capture diagram. */
html[data-theme] .home-hero {
  color: var(--color-text) !important;
  background: #0b1020 !important;
  border-bottom: 1px solid var(--color-divider);
}
html[data-theme] .home-hero > div:first-child { opacity: .13 !important; mask-image: linear-gradient(#000, transparent); }
html[data-theme] .home-hero > div:nth-child(2) {
  background: radial-gradient(ellipse at 84% 34%, #ff6f611a, transparent 53%), radial-gradient(ellipse at 48% 100%, #3b71b51c, transparent 58%) !important;
}
.hero-eyebrow { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 32px; }
.hero-label { display: inline-flex; align-items: center; gap: 10px; color: #ffb4a7; font-size: 11px; letter-spacing: .12em; }
.hero-label > i { width: 6px; height: 6px; flex: none; background: var(--brand-coral); border-radius: 50%; box-shadow: 0 0 16px #ff6f6180; }
.hero-edition { font-size: 9px; letter-spacing: .15em; color: #8793b0; }
html[data-theme] .home-hero [data-hero-split] { min-height: 530px; padding-block: 66px 76px !important; gap: clamp(28px, 4vw, 64px) !important; }
html[data-theme] [data-hero-h1] { font-size: clamp(34px, 4.1vw, 54px) !important; line-height: 1.2 !important; letter-spacing: -.025em !important; }
html[data-theme] [data-hero-h1] [data-l] > span { color: var(--brand-coral) !important; }
html[data-theme] [data-lang="en"] [data-hero-h1] { font-size: clamp(29px, 3.2vw, 44px) !important; }
html[data-theme] [data-lang="ru"] [data-hero-h1] { font-size: clamp(25px, 2.45vw, 34px) !important; }
html[data-theme] .home-hero [data-hero-rise] > p { color: #afb9d0 !important; font-size: 15px !important; line-height: 1.95 !important; }
html[data-theme] .hero-console {
  position: relative;
  padding: 24px !important;
  border: 1px solid #ffb9ac38 !important;
  border-radius: 24px;
  background: linear-gradient(145deg, #20263cf0, #101a2bf0 70%);
  box-shadow: 0 24px 80px #00000040, 0 0 64px #ff6f610c, inset 0 1px 0 #ffffff13;
}
.console-heading { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid #ffffff12; color: #afbad2; font-size: 10px; letter-spacing: .12em; }
.console-dots { display: flex; gap: 5px; margin-right: auto; }
.console-dots i { width: 5px; height: 5px; background: #46506b; border-radius: 50%; }
.console-dots i:first-child { background: #ff8575; }
.console-signal { margin-left: auto; width: 22px; height: 8px; background: repeating-linear-gradient(90deg, #7bdde8 0 2px, transparent 2px 5px); opacity: .8; }
html[data-theme] #hero-draw { filter: drop-shadow(0 0 8px #7bdde812); }
html[data-theme] #hero-draw > rect:first-of-type { fill: #7bdde8; opacity: .2; }
html[data-theme] #hero-draw g[clip-path="url(#hero-print)"] { fill: #c2f4f7; }

/* Replace light/dark inversions with two complementary dark surfaces. */
html[data-theme] [data-invert] {
  --color-text: #f2f5ff;
  --color-divider: #ffffff1c;
  --color-accent: #ff6f61;
  --color-accent-100: #261d2b;
  --color-accent-400: #ff9788;
  --color-accent-700: #ff9c8d;
  --color-accent-800: #ffd2c9;
}
html[data-theme] [data-band="steel"] {
  color: var(--color-text) !important;
  background: linear-gradient(115deg, #11182c, #101729 60%, #141b2e) !important;
  border-block: 1px solid #ffffff0c;
}
html[data-theme] [data-band="steel"] > div[style*="pointer-events:none"] { opacity: .12 !important; }
html[data-theme] [data-band="steel"] b { color: var(--color-text) !important; }
html[data-theme] [data-band="steel"] p { color: #b4bed3 !important; }
html[data-theme] [data-band="steel"] .tag-accent { background: #ff6f6115; color: #ffae9f; }
html[data-theme] [data-back] { color: var(--text-muted); }
html[data-theme] [data-back]:hover { color: #fff; }

/* Shared diagram palette: retain geometry and animations. */
html[data-theme] [data-page] svg [stroke="#94bce3"],
html[data-theme] [data-page] svg [stroke="#b5d9fd"] { stroke: var(--signal-blue); }
html[data-theme] [data-page] svg [fill="#b5d9fd"],
html[data-theme] [data-page] svg [fill="#94bce3"] { fill: var(--signal-blue); }
html[data-theme] [data-page] svg [stroke="#f2f2f3"] { stroke: #e1e7fa; }
html[data-theme] [data-page] svg [stroke="#eef6ff"] { stroke: #ff9c8d; }
html[data-theme] [data-page] svg [fill="#eef6ff"] { fill: #ff9c8d; }

/* Cards, workflow nodes, and video surfaces. */
.video-cover { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate; }
.video-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%; color: #d65343; background: #fffffff0; border: 1px solid #ffd8cf; box-shadow: 0 3px 12px #24365714; backdrop-filter: blur(6px); transition: background .2s, color .2s, box-shadow .2s; pointer-events: none; }
.cover-play svg { margin-left: 2px; }
.cover-play-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html[data-theme] .video-cover:focus-visible { outline: 3px solid var(--color-accent); outline-offset: -4px; border-radius: inherit; }
.video-cover:hover .cover-play, .video-cover:focus-visible .cover-play { color: #c44838; background: #fff0eb; border-color: #ffad9c; box-shadow: 0 4px 16px #ff6f6126; }
.video-cover-compact { border-radius: 8px; }
.video-cover-compact .cover-play { width: 38px; height: 38px; }
.video-cover-compact .cover-play svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .cover-play { transition: none; } }
html[data-theme] .blueprint { border-radius: 18px; border-color: var(--color-divider); }
html[data-theme] .blueprint > .corner { display: none; }
html[data-theme] [data-page] .blueprint:hover { border-color: #ff6f6166; }
html[data-theme] [data-sol="1"],
html[data-theme] [data-ep],
html[data-theme] .guide-link {
  background: linear-gradient(145deg, #182137aa, #11192bf5);
  border: 1px solid #ffffff20;
  border-radius: 18px;
  box-shadow: inset 0 1px 0 #ffffff06;
  transition: border-color .22s, background .22s, box-shadow .22s, transform .22s;
}
html[data-theme] [data-sol="1"] { padding: 26px; }
html[data-theme] .guide-link { display: flex; flex-direction: column; padding: 18px; }
html[data-theme] .guide-link img { border-radius: 10px; margin-bottom: 22px; }
html[data-theme] .guide-link h3 { font-size: 20px; margin: 10px 0 12px; }
html[data-theme] .guide-link p { color: var(--text-muted); line-height: 1.9; }
html[data-theme] .guide-link-action { margin-top: auto; padding-top: 12px; color: #ffab9c; }
html[data-theme] .home-video-meta { color: #8291b1; font-size: 11px; letter-spacing: .06em; }
html[data-theme] [data-sec="home-guides"] { padding-top: 76px !important; padding-bottom: 40px !important; }
html[data-theme] [data-sec="home-guides"] > h2 { font-size: clamp(26px, 3vw, 36px) !important; margin-bottom: 32px !important; }
html[data-theme] [data-flow] > div { padding: 22px 18px; background: #ffffff03; border: 1px solid var(--color-divider); border-radius: 16px; }
html[data-theme] [data-flow] > i { margin-top: 52px; color: #ff9c8d; }
html[data-theme] [data-track] > *::after { background: var(--brand-coral); box-shadow: 0 0 0 5px var(--color-bg), 0 0 18px #ff6f6140; }
html[data-theme] [data-level] > div:first-child { border-radius: 8px; }
html[data-theme] [data-series="pda"] { --s-ink: #ffad98; --s-tint: #2b2030; }
html[data-theme] [data-series="admin"] { --s-ink: #9de6ed; --s-tint: #152c3a; }
html[data-theme] [data-chip] { border-radius: 100px; }
html[data-theme] [data-ep] > div { padding: 22px; gap: 10px; }
html[data-theme] [data-ep] h3 { line-height: 1.55; }
html[data-theme] [data-dur] { border-radius: 6px; background: #090d1adc; }
html[data-theme] .tutorial-entry {
  background: #182239;
  color: var(--color-text);
  border: 1px solid #ffffff22;
  border-left: 3px solid var(--s-ink);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
html[data-theme] .tutorial-entry img { border-radius: 8px; }
html[data-theme] .tutorial-entry p,
html[data-theme] [data-band="steel"] .tutorial-entry p { color: #b4bed3 !important; }
html[data-theme] .tutorial-entry-actions > a:not(.btn) { color: var(--s-ink); }
html[data-theme] .watch-player { overflow: hidden; border-radius: 18px; border: 1px solid #ffffff26; background: #050813; box-shadow: var(--shadow-lg); }
html[data-theme] .watch-item { background: #11192b; border-radius: 10px; padding: 14px; }
html[data-theme] .watch-item[aria-current="page"] { background: #ff6f6115; color: #ffb4a7; border-color: #ff6f6160; }
html[data-theme] [data-page="guide"],
html[data-theme] [data-page="watch"] { background: radial-gradient(ellipse at 100% 0, #ff6f610a, transparent 45%); }

/* Forms, selection matrix, and footer are part of the same theme. */
html[data-theme] .input { border-radius: 10px; min-height: 46px; padding: 11px 14px; background: #10182a; }
html[data-theme] .input:focus-visible { border-color: #ff9788; outline: 3px solid #ff6f6120; outline-offset: 0; }
html[data-theme] .input::placeholder { color: #74829e; }
html[data-theme] textarea.input { min-height: 132px; }
html[data-theme] [data-cmp-open] > div { border-radius: 20px; box-shadow: var(--shadow-lg); }
html[data-theme] [data-cmp] { border-radius: 14px; }
html[data-theme] [data-cmp="1"] thead [data-hcol] { color: var(--color-text); }
html[data-theme] [data-cmp="1"] thead [data-hcol="1"],
html[data-theme] [data-cmp="1"]:has([data-col="2"]:hover) thead [data-hcol="2"],
html[data-theme] [data-cmp="1"]:has([data-col="3"]:hover) thead [data-hcol="3"] { background: #ff6f611c; }
html[data-theme] footer { background: #060a14; border-top: 1px solid #ff6f6122 !important; }
html[data-theme] footer > div { padding-top: 52px !important; }
html[data-theme] img[src^="assets/qr/"] { background: #fff !important; border: 5px solid #fff; border-radius: 8px; }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  html[data-theme] .guide-link:hover,
  html[data-theme] [data-sol="1"]:hover { transform: translateY(-4px); border-color: #ff9c8d70; box-shadow: 0 16px 36px #00000035; }
  html[data-theme] .btn:hover { transform: translateY(-1px); }
}
@media (min-width: 861px) {
  html[data-theme] [data-sticky] { top: 72px; height: calc(100vh - 72px); min-height: min(540px, calc(100vh - 72px)); }
}
@media (max-width: 1320px) {
  html[data-theme] [data-navlinks],
  html[data-theme] [data-navcta] { display: none !important; }
  html[data-theme] [data-burger] { display: inline-flex; }
  html[data-theme] .nav > .seg { margin-left: auto !important; }
  .hero-edition { display: none; }
  html[data-theme] .nav-brand { margin-right: auto; }
}
@media (max-width: 860px) {
  html[data-theme] .home-hero [data-hero-split] { min-height: 0; padding-block: 40px 48px !important; gap: 40px !important; }
  html[data-theme] [data-hero-h1] { font-size: clamp(32px, 6.7vw, 50px) !important; }
  html[data-theme] [data-lang="en"] [data-hero-h1] { font-size: clamp(27px, 5.8vw, 42px) !important; }
  html[data-theme] [data-lang="ru"] [data-hero-h1] { font-size: clamp(21px, 4.6vw, 32px) !important; }
  html[data-theme] .hero-console { max-width: 520px !important; padding: 20px !important; border-radius: 18px; }
  html[data-theme] [data-flow] > div { padding: 22px !important; }
  html[data-theme] [data-sec="home-guides"] { padding-top: 48px !important; padding-bottom: 12px !important; }
  html[data-theme] .watch-player { border-radius: 12px; }
}
@media (max-width: 480px) {
  html[data-theme] .nav { min-height: 64px; padding-inline: 14px !important; gap: 8px !important; }
  html[data-theme] .nav .brand-logo { width: 112px; height: 28px; }
  html[data-theme] .nav [data-langbtn] { padding-inline: 7px; }
  .hero-eyebrow { padding-top: 24px; }
  .hero-label { font-size: 10px; letter-spacing: .08em; }
  .console-heading { gap: 8px; margin-bottom: 18px; font-size: 9px; }
  html[data-theme] .home-hero [data-hero-rise] > p { font-size: 14px !important; }
  html[data-theme] .guide-link { padding: 16px; }
  html[data-theme] .btn { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme] .btn,
  html[data-theme] .guide-link,
  html[data-theme] [data-sol="1"] { transition: none; }
}

/* Preserve intrinsic image proportions while reserving layout space. */
img[width][height] { height: auto; }
