:root {
  --tint: #eef1ff;
  --accent-line: #c8d4fb;
  --button-ink: #fff;
  --mark: url('./assets/rs-light.png');
  --site-error: #842c19;
  --site-error-surface: #fff3ef;
  --site-error-line: #f6d6cd;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d1322;
  --surface: #151e30;
  --ink: #eef3ff;
  --muted: #acbbd4;
  --line: #2d3b54;
  --blue: #8daaff;
  --blue-hover: #aec0ff;
  --focus: #9eb7ff;
  --width: 80rem;
  --tint: #23375f;
  --accent-line: #435d93;
  --button-ink: #101a31;
  --mark: url('./assets/rs-dark.png');
  --site-error: #ffd1c6;
  --site-error-surface: #392637;
  --site-error-line: #85545e;
}
.site-header .brand-icon, .site-footer .brand-icon {
  background: var(--mark) center / 100% 100% no-repeat;
}
.site-header .brand { letter-spacing: -.068em; }
.site-header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  justify-content: flex-end;
  gap: .5rem;
}
.site-theme-toggle {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--surface);
  color: var(--ink);
  font: 1.4rem/1 "Segoe UI Symbol", system-ui, sans-serif;
}
.site-theme-toggle:hover { background: var(--tint); color: var(--blue); border-color: var(--accent-line); }
.site-back { color: var(--blue); font-size: .9rem; font-weight: 650; }
.site-back:hover { text-decoration: underline; text-underline-offset: .2em; }
.site-header-actions .header-contact { align-self: center; white-space: nowrap; }
.button-primary { color: var(--button-ink); }
.button-outline:hover, .button-secondary:hover,
.main-nav a:hover, .main-nav .nav-current,
.checkout-nav a:hover, .checkout-plans a:hover,
.checkout-nav a[aria-current], .checkout-plans a[aria-current],
.program-review-link:hover {
  color: var(--blue);
  background: var(--tint);
  border-color: var(--accent-line);
}
.button:hover .icon-chat::after { background: var(--tint); }
.support-panel { background: var(--surface); border-color: var(--line); }

.home-page .hero {
  grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr);
  padding-block: 1.9rem 1.8rem;
  gap: clamp(1.4rem, 4vw, 4rem);
}
.home-page .hero-copy { container-type: inline-size; padding: 0; }
.home-page .hero h1 { font-size: min(clamp(2.8rem, 5.15vw, 5.05rem), 12.7cqi); }
.home-page .hero p { margin-top: 1.1rem; max-width: 35ch; line-height: 1.45; }
.home-page .hero-button { margin-top: 1.4rem; min-height: 2.75rem; }
.home-page .hero-art {
  position: relative;
  isolation: isolate;
  border-radius: 1.2rem;
  background: #1941ee;
  aspect-ratio: 1.79;
}
.robot-scene {
  position: absolute;
  width: 100%;
  top: 23%;
  transform: translateY(-23%);
  aspect-ratio: 3 / 2;
}
.hero-art .robot-scene img { object-fit: fill; }
.robot-eyes {
  position: absolute;
  inset: 0;
  opacity: 0;
  mask-image:
    radial-gradient(ellipse 6.5% 4.6% at 48.8% 33.3%, black 65%, transparent),
    radial-gradient(ellipse 6.4% 4.6% at 63.2% 29.6%, black 65%, transparent),
    radial-gradient(ellipse 4.1% 6% at 58.8% 59.9%, black 45%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .hero-art.robot-awake .robot-eyes { animation: robot-wake 1650ms ease-in-out; }
}
@keyframes robot-wake {
  0%, 100% { opacity: 0; filter: brightness(1); }
  15% { opacity: .94; filter: brightness(.27); }
  30% { opacity: 1; filter: brightness(1.8) saturate(1.15); }
  54% { opacity: .66; filter: brightness(1.25); }
  71% { opacity: .33; filter: brightness(1.6); }
}
.home-page .catalog { padding-top: 1.6rem; border-top: 1px solid var(--line); }
.home-page .catalog-toolbar { margin: .85rem 0 .8rem; }
.home-page .program-grid { gap: .75rem; }
.home-page .product-card { border-radius: .8rem; padding: .9rem; min-height: 11rem; }
.home-page .product-card:hover, .home-page .product-card:focus-within { border-color: var(--accent-line); }
.home-page .product-head { align-items: center; justify-content: flex-start; gap: .65rem; }
.home-page .product-icon { flex: 0 0 auto; width: 2.5rem; height: 2.5rem; border-radius: .65rem; }
.home-page .product-identity { min-width: 0; }
.home-page .product-title { margin: 0; font-size: 1.2rem; overflow-wrap: anywhere; }
.home-page .product-meta { padding: 0; margin: .18rem 0 0; gap: .3rem; }
.home-page .product-meta span { background: none; color: var(--muted); padding: 0; font-size: .76rem; }
.home-page .product-version:not([hidden]):not(:first-child)::before { content: "·"; margin-right: .35rem; }
.home-page .product-summary { margin-top: .55rem; font-size: .875rem; }
.home-page .product-footer { align-items: center; margin-top: auto; padding-top: .85rem; border: 0; }
.product-free { display: block; margin-top: .2rem; color: var(--muted); font-size: .76rem; }
.product-open { color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.product-open:hover { color: var(--blue); background: var(--tint); border-color: var(--accent-line); }

.home-page #services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .7rem;
  margin-block: clamp(1.8rem, 4vw, 3.8rem);
}
.home-page #services .catalog-heading { grid-column: 1 / -1; margin: 0 0 .25rem; }
.home-page #services .support-panel {
  display: grid;
  grid-template-columns: 2.35rem minmax(0,1fr);
  grid-template-rows: auto auto;
  align-items: start;
  gap: .24rem .7rem;
  padding: .85rem;
  margin: 0;
  border-radius: .85rem;
}
.service-icon {
  grid-row: span 2;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: .45rem;
  background: var(--tint);
  color: var(--blue);
  font: 650 .86rem/1 ui-monospace, Consolas, monospace;
}
.home-page #services h3 { font-size: 1.23rem; letter-spacing: -.025em; line-height: 1.2; }
.home-page #services p { margin: .2rem 0 0; font-size: .85rem; }
.home-page #services .button {
  justify-self: start;
  min-height: 1.4rem;
  padding: 0;
  color: var(--blue);
  background: none;
  border: 0;
  font-size: .85rem;
}
.home-page #services .button:hover { text-decoration: underline; }
.home-help {
  display: grid;
  grid-template-columns: minmax(0,1.15fr) minmax(0,1fr);
  gap: clamp(1rem,3vw,2.5rem);
  align-items: start;
  padding-block: 1.6rem 2rem;
  border-top: 1px solid var(--line);
}
.home-help .help, .home-help .support { margin: 0; padding: 0; }
.home-help .help h2 { margin: 0 0 .85rem; }
.home-help .support-panel { align-items: flex-start; flex-direction: column; gap: 1rem; }
.program-hero.program-identity { justify-content: flex-start; align-items: flex-start; flex-direction: row; gap: 1rem; padding: clamp(1rem, 3vw, 1.8rem); background: var(--surface); border-color: var(--line); }
.program-identity > .product-icon { order: -1; width: clamp(2.7rem, 6vw, 4rem); height: clamp(2.7rem, 6vw, 4rem); box-shadow: none; border-radius: .75rem; }
.program-category { color: var(--blue); }
.program-get .program-detail-meta { display: block; }
.program-get .program-detail-meta > div { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: .55rem 0; }
.program-get .program-detail-meta dd { margin: 0; text-align: end; }
.program-get .program-detail-meta > div:has(dd:empty) { display: none; }
.program-get .checkout-actions .button { flex: 1 1 8rem; text-align: center; }

[data-theme="dark"] .program-hero:not(.program-identity), [data-theme="dark"] .ip-card {
  background: var(--surface);
  border-color: var(--line);
}
[data-theme="dark"] .filters { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .ip-fields > div,
[data-theme="dark"] .legacy-article th,
[data-theme="dark"] .legacy-article td,
[data-theme="dark"] .legacy-plan + .legacy-plan { border-color: var(--line); }
[data-theme="dark"] .sort-box select option, [data-theme="dark"] .checkout-field input { background: var(--page); color: var(--ink); }
[data-theme="dark"] .filters button[aria-pressed="true"], [data-theme="dark"] .dialog-close:hover,
[data-theme="dark"] .program-review-play, [data-theme="dark"] .product-meta span:not(.product-platform,.product-version),
[data-theme="dark"] .program-notice, [data-theme="dark"] .dialog-product-notice,
[data-theme="dark"] .checkout-notice, [data-theme="dark"] .download-panel .download-notice,
[data-theme="dark"] .checkout-total, [data-theme="dark"] .product-kind, [data-theme="dark"] .dialog-product-kind {
  background: var(--tint);
  color: var(--ink);
  border-color: var(--accent-line);
}
[data-theme="dark"] .download-panel .download-error,
[data-theme="dark"] .checkout-error {
  color: var(--site-error);
  background: var(--site-error-surface);
  border-color: var(--site-error-line);
}
[data-theme="dark"] .checkout-actions button:disabled { color: var(--muted); background: var(--surface); }
[data-theme="dark"] .faq summary::after { color: var(--blue); background: var(--tint); }
[data-theme="dark"] .ip-card .ip-value, [data-theme="dark"] .ip-card .ip-label { color: var(--ink); }
[data-theme="dark"] .ip-fields dd, [data-theme="dark"] .ip-agent, [data-theme="dark"] .legacy-link, [data-theme="dark"] .legacy-meta { color: var(--ink); }

@media (min-width: 58rem) {
  .home-page .product-card:only-child { grid-column: span 2; }
}
@media (max-width: 53rem) {
  .home-page .hero { grid-template-columns: 1fr; }
  .program-detail-grid:has(.program-identity) { grid-template-columns: 1fr; }
  .program-detail-grid:has(.program-identity) > div { display: contents; }
  .program-identity { order: -2; }
  .program-get { order: -1; }
}
@media (max-width: 47rem) {
  .home-page .hero h1 { font-size: min(clamp(2.625rem, 8.6vw, 4.2rem), 12.7cqi); }
}
@media (max-width: 42rem) {
  .site-header .header-inner {
    grid-template-columns: minmax(0,1fr) auto;
    gap: .25rem .45rem;
    padding-block: .5rem;
  }
  .site-header .main-nav { display: flex; grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; flex-wrap: wrap; }
  .site-header-actions { grid-row: 1; grid-column: 2; gap: .35rem; }
  .site-header-actions .header-contact { display: inline-flex; min-height: 2.15rem; padding: .2rem .5rem; font-size: .78rem; }
  .site-header-actions .header-contact .icon { display: none; }
  .site-theme-toggle { width: 2.15rem; height: 2.15rem; }
  .home-page #services, .home-help { grid-template-columns: 1fr; }
  .home-page .hero-art { aspect-ratio: 1.6; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
