:root {
  color-scheme: light;
  --page: #f8f7fd;
  --paper: #ffffff;
  --ink: #211941;
  --muted: #635b77;
  --line: #ded8ee;
  --purple: #5340b6;
  --purple-deep: #3d2b91;
  --lavender: #eae3ff;
  --mint: #bdf9e4;
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
}

*, *::after, *::before { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid #755add; outline-offset: 4px; }
section[id] { scroll-margin-top: 1.5rem; }
.frame { width: min(100% - 3rem, 73rem); margin-inline: auto; }
.skip:not(:focus) { position: absolute; clip: rect(0,0,0,0); width: 1px; height: 1px; white-space: nowrap; overflow: hidden; }
.skip { position: fixed; z-index: 3; top: .55rem; left: .55rem; padding: .6rem 1rem; border-radius: .5rem; background: white; }

.site-header { border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 80%); }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: .75rem; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; font-weight: 760; letter-spacing: -.05em; font-size: 1.35rem; text-decoration: none; white-space: nowrap; }
.brand > span:last-child, .footer-brand > span { color: var(--purple); }
.brand-mark { width: 2.2rem; height: 2.2rem; display: inline-block; position: relative; flex: 0 0 auto; margin-right: .6rem; border-radius: .65rem; background: var(--purple); overflow: hidden; }
.brand-mark::before, .brand-mark::after { position: absolute; content: ""; border-radius: 100% 16% 100% 14%; transform: rotate(-37deg); }
.brand-mark::before { inset: 19% 22% 20% 29%; background: var(--mint); }
.brand-mark::after { inset: 17% 44% 40% 17%; background: #e6f7ff; }
nav { display: flex; align-items: center; gap: clamp(.65rem, 2.4vw, 1.75rem); }
nav a { color: var(--muted); font-weight: 680; text-decoration: none; white-space: nowrap; }
nav a:hover { color: var(--purple); text-decoration: underline; text-underline-offset: .25em; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 27rem; overflow: hidden; border: 1px solid #dbd0f8; border-radius: 1.1rem; background: var(--lavender); margin-top: clamp(2rem, 5.3vw, 4.35rem); }
.hero-content { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(1.65rem, 5.9vw, 5rem); position: relative; z-index: 1; }
.hero h1, .source-hero h1 { font-size: clamp(2.75rem, 6.25vw, 5.5rem); font-weight: 760; letter-spacing: -.066em; line-height: 1.045; }
.hero p, .source-hero p { color: #4d426b; max-width: 28rem; margin-top: 1.25rem; font-size: clamp(1.05rem, 1.8vw, 1.23rem); }
.hero .button { margin-top: 1.6rem; }
.hero-map { position: relative; isolation: isolate; min-width: 0; background-image: linear-gradient(#6553a527 1px, transparent 1px), linear-gradient(90deg, #6553a527 1px, transparent 1px); background-size: 2.35rem 2.35rem; border-left: 1px solid #b6a6df; }
.map-orbit { position: absolute; top: 50%; left: 50%; width: 90%; height: 51%; border: 1px solid #6d56bd95; border-radius: 50%; transform: translate(-50%, -50%) rotate(-32deg); }
.map-orbit-b { width: 81%; height: 40%; transform: translate(-50%, -50%) rotate(53deg); border-color: #7764c574; }
.map-orbit-c { width: 66%; height: 36%; transform: translate(-50%, -50%) rotate(4deg); border-width: 1px; border-style: dashed; }
.map-core, .map-node { position: absolute; display: grid; place-items: center; transform: translate(-50%, -50%); }
.map-core { left: 50%; top: 50%; width: clamp(4.5rem, 10vw, 8.3rem); aspect-ratio: 1; border-radius: 27%; transform: translate(-50%, -50%) rotate(-11deg); background: #f8f2ff; border: 1px solid #ccb9fb; box-shadow: 0 15px 40px #4f339d40; }
.map-core .brand-mark { width: 76%; height: 76%; border-radius: 25%; margin: 0; }
.map-node { width: clamp(2.25rem, 5.1vw, 3.9rem); aspect-ratio: 1; border-radius: 22%; font: 700 clamp(1rem, 2.4vw, 1.65rem) "Cascadia Code", Consolas, monospace; }
.map-node-api { left: 72%; top: 26%; color: #c8fce9; background: #392967; }
.map-node-code { left: 21%; top: 68%; color: #52398d; background: #fff; border: 1px solid #b9a6ef; }
.map-node-play { left: 77%; top: 71%; color: #2c6254; background: #d1f9eb; border: 1px solid #6ecbb0; }
.map-node-play span { display: block; width: 0; height: 0; margin-left: 9%; border-block: .43em solid transparent; border-left: .68em solid currentColor; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.8rem; padding: .57rem 1.02rem; border: 1px solid transparent; border-radius: .55rem; font-weight: 720; text-decoration: none; text-align: center; }
.button-primary { color: #fff; background: var(--purple); }
.button-primary:hover { background: var(--purple-deep); }
.button-outline { color: var(--purple-deep); background: white; border-color: #d1c7ea; }
.button-outline:hover { background: #f2edff; border-color: #aa95e6; }
.button-dark { color: #fdfbff; background: #35265e; }
.button-dark:hover { background: #47347b; }
.directory, .catalogue { margin-top: clamp(2.55rem, 5.1vw, 4.35rem); }
.section-heading { margin-bottom: 1rem; }
.section-heading h2 { font-size: clamp(1.54rem, 3.2vw, 2.35rem); font-weight: 760; letter-spacing: -.045em; line-height: 1.2; }
.service-grid, .game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.service-card { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: .85rem 1rem; padding: clamp(1rem, 3vw, 1.5rem); background: var(--paper); border: 1px solid var(--line); border-radius: .8rem; }
.service-card .button { grid-column: 2; justify-self: start; }
.service-content h3, .game-content h3, .catalogue-empty h3 { font-size: clamp(1.12rem, 2vw, 1.38rem); font-weight: 740; letter-spacing: -.027em; line-height: 1.2; }
.service-content p, .catalogue-empty p { color: var(--muted); margin-top: .43rem; }
.service-icon { display: grid; place-items: center; width: 2.65rem; height: 2.65rem; border-radius: .58rem; color: #513bb0; background: #ede6ff; font: 700 1rem "Cascadia Code", Consolas, monospace; flex: 0 0 auto; }
.icon-api { color: #21594b; background: #dff9f0; }
.game-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; min-width: 0; padding: .95rem 1.1rem; border: 1px solid #d9cdf5; border-radius: .8rem; background: #f1ebfc; }
.game-emblem { position: relative; display: grid; place-items: center; width: 3rem; height: 3rem; background: #e3d7f9; border-radius: .55rem; color: #64469e; }
.game-emblem::before { content: ""; border: 3px solid currentColor; transform: rotate(45deg); width: 1.18rem; height: 1.18rem; border-radius: 1px; }
.game-emblem span { position: absolute; width: .43rem; height: .43rem; border: 1px solid currentColor; transform: rotate(45deg); }
.game-card .button { font-size: .91rem; white-space: nowrap; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .65rem; margin-top: clamp(2.7rem, 6vw, 5rem); min-height: 4.75rem; border-top: 1px solid var(--line); color: var(--muted); }
.footer a { text-underline-offset: .18em; }
.footer-brand { color: var(--ink); font-weight: 740; letter-spacing: -.045em; text-decoration: none; }

.source-main { min-height: 63vh; }
.source-hero { margin-top: clamp(2rem, 5.3vw, 4.35rem); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .47fr); align-items: center; overflow: hidden; min-height: 19rem; padding: clamp(1.6rem, 5.5vw, 4rem); border: 1px solid #dbd0f8; border-radius: 1.1rem; background: var(--lavender); }
.source-hero h1 { font-size: clamp(2.75rem, 6vw, 5rem); }
.source-illustration { display: flex; align-items: center; justify-content: center; color: #563ba0; gap: clamp(.17rem, 1vw, .65rem); align-self: stretch; font: 700 clamp(2rem, 6vw, 5.8rem) "Cascadia Code", Consolas, monospace; letter-spacing: -.1em; transform: rotate(-12deg); background-image: radial-gradient(#8f71d563 1px, transparent 1px); background-size: .9rem .9rem; border-radius: 40%; }
.source-illustration span:nth-child(2) { color: #3e9e82; }
.catalogue-empty { display: flex; align-items: flex-start; gap: .95rem; padding: clamp(1.2rem, 3vw, 1.8rem); border: 1px dashed #cfc6e4; border-radius: .8rem; background: white; }

@media (max-width: 720px) {
  .frame { width: calc(100% - 2rem); }
  .header-inner { min-height: 4.1rem; }
  nav a { font-size: .92rem; }
  .hero { grid-template-columns: 1fr; }
  .hero-map { min-height: clamp(11rem, 39vw, 17.5rem); border-top: 1px solid #b6a6df; border-left: 0; }
  .hero h1 { font-size: clamp(2.6rem, 9.8vw, 4.25rem); }
  .service-grid, .game-grid { grid-template-columns: 1fr; }
  .source-hero { min-height: 14rem; }
}
@media (max-width: 375px) {
  .frame { width: calc(100% - 1.3rem); }
  .header-inner { gap: .45rem; }
  .brand { font-size: 1.12rem; }
  .brand-mark { width: 1.75rem; height: 1.75rem; margin-right: .4rem; }
  nav { gap: .6rem; }
  nav a { font-size: .9rem; }
  .hero-content, .source-hero { padding: 1.2rem; }
  .source-hero { grid-template-columns: minmax(0, 1fr) minmax(0, .32fr); }
  .game-card { grid-template-columns: auto minmax(0, 1fr); }
  .game-card .button { grid-column: 2; justify-self: start; }
}
