:root {
  color-scheme: dark;
  --ink: #f5fbff;
  --muted: #afc4d2;
  --ocean-950: #020711;
  --ocean-900: #05101c;
  --ocean-850: #071827;
  --ocean-800: #0a2233;
  --cyan: #7be4e8;
  --cyan-strong: #b5fbf6;
  --coral: #ff836c;
  --coral-strong: #ffb09d;
  --gold: #ffd07a;
  --line: rgba(123, 228, 232, 0.22);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--ocean-950);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 13% 8%, rgba(37, 116, 137, 0.23), transparent 29rem),
    radial-gradient(circle at 88% 28%, rgba(255, 131, 108, 0.09), transparent 24rem),
    linear-gradient(180deg, var(--ocean-900), var(--ocean-950) 62%);
  font-size: 1rem;
  line-height: 1.75;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, black, transparent 72%);
}

a {
  color: var(--cyan-strong);
  text-decoration-thickness: .08em;
  text-underline-offset: .2em;
}

a:hover { color: #fff; }

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
  border-radius: 6px;
}

img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  min-height: 44px;
  padding: 10px 16px;
  color: var(--ocean-950);
  background: var(--cyan-strong);
  border-radius: 10px;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(2,7,17,.88);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: .03em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid rgba(123,228,232,.4);
  border-radius: 12px;
  box-shadow: 0 0 28px rgba(123,228,232,.16);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links a[aria-current="page"],
.nav-links a:hover {
  color: var(--ink);
  background: rgba(123,228,232,.08);
  border-radius: 999px;
}

.hero {
  position: relative;
  min-height: min(760px, calc(100vh - 70px));
  display: grid;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background: url("/assets/hero.webp") center / cover no-repeat;
  filter: saturate(.94) contrast(1.05);
  transform: scale(1.015);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2,7,17,.98), rgba(2,7,17,.88) 38%, rgba(2,7,17,.34) 72%, rgba(2,7,17,.56)),
    linear-gradient(0deg, var(--ocean-950), transparent 42%);
}

.hero-shell,
.shell,
.footer-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-shell { padding: 72px 0 88px; }
.hero-copy { width: min(650px, 100%); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 30px;
  height: 1px;
  background: currentColor;
}

h1, h2, h3 {
  margin-top: 0;
  line-height: 1.28;
  text-wrap: balance;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(2.35rem, 7vw, 5.4rem);
  letter-spacing: -.045em;
}

.hero-lead {
  max-width: 600px;
  margin: 0 0 28px;
  color: #d7e9f0;
  font-size: clamp(1.05rem, 2.1vw, 1.32rem);
  line-height: 1.85;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 34px;
  padding: 0;
  list-style: none;
}

.badge {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border: 1px solid rgba(123,228,232,.28);
  border-radius: 999px;
  color: #d9fbfa;
  background: rgba(5,16,28,.74);
  font-size: .82rem;
  font-weight: 700;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  border: 1px solid rgba(123,228,232,.42);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(7,24,39,.8);
  font-size: .96rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}

.button.primary {
  color: #071319;
  border-color: var(--coral-strong);
  background: linear-gradient(135deg, var(--coral-strong), var(--coral));
}

.button:hover {
  color: #fff;
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.button.primary:hover { color: #071319; filter: brightness(1.08); }
.microcopy { margin: 15px 0 0; color: var(--muted); font-size: .84rem; }

.section { position: relative; padding: 88px 0; }

.section.alt {
  border-block: 1px solid rgba(123,228,232,.11);
  background: rgba(7,24,39,.45);
}

.section-heading { max-width: 740px; margin-bottom: 38px; }
.section-heading h2 { margin-bottom: 12px; font-size: clamp(1.8rem, 4vw, 3rem); }
.section-heading p { margin: 0; color: var(--muted); font-size: 1.02rem; }

.loop-grid,
.feature-grid,
.trust-grid { display: grid; gap: 16px; }
.loop-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.feature-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.trust-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }

.card {
  position: relative;
  min-width: 0;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(10,34,51,.9), rgba(5,16,28,.92));
  box-shadow: var(--shadow);
}

.loop-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -28px;
  width: 90px;
  height: 90px;
  border: 1px solid rgba(123,228,232,.15);
  border-radius: 50%;
}

.step {
  display: block;
  margin-bottom: 26px;
  color: var(--coral-strong);
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .13em;
}

.card h3 { margin-bottom: 8px; font-size: 1.22rem; }
.card p { margin: 0; color: var(--muted); }
.feature-card { min-height: 190px; }

.feature-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--cyan-strong);
  font-size: .83rem;
  letter-spacing: .06em;
}

.world-panel {
  display: grid;
  grid-template-columns: minmax(0,1.16fr) minmax(280px,.84fr);
  min-height: 460px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--ocean-850);
  box-shadow: var(--shadow);
}

.world-panel img { width: 100%; height: 100%; object-fit: cover; }
.world-copy { align-self: center; padding: clamp(28px,5vw,56px); }
.world-copy h2 { font-size: clamp(1.8rem,3.2vw,2.7rem); }
.world-copy p { color: var(--muted); }
.trust-card { min-height: 140px; }
.trust-card b { display: block; margin-bottom: 6px; color: var(--cyan-strong); }

.beta-note,
.release-note,
.notice {
  padding: 18px 20px;
  border: 1px solid rgba(255,208,122,.32);
  border-radius: 12px;
  color: #f3e3bf;
  background: rgba(255,208,122,.07);
}

.beta-note,
.release-note { margin-top: 32px; border-left-width: 4px; }

.page-hero {
  padding: 82px 0 56px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(2,7,17,.94), rgba(2,7,17,.63)),
    url("/assets/legal.webp") center / cover no-repeat;
}

.page-hero h1 { max-width: 800px; margin-bottom: 16px; font-size: clamp(2.2rem,5vw,4.2rem); }
.page-hero p { max-width: 720px; margin: 0; color: #d4e5ec; font-size: 1.06rem; }

.legal-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 250px;
  gap: 48px;
  align-items: start;
}

.prose { min-width: 0; }

.prose h2 {
  margin: 52px 0 13px;
  padding-top: 6px;
  color: var(--cyan-strong);
  font-size: clamp(1.25rem,2vw,1.55rem);
}

.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 30px 0 9px; font-size: 1.08rem; }
.prose p, .prose li { color: #d2e1e8; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li + li { margin-top: 8px; }

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 34px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(10,34,51,.44);
  font-size: .9rem;
}

.toc {
  position: sticky;
  top: 94px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(5,16,28,.76);
}

.toc b { display: block; margin-bottom: 10px; font-size: .85rem; letter-spacing: .08em; }
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc a { min-height: 36px; display: flex; align-items: center; color: var(--muted); font-size: .85rem; text-decoration: none; }
.toc a:hover { color: var(--ink); }

.contact-card {
  padding: 28px;
  border: 1px solid rgba(255,131,108,.32);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,131,108,.1), rgba(5,16,28,.86));
}

.contact-card h2, .contact-card h3 { margin-bottom: 8px; }
.contact-card p { margin-top: 0; color: var(--muted); }
.faq-list, .credit-list { display: grid; gap: 12px; }

details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10,34,51,.48);
}

summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

summary::after { content: "+"; color: var(--cyan); font-size: 1.35rem; }
details[open] summary::after { content: "−"; }
.details-body { padding: 0 18px 18px; color: var(--muted); }
.details-body p:last-child { margin-bottom: 0; }

.credit-list { gap: 18px; }
.credit-item { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: rgba(10,34,51,.5); }
.credit-item h2 { margin: 0 0 8px; color: var(--ink); }
.credit-item p { margin: 7px 0 0; }

.site-footer { border-top: 1px solid var(--line); background: #020711; }

.footer-shell {
  padding: 36px 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 28px;
  align-items: center;
}

.footer-copy { color: var(--muted); font-size: .84rem; }
.footer-copy b { display: block; margin-bottom: 3px; color: var(--ink); font-size: .94rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); font-size: .86rem; text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

.not-found {
  min-height: calc(100vh - 70px);
  display: grid;
  place-items: center;
  padding: 64px 16px;
  text-align: center;
}

.not-found-card {
  width: min(620px,100%);
  padding: clamp(30px,6vw,58px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(5,16,28,.86);
  box-shadow: var(--shadow);
}

.not-found-code { display: block; color: var(--coral-strong); font-size: clamp(3rem,12vw,6rem); font-weight: 900; line-height: 1; }

@media (max-width: 900px) {
  .nav-shell { align-items: flex-start; flex-direction: column; gap: 3px; padding: 10px 0 8px; }
  .nav-links { width: 100%; overflow-x: auto; justify-content: flex-start; }
  .site-header { position: relative; }
  .loop-grid, .trust-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .world-panel { grid-template-columns: 1fr; }
  .world-panel img { max-height: 360px; }
  .legal-layout { grid-template-columns: 1fr; }
  .toc { position: static; order: -1; }
}

@media (max-width: 640px) {
  .nav-shell, .hero-shell, .shell, .footer-shell { width: min(100% - 24px,1120px); }
  .brand img { width: 38px; height: 38px; }
  .nav-links a { padding-inline: 11px; }
  .hero { min-height: 690px; }
  .hero::before { background-position: 58% center; }
  .hero::after { background: linear-gradient(180deg, rgba(2,7,17,.68), rgba(2,7,17,.9) 51%, var(--ocean-950)); }
  .hero-shell { padding: 300px 0 54px; }
  h1 { font-size: clamp(2.25rem,13vw,3.4rem); }
  .cta-row, .button { width: 100%; }
  .section { padding: 64px 0; }
  .loop-grid, .feature-grid, .trust-grid { grid-template-columns: 1fr; }
  .card { padding: 21px; }
  .page-hero { padding: 58px 0 44px; }
  .footer-shell { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .button:hover { transform: none; }
}
