/* Rontex theme, using the Greate dark palette. Layout and media stay in style.css. */
:root {
  color-scheme: dark;
  --rontex-ink: #070f1f;
  --rontex-surface: #0e1a30;
  --rontex-surface-raised: #132242;
  --rontex-brand: #0066cc;
  --rontex-brand-hover: #0756a7;
  --rontex-sky: #5aa9ff;
  --rontex-text: #eef3fb;
  --rontex-muted: #a7b6cc;
  --rontex-line: rgb(255 255 255 / 0.12);
  --rontex-line-strong: rgb(255 255 255 / 0.25);
  --rontex-sans: 'Noto Sans TC', 'PingFang TC', ui-sans-serif, system-ui, sans-serif;
  --rontex-display: 'Space Grotesk', var(--rontex-sans);
  --rontex-chip-art: url("../assets/images/ai-chip-motion.svg?v=2");
}

body.font-inter {
  background: var(--rontex-ink);
  color: var(--rontex-text);
  font-family: var(--rontex-sans);
}

h1, h2, h3, h4 { font-family: var(--rontex-display); }
h1, h2 { letter-spacing: -0.025em; }
.text-light, .text-white { color: var(--rontex-text); }
.text-gray-300, .text-gray-400, .text-white-400,
.pdf-dialog-copy, #pdfSelectionStatus { color: var(--rontex-muted); }
.text-accent, .hover\:text-accent:hover, .a-href:hover { color: var(--rontex-sky); }

.bg-secondary, .bg-dark, .product-bg { background-color: var(--rontex-ink); }
#downloads, #about, footer.product-bg { background-color: var(--rontex-surface); }
#home {
  background: radial-gradient(ellipse at 78% 20%, #132d54, var(--rontex-ink) 72%);
}
#home .space-y-2, .border-left { border-left-color: var(--rontex-sky); }
.bg-primary\/30 { background-color: rgb(0 102 204 / 0.22); }

#navbar {
  background-color: rgb(7 15 31 / 0.90);
  border-bottom: 1px solid var(--rontex-line);
}
#mobileMenu, .languageDropdown .dropdown-list {
  background: var(--rontex-surface);
  border: 1px solid var(--rontex-line);
}
.languageDropdown .dropdown-selected {
  background: var(--rontex-surface-raised);
  color: var(--rontex-text);
  border: 1px solid var(--rontex-line);
}
.languageDropdown .dropdown-selected::after { border-top-color: var(--rontex-sky); }
.languageDropdown.open .dropdown-selected::after { border-bottom-color: var(--rontex-sky); }
.languageDropdown .dropdown-list a { color: var(--rontex-text); }
.languageDropdown .dropdown-list a:hover { background: var(--rontex-surface-raised); }

.card-hover, #contact .bg-dark\/50 {
  background-color: rgb(14 26 48 / 0.92);
  border-color: var(--rontex-line);
}
.card-hover:hover {
  border-color: rgb(90 169 255 / 0.44);
  box-shadow: 0 16px 32px rgb(0 0 0 / 0.24);
}

.bg-accent, .pdf-send-button {
  background-color: var(--rontex-brand);
  color: #fff;
}
.bg-accent:hover, .pdf-send-button:not(:disabled):hover { background-color: var(--rontex-brand-hover); }
:is(a, button).bg-accent:not(#backToTop),
#home a.rounded-full, .pdf-send-button { border-radius: 6px; }
#home a.bg-white\/10 { border-color: var(--rontex-line-strong); }
#home a.bg-white\/10:hover { background: var(--rontex-surface-raised); }

#pdfDialog {
  background: var(--rontex-surface);
  color: var(--rontex-text);
  border-color: var(--rontex-line-strong);
  scrollbar-color: var(--rontex-sky) var(--rontex-ink);
}
#pdfDialog::backdrop { background: rgb(7 15 31 / 0.82); }
#pdfDialog::-webkit-scrollbar-track { background: var(--rontex-ink); }
#pdfDialog::-webkit-scrollbar-thumb { background-color: #435e80; border-color: var(--rontex-ink); }
#pdfDialog::-webkit-scrollbar-thumb:hover { background-color: var(--rontex-sky); }
#pdfName, #pdfCompany, #pdfEmail, #contactForm input:not([type="hidden"]), #contactForm textarea {
  background: var(--rontex-ink);
  border-color: var(--rontex-line-strong);
  color: var(--rontex-text);
}
#pdfDialog .pdf-choices { border-color: var(--rontex-line-strong); }
.pdf-choice input { accent-color: var(--rontex-sky); }
:is(a, button, input, textarea, [role="button"]):focus-visible {
  outline: 2px solid var(--rontex-sky);
  outline-offset: 3px;
}

/* The animated processor replaces the hero photo in the decorative background layer. */
.hero-chip-bg {
  position: absolute;
  z-index: 1;
  top: clamp(4.5rem, 9vh, 6.25rem);
  right: max(-8rem, calc((100% - 104rem) / 2));
  width: clamp(39rem, 87vw, 75rem);
  aspect-ratio: 1160 / 760;
  background: var(--rontex-chip-art) center / contain no-repeat;
  --chip-opacity: 0.87;
  opacity: var(--chip-opacity);
  pointer-events: none;
  transform: perspective(1300px) translateY(var(--chip-scroll-y, 0px))
    rotateZ(var(--chip-scroll-roll, 0deg)) rotateY(var(--chip-scroll-tilt, 0deg));
  transform-origin: 57% 45%;
  mask-image: radial-gradient(ellipse at 57% 45%, #000 36%, rgb(0 0 0 / 0.85) 52%, transparent 78%);
}

/* Each section has its own illustrated scene, separate from its content photos. */
#advantage {
  --section-art: url("../assets/images/section-advantage-art.svg");
  --section-glow: 82 207 255;
  --section-signal: url("../assets/images/section-advantage-motion.svg");
  --signal-top: -6rem;
}
#services {
  --section-art: url("../assets/images/section-services-art.svg");
  --section-glow: 84 160 255;
  --section-signal: url("../assets/images/section-services-motion.svg");
  --signal-top: -9rem;
}
#products { --section-art: url("../assets/images/section-products-art.svg"); --section-glow: 123 142 255; }
#case { --section-art: url("../assets/images/section-case-art.svg"); --section-glow: 110 191 255; }
#downloads { --section-art: url("../assets/images/section-downloads-art.svg"); --section-glow: 102 184 255; }
#about {
  --section-art: url("../assets/images/section-about-art.svg");
  --section-glow: 84 225 214;
  --section-signal: url("../assets/images/section-about-motion.svg");
  --signal-top: 7rem;
}
#team { --section-art: url("../assets/images/section-team-art.svg"); --section-glow: 155 162 255; }
#contact { --section-art: url("../assets/images/section-contact-art.svg"); --section-glow: 94 198 255; }

body > section:not(#home) {
  --section-base: var(--rontex-ink);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  background-color: var(--section-base);
  background-image: none;
}
#downloads, #about { --section-base: var(--rontex-surface); }
body > section:not(#home)::before,
body > section:not(#home)::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -24px 0 auto;
  height: min(calc(100% + 48px), 64rem);
  pointer-events: none;
}
body > section:not(#home)::before {
  background: radial-gradient(ellipse at 71% 35%, rgb(var(--section-glow, 90 169 255) / 0.12), transparent 58%);
  mask-image: linear-gradient(#000 64%, transparent);
  translate: 0 var(--section-photo-y, 0px);
}
body > section.section-in-view:not(#home)::before {
  background:
    var(--section-art, none) right -1rem top -1.5rem / clamp(40rem, 82vw, 75rem) auto no-repeat,
    radial-gradient(ellipse at 71% 35%, rgb(var(--section-glow, 90 169 255) / 0.12), transparent 58%);
}
body > section:not(#home)::after {
  background:
    radial-gradient(ellipse at 47% 35%, rgb(var(--section-glow, 90 169 255) / 0.19), transparent 64%),
    linear-gradient(122deg, transparent 34%, rgb(var(--section-glow, 90 169 255) / 0.15) 48%, transparent 64%);
  mask-image: linear-gradient(#000, #000 48%, transparent 95%);
  opacity: 0;
}

.section-signal {
  position: absolute;
  z-index: -1;
  top: var(--signal-top, 0);
  right: 0;
  width: min(57rem, 100%);
  aspect-ratio: 900 / 520;
  pointer-events: none;
  opacity: 0.82;
}
.section-in-view > .section-signal {
  background: var(--section-signal, none) center / contain no-repeat;
}

@media (max-width: 639px) {
  .hero-chip-bg {
    top: 5.5rem;
    right: -12.5rem;
    width: 40rem;
    --chip-opacity: 0.56;
  }
  .section-signal {
    width: min(36rem, 150vw);
    right: -2.5rem;
    top: max(var(--signal-top, 0px), -2rem);
    opacity: 0.66;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-chip-bg { transform: none; }
  body > section:not(#home)::before { translate: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .section-signal {
    translate: 0 calc(var(--section-photo-y, 0px) * 0.9);
    transition: filter 240ms ease, opacity 240ms ease, scale 240ms ease;
  }
  html.is-scroll-boost .section-in-view > .section-signal {
    filter: brightness(1.65) saturate(1.16);
    opacity: 1;
    scale: 1.035;
  }
  html.is-scroll-boost body > section.section-in-view:not(#home)::after {
    filter: brightness(1.55);
  }
  body > section:not(#home)::before {
    animation: rontex-section-pan 16s ease-in-out infinite alternate paused;
    transform-origin: 55% 36%;
    transition: filter 240ms ease;
  }
  body > section:not(#home)::after {
    animation: rontex-section-light 8s ease-in-out infinite paused;
  }
  body > section.section-in-view:not(#home)::before,
  body > section.section-in-view:not(#home)::after {
    animation-play-state: running;
  }
  html.is-scroll-boost body > section.section-in-view:not(#home)::before {
    filter: brightness(1.28) saturate(1.12);
  }
  #services::before, #about::before { animation-duration: 20s; }
  #services::after, #about::after { animation-duration: 10s; }
  @keyframes rontex-section-pan {
    from { transform: scale(1.01); }
    to { transform: scale(1.10); }
  }
  @keyframes rontex-section-light {
    0%, 100% { transform: translateX(-42%); opacity: 0.25; }
    25% { opacity: 0.9; }
    55% { transform: translateX(39%); opacity: 0.65; }
    72% { opacity: 0.1; }
    73%, 99% { transform: translateX(-42%); opacity: 0.1; }
  }
  .hero-chip-bg {
    animation: rontex-chip-boot 1.2s cubic-bezier(0.2, 0.7, 0.25, 1);
  }
  #home::before {
    content: '';
    position: absolute;
    z-index: 2;
    inset: 0 auto 0 0;
    width: min(26vw, 23rem);
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgb(90 195 255 / 0.1) 66%, rgb(156 236 255 / 0.48) 91%, transparent);
    animation: rontex-boot-scan 1.16s ease-out both;
  }
  @keyframes rontex-chip-boot {
    0% { opacity: 0.12; scale: 0.93; }
    52% { opacity: 1; }
    100% { opacity: var(--chip-opacity); scale: 1; }
  }
  @keyframes rontex-boot-scan {
    0% { transform: translateX(-40vw) skewX(-19deg); opacity: 0; }
    30% { opacity: 0.72; }
    100% { transform: translateX(114vw) skewX(-19deg); opacity: 0; }
  }
  .scroll-arrived { animation: rontex-scroll-arrive 540ms cubic-bezier(0.2, 0.65, 0.3, 1) both; }
  .photo-arrived { animation: rontex-photo-arrive 670ms cubic-bezier(0.2, 0.65, 0.3, 1); }
  @keyframes rontex-scroll-arrive {
    from { opacity: 0.8; translate: 0 14px; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes rontex-photo-arrive {
    from { opacity: 0.65; translate: 0 13px; scale: 0.97; }
    to { opacity: 1; translate: 0 0; scale: 1; }
  }
}
