/* Palette from furigone/src/theme/tokens.ts. No web fonts or third-party requests: see the privacy policy. */
:root {
  color-scheme: dark;
  --bg: #0d0f1c;
  --surface: #151829;
  --surface-alt: #1c2036;
  --border: #2a2f4d;
  --text: #ecedf7;
  --muted: #a0a4c0;
  --primary: #b6a6ff;
  --primary-soft: rgba(182, 166, 255, 0.14);
  --on-primary: #14122b;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, system-ui, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f5f5fa;
    --surface: #ffffff;
    --surface-alt: #eeeef6;
    --border: #dedfec;
    --text: #161930;
    --muted: #5a5e7d;
    --primary: #6a55e0;
    --primary-soft: rgba(106, 85, 224, 0.1);
    --on-primary: #ffffff;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--ui);
  overflow-wrap: break-word;
}

a {
  color: var(--primary);
  text-underline-offset: 0.15em;
}

img {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

[lang="ja"] {
  font-family: var(--jp);
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Header and footer */
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 34px;
  height: 34px;
}

.lang-switch {
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer {
  margin-top: 72px;
  padding: 32px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 16px;
}

.site-footer nav a {
  color: var(--text);
}

.site-footer p {
  max-width: 76ch;
  margin: 0 0 8px;
}

/* Buttons */
.button {
  display: inline-block;
  padding: 14px 24px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.08);
}

.button.small {
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.button.ghost {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(236, 237, 247, 0.35);
  color: #ecedf7;
}

.button.ghost:hover {
  box-shadow: inset 0 0 0 1.5px rgba(236, 237, 247, 0.7);
  filter: none;
}

/* Landing. The header and hero keep the brand's dark colours in both themes, like the app's screens. */
.landing .wrap {
  max-width: 1160px;
}

.landing .site-header,
.hero {
  --text: #ecedf7;
  --muted: #b4b7d2;
  --primary: #b6a6ff;
  --on-primary: #14122b;
}

.landing .site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13, 15, 28, 0.86);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  color: var(--text);
}

.landing .site-header .wrap {
  padding-top: 12px;
  padding-bottom: 12px;
}

.site-nav {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 24px;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 620px at 8% -10%, rgba(58, 76, 170, 0.5), transparent 70%),
    radial-gradient(900px 700px at 100% 40%, rgba(154, 132, 244, 0.3), transparent 70%),
    #0d0f1c;
  color: var(--text);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/tiles.svg") center top / 560px 420px;
  -webkit-mask-image: linear-gradient(100deg, transparent 38%, #000 72%);
  mask-image: linear-gradient(100deg, transparent 38%, #000 72%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding-top: 44px;
  padding-bottom: 96px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 650;
}

.hero h1 {
  margin: 0 0 22px;
  font-size: clamp(2.625rem, 5.6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.hero h1 em {
  display: block;
  background: linear-gradient(95deg, #b6a6ff, #d7ccff 45%, rgba(215, 204, 255, 0.45));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: normal;
}

.hero .lead {
  max-width: 34em;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.1875rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 18px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  list-style: none;
}

.hero-notes li::before {
  content: "✓";
  margin-right: 6px;
  color: var(--primary);
  font-weight: 700;
}

.hero-image {
  display: block;
  width: 100%;
}

.wave {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  display: block;
  width: 100%;
  height: clamp(36px, 6vw, 90px);
  fill: var(--bg);
}

/* Landing: figures */
.stats ul {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px 24px;
  margin: 16px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.35;
  list-style: none;
}

.stats strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: clamp(1.625rem, 2.8vw, 2.25rem);
  font-weight: 750;
  letter-spacing: -0.02em;
}

/* Landing: sections */
.section {
  padding-top: 88px;
}

.section h2 {
  max-width: 22em;
  margin: 0 0 12px;
  font-size: clamp(1.875rem, 4vw, 2.875rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.intro {
  max-width: 42em;
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 1.125rem;
}

.why {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.why-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
}

.why-card img {
  display: block;
  width: 100%;
  border-bottom: 1px solid var(--border);
}

.why-card h3 {
  margin: 20px 22px 8px;
  font-size: 1.25rem;
}

.why-card p {
  margin: 0 22px 24px;
  color: var(--muted);
  font-size: 1rem;
}

/* Landing: how the furigana goes */
.furigana-section {
  margin-top: 88px;
  padding: 72px 0;
  background: linear-gradient(145deg, #1f2b66, #3a2f8a 60%, #5d4cc0);
  color: #ecedf7;
}

.furigana-section .intro {
  color: #cfd1e8;
}

.stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stages li {
  overflow: hidden;
  border-radius: 22px;
  background: #151829;
}

.stages img {
  display: block;
  width: 100%;
}

.stages h3 {
  margin: 16px 22px 6px;
  font-size: 1.25rem;
}

.stages p {
  margin: 0 22px 22px;
  color: #b4b7d2;
  font-size: 1rem;
}

.note {
  margin: 20px 0 0;
  color: #cfd1e8;
  font-size: 0.9375rem;
}

/* Landing: text next to an edited screenshot */
.rows {
  display: grid;
  gap: 64px;
  margin-top: 40px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.row img {
  display: block;
  width: 100%;
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(5, 6, 20, 0.28);
}

.row.flip .row-copy {
  order: 2;
}

.row h3 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 750;
}

.row p {
  max-width: 32em;
  margin: 0;
  color: var(--muted);
  font-size: 1.125rem;
}

.step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 1.25rem;
  font-weight: 750;
}

/* Landing: books */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}

.books {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.books th,
.books td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.books tbody tr:last-child th,
.books tbody tr:last-child td {
  border-bottom: 0;
}

.books thead th {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.books th:first-child {
  text-align: left;
}

.books tbody th {
  font-weight: 650;
}

.books tbody th span {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.fine-print {
  max-width: 76ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Landing: plans */
.plans {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.plan {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
}

.plan.featured {
  border: 2px solid var(--primary);
}

.plan h3 {
  margin: 0 0 12px;
  font-size: 1.5rem;
}

.plan ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--muted);
}

.plan li + li {
  margin-top: 6px;
}

.plan p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Landing: questions */
.faq {
  max-width: 820px;
  margin-top: 28px;
  border-top: 1px solid var(--border);
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  cursor: pointer;
  font-size: 1.125rem;
  font-weight: 650;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq p {
  max-width: 44em;
  margin: 0 0 20px;
  color: var(--muted);
}

/* Landing: closing */
.closing {
  margin-top: 88px;
  padding: 72px 0;
  background: linear-gradient(145deg, #27357f, #6c5bd6 62%, #9a84f4);
  color: #fff;
  text-align: center;
}

.closing h2 {
  margin: 0 auto 12px;
  font-size: clamp(1.875rem, 4vw, 2.875rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.closing p {
  max-width: 38em;
  margin: 0 auto 28px;
  font-size: 1.125rem;
}

.closing .button {
  background: #fff;
  color: #1f2b66;
}

.landing .site-footer {
  margin-top: 0;
}

/* Legal and help pages */
.prose {
  max-width: 720px;
  padding: 32px 0 0;
}

.prose h1 {
  margin: 0 0 8px;
  font-size: clamp(1.875rem, 4.5vw, 2.5rem);
}

.prose .updated {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.prose h2 {
  margin: 36px 0 8px;
  font-size: 1.3125rem;
}

.prose h3 {
  margin: 24px 0 4px;
  font-size: 1.0625rem;
}

.prose p,
.prose ul {
  margin: 0 0 14px;
}

.prose ul {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 6px;
}

.summary {
  margin: 0 0 28px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--surface-alt);
}

.details {
  margin: 0 0 14px;
  padding: 0;
}

.details div {
  display: grid;
  grid-template-columns: minmax(120px, 11em) 1fr;
  gap: 4px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.details dt {
  color: var(--muted);
}

.details dd {
  margin: 0;
}

@media (max-width: 1080px) {
  .site-nav {
    display: none;
  }
  .landing .site-header .wrap {
    justify-content: flex-start;
  }
  .landing .brand {
    margin-right: auto;
  }
}

@media (max-width: 980px) {
  .hero::before {
    -webkit-mask-image: linear-gradient(180deg, transparent 45%, #000 70%, transparent 96%);
    mask-image: linear-gradient(180deg, transparent 45%, #000 70%, transparent 96%);
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 28px;
    padding-bottom: 72px;
  }
  .hero-image {
    max-width: 620px;
    margin: 0 auto;
  }
  .stats ul {
    grid-template-columns: repeat(3, 1fr);
  }
  .stages,
  .why {
    grid-template-columns: 1fr;
    max-width: 620px;
  }
}

@media (max-width: 860px) {
  .row {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .row.flip .row-copy {
    order: 0;
  }
  .row img {
    max-width: 620px;
  }
}

@media (max-width: 620px) {
  .wrap {
    padding: 0 16px;
  }
  .landing .site-header .wrap {
    gap: 10px;
  }
  .brand {
    font-size: 1.125rem;
  }
  .brand img {
    width: 30px;
    height: 30px;
  }
  .section {
    padding-top: 64px;
  }
  .stats ul {
    grid-template-columns: repeat(2, 1fr);
  }
  .actions .button {
    flex: 1 1 100%;
  }
  .rows {
    gap: 48px;
  }
  .row img {
    border-radius: 22px;
  }
  .books th,
  .books td {
    padding: 11px 10px;
  }
  .books tbody th {
    font-size: 0.9375rem;
  }
  .books tbody th span {
    font-size: 0.8125rem;
  }
  .plans {
    grid-template-columns: 1fr;
  }
  .furigana-section,
  .closing {
    margin-top: 64px;
    padding: 56px 0;
  }
  .details div {
    grid-template-columns: 1fr;
  }
}
