:root {
  --canvas: #fcfbff;
  --surface: #ffffff;
  --ink: #18151f;
  --muted: #6f6878;
  --border: #eae5f0;
  --primary: #6c4dff;
  --coral: #ff7a73;
  --mint: #5ed6b3;
  --lilac: #d9d0ff;
  --shadow: 0 18px 48px rgb(34 19 73 / 10%);
  --radius-xl: 1.8rem;
  --radius-lg: 1.2rem;
  --container: 73rem;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  margin: 0;
  min-width: 20rem;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}
a { color: inherit; }
button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, select:focus-visible, canvas:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}
.container { width: min(calc(100% - 2.5rem), var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 20; top: -4rem; left: 1rem; padding: .65rem .9rem; border-radius: .5rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky; z-index: 10; top: 0;
  border-bottom: 1px solid rgb(234 229 240 / 78%);
  background: rgb(252 251 255 / 88%);
  box-shadow: 0 6px 22px rgb(35 22 61 / 5%);
  backdrop-filter: blur(16px);
  transition: padding .2s ease, box-shadow .2s ease;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 5.15rem; gap: 1.5rem; transition: min-height .2s ease; }
.site-header.is-compact .header-inner { min-height: 4.15rem; }
.brand { display: inline-flex; gap: .64rem; align-items: center; text-decoration: none; font-weight: 760; letter-spacing: -.035em; white-space: nowrap; }
.brand img { display: block; }
.primary-nav { display: flex; gap: .8rem; align-items: center; font-size: .94rem; font-weight: 650; }
.unit-nav-link { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.45rem; padding: .35rem .75rem; border: 1px solid var(--border); border-radius: 999px; color: var(--ink); background: var(--surface); box-shadow: 0 4px 14px rgb(30 18 60 / 5%); text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.unit-nav-link:hover { transform: translateY(-2px); border-color: #cfc5ff; box-shadow: 0 9px 20px rgb(41 25 92 / 10%); }
.unit-nav-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgb(94 214 179 / 15%); }
.language-picker { position: relative; display: inline-flex; }
.language-picker select { appearance: none; border: 1px solid var(--border); border-radius: 999px; padding: .38rem 1.65rem .38rem .75rem; color: var(--ink); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%236f6878' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right .52rem center / .85rem; cursor: pointer; }
.menu-button { display: none; border: 0; background: transparent; padding: .55rem; cursor: pointer; }
.menu-button span { display: block; width: 1.35rem; height: 2px; margin: .23rem; border-radius: 2px; background: var(--ink); }

.hero { padding: clamp(3.5rem, 8vw, 7.6rem) 0 4.7rem; overflow: clip; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(2.5rem, 7vw, 7rem); }
.snake-panel { position: relative; padding: clamp(1rem, 2vw, 1.5rem); border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); }
.snake-panel::before { position: absolute; z-index: 0; inset: -4rem auto auto -4rem; width: 11rem; height: 11rem; border-radius: 999px; background: rgb(217 208 255 / 36%); content: ""; filter: blur(2px); }
.panel-topline, .game-controls, #snakeCanvas { position: relative; z-index: 1; }
.panel-topline { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.section-kicker, .product-label, .gateway-label { margin: 0; color: var(--primary); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.score { margin: 0; color: var(--muted); font-size: .88rem; }
.score strong { color: var(--ink); font-variant-numeric: tabular-nums; }
#snakeCanvas { display: block; width: 100%; height: auto; margin: 1rem 0 1.05rem; border: 1px solid var(--lilac); border-radius: 1rem; background: #fbfaff; image-rendering: pixelated; touch-action: none; }
.game-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.game-status { flex-basis: 100%; margin: .15rem 0 0; color: var(--muted); font-size: .86rem; }
.button, .text-button { display: inline-flex; min-height: 2.7rem; align-items: center; justify-content: center; border-radius: .78rem; padding: .65rem 1rem; font-weight: 760; text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { border: 1px solid var(--primary); background: var(--primary); color: #fff; box-shadow: 0 8px 16px rgb(108 77 255 / 20%); }
.button-primary:hover { box-shadow: 0 12px 23px rgb(108 77 255 / 28%); }
.button-outline { border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
.button-quiet { border: 1px solid var(--border); background: #f8f6fc; color: var(--ink); }
.button:disabled { cursor: not-allowed; opacity: .52; transform: none; box-shadow: none; }
.text-button { min-height: 2.5rem; border: 0; background: transparent; color: var(--muted); padding-inline: .45rem; }
.text-button:hover { color: var(--ink); }
.hero-copy { max-width: 32rem; }
.hero-copy h1, .section-heading h2 { margin: .55rem 0 1rem; letter-spacing: -.055em; line-height: 1.02; }
.hero-copy h1 { max-width: 8ch; font-size: clamp(3.2rem, 6.3vw, 5.65rem); }
.hero-lede { max-width: 34rem; margin: 0; color: var(--muted); font-size: clamp(1.05rem, 1.8vw, 1.22rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.7rem; }
.hero-note { margin: 1.1rem 0 0; color: var(--muted); font-size: .9rem; }

.section { padding: clamp(4.3rem, 9vw, 7.5rem) 0; }
.products-section { border-top: 1px solid var(--border); background: var(--surface); }
.section-heading { max-width: 42rem; }
.section-heading h2 { font-size: clamp(2.15rem, 4vw, 3.7rem); }
.section-heading > p:last-child { margin: 0; color: var(--muted); font-size: 1.05rem; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 1.2rem; margin-top: 2.2rem; padding-bottom: 2rem; }
.product-card { --card-offset: 0px; display: grid; grid-template-rows: auto 1fr auto; align-items: start; gap: 1.1rem; min-height: 23rem; padding: clamp(1.15rem, 3vw, 2rem); border: 1px dashed #cfc5ff; border-radius: var(--radius-xl); background: linear-gradient(135deg, #fff 0%, #fbfaff 100%); box-shadow: 0 6px 18px rgb(26 15 49 / 4%); transform: translateY(var(--card-offset)); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.product-card:nth-child(2) { --card-offset: 2.2rem; }
.product-card:hover { transform: translateY(calc(var(--card-offset) - 5px)); border-color: #bfb2ff; box-shadow: 0 21px 45px rgb(39 24 82 / 13%); }
.product-icon, .gateway-icon { display: grid; width: 3.55rem; height: 3.55rem; place-items: center; border-radius: 1.05rem; transition: transform .2s ease, box-shadow .2s ease; }
.example-icon { background: #eeeaff; color: var(--primary); }
.icon-coral { background: #fff0ef; color: #d64d49; }
.icon-mint { background: #e7fff7; color: #148363; }
.product-icon svg, .gateway-icon svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.product-card:hover .product-icon, .gateway-card:hover .gateway-icon { transform: translateY(-2px) scale(1.04); box-shadow: 0 0 0 10px rgb(108 77 255 / 8%), 0 12px 25px rgb(108 77 255 / 14%); }
.product-main h3, .gateway-card h3, .principle-list h3 { margin: .22rem 0 .4rem; letter-spacing: -.028em; line-height: 1.18; }
.product-main p:last-child, .gateway-card p, .principle-list p { margin: 0; color: var(--muted); }
.product-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .84rem; }
.platform-badge { padding: .25rem .56rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-weight: 730; }
.availability { color: var(--muted); }

.ecosystem-section { overflow: clip; }
.split-heading { display: grid; grid-template-columns: 1fr minmax(15rem, 27rem); align-items: end; gap: 2rem; }
.gateway-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.4rem; margin-top: 2.3rem; padding: clamp(1.3rem, 4vw, 2.7rem); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: 0 6px 18px rgb(26 15 49 / 4%); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.gateway-card::before { position: absolute; width: 13rem; height: 13rem; right: -5rem; bottom: -8rem; border-radius: 50%; background: rgb(255 122 115 / 12%); content: ""; transition: transform .25s ease; }
.gateway-card:hover { transform: translateY(-5px); border-color: #d8cffd; box-shadow: 0 21px 45px rgb(39 24 82 / 13%); }
.gateway-card:hover::before { transform: scale(1.15); }
.gateway-icon { position: relative; background: #e7fff7; color: #148363; }
.gateway-card > div, .gateway-arrow { position: relative; }
.gateway-arrow { display: grid; width: 2.8rem; height: 2.8rem; place-items: center; border-radius: 50%; background: var(--ink); color: white; font-size: 1.3rem; transition: transform .2s ease, background .2s ease; }
.gateway-card:hover .gateway-arrow { transform: translateX(4px) scale(1.08); background: var(--primary); }

.principles-section { background: #18151f; color: #fff; }
.principles-section .section-kicker { color: var(--mint); }
.principles-section .section-heading h2 { max-width: 10ch; }
.principles-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(3rem, 9vw, 8rem); }
.principle-list { border-top: 1px solid rgb(255 255 255 / 20%); }
.principle-list article { display: grid; grid-template-columns: 2.5rem 1fr; column-gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid rgb(255 255 255 / 20%); }
.principle-list span { grid-row: span 2; color: var(--mint); font-size: .83rem; font-weight: 800; }
.principle-list p { color: rgb(255 255 255 / 67%); }
.site-footer { padding: 1.65rem 0; background: var(--ink); color: rgb(255 255 255 / 72%); border-top: 1px solid rgb(255 255 255 / 15%); font-size: .87rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.footer-inner p { margin: 0; }
.brand-footer { color: white; }

.cursor-orbit { position: fixed; z-index: 30; top: 0; left: 0; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: rgb(255 122 115 / 28%); pointer-events: none; opacity: 0; transform: translate3d(-100px, -100px, 0); mix-blend-mode: multiply; transition: width .18s ease, height .18s ease, opacity .18s ease, background .18s ease; will-change: transform; }
body.cursor-active .cursor-orbit { opacity: 1; }
body.cursor-feature .cursor-orbit { width: 4.2rem; height: 4.2rem; background: rgb(108 77 255 / 22%); }
body.cursor-feature .cursor-orbit::after { position: absolute; inset: 0; display: grid; place-items: center; color: var(--primary); content: "→"; font-size: 1.4rem; font-weight: 800; }

@media (max-width: 760px) {
  .container { width: min(calc(100% - 1.5rem), var(--container)); }
  .header-inner { min-height: 4.45rem; }
  .menu-button { display: block; }
  .primary-nav { position: absolute; top: calc(100% + .55rem); right: .75rem; left: .75rem; display: grid; gap: 0; padding: .55rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(-.5rem); transition: opacity .16s ease, transform .16s ease; }
  .primary-nav.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .unit-nav-link, .language-picker { padding: .78rem .65rem; }
  .language-picker select { width: 100%; }
  .hero { padding-top: 2.5rem; }
  .hero-grid, .principles-grid, .split-heading { grid-template-columns: 1fr; }
  .hero-copy { order: -1; }
  .hero-copy h1 { max-width: 11ch; }
  .snake-panel { max-width: 34rem; }
  .product-grid { grid-template-columns: 1fr; gap: 1rem; padding-bottom: 0; }
  .product-card, .product-card:nth-child(2) { --card-offset: 0px; min-height: 0; }
  .gateway-card { grid-template-columns: auto minmax(0, 1fr); }
  .gateway-arrow { grid-column: 2; justify-self: start; }
  .section { padding: 4.4rem 0; }
}

@media (max-width: 440px) {
  .brand { gap: .46rem; font-size: .95rem; }
  .brand img { width: 31px; height: 31px; }
  .hero-actions .button { width: 100%; }
  .game-controls .button { flex: 1; }
  .product-card, .gateway-card { gap: 1rem; }
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) { .cursor-orbit { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
