:root {
  --bg: #ffffff;
  --panel: #f7f7fb;
  --ink: #111114;
  --text: #45454f;
  --soft: #7a7a86;
  --line: #e6e6ee;
  --grad: linear-gradient(120deg, #2881ec 0%, #885fe8 100%);
  --accent: #5a68e1;
  --font: "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 880px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border: 0; border-radius: 12px;
  background: var(--grad); color: #fff; font: 600 17px/1 var(--font); cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn:focus-visible, .tab:focus-visible, .copy:focus-visible { outline: 3px solid rgba(90, 104, 225, 0.4); outline-offset: 2px; }
.btn.small { min-height: 40px; padding: 0 18px; font-size: 15px; border-radius: 10px; }

h1 { color: var(--ink); font-size: clamp(34px, 6vw, 54px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 600; }
h2 { color: var(--ink); font-size: clamp(24px, 4vw, 30px); line-height: 1.2; letter-spacing: -0.015em; font-weight: 600; }
.eyebrow { color: var(--accent); font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 14px; }
.sub { margin-top: 16px; max-width: 34em; }

/* Home */
body.is-home { overflow-x: hidden; background: #f4efea; }
.glow { display: none; }
.home { min-height: calc(100svh - 76px); display: grid; align-content: center; justify-items: center; text-align: center; gap: 4px; padding: 8px 0 40px; }
.logo3d { position: relative; width: min(78vw, 46svh, 520px); aspect-ratio: 1 / 1; touch-action: pan-y; cursor: grab; }
.logo3d:active { cursor: grabbing; }
.logo3d canvas, .logo3d img { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo3d canvas { opacity: 0; transition: opacity 0.6s ease; }
.logo3d.ready canvas { opacity: 1; }
.logo3d img { padding: 14%; transition: opacity 0.4s ease; }
.logo3d.ready img { opacity: 0; }
.logo3d::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: 0; height: 12%; border-radius: 50%; background: radial-gradient(closest-side, rgba(120, 110, 245, 0.34), rgba(120, 110, 245, 0)); z-index: 1; pointer-events: none; }
.home h1 { font-size: clamp(34px, 9.6vw, 76px); white-space: nowrap; }
.free { margin-top: 14px; color: var(--soft); font-size: 15px; font-weight: 500; }
.home .sub { margin-left: auto; margin-right: auto; font-size: clamp(17px, 2.2vw, 20px); }
.home .btn { margin-top: 28px; min-height: 56px; padding: 0 32px; font-size: 18px; border-radius: 14px; box-shadow: 0 12px 30px -10px rgba(90, 104, 225, 0.65); }
.points { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin-top: 26px; }
.points li { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.7); color: var(--text); font-size: 14px; font-weight: 500; }
.rise { opacity: 0; transform: translateY(14px); animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; animation-delay: calc(var(--i, 0) * 90ms + 250ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (min-width: 980px) {
  body.is-home .wrap { max-width: 1240px; }
  .home h1 { font-size: clamp(48px, 4.6vw, 72px); }
  .home { grid-template-columns: 1fr 1fr; justify-items: start; text-align: left; column-gap: 40px; align-items: center; }
  .home .copy-col { order: 1; }
  .logo3d { order: 2; justify-self: center; width: min(44vw, 70svh, 620px); }
  .home .sub { margin-left: 0; }
  .points { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .rise { animation: none; opacity: 1; transform: none; } }

/* Battle page */
.head { padding: 36px 0 28px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tab {
  min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text); font: 500 15px/1 var(--font); cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.stage { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 78vh; border-radius: 16px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.meta { margin-top: 12px; color: var(--soft); font-size: 15px; }
.meta strong { color: var(--ink); font-weight: 600; }

.block { padding: 56px 0 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.copy {
  min-height: 40px; padding: 0 16px; border: 1px solid var(--ink); border-radius: 10px;
  background: var(--ink); color: #fff; font: 600 15px/1 var(--font); cursor: pointer; white-space: nowrap;
}
.prompt {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px;
  font: 15px/1.65 var(--mono); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere;
}
.note { margin-top: 12px; color: var(--soft); font-size: 15px; }

.cta { margin: 64px 0 0; padding: 40px 28px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.cta p { margin: 10px auto 24px; }
@media (min-width: 700px) { .cta p { white-space: nowrap; } }

.foot { padding: 40px 0 36px; color: var(--soft); font-size: 14px; text-align: center; }

@media (max-width: 560px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .tab { padding: 0 8px; font-size: 14px; }
  .prompt { padding: 18px; font-size: 14px; }
}
