/* VietScene landing: the learner's journal print as stationery.
   Colours and face are the app's own (apps/mobile app_theme.dart, light). */

:root {
  --paper: #fffdf8;
  --ink: #10291e;
  --muted: #55685e;
  --green: #16834a;
  --green-deep: #0f4530;
  --green-ink: #11703f;
  --green-tint: #dcf0e2;
  --sun: #f6b23e;
  --coral: #ff6b57;
  --coral-ink: #bc3423;
  --coral-tint: #ffe1da;
  --sky: #3da5ee;
  --sky-tint: #dceefc;

  --font: "Be Vietnam Pro", system-ui, sans-serif;
  /* five sizes */
  --t-display: clamp(2.6rem, 4.3vw, 4.25rem);
  --t-section: clamp(2rem, 3.4vw, 2.875rem);
  --t-lead: clamp(1.25rem, 1.6vw, 1.4rem);
  --t-body: 1.0625rem;
  --t-small: 0.875rem;

  --radius: 16px;
  --gutter: clamp(16px, 3vw, 40px);
  --container: 1360px;
  --section: clamp(96px, 13vw, 200px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: var(--t-body); line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
svg { display: block; width: 100%; height: 100%; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; text-wrap: balance; }
h3 { font-size: var(--t-body); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--sun); color: var(--ink); }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; }
.skip-link:focus { top: 12px; }

s { color: var(--coral-ink); text-decoration-thickness: 2px; }
ins { text-decoration: none; color: var(--green-ink); font-weight: 700; background: var(--green-tint); padding: 0 .2em; border-radius: 4px; }
mark { background: var(--green-tint); color: var(--green-ink); font-weight: 700; padding: 0 .15em; border-radius: 4px; }

/* the app's colour strip: green, sun, coral, sky, repeating */
.strip { display: block; width: 100%; height: 56px; }
.strip--thin { height: 10px; }

/* buttons: fully round, flat */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 26px; border-radius: 999px; font-weight: 700; text-decoration: none; transition: transform .2s var(--ease), background-color .2s; }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-ink); }
.btn--soft { background: var(--green-tint); color: var(--green-deep); }
.btn--soft:hover { background: #c8e7d2; }
.btn:active, .bar:active, .square:active, .attempt:active { transform: scale(.97); }
.btn:hover { transform: translateY(-2px); }
.text-link { font-weight: 700; color: var(--green-ink); }
.text-link:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; min-height: 100svh; background: var(--green-tint); }
.hero__card { display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius); overflow: hidden; }
.hero__nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px clamp(20px, 3vw, 44px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: var(--t-lead); letter-spacing: -0.02em; text-decoration: none; }
.brand img { border-radius: 10px; }
.hero__links { display: flex; gap: clamp(14px, 2vw, 28px); }
.hero__links a { text-decoration: none; font-weight: 600; }
.hero__links a:hover { color: var(--green-ink); text-decoration: underline; }
.hero__body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px clamp(20px, 4vw, 64px) clamp(40px, 6vw, 72px); }
.hero h1 { font-size: var(--t-display); max-width: none; }
.hero__lead { margin-top: 36px; font-size: var(--t-lead); line-height: 1.45; max-width: 30ch; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.hero__small { margin-top: 18px; font-size: var(--t-small); color: var(--muted); }

.hero__photo { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--green-deep); min-height: 520px; }
.shot { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 1.6s ease, visibility 0s linear 1.6s; }
.shot.is-on { opacity: 1; visibility: visible; transition: opacity 1.6s ease; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot.is-on img { animation: drift 9s ease-out both; }
@keyframes drift { from { transform: scale(1.06); } to { transform: scale(1); } }
.caption { position: absolute; left: 20px; right: 20px; bottom: 20px; max-width: 460px; display: grid; gap: 6px; padding: 20px 22px; background: var(--paper); border-radius: var(--radius); }
.caption__time { font-size: var(--t-small); font-weight: 700; color: var(--green-ink); }
.caption__line { font-size: var(--t-lead); font-weight: 600; line-height: 1.35; }
.caption__why { font-size: var(--t-small); color: var(--muted); }

/* ---------- A day of moments ---------- */
.day { padding-top: var(--section); }
.day__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.day h2 { font-size: var(--t-section); max-width: 18ch; }
.day__controls { display: flex; gap: 8px; }
.square { width: 52px; height: 52px; padding: 14px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); cursor: pointer; transition: background-color .2s, transform .2s var(--ease); }
.square:hover { background: var(--green); }
.progress { margin-top: 28px; height: 6px; border-radius: 6px; background: var(--green-tint); overflow: hidden; }
.progress span { display: block; height: 100%; width: 20%; background: var(--green); border-radius: 6px; transition: width .2s; }
.day__lead { margin-top: 28px; font-size: var(--t-lead); max-width: calc(60ch + 2 * var(--gutter)); margin-inline: max(0px, calc((100vw - var(--container)) / 2)); }
.moments { list-style: none; margin: 56px auto 0; padding: 0 0 8px; width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--container) - 2 * var(--gutter)); display: flex; gap: 32px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.moments::-webkit-scrollbar { display: none; }
.moment { flex: 0 0 340px; scroll-snap-align: start; display: flex; flex-direction: column; }
.moment h3 { font-size: var(--t-lead); letter-spacing: -0.02em; }
.moment p[lang] { margin-top: 12px; font-size: var(--t-body); font-weight: 600; }
.moment__why { margin-top: 6px; font-size: var(--t-small); color: var(--muted); }
.moment img { margin-top: var(--gap); aspect-ratio: 4 / 5; width: 100%; object-fit: cover; border-radius: var(--radius); }

/* ---------- Corrections + slips ---------- */
.fixes { position: relative; margin-top: var(--section); overflow: hidden; color: var(--paper); background: var(--green-deep); }
.fixes__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fixes::before { content: ""; position: absolute; inset: 0; background: rgba(8, 26, 18, .62); z-index: 1; }
.fixes__grid { position: relative; z-index: 2; display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 5vw, 80px); align-items: start; padding-top: clamp(80px, 10vw, 140px); }
.fixes h2 { font-size: var(--t-section); }
.fixes__copy p { margin-top: 24px; font-size: var(--t-lead); line-height: 1.45; max-width: 30ch; }
.try { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: clamp(20px, 2.4vw, 32px); display: grid; gap: 20px; }
.attempts { display: grid; gap: 8px; }
.attempt { text-align: left; padding: 14px 18px; border-radius: 12px; border: 0; background: #eef3ef; cursor: pointer; font-weight: 600; transition: background-color .2s, transform .2s var(--ease); }
.attempt:hover { background: var(--green-tint); }
.attempt[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.fix { background: var(--coral-tint); border-radius: 12px; padding: 20px; display: grid; gap: 12px; }
.fix__label { font-size: var(--t-small); font-weight: 700; color: var(--coral-ink); }
.fix__sentence { font-size: var(--t-lead); font-weight: 600; line-height: 1.35; }
.fix__tools { display: flex; gap: 8px; }
.tool { min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--paper); font-weight: 700; font-size: var(--t-small); cursor: pointer; transition: background-color .2s; }
.tool:hover { background: #fff; color: var(--green-ink); }
.no-speech .speak { display: none; }
.fix__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fix__change { font-weight: 700; }
.fix__why, .fix__vi { font-size: var(--t-small); }

.slips { position: relative; z-index: 2; display: flex; align-items: flex-start; gap: 12px; margin-top: clamp(64px, 8vw, 120px); padding-inline: 12px; height: 44svh; min-height: 300px; overflow: hidden; }
.slip { flex: 1 1 0; min-width: 0; height: var(--h); min-height: 220px; margin-top: calc(44svh - var(--h)); padding: 22px 20px 0; background: var(--paper); color: var(--ink); border-radius: var(--radius) var(--radius) 0 0; transform: rotate(var(--r, 0deg)); transform-origin: bottom center; display: flex; flex-direction: column; gap: 6px; font-size: var(--t-small); }
.slip h3 { font-size: var(--t-body); font-weight: 800; }
.slip__dots { color: var(--muted); letter-spacing: .1em; overflow: hidden; white-space: nowrap; }

/* ---------- Menu sheet ---------- */
.menu { background: var(--green); padding-block: var(--section); }
.menu__grid { display: grid; grid-template-columns: minmax(0, 600px) 1fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.sheet { --scallop: 14px; background: var(--paper); padding: calc(48px + var(--scallop)) clamp(24px, 3.4vw, 52px); /* taste-skill-ignore: mask cuts the scalloped paper edge, not a fill */ -webkit-mask: radial-gradient(circle var(--scallop) at 50% 0, #0000 98%, #000) top / 34px 51% repeat-x, radial-gradient(circle var(--scallop) at 50% 100%, #0000 98%, #000) bottom / 34px 51% repeat-x; mask: radial-gradient(circle var(--scallop) at 50% 0, #0000 98%, #000) top / 34px 51% repeat-x, radial-gradient(circle var(--scallop) at 50% 100%, #0000 98%, #000) bottom / 34px 51% repeat-x; }
.sheet h2 { font-size: var(--t-section); text-align: center; }
.sheet__group { margin-top: 44px; }
.sheet__group h3 { font-size: var(--t-lead); color: var(--green-ink); }
.sheet dl { margin: 14px 0 0; display: grid; gap: 18px; }
.sheet dl > div { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; column-gap: 10px; }
.sheet dl > div::after { content: ""; grid-column: 2; grid-row: 1; align-self: end; margin-bottom: .35em; border-bottom: 4px dotted #b9c7bf; }
.sheet dt { grid-column: 1; grid-row: 1; font-weight: 700; font-size: var(--t-body); }
.sheet dd { grid-column: 3; grid-row: 1; margin: 0; font-weight: 600; color: var(--green-ink); }
.sheet dl p { grid-column: 1 / -1; margin-top: 2px; max-width: 40ch; font-size: var(--t-small); color: var(--muted); }

.screens { position: relative; height: clamp(620px, 62vw, 880px); }
.screen { position: absolute; margin: 0; width: 50%; border-radius: 28px; overflow: hidden; background: var(--paper); padding: 8px; }
.screen img { border-radius: 22px; }
.screen--a { left: -2%; top: 12%; transform: rotate(-4deg); }
.screen--b { left: 25%; top: 2%; z-index: 2; }
.screen--c { right: -2%; top: 18%; transform: rotate(4deg); }

/* ---------- FAQ ---------- */
.faq { background: var(--sky-tint); padding-bottom: 80px; overflow: hidden; }
.faq__grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(40px, 6vw, 96px); }
.faq__text { padding-top: var(--section); }
.faq h2 { font-size: var(--t-section); }
.faq__facts { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 6px; font-size: 1.125rem; font-weight: 600; }
.faq__list { margin-top: 44px; display: grid; gap: 22px; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; font-size: 1.25rem; font-weight: 700; line-height: 1.35; padding-block: 4px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: 0 0 12px; width: 12px; height: 12px; margin-top: .45em; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(225deg); }
.faq summary:hover { color: var(--green-ink); }
.faq details p { margin-top: 8px; max-width: 52ch; }
.faq details a { color: var(--green-ink); font-weight: 700; }
.faq__actions { margin-top: 44px; display: flex; align-items: center; gap: 24px; }
.faq__photos { position: relative; }
.faq__tall { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 0 0 var(--radius) var(--radius); }
.faq__square { position: absolute; left: -40px; bottom: -40px; width: 36%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); outline: 8px solid var(--sky-tint); }

/* ---------- CTA card ---------- */
.cta { background: var(--green-deep); color: var(--paper); padding-top: clamp(96px, 11vw, 160px); overflow: hidden; }
.cta__grid { display: grid; grid-template-columns: 4fr 1fr 7fr; align-items: end; }
.cta__note { grid-column: 1; font-size: clamp(1.25rem, 1.8vw, 1.5rem); line-height: 1.4; padding-bottom: 64px; max-width: 24ch; }
.card { grid-column: 3; background: var(--paper); color: var(--ink); padding: 0 clamp(24px, 3.4vw, 48px) clamp(80px, 8vw, 110px); text-align: center; transform: rotate(2deg) translateY(60px); transform-origin: bottom center; display: grid; gap: 16px; justify-items: center; }
.card .strip { width: calc(100% + 2 * clamp(24px, 3.4vw, 48px)); margin-bottom: 32px; }
.card h2 { font-size: var(--t-section); }
.card p { max-width: 34ch; }
.bar { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 999px; font-weight: 700; text-decoration: none; background: var(--green-tint); color: var(--green-deep); transition: transform .2s var(--ease), background-color .2s; }
.bar--primary { margin-top: 12px; background: var(--ink); color: var(--paper); }
.bar:hover { background: var(--green); color: #fff; }

/* ---------- Footer: the back of the postcard ---------- */
.foot { background: var(--green-deep); padding: 120px 0 40px; }
.postcard { --sc: 50px; position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); padding: calc(56px + var(--sc) / 2) clamp(24px, 5vw, 72px) 40px; background: var(--paper); border-radius: 0 0 var(--radius) var(--radius); /* taste-skill-ignore: mask cuts the postcard scallops */ -webkit-mask: radial-gradient(circle calc(var(--sc) / 2) at 50% 0, #0000 98%, #000) top / var(--sc) 100% repeat-x; mask: radial-gradient(circle calc(var(--sc) / 2) at 50% 0, #0000 98%, #000) top / var(--sc) 100% repeat-x; }
.postcard__message { display: grid; gap: 16px; align-content: start; }
.postcard__sign { font-size: clamp(1.75rem, 2.6vw, 2.25rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.postcard__message p:not(.postcard__sign) { max-width: 40ch; }
.postcard__from { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-top: 8px; }
.postcard__from img { border-radius: 8px; }
.postcard__address { position: relative; padding-top: 4px; }
.stamp { position: absolute; right: 0; top: 0; width: 88px; aspect-ratio: 3 / 4; object-fit: cover; padding: 6px; background: var(--paper); outline: 4px dotted var(--sun); outline-offset: -2px; }
.postcard__address nav { display: grid; gap: 12px; padding-top: 120px; font-size: 1.125rem; }
.postcard__address a { font-weight: 600; word-break: break-word; }
.postcard__address a:hover { color: var(--green-ink); }
.postcard__imprint { grid-column: 1 / -1; text-align: center; font-size: var(--t-small); color: var(--muted); }
.credits { margin-top: 24px; color: #c9dccf; font-size: var(--t-small); }
.credits summary { cursor: pointer; font-weight: 600; }
.credits p { margin-top: 10px; max-width: 75ch; }

/* ---------- Reveal (only when script runs) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--n, 0) * 80ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js .slip[data-reveal] { transform: translateY(60px) rotate(var(--r, 0deg)); }
.js .slip[data-reveal].is-in { transform: rotate(var(--r, 0deg)); }
.js .hero [data-reveal] { transition-duration: .9s; }

/* ---------- Tablet ---------- */
@media (max-width: 60rem) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__photo { order: -1; height: 56svh; min-height: 380px; }
  .hero__card { margin-top: -24px; position: relative; z-index: 2; }
  .hero__body { padding-top: 16px; }
  .fixes__grid, .menu__grid, .faq__grid { grid-template-columns: 1fr; }
  .fixes__copy p { max-width: 46ch; }
  .menu__grid { justify-items: center; }
  .sheet { width: 100%; max-width: 600px; }
  .screens { width: 100%; max-width: 620px; height: 108vw; max-height: 640px; }
  .faq__photos { order: -1; margin-inline: calc(-1 * var(--gutter)); }
  .faq__tall { aspect-ratio: 4 / 5; border-radius: 0; }
  .faq__square { left: auto; right: var(--gutter); bottom: -32px; width: 38%; }
  .faq__text { padding-top: 64px; }
  .cta__grid { grid-template-columns: 1fr; justify-items: center; }
  .cta__note { grid-column: 1; padding-bottom: 48px; justify-self: start; }
  .card { grid-column: 1; width: 90%; max-width: 560px; transform: rotate(1deg) translateY(48px); }
  .postcard { grid-template-columns: 1fr; }
  .slips { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: max(20px, var(--gutter)); padding-inline: 0; }
  .slips::-webkit-scrollbar { display: none; }
  .slip { flex: 0 0 min(44vw, 260px); scroll-snap-align: start; }
  .postcard__address nav { padding-top: 0; padding-right: 96px; }
}

/* ---------- Phone ---------- */
@media (max-width: 40rem) {
  .hero { padding: 12px; }
  .hero__photo { height: 48svh; min-height: 320px; }
  .hero__links { display: none; }
  .hero h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .hero__lead { margin-top: 24px; }
  .stores { flex-direction: column; }
  .stores .btn { width: 100%; }
  .strip { height: 40px; }
  .caption { left: 12px; right: 12px; bottom: 36px; padding: 14px 16px; }
  .caption__line { font-size: var(--t-body); }
  .day__controls { display: none; }
  .moments { gap: 16px; }
  .moment { flex-basis: 74vw; }
  .moment img { margin-top: calc(var(--gap) / 2.2); }
  .slips { height: 40svh; }
  .slip { flex-basis: 44vw; margin-top: calc(40svh - var(--h) * .9); height: calc(var(--h) * .9); }
  .sheet { padding-inline: 20px; }
  .sheet__group h3 { font-size: 1.125rem; }
  .screen { width: 50%; }
  .faq summary { font-size: 1.125rem; }
  .faq__actions { flex-direction: column; align-items: stretch; text-align: center; }
  .postcard { --sc: 56px; padding-inline: 20px; }
  .stamp { width: 64px; }
  .postcard__address nav { padding-right: 76px; font-size: var(--t-body); }
  .postcard__address a[href^="mailto"] { font-size: var(--t-small); word-break: normal; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .slip[data-reveal] { transform: rotate(var(--r, 0deg)); }
  .shot:not(:first-child) { display: none; }
}
