/* ChunkIt welcome · polished teal — tokens from the app's src/styles/flashcardStudy.ts */
:root {
  --bg: oklch(97.4% 0.003 220);
  --surface: oklch(100% 0 0);
  --fg: oklch(25.4% 0.028 258);
  --muted: oklch(52% 0.026 242);
  --border: oklch(92.8% 0.008 237);
  --accent: oklch(62.4% 0.101 180);
  --accent-strong: oklch(50% 0.088 181);
  --fg-soft: color-mix(in oklch, var(--fg) 6%, transparent);
  --font-body: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-zh: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --pad: 22px;
  --col: 480px;
  --art: min(100%, 36vh, 320px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
p, h1, h2, ol { margin: 0; }
.zh { font-family: var(--font-zh); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.app { height: 100%; height: 100dvh; display: flex; flex-direction: column; }

/* Top bar */
.topbar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  min-height: 52px;
  padding: 6px 12px 0 var(--pad);
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-zh); font-weight: 700; font-size: 15px; letter-spacing: 0.02em;
}
.brand img {
  width: 28px; height: 28px; border-radius: 22.37%; display: block;
  box-shadow: 0 0 0 1px var(--border);
}
/* Slides */
.track {
  flex: 1; min-height: 0;
  display: flex;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.track::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 10px var(--pad) 16px;
  display: flex; flex-direction: column; gap: 22px;
}
.slide::-webkit-scrollbar { display: none; }
.slide > .copy { width: 100%; max-width: var(--col); margin-inline: auto; }
.footer > * { width: 100%; max-width: var(--col); margin-inline: auto; }

/* Illustration: see-through art straight on the page, no panel */
.art {
  flex-shrink: 0;
  position: relative;
  width: var(--art);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
}
.art > img:not(.hero-logo) {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
  transform: scale(1.05);
  opacity: 0.35;
  transition: transform 800ms var(--ease), opacity 500ms ease;
}
.slide.is-active .art > img:not(.hero-logo) { transform: scale(1); opacity: 1; }

.art.art-hero { display: grid; place-items: center; }
.hero-logo {
  width: 100%; aspect-ratio: 1 / 1; display: block;
  object-fit: contain;
  transform: translateY(10px) scale(0.94);
  opacity: 0;
  transition: transform 800ms var(--ease), opacity 500ms ease;
}
.slide.is-active .hero-logo { transform: none; opacity: 1; }

/* Copy */
.copy { display: flex; flex-direction: column; align-items: center; text-align: center; }
.copy > * { max-width: 100%; }
.copy > * { transition: opacity 420ms ease, transform 420ms var(--ease); }
.slide:not(.is-active) .copy > * { opacity: 0; transform: translateY(8px); }
.slide.is-active .copy > :nth-child(2) { transition-delay: 40ms; }
.slide.is-active .copy > :nth-child(3) { transition-delay: 80ms; }
.slide.is-active .copy > :nth-child(n+4) { transition-delay: 120ms; }

.title-zh {
  font-family: var(--font-zh);
  font-size: clamp(24px, 6.8vw, 28px);
  font-weight: 750; line-height: 1.25; letter-spacing: 0.01em;
  text-wrap: balance;
}
.title-zh .gt { color: var(--muted); font-weight: 500; margin-inline: 0.15em; }
.title-en {
  margin-top: 6px;
  font-size: 16px; font-weight: 600; line-height: 1.35;
  color: var(--muted); letter-spacing: -0.01em;
  text-wrap: balance;
}
.body-zh {
  margin-top: 16px;
  font-family: var(--font-zh);
  font-size: 16px; line-height: 1.7;
}

/* Card 1 */
.app-name {
  font-family: var(--font-zh);
  font-size: clamp(32px, 9vw, 38px);
  font-weight: 800; line-height: 1.1; letter-spacing: 0.02em;
}
.tagline-zh {
  margin-top: 12px;
  font-family: var(--font-zh);
  font-size: 18px; font-weight: 600; line-height: 1.45;
}
.tagline-zh .mono { font-weight: 700; }
.tagline-en { margin-top: 4px; font-size: 15px; line-height: 1.45; color: var(--muted); }
.exam-row { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.exam-row span {
  display: inline-flex; align-items: center;
  min-height: 28px; padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
}

/* Research citation */
.cite {
  width: 100%;
  margin-top: 18px;
  padding: 12px 14px 13px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.cite-label {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-bottom: 4px;
}
.cite-label svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.cite p:not(.cite-label) { font-size: 13px; line-height: 1.5; }

/* Card 5 path */
.path { width: 100%; list-style: none; padding: 0; margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.path li {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 10px 11px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.path .n {
  width: 24px; height: 24px; border-radius: 8px; margin-bottom: 6px;
  display: grid; place-items: center;
  background: var(--fg-soft);
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
}
.path .zh-l { font-family: var(--font-zh); font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.path .en-l { font-size: 12px; line-height: 1.3; color: var(--muted); }

/* Footer */
.footer {
  flex-shrink: 0;
  padding: 12px var(--pad) 20px;
  display: grid; gap: 16px;
}
.progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.progress button { height: 20px; padding: 8px 0; display: block; }
.progress button::before {
  content: ""; display: block; height: 4px; border-radius: 4px;
  background: var(--border);
  transition: background 0.25s ease;
}
.progress button:hover::before { background: color-mix(in oklch, var(--fg) 20%, var(--border)); }
.progress button.done::before { background: color-mix(in oklch, var(--fg) 30%, var(--border)); }
.progress button.current::before { background: var(--accent); }

.actions { display: flex; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 14px 20px; border-radius: 14px;
  font-size: 16px; font-weight: 650; letter-spacing: -0.005em;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.btn-primary {
  flex: 1;
  font-family: var(--font-zh);
  background: var(--accent-strong);
  color: var(--surface);
  box-shadow:
    0 12px 24px -10px color-mix(in oklch, var(--accent-strong) 60%, transparent),
    inset 0 1px 0 color-mix(in oklch, white 22%, transparent);
}
.btn-primary:hover { background: color-mix(in oklch, var(--accent-strong) 88%, black); }
.btn-primary .sep { opacity: 0.6; margin-inline: 2px; }
.btn-primary:focus-visible, .btn-back:focus-visible, .progress button:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--accent) 40%, transparent); outline-offset: 2px;
}
.btn-back {
  width: 52px; padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
}
.btn-back:hover { background: color-mix(in oklch, var(--fg) 4%, var(--surface)); }
.btn-back[hidden] { display: none; }

.toast {
  position: fixed; left: 50%; bottom: 150px; z-index: 30;
  transform: translateX(-50%) translateY(12px);
  background: var(--fg); color: var(--surface);
  padding: 12px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-height: 700px) {
  :root { --art: min(100%, 30vh); }
  .slide { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* iOS */
body.ios .btn { border-radius: 14px; }

/* Android / Material */
body.android .btn, body.android .btn-back { border-radius: 999px; }
body.android .title-en { letter-spacing: 0; }
body.android .cite, body.android .path li { border-radius: 16px; }

/* iPad — portrait: one wide centered column */
body.ipad {
  --pad: 56px;
  --col: 600px;
  --art: min(100%, 40vh, 480px);
}
body.ipad .topbar { min-height: 68px; padding: 12px 28px 0 40px; }
body.ipad .brand { font-size: 17px; }
body.ipad .brand img { width: 34px; height: 34px; }
body.ipad .slide { gap: 36px; padding-top: 20px; padding-bottom: 20px; }
body.ipad .slide > :first-child { margin-top: auto; }
body.ipad .slide > :last-child { margin-bottom: auto; }
body.ipad .app-name { font-size: 50px; }
body.ipad .tagline-zh { font-size: 22px; margin-top: 16px; }
body.ipad .tagline-en { font-size: 17px; }
body.ipad .title-zh { font-size: 38px; }
body.ipad .title-en { font-size: 20px; margin-top: 8px; }
body.ipad .body-zh { font-size: 19px; margin-top: 20px; }
body.ipad .exam-row span { font-size: 15px; min-height: 34px; padding: 6px 14px; }
body.ipad .cite { margin-top: 24px; padding: 16px 20px; border-radius: 18px; }
body.ipad .cite-label { font-size: 11.5px; }
body.ipad .cite p:not(.cite-label) { font-size: 15px; }
body.ipad .path { gap: 12px; margin-top: 22px; }
body.ipad .path li { padding: 14px 16px; border-radius: 18px; }
body.ipad .path .zh-l { font-size: 17px; }
body.ipad .path .en-l { font-size: 14px; }
body.ipad .footer { padding: 16px var(--pad) 36px; gap: 18px; }
body.ipad .btn { min-height: 58px; font-size: 17px; border-radius: 16px; }
body.ipad .btn-back { width: 58px; }
body.ipad .toast { bottom: 170px; font-size: 15px; padding: 14px 20px; }

/* iPad — landscape: illustration left, words + controls right */
@media (orientation: landscape) {
  body.ipad { --pad: 64px; --col: 480px; --art: min(100%, 62vh, 540px); }
  body.ipad .slide {
    display: grid; grid-template-columns: 1fr 1fr; align-items: center;
    column-gap: 56px; row-gap: 0;
    padding-top: 12px; padding-bottom: 8px;
  }
  body.ipad .slide > :first-child, body.ipad .slide > :last-child { margin-block: 0; }
  body.ipad .art { margin: 0; justify-self: end; }
  body.ipad .slide > .copy { margin: 0; }
  body.ipad .title-zh { font-size: 40px; }
  body.ipad .footer { padding: 12px var(--pad) 32px calc(50% + 28px); }
  body.ipad .footer > * { margin-inline: 0; }
}
