/* Baito website. Palette C "Nezumi + Yamabuki" (src/theme/tokens.ts):
   grey paper, ink buttons, gold accent used sparingly, the icon green behind Baito.
   No gradients, no glass, no emoji icons. */

@font-face {
  font-family: "Fredoka";
  src: url("/fonts/Fredoka_600SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  --paper: #eeede8;
  --surface: #fafaf7;
  --ink: #24252a;
  --muted: #67686e;
  --line: #d8d7d0;
  --button: #24252a;
  --button-text: #fafaf7;
  --accent: #a8740f;
  --accent-soft: #f3e8d2;
  --ok: #2f7350;
  --ok-soft: #e1eee6;
  --ng: #9e3d3f;
  --ng-soft: #f5e1df;
  --mascot: #b3cf9f;
  --mascot-ink: #24252a;
  --radius: 12px;
  --display: "Fredoka", ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161719;
    --surface: #1f2023;
    --ink: #e9e8e3;
    --muted: #9c9da2;
    --line: #303136;
    --button: #e9e8e3;
    --button-text: #161719;
    --accent: #e0b04e;
    --accent-soft: #3a2f18;
    --ok: #7cc19a;
    --ok-soft: #1d3226;
    --ng: #e38c8a;
    --ng-soft: #3a2224;
    --mascot: #2f3a2a;
    --mascot-ink: #e9e8e3;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
}

[lang="ja"] { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif; }

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

a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; }

/* Top bar */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 22px/1 var(--display);
  color: var(--ink);
  text-decoration: none;
}
.mark img { width: 36px; height: 36px; border-radius: 9px; }
.top nav { display: flex; gap: 20px; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--radius);
  background: var(--button);
  color: var(--button-text);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.btn:hover { opacity: 0.9; }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn-quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 48px;
  padding: 40px 0 72px;
}
.eyebrow { color: var(--muted); font-size: 15px; letter-spacing: 0.04em; margin: 0 0 12px; }
h1 {
  font: 600 clamp(38px, 6vw, 60px)/1.08 var(--display);
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
h1 em, h2 em { font-style: normal; color: var(--accent); white-space: nowrap; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 32px; max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.fine { font-size: 14px; color: var(--muted); margin: 0; }

.baito-stage { position: relative; max-width: 420px; justify-self: center; width: 100%; }
.baito-disc {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--mascot);
  display: grid;
  place-items: center;
}
.baito-disc img { width: 64%; height: auto; }
.bubble {
  position: absolute;
  top: 2%;
  right: -2%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 17px;
  white-space: nowrap;
}
.bubble::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -9px;
  width: 16px;
  height: 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

/* Sections */
section { padding: 56px 0; }
section + section { border-top: 1px solid var(--line); }
h2 {
  font: 600 clamp(28px, 4vw, 38px)/1.15 var(--display);
  margin: 0 0 8px;
}
.section-sub { color: var(--muted); margin: 0 0 32px; }

/* Question of the day */
.qotd-grid { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.qcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.qmeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.toggle { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.qsection { margin: 0; font-weight: 600; font-size: 18px; }
.qinst { margin: 2px 0 18px; color: var(--muted); font-size: 14px; }
.qprompt { font-size: 21px; line-height: 2.1; margin: 0 0 20px; }
.qprompt u.target {
  text-decoration: none;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 1px;
}
ruby rt { font-size: 0.5em; color: var(--muted); }
.no-furi rt { display: none; }

.opts { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  font: inherit;
  font-size: 18px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
}
.opt:hover:not(:disabled) { border-color: var(--ink); }
.opt:disabled { cursor: default; }
.opt .num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--muted);
}
.opt .mark-shape { margin-left: auto; font-size: 20px; font-weight: 600; }
.opt.right { background: var(--ok-soft); border-color: var(--ok); }
.opt.right .num { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.opt.right .mark-shape { color: var(--ok); }
.opt.wrong { background: var(--ng-soft); border-color: var(--ng); }
.opt.wrong .num { background: var(--ng); border-color: var(--ng); color: var(--surface); }
.opt.wrong .mark-shape { color: var(--ng); }

.explain {
  margin-top: 18px;
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 16px;
}
.explain .verdict { font-weight: 600; margin: 0 0 6px; }
.explain .verdict.ok { color: var(--ok); }
.explain .verdict.ng { color: var(--ng); }
.explain p { margin: 0; }
.qfoot { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.qside p { margin: 0 0 16px; color: var(--muted); }
.baito-small { height: auto; }
.qside { padding-top: 96px; }
.qside .baito-small { width: 120px; margin-bottom: 16px; }

/* Why it works */
.why { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.why li { border-top: 2px solid var(--accent); padding-top: 20px; }
.why-glyph {
  display: block;
  font-size: 44px;
  line-height: 1;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
}
.why h3 { font: 600 22px/1.25 var(--display); margin: 0 0 8px; }
.why p { margin: 0; color: var(--muted); }

/* Features */
.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.features li {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.glyph {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 600;
}
.features h3 { margin: 0 0 4px; font-size: 17px; }
.features p { margin: 0; color: var(--muted); font-size: 15px; }

/* Screenshots */
.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 1fr);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
}
.shots img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  scroll-snap-align: start;
  width: 100%;
  height: auto;
}

/* Plans */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.plan.pro { border-color: var(--accent); }
.plan h3 { font: 600 22px/1.2 var(--display); margin: 0 0 12px; }
.plan ul { margin: 0; padding-left: 20px; }
.plan li { margin: 6px 0; }

/* Closing call to action */
.closing { text-align: center; }
.closing .baito-small { width: 96px; margin: 0 auto 16px; }
.closing .cta-row { justify-content: center; margin-top: 24px; }

/* Text pages (support, privacy) */
.page-head {
  padding: 32px 0 28px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 36px;
}
.page-head h1 { font-size: clamp(32px, 5vw, 42px); margin: 0 0 8px; }
.page-head .lede { margin: 0; }
.prose h2 { font-size: 24px; margin: 40px 0 10px; }
.prose h3 { font-size: 17px; font-weight: 600; margin: 28px 0 6px; font-family: var(--body); }
.prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.updated { font-size: 15px; color: var(--muted); margin: 0 0 28px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 28px 0;
}
.card h3:first-child, .card h2:first-child { margin-top: 0; }

/* Footer */
footer {
  margin-top: 40px;
  padding: 32px 0 56px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
footer .links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
footer p { margin: 6px 0; max-width: 46em; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 16px 0 48px; }
  .baito-stage { max-width: 280px; order: -1; }
  .qotd-grid { grid-template-columns: 1fr; gap: 24px; }
  .qside { order: 2; padding-top: 0; }
  .features { grid-template-columns: 1fr; }
  .why { grid-template-columns: 1fr; gap: 28px; }
  .plans { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .top nav { gap: 14px; }
  .qcard { padding: 18px 16px; }
  .qprompt { font-size: 19px; }
  .card { padding: 20px; }
  .bubble { font-size: 14px; right: -12px; padding: 8px 12px; }
  .baito-stage { max-width: 220px; }
  .shots { grid-auto-columns: 70%; }
}
