/* InfiniPort landing — layers: background (color fields + light threads) → glass → content. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/inter-latin-500.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600.woff2) format("woff2"); }

/* Material tokens registered so surfaces glide between states (recipe step 1). */
@property --glass-alpha { syntax: "<number>"; inherits: true; initial-value: 0.22; }

:root {
  --primary: #3d7fd9;
  --primary-fill: #2470ce;
  --primary-rgb: 61 127 217;
  --bg: #ffffff;
  --text: #0b0c0f;
  --text-2: rgb(60 60 67);
  --ring: rgb(36 112 206 / 0.55);
  --container: 1200px;
  --gutter: 24px;
  /* Radius scale (Stisla): base 1rem; sm 0.65, md 0.75, lg 1, 2xl 2. Only pills are fully round. */
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Liquid glass, light (recipe step 1): white 6–22% (dense when the backdrop cannot be read), blur 2px. */
  --glass-rgb: 255 255 255;
  --glass-dense: 0.22;
  --glass-filter: blur(2px) saturate(180%) brightness(1.06);
  --glass-edge: inset 1.5px 1.5px 1px -1px rgb(255 255 255 / 0.95), inset -1.5px -1.5px 1px -1px rgb(255 255 255 / 0.55),
    inset 0 0 0 0.5px rgb(255 255 255 / 0.3);
  --glass-shadow: 0 0 0 0.5px rgb(0 0 0 / 0.06), 0 6px 24px rgb(0 0 0 / 0.08);
  --glass-light: 1;
  --glass-ink: rgb(0 0 0 / 0.86);
  --glass-ink-2: rgb(60 60 67);
  --glass-icon: #000;
  --glass-icon-opacity: 0.86;
  --glass-blend: multiply;
  --glass-solid: #ffffff;
  --wallpaper: radial-gradient(ellipse 32% 48% at 26% 25%, #ffffff 52%, #ffffff00 82%),
    radial-gradient(ellipse 60% 40% at 80% 13%, #65a9ec 58%, #65a9ec00 100%),
    radial-gradient(ellipse 16% 64% at -2% 68%, #65a9ec 65%, #65a9ec00 100%), #ffffff;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #000000;
  --text: #f5f5f7;
  --text-2: rgb(235 235 245 / 0.78);
  --ring: rgb(120 170 240 / 0.7);
  --glass-rgb: 20 20 24;
  --glass-dense: 0.38;
  --glass-filter: blur(2px) saturate(160%) brightness(0.8);
  --glass-edge: inset 1.5px 1.5px 1px -1px rgb(255 255 255 / 0.32), inset -1.5px -1.5px 1px -1px rgb(255 255 255 / 0.18),
    inset 0 0 0 0.5px rgb(0 0 0 / 0.45);
  --glass-shadow: 0 6px 24px rgb(0 0 0 / 0.24);
  --glass-light: 0.3333;
  --glass-ink: rgb(255 255 255 / 0.94);
  --glass-ink-2: rgb(235 235 245);
  --glass-icon: #fff;
  --glass-icon-opacity: 0.94;
  --glass-blend: plus-lighter;
  --glass-solid: rgb(28 28 32);
  --wallpaper: radial-gradient(ellipse 32% 48% at 26% 25%, #000000 52%, #00000000 82%),
    radial-gradient(ellipse 60% 40% at 80% 13%, #3d7fd9 58%, #3d7fd900 100%),
    radial-gradient(ellipse 16% 64% at -2% 68%, #3d7fd9 65%, #3d7fd900 100%), #000000;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss03";
}
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 12px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; }

/* ---------- Background layer: one canvas for fields, hero threads and glass (scene.js) ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--wallpaper);
  pointer-events: none;
}
.backdrop__canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 250ms linear;
}
.backdrop__canvas[data-ready] { opacity: 1; }

/* ---------- Liquid glass (recipe steps 1–2, 6) ---------- */
.glass {
  --glass-alpha: var(--glass-dense);
  position: relative;
  isolation: isolate;
  background: rgb(var(--glass-rgb) / var(--glass-alpha));
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--glass-shadow);
  color: var(--glass-ink);
  transition: --glass-alpha 0.35s ease;
}
/* Inner light: a top-left radial highlight and soft glows just inside the rim. */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  opacity: var(--glass-light);
  background: radial-gradient(at 0% 0%, rgb(255 255 255 / 0.3), transparent 55%);
  box-shadow: inset 3px 3px 10px -8px rgb(255 255 255 / 0.5), inset -2px -3px 8px -7px rgb(0 0 0 / 0.2);
}
.glass :is(.partners__label, .nav__link, .button--glass) { mix-blend-mode: var(--glass-blend); }
.glass .icon { color: var(--glass-icon); opacity: var(--glass-icon-opacity); }

/* WebGL glass (glass.js): the background canvas refracts itself at each surface's rim
   (Glass theme auth glass-shader). The CSS material above stays as the fallback. */
.glass__surface { display: none; position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; border-radius: inherit; pointer-events: none; }
html[data-glass="webgl"] .glass:has(> .glass__surface) { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-glass="webgl"] .glass__surface { display: block; }

/* ---------- Buttons ---------- */
.button {
  --button-edge: .071429em;
  --button-light: rgb(255 255 255 / .28);
  --button-dark-edge: rgb(0 0 0 / .18);
  --button-contact: rgb(0 0 0 / .13);
  --button-lift: rgb(0 0 0 / .10);
  --button-press: rgb(0 0 0 / .21);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 120ms ease-out, box-shadow 200ms ease-out, --glass-alpha 0.35s ease, background-color 160ms ease;
}
.button--sm { height: 36px; padding: 0 16px; font-size: 14px; border-radius: var(--radius-sm); }
.button--lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: var(--radius-lg); }
.button--lg .icon { width: 20px; height: 20px; }
/* Solid fill with the Glass button material: top hairline highlight, faint contact shadow. */
.button--primary {
  color: #fff;
  background: var(--primary-fill);
  overflow: hidden;
  isolation: isolate;
  box-shadow: inset 0 var(--button-edge) var(--button-light), inset 0 calc(-1 * var(--button-edge)) var(--button-dark-edge), 0 1px 2px var(--button-contact), 0 3px 6px var(--button-lift);
}
[data-theme="dark"] .button {
  --button-light: rgb(255 255 255 / .15);
  --button-dark-edge: rgb(0 0 0 / .36);
  --button-contact: rgb(0 0 0 / .34);
  --button-lift: rgb(0 0 0 / .27);
  --button-press: rgb(0 0 0 / .40);
}
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  box-shadow: var(--glass-edge);
}
.button--primary .icon { transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .button:hover { transform: translateY(-1px); }
  .button--primary:hover .icon { transform: translateX(3px); }
}
.button:active { transform: translateY(1px); }
.button--primary:active { box-shadow: inset 0 var(--button-edge) 2px var(--button-press), inset 0 calc(-1 * var(--button-edge)) var(--button-light), 0 1px 2px var(--button-contact); }
.button--glass:active::after { box-shadow: var(--glass-edge), inset 0 var(--button-edge) 2px var(--button-press); }
.button--glass { color: var(--glass-ink); }

/* ---------- Navigation ---------- */
.nav-wrap {
  position: fixed;
  inset: 16px 0 auto;
  z-index: 10;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--container);
  height: 60px;
  margin: 0 auto;
  padding: 0 12px 0 18px;
  border-radius: 20px;
  pointer-events: auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand__mark { width: 44px; height: auto; }
.brand__word {
  width: 98px;
  height: 17px;
  background: var(--glass-ink);
  -webkit-mask: url(../images/brand/wordmark.png) left center / contain no-repeat;
  mask: url(../images/brand/wordmark.png) left center / contain no-repeat;
}
.nav__actions { display: flex; align-items: center; gap: 10px; }
.nav__link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 160ms ease;
}
.nav__link:hover { background: rgb(255 255 255 / 0.42); }
[data-theme="dark"] .nav__link:hover { background: rgb(255 255 255 / 0.08); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  min-height: 100svh;
  padding: 160px var(--gutter) 40px;
}
.hero::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 62% 52% at 24% 66%, rgb(255 255 255 / 0.6), transparent 72%);
  transition: opacity 250ms linear;
}
/* The canvas draws this veil itself (so glass can refract it). */
html[data-scene="webgl2"]:has(.backdrop__canvas[data-ready]) .hero::after { opacity: 0; }
[data-theme="dark"] .hero::after {
  background: radial-gradient(ellipse 72% 46% at 26% 70%, rgb(0 0 0 / 0.82), rgb(0 0 0 / 0.4) 55%, transparent 80%);
}
.hero__body { width: 100%; max-width: var(--container); margin: auto auto 0; }
.hero__title {
  font-size: clamp(56px, 8.2vw, 116px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.hero__title .line { display: block; }
.hero__lead {
  max-width: 34em;
  margin-top: 28px;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.55;
  letter-spacing: -0.011em;
  color: var(--text-2);
}
/* Lines break only after a comma or a full stop: each phrase stays whole. */
.hero__lead span { white-space: nowrap; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* Title entrance: lines rise out of a blur, staggered (Apple product pages; Magic UI BlurFade). */
html.enhanced .hero__title .line,
html.enhanced .intro {
  animation: rise 1100ms var(--ease-out) both;
  animation-delay: calc(120ms + var(--i, 0) * 110ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(0.4em); filter: blur(14px); }
  to { opacity: 1; transform: none; filter: none; }
}
html.enhanced .intro { animation-name: rise-soft; }
@keyframes rise-soft {
  from { opacity: 0; transform: translateY(16px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* ---------- Partners marquee (Magic UI Marquee; Vercel / Linear logo walls) ---------- */
.partners {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: var(--container);
  min-height: 84px;
  margin: 0 auto;
  padding: 0 8px 0 28px;
  border-radius: 24px;
  overflow: hidden;
}
.partners__label { flex: none; font-size: 14px; font-weight: 500; color: var(--glass-ink-2); }
.marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 36s linear infinite; }
@media (hover: hover) and (pointer: fine) {
  .marquee:hover .marquee__track { animation-play-state: paused; }
}
.marquee__group { display: flex; align-items: center; gap: 64px; padding-right: 64px; }
@keyframes marquee { to { transform: translateX(-50%); } }
/* Partner logos as one-color masks in the glass ink, so both themes read the same. */
.logo {
  height: var(--h, 22px);
  aspect-ratio: var(--ratio);
  background: var(--glass-ink);
  opacity: 0.72;
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
  mix-blend-mode: var(--glass-blend);
  transition: opacity 200ms ease;
}
.marquee:hover .logo { opacity: 0.9; }
.logo--cloudflare { --logo: url(../images/partners/cloudflare.png); --ratio: 656 / 96; --h: 21px; }
.logo--azure { --logo: url(../images/partners/azure.png); --ratio: 624 / 96; --h: 21px; }
.logo--datacamp { --logo: url(../images/partners/datacamp.png); --ratio: 484 / 96; --h: 22px; }
.logo--china-mobile { --logo: url(../images/partners/china-mobile.png); --ratio: 309 / 96; --h: 30px; }
.logo--hinet { --logo: url(../images/partners/hinet.png); --ratio: 970 / 96; --h: 20px; }

/* ---------- Footer (plain page footer) ---------- */
.footer {
  padding: 28px var(--gutter) 32px;
  border-top: 1px solid rgb(0 0 0 / 0.08);
  background: var(--bg);
}
[data-theme="dark"] .footer { border-top-color: rgb(255 255 255 / 0.1); }
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  max-width: var(--container);
  margin: 0 auto;
}
.footer__tagline { font-size: 15px; font-weight: 500; color: var(--text); }
.footer__copy { margin-top: 4px; font-size: 13px; color: var(--text-2); }
.footer__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 160ms ease;
}
.footer__link:hover { color: var(--text); }
.footer__link .icon { width: 18px; height: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .nav-wrap { top: 12px; }
  .nav { height: 56px; padding: 0 8px 0 14px; border-radius: 18px; }
  .brand__mark { width: 38px; }
  .brand__word { width: 84px; height: 15px; }
  .nav__link { display: none; }
  .hero { padding-top: 128px; padding-bottom: 24px; gap: 40px; }
  .hero__title { font-size: clamp(48px, 15vw, 64px); }
  .hero__lead { margin-top: 20px; font-size: 17px; }
  .hero__actions { margin-top: 28px; }
  .hero__actions .button { flex: 1 1 auto; }
  .partners { flex-direction: column; align-items: stretch; gap: 12px; min-height: 0; padding: 18px 0 20px; border-radius: 22px; }
  .partners__label { padding: 0 20px; }
  .marquee__group { gap: 44px; padding-right: 44px; }
  .footer { padding-bottom: 24px; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Degradation (Glass theme model) ---------- */
/* Hidden tab: pause every CSS loop; the WebGL loop stops in scene.js. */
html[data-hidden] *, html[data-hidden] *::before, html[data-hidden] *::after { animation-play-state: paused !important; }

html[data-scene="css"] .backdrop { overflow: hidden; }
html[data-scene="css"] .backdrop::after {
  content: "";
  position: absolute;
  inset: -4%;
  background: url(../images/threads-light.jpg) center / cover no-repeat;
  animation: thread-drift 9s ease-in-out infinite alternate;
}
html[data-theme="dark"][data-scene="css"] .backdrop::after { background-image: url(../images/threads-dark.jpg); }
@keyframes thread-drift {
  from { transform: translateX(-2%); }
  to { transform: translateX(2%); }
}
html[data-scene="css"] .hero::after { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  html[data-scene="css"] .backdrop::after { animation: none !important; }
}
html[data-still] .backdrop::after, html[data-still] .marquee__track { animation: none; }
html[data-still] .marquee__group[aria-hidden="true"] { display: none; }
html[data-still] .marquee__track, html[data-still] .marquee__group { width: 100%; flex-wrap: wrap; }

/* No WebGL2 surface: the CSS wallpaper (same palette) stays. */
html[data-scene="css"] .backdrop__canvas { display: none; }

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .glass { background: var(--glass-solid); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 1ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .marquee__track { animation-duration: 48s !important; animation-iteration-count: infinite !important; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .button:hover, .button:active { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  html[data-glass="webgl"] .glass__surface { display: none; }
  html[data-glass="webgl"] .glass:has(> .glass__surface) { background: var(--glass-solid); }
  .glass { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .glass::before, .glass::after { display: none; }
  .glass * { mix-blend-mode: normal !important; }
}

@media (forced-colors: active) {
  html[data-glass="webgl"] .glass__surface { display: none; }
  .glass { background: Canvas; color: CanvasText; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; border: 1px solid CanvasText; }
  .glass::before, .glass::after, .backdrop__canvas { display: none; }
  .glass * { mix-blend-mode: normal !important; }
  .logo, .brand__word { background: CanvasText; }
}

/* Core (not .enhanced): opaque surfaces, no blur, no blends, no canvases, no motion beyond feedback. */
html:not(.enhanced) { --bg: #eceef2; }
html:not(.enhanced)[data-theme="dark"] { --bg: #080808; }
html:not(.enhanced) .backdrop { background: var(--bg); }
html:not(.enhanced) .backdrop__canvas { display: none; }
html:not(.enhanced) .glass { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 0 0 1px #e5e5e5; }
html:not(.enhanced)[data-theme="dark"] .glass { background: #171717; box-shadow: 0 0 0 1px #353535; }
html:not(.enhanced) .glass::before, html:not(.enhanced) .glass::after { display: none; }
html:not(.enhanced) * { mix-blend-mode: normal !important; }
