/* Home v2 (13/11): a short welcome for a first visit, a "Today" screen and tabs for a returning reader.
   KOA colours: page #faf5ea, cards #fffdf9, ink #29202b / #3d3054, violet #76518e, lilac #efe6f7, lines #e2d6c6. */

/* ---- First visit: one sentence, the demo, one big button ---- */
.home-hero-v2{display:grid;gap:18px;padding-top:22px;padding-bottom:34px}
.home-hero-v2 h1{margin:0;font:700 clamp(2rem,7.5vw,3.2rem)/1.1 Georgia,serif;color:#29202b}
.home-hero-v2 .hero-lead{margin:8px 0 0;font-size:1.12rem;color:#5c4f5d}
.home-hero-v2 .hero-actions{display:grid;gap:14px}
.home-cta.home-cta-big{display:flex;align-items:center;justify-content:center;width:100%;min-height:60px;font-size:1.15rem}
.hero-reassure{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 18px;margin:0;padding:0;list-style:none;color:#6f6170;font-size:.95rem}
.hero-reassure li::before{content:"✓ ";color:#4c9a5b;font-weight:800}
@media(min-width:900px){.home-hero-v2{grid-template-columns:1fr 1fr;align-items:center;column-gap:48px}.home-hero-v2 .home-demo{grid-row:span 2}}

/* ---- Returning reader: only "Today" (or the library), with tabs at the bottom ---- */
body.is-returning{padding-bottom:calc(86px + env(safe-area-inset-bottom))}
body.is-returning .home-hero,body.is-returning .manga-picks,body.is-returning .home-how,body.is-returning .home-why,
body.is-returning .home-faq,body.is-returning .home-final,body.is-returning .koa-resume,body.is-returning .koa-week-strip,
body.is-returning .koa-words-card,body.is-returning .home-cta-small{display:none!important}
body.is-returning[data-view="today"] #comics,body.is-returning[data-view="today"] .footer{display:none}
body.is-returning[data-view="library"] #koa-today{display:none}
body:not(.is-returning) #koa-today{display:none}

.koa-today{display:grid;gap:16px;max-width:520px;padding-top:14px;padding-bottom:20px}
.t-hello h1{margin:0;font:700 2rem/1.15 Georgia,serif;color:#29202b}
.t-hello p{margin:4px 0 0;font-size:1.05rem;color:#5c4f5d}
/* 15/11 (Alexis): the chest of the path (koa-path.js) right under "Hello!". */
.t-hello .kp-chest{margin-top:8px}
/* ...and to keep "Today" on one phone screen with it, a little less air between the blocks. */
.koa-today{gap:12px}
.koa-today .t-mini{padding:11px 16px}.koa-today .t-mini .t-go{padding:8px 14px}
.koa-today .t-hello+.t-mini{margin-top:0}.t-card{display:block;padding:18px;border:2px solid #3d3054;border-radius:24px;background:#fffdf9;box-shadow:0 5px 0 #3d3054;color:#29202b;text-decoration:none;-webkit-tap-highlight-color:transparent}
.t-card:active{transform:translateY(3px);box-shadow:0 2px 0 #3d3054}
.t-kicker{display:block;margin-bottom:12px;font:800 .8rem/1 Inter,"Segoe UI",Arial,sans-serif;letter-spacing:.12em;text-transform:uppercase;color:#76518e}
.t-body{display:grid;grid-template-columns:120px 1fr;gap:16px;align-items:center;margin-bottom:16px}
.t-body img{width:120px;height:180px;object-fit:cover;border-radius:12px;box-shadow:0 0 0 1px #29202b14,0 8px 20px #29202b33}
.t-body h2{margin:0 0 6px;font:700 1.45rem/1.15 Georgia,serif}
.t-body p{margin:0;font-size:1rem;line-height:1.4;color:#5c4f5d}
.t-body .t-min{margin-top:8px;font-weight:800;color:#76518e}
.t-btn{display:flex;align-items:center;justify-content:center;min-height:56px;border:2px solid #3d3054;border-radius:16px;background:linear-gradient(180deg,#cdb4ec,#b48fe0);box-shadow:0 4px 0 #3d3054;font:900 1.12rem Inter,"Segoe UI",Arial,sans-serif;color:#302344}
.t-mini{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:16px 18px;border:1.5px solid #e2d6c6;border-radius:18px;background:#fffdf9;font:inherit;color:#29202b;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.t-mini strong{display:block;font-size:1.05rem}.t-mini small{color:#6f6170;font-size:.92rem}
.t-go{flex:none;padding:10px 16px;border-radius:12px;background:#efe6f7;color:#4b2f63;font-weight:800}
.t-level{display:block;padding:4px 2px;color:#5c4f5d;text-decoration:none;font-size:1rem}
.t-level-head{display:flex;justify-content:space-between;gap:10px}
.t-level b{color:#29202b}
.t-bar{display:block;height:10px;margin-top:8px;border-radius:999px;background:#e9e1ee;overflow:hidden}
.t-bar span{display:block;height:100%;border-radius:999px;background:#bda1e2}

/* ---- Tabs: icons with words (familiar, readable for every age) ---- */
.home-tabs{position:fixed;left:0;right:0;bottom:0;z-index:50;display:flex;justify-content:space-around;padding:8px 6px calc(8px + env(safe-area-inset-bottom));border-top:1px solid #e2d6c6;background:#fffdf9}
.home-tab{display:grid;justify-items:center;gap:3px;min-width:96px;min-height:52px;padding:4px 6px;border:0;background:none;color:#8a7c8b;font:800 .82rem Inter,"Segoe UI",Arial,sans-serif;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.home-tab svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.home-tab.is-on{color:#76518e}
.home-tab:active{transform:scale(.96)}
@media(prefers-reduced-motion:reduce){.t-card:active,.home-tab:active{transform:none}}

/* On a phone the big button of the welcome is enough: no second "Start reading" in the header. */
@media(max-width:700px){.home-cta-small{display:none!important}}

/* ---- Review tab (koa-review.js, 13/11) ---- */
body:not([data-view="review"]) .koa-review-tab{display:none}
body.is-returning[data-view="review"] #koa-today,body.is-returning[data-view="review"] #comics,body.is-returning[data-view="review"] .footer{display:none}
.home-tab{position:relative}
.home-tab-badge{position:absolute;top:0;left:calc(50% + 6px);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#e07b1f;color:#fff;font:900 11px/18px Inter,"Segoe UI",Arial,sans-serif;font-style:normal}
.home-tab-badge[hidden]{display:none}

/* ---- First visit (13/11): currents of real panels, one sentence, one big button, then the tap gesture ---- */
body:not(.is-returning) .home-hero-v2{display:none}
.home-wind{position:relative;padding:0 0 26px}
.wind{position:relative;height:310px;margin-top:-10px;overflow:hidden;-webkit-mask-image:linear-gradient(180deg,transparent 0,#000 14%,#000 78%,transparent 100%);mask-image:linear-gradient(180deg,transparent 0,#000 14%,#000 78%,transparent 100%)}
.wind-stream{position:absolute;left:-40%;width:180%;transform:rotate(var(--tilt));filter:drop-shadow(0 8px 12px #29202b45);animation:wind-sway var(--sway) ease-in-out infinite alternate}
.wind-track{display:flex;gap:14px;width:max-content;animation:wind-blow var(--speed) linear infinite}
.wind-tile{flex:none;width:var(--w);height:var(--h);padding:4px;background:#fff;clip-path:var(--shape);transform:perspective(500px) rotate(var(--r)) rotateY(var(--ry)) skewX(var(--sk))}
.wind-tile img{display:block;width:100%;height:100%;object-fit:cover;clip-path:var(--shape)}
@keyframes wind-blow{from{transform:translateX(-50%)}to{transform:translateX(0)}}
@keyframes wind-sway{from{translate:0 -10px}to{translate:0 12px}}
.wind-copy{max-width:520px;text-align:center}
.wind-copy h1{margin:-4px 0 0;font:700 clamp(2rem,7.5vw,2.6rem)/1.15 Georgia,serif;color:#29202b}
.wind-lead{margin:10px auto 0;max-width:340px;color:#5c4f5d;font-size:1.08rem}
.home-cta.wind-go{display:flex;align-items:center;justify-content:center;width:100%;min-height:60px;margin-top:22px;font-size:1.15rem}
.wind-all{display:flex;align-items:center;justify-content:center;width:100%;min-height:52px;margin-top:12px;border:2px solid #e2d6c6;border-radius:16px;background:#fffdf9;font:800 1rem Inter,"Segoe UI",Arial,sans-serif;color:#3d3054;text-decoration:none}
.wind-trust{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 16px;margin:16px 0 0;padding:0;list-style:none;color:#6f6170;font-size:.92rem}
.wind-trust li::before{content:"✓ ";color:#3f8a50;font-weight:900}
.home-tap{max-width:520px;padding-top:30px;padding-bottom:40px;text-align:center}
.home-tap h2{margin:46px 0 6px;font:900 1.65rem/1.15 Inter,"Segoe UI",Arial,sans-serif;color:#76518e}
.home-tap p{margin:0 auto;max-width:360px;color:#5c4f5d}
.tap-scene{position:relative;display:block;max-width:440px;margin:0 auto}
/* A real comic bubble: thick ink outline, slightly uneven oval, a tail, the comics' lettering font (Andika), big */
/* The balloon of our comics (drawn by scripts/manhwa/bubbles.mjs, "speech" shape): ink outline and tail in one piece */
.tap-bubble{display:flex;flex-wrap:wrap;align-content:center;justify-content:center;gap:.1em .32em;width:100%;aspect-ratio:440/320;padding:4% 10% 15.8%;background:url(/assets/home/bubble.svg?v=2) center/100% 100% no-repeat;filter:drop-shadow(0 10px 16px #29202b26);font:800 clamp(1.5rem,6.6vw,2.1rem)/1.22 Andika,"Segoe UI",Arial,sans-serif;color:#141018}
.tap-w{padding:0 .04em;border:0;border-radius:8px;background:none;font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.tap-w.is-on{color:#c23a5e}
.tap-w:focus:not(:focus-visible){outline:none}
.tap-unit{white-space:nowrap}.home-tap .tap-hint{margin:44px auto 0;color:#76518e;font-weight:800;font-size:.95rem}
.tap-finger{position:absolute;left:0;top:0;width:44px;pointer-events:none;opacity:0}
.tap-finger svg{display:block;width:44px;height:auto}
.tap-scene.is-demo .tap-finger{animation:tap-finger 5.2s infinite}
@keyframes tap-finger{0%{transform:translate(40px,40px);opacity:0}18%{transform:translate(0,0);opacity:1}25%{transform:scale(.85)}30%{transform:none;opacity:1}55%,100%{transform:translate(30px,40px);opacity:0}}
body.is-returning .home-tap{display:none}
@media(prefers-reduced-motion:reduce){.wind-track,.wind-stream,.tap-finger{animation:none}}
@media(min-width:900px){.wind{height:360px}.wind-stream{left:-10%;width:120%}}

/* The old "words of the day" card of the welcome page: the Review tab replaces it (13/11). */
.koa-words-card{display:none!important}
.home-wind .home-cta.wind-go{border:2px solid #3d3054;border-radius:18px;background:linear-gradient(180deg,#cdb4ec,#b48fe0);box-shadow:0 5px 0 #3d3054;color:#21162e;font-weight:900}
.home-wind .home-cta.wind-go:active{transform:translateY(3px);box-shadow:0 2px 0 #3d3054}
.wind-copy h1 .wind-zero{color:#c23a5e;white-space:nowrap}
@media(max-width:359px){.wind-copy h1 .wind-zero{white-space:normal}}
/* A short line in our comics' bubble on a few panels of the wall (romanized Thai, or Thai script) */
.wind-tile{position:relative}
.wind-say{position:absolute;aspect-ratio:440/320;display:flex;align-items:center;justify-content:center;padding:0 9% 10%;text-wrap:balance;font:800 clamp(.72rem,3.6vw,.95rem)/1.05 Andika,"Segoe UI",Arial,sans-serif;color:#141018;text-align:center;pointer-events:none;filter:drop-shadow(0 2px 3px #0006)}
.wind-say::before{content:"";position:absolute;inset:0;z-index:-1;background:url(/assets/home/bubble.svg?v=2) center/100% 100% no-repeat}
.wind-say.is-flip::before{transform:scaleX(-1)}
.wind-say.is-th{font:700 clamp(.8rem,4vw,1.05rem)/1.2 "Noto Sans Thai Looped","Noto Sans Thai",Tahoma,sans-serif}
/* 'Me' tab (koa-me.js, 15/11): its own screen. On the phone the header keeps only the logo and the flame:
   the language and the account are in 'Me' (they did not fit next to each other). */
body:not([data-view="me"]) .koa-me-tab{display:none}
body.is-returning[data-view="me"] #koa-today,body.is-returning[data-view="me"] #comics,body.is-returning[data-view="me"] .footer{display:none}
@media(max-width:700px){body.is-returning .home-header .lang-picker,body.is-returning .home-header .home-account[data-koa-account]{display:none!important}}
/* 15/11 (Alexis): on the phone, without an account, "Log in" sits top right (the streak is for accounts). */
@media(max-width:700px){body.is-returning .home-header .home-account[data-koa-login]:not([hidden]){display:inline-flex!important}}
.t-hello+.t-mini{margin-top:10px}
