/* Manabi website. One stylesheet for every page and language, after
   michi.website's: the same layout, in the app's colours (Theme.swift and
   AccentColor: navy #363D84, peach #FFB48C, orange #FF8C54). */

:root {
  --accent: #363d84;
  --accent-deep: #252b63;
  --warm: #d9581f;
  --peach: #ffb48c;
  --ink: #2a1812;
  --ink-2: #57443d;
  --ink-3: #85726b;
  --line: #f1e3db;
  --bg: #ffffff;
  --bg-soft: #fff6f1;
  --card: #ffffff;
  --error: #c0392b;
  --shadow-sm: 0 1px 2px rgba(74, 36, 25, 0.05), 0 2px 8px rgba(74, 36, 25, 0.05);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 16px;
  --maxw: 1040px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #9aa8f5; --accent-deep: #c4ccff; --warm: #ff9b6a; --peach: #ffb48c;
    --ink: #f7ede8; --ink-2: #d6c6bf; --ink-3: #a3918a;
    --line: #33282a;
    --bg: #151012; --bg-soft: #1e1618; --card: #1b1416;
    --error: #ff8a7a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent-deep); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.rounded { font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* Header */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand img { width: 28px; height: 28px; border-radius: 7px; box-shadow: var(--shadow-sm); }
.brand-name { letter-spacing: -0.01em; font-size: 17px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links > a { color: var(--ink-2); font-size: 14.5px; font-weight: 500; text-decoration: none; }
.nav-links > a:hover, .nav-links > a[aria-current="page"] { color: var(--ink); }

/* Language picker (as on mappu.website and michi.website) */
.lang-picker { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s ease, border-color .15s ease;
}
.lang-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  list-style: none; padding: 6px; margin: 0;
  min-width: 152px;
  box-shadow: 0 10px 30px rgba(74,36,25,.12), 0 4px 12px rgba(74,36,25,.06);
  z-index: 60;
}
.lang-menu li { margin: 0; }
.lang-menu a {
  display: block; padding: 10px 14px; border-radius: 8px;
  color: var(--ink-2); font-size: 14px; text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.lang-menu a:hover { background: var(--bg-soft); color: var(--ink); }
.lang-menu a[aria-current="true"] { color: var(--accent); font-weight: 600; }
/* On a phone the footer carries the page links, so the header keeps only
   the picker. `>` so the picker's own links stay visible. */
@media (max-width: 520px) {
  .nav-links > a { display: none; }
}

/* ---------- Home page ---------- */

/* The hero is the app's own home-screen header art. Its logo is part of the
   picture, so the fade under it is short. */
.hero-art {
  position: relative;
  height: clamp(210px, 30vw, 400px);
  overflow: hidden;
  background: #ffd9c4;
}
.hero-art img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 40%;
  display: block;
}
.hero-art::after {
  content: ""; position: absolute; inset: auto 0 -1px 0; height: 26%;
  background: linear-gradient(to bottom, transparent, var(--bg) 94%);
}
.hero { text-align: center; padding-bottom: 60px; margin-top: -44px; position: relative; }
.hero-icon {
  width: 96px; height: 96px; border-radius: 22px;
  box-shadow: 0 10px 30px rgba(74,36,25,.18), 0 2px 6px rgba(74,36,25,.08);
  display: block; margin: 0 auto 18px;
}
.eyebrow { color: var(--ink-3); font-size: 15px; font-weight: 600; letter-spacing: .01em; margin: 0 0 6px; }
.hero h1 {
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.1; letter-spacing: -0.025em; font-weight: 700;
  margin: 0 auto 16px; max-width: 17ch;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--warm); }
.hero .lede { color: var(--ink-2); font-size: clamp(17px, 2vw, 19px); max-width: 36em; margin: 0 auto 26px; }
.store-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 16px; }
.store-badge {
  display: inline-block; border-radius: 8px;
  transition: transform .25s var(--ease-out), filter .25s ease;
}
.store-badge img { display: block; height: 56px; width: auto; max-width: 100%; }
.store-badge:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
/* Both badges on one row on a phone */
@media (max-width: 420px) {
  .store-links { gap: 12px; }
  .store-badge img { height: 46px; }
}
.langs { color: var(--ink-3); font-size: 14px; margin: 10px 0 0; word-break: keep-all; text-wrap: balance; }

/* Sections */
main > section { padding: 56px 0; border-top: 1px solid var(--line); }
.section-title {
  text-wrap: balance;
  font-size: clamp(26px, 3.2vw, 34px); line-height: 1.18; letter-spacing: -0.02em;
  margin: 0 0 10px; font-weight: 700;
}
.section-lede { color: var(--ink-2); font-size: 17px; margin: 0 0 32px; max-width: 40em; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 20px; box-shadow: var(--shadow-sm);
}
.card-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: color-mix(in oklab, var(--peach) 34%, transparent);
  color: var(--warm); font-weight: 700; font-size: 15px;
  margin-bottom: 12px;
}
.card h3 { font-size: 18px; letter-spacing: -0.01em; margin: 0 0 8px; }
.card p { color: var(--ink-2); margin: 0; font-size: 15.5px; }

/* Levels */
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; list-style: none; padding: 0; margin: 0 0 18px; }
.levels li {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-size: 14px; color: var(--ink-2);
}
.levels .lv {
  display: block; font-weight: 800; font-size: 24px; letter-spacing: -0.01em;
  color: var(--accent); line-height: 1.2; margin-bottom: 4px;
}
.levels li span { display: block; }
.note { color: var(--ink-3); font-size: 14.5px; margin: 0; max-width: 46em; }

/* Free and level pack */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.plan-pack { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
.plan-pack h3 { color: var(--accent); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px;
}
.panel h3 { font-size: 18px; margin: 0 0 8px; }
.panel p { color: var(--ink-2); margin: 0 0 10px; font-size: 15.5px; }
.panel p:last-child { margin-bottom: 0; }
.credits { color: var(--ink-3); font-size: 13.5px; margin: 22px 0 0; }

/* Screenshots: a row that scrolls sideways, starting in line with the text
   and centred when there is room for all of them. */
main > section.shots { border-top: 0; padding: 0 0 56px; }
.shots-row {
  --inset: max(22px, calc((100vw - var(--maxw)) / 2 + 22px));
  display: flex; gap: 16px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--inset);
  padding: 6px var(--inset) 16px;
  scrollbar-width: thin;
}
.shots-row figure { flex: 0 0 auto; width: clamp(200px, 23vw, 240px); margin: 0; scroll-snap-align: start; }
.shots-row figure:first-child { margin-left: auto; }
.shots-row figure:last-child { margin-right: auto; }
.shots-row img {
  display: block; width: 100%; height: auto;
  border-radius: 18px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

/* Mappu-style lift, with Manabi's navy around each cell. */
.card, .panel, .levels li {
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .3s ease;
}
@media (hover: hover) and (pointer: fine) {
  a.store-badge:hover {
    transform: translateY(-3px);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.12));
  }
  .card:hover, .panel:hover, .levels li:hover {
    transform: translateY(-4px);
    border-color: color-mix(in oklab, var(--accent) 50%, var(--line));
    box-shadow: var(--shadow-sm), 0 0 18px color-mix(in oklab, var(--accent) 16%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .store-badge, .card, .panel, .levels li { transition: none; }
  a.store-badge:hover, .card:hover, .panel:hover, .levels li:hover { transform: none; }
}

@media (max-width: 820px) {
  .cards, .split, .plans { grid-template-columns: 1fr; }
  .levels { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .levels { grid-template-columns: 1fr 1fr; }
}

/* ---------- Policy, terms and contact pages ---------- */

.doc { max-width: 760px; }
article { padding: 56px 0 80px; }
article h1 {
  font-size: clamp(34px, 4.6vw, 46px);
  line-height: 1.12; letter-spacing: -0.025em; font-weight: 700;
  margin: 0 0 8px;
}
article .meta { color: var(--ink-3); font-size: 14px; margin: 0 0 28px; }
article h2 {
  font-size: 22px; letter-spacing: -0.01em; line-height: 1.3;
  margin: 38px 0 12px; font-weight: 700;
  scroll-margin-top: 76px;
}
article p { color: var(--ink-2); margin: 0 0 14px; font-size: 16px; line-height: 1.65; }
article ul { color: var(--ink-2); padding-left: 22px; margin: 0 0 16px; line-height: 1.65; }
article li { margin-bottom: 8px; }
article p[id], article li[id] { scroll-margin-top: 76px; }
article strong { color: var(--ink); font-weight: 600; }
article .lede { color: var(--ink-2); font-size: 18px; margin: 0 0 36px; }
.callout-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0 28px;
}
.callout-box ul { margin: 0; }
.callout-box li:last-child, .callout-box p:last-child { margin-bottom: 0; }
.legal-caps { font-size: 14.5px; }

/* Contact form */
form { margin-top: 8px; }
form label { display: block; margin-bottom: 18px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
form .label-text { display: block; margin-bottom: 6px; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid color-mix(in oklab, var(--line) 65%, var(--ink-3));
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--ink);
  font: inherit; font-weight: 400; line-height: 1.4;
  transition: border-color .15s ease, background .15s ease;
}
input[type="text"]:focus, input[type="email"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}
textarea { resize: vertical; min-height: 140px; }
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%2385726b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.hint { display: block; margin-top: 6px; color: var(--ink-3); font-size: 13.5px; font-weight: 400; }
/* Honeypot: invisible to people, filled in by bots */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.h-captcha { margin: 4px 0 18px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  background: var(--accent); color: #fff;
  border: 1px solid var(--accent);
  font: inherit; font-weight: 600; font-size: 15.5px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: var(--accent-deep); transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
@media (prefers-color-scheme: dark) { .btn { color: #151012; } }
.form-status { margin: 14px 0 0; min-height: 22px; color: var(--ink-2); font-size: 14.5px; }
.form-status.error { color: var(--error); }
.privacy-note { margin-top: 18px; color: var(--ink-3); font-size: 13.5px; }
article .privacy-note { color: var(--ink-3); font-size: 13.5px; }
.thanks {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-soft);
  border-radius: 10px;
}
.thanks h2 { font-size: 24px; margin: 0 0 10px; color: var(--ink); }
.thanks p { margin: 0; }

/* Footer */
footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
  color: var(--ink-3); font-size: 14px;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer .brand { font-weight: 500; color: var(--ink-3); gap: 8px; }
footer .brand img { width: 24px; height: 24px; border-radius: 6px; box-shadow: none; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-3); text-decoration: none; }
.footer-links a:hover, .footer-links a[aria-current="page"] { color: var(--ink); }
.copyright-link { color: var(--ink-3); text-decoration: none; }
.copyright-link:hover { color: var(--ink); text-decoration: underline; }
.footer-note { margin-top: 14px; font-size: 12.5px; color: var(--ink-3); }

/* Per-language type */
html:lang(ko) body { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", Roboto, sans-serif; word-break: keep-all; }
html:lang(zh-CN) body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", Roboto, sans-serif; }
html:lang(zh-TW) body { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Segoe UI", Roboto, sans-serif; }
html:lang(ko) h1, html:lang(ko) h2, html:lang(ko) h3,
html:lang(zh-CN) h1, html:lang(zh-CN) h2, html:lang(zh-CN) h3,
html:lang(zh-TW) h1, html:lang(zh-TW) h2, html:lang(zh-TW) h3 { letter-spacing: 0; }
html:lang(zh-CN) article p, html:lang(zh-TW) article p,
html:lang(zh-CN) article li, html:lang(zh-TW) article li { line-height: 1.75; }
/* Japanese words on the page (voice credits, まなび) */
[lang="ja"] { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; }

/* Cookie consent (as on michi.website): a card at the foot of the screen
   until the visitor chooses. Accept and Decline carry the same weight. */
.cookie-consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px;
  max-width: 560px; margin: 0 auto;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 10px 40px rgba(74,36,25,.18);
  z-index: 200;
  display: flex; flex-direction: column; gap: 12px;
  font-size: 13.5px; color: var(--ink-2); line-height: 1.55;
}
.cookie-consent[hidden] { display: none !important; }
.cookie-consent p { margin: 0; font-size: inherit; color: inherit; }
.cookie-actions { display: flex; gap: 10px; justify-content: flex-end; }
.cookie-btn {
  min-width: 96px; padding: 8px 18px; border-radius: 999px;
  font: inherit; font-weight: 600;
  background: transparent; color: var(--accent);
  border: 1.5px solid var(--accent);
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.cookie-btn:hover { background: color-mix(in oklab, var(--accent) 10%, transparent); }
.footer-note button {
  background: none; border: 0; padding: 0; font: inherit; color: inherit;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.footer-note button:hover { color: var(--ink); }
