/* LP remake (LP-AWWWARDS-01, docs/web/LP_REMAKE_PLAN_2026-11-14.md): the "travel poster + big phone" version.
   Every rule is under html.lp-new, which the split script in each LP page's <head> sets before the first paint.
   The current page (the control, html without .lp-new) only hides the .rm elements, so it renders as before.
   --rm-bonsai-frames must equal frames of bonsai-sprite.webp in assets/lp-remake/provenance.json (check-web). */
html:not(.lp-new) .rm{display:none!important}
html.lp-new{--rm-bonsai-frames:10;--rm-dock:calc(94px + env(safe-area-inset-bottom));scroll-padding-top:24px}
html.lp-new .hero-stage,html.lp-new .hero-facts{display:none}
html.lp-new .art img:not(.rm-fig){display:none}

/* Header over the photo */
html.lp-new .site-header{position:absolute;top:0;left:0;right:0;background:transparent;color:#fff}
html.lp-new .site-header .brand-wordmark{filter:brightness(0) invert(1)}
html.lp-new .site-header .lang-menu summary:hover,html.lp-new .site-header .lang-menu[open] summary{background:#ffffff26}
html.lp-new .site-header .lang-menu-list{color:var(--ink)}

/* First screen */
html.lp-new .hero{background:#101a0f;min-height:100svh}
html.lp-new .rm-photos{position:absolute;inset:0;z-index:0;overflow:hidden}
html.lp-new .rm-photo{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:cover;opacity:0;transition:opacity 1.2s ease}
html.lp-new .rm-photo.is-on{opacity:1}
html.lp-new .rm-photo[data-word=scenery]{object-position:46% 50%}
html.lp-new .rm-photo[data-word=ryokan]{object-position:58% 50%}
html.lp-new .rm-photo[data-word=soft]{object-position:62% 50%}
html.lp-new .rm-photos:after{content:"";position:absolute;inset:0;background:linear-gradient(to bottom,#0c1a0eb8 0,#0c1a0e6b 22%,#0c1a0e2e 40%,#0c180c5c 62%,#0c180cdb 80%,#142113 92%)}
html.lp-new .hero-layout{position:relative;z-index:auto}
html.lp-new .hero .hero-copy{padding:0;text-align:left}
html.lp-new .hero .eyebrow{color:#dfe6d6;font-size:.65625rem;letter-spacing:.18em;margin:0 0 8px}
html.lp-new .hero h1{color:#fff;text-shadow:0 1px 18px #0c1a0e66}
html.lp-new .hero h1 em{color:#b6cf8d}
html.lp-new .rm-word{grid-area:word;align-self:stretch;position:relative;min-height:0;min-width:0;container-type:size}
/* The words do not crossfade (the old and new romaji and meaning overlapped for about 0.5 s, unreadable): the old word fades out in 0.5 s, then the new one fades in. The photo still crossfades over 1.2 s. */
html.lp-new .rm-slide{position:absolute;inset:0;opacity:0;transition:opacity .5s ease}
html.lp-new .rm-slide.is-on{opacity:1;transition:opacity .7s ease .5s}
/* Hiragana leads (2026-11-15 User: kana makes it read as Japanese, not Chinese, and beginners can read it); the kanji sits beside it small: at most 0.6x the kana of the longest word (5 kana), so it never outgrows the kana on short screens. */
html.lp-new .rm-tatebox{display:flex;flex-direction:row-reverse;justify-content:flex-end;align-items:flex-start;gap:6px}
html.lp-new .rm-tate{writing-mode:vertical-rl;font-family:"Noto Serif JP",serif;font-weight:700;line-height:1;color:#fff;text-shadow:0 2px 16px #0a1e2880;font-size:min(30px,calc((100cqh - 140px) * .115));margin-top:4px}
html.lp-new .rm-kana{writing-mode:vertical-rl;font-family:"Noto Serif JP",serif;font-weight:700;font-size:min(80px,calc((100cqh - 140px) / (var(--k) * 1.04)),calc(100cqw - 44px));line-height:1;letter-spacing:.04em;color:#fff;text-shadow:0 2px 24px #0a1e2880}
html.lp-new .rm-read{position:absolute;left:0;right:0;bottom:46px;margin:0;font-size:.71875rem;letter-spacing:.16em;color:#dfe6d6;text-shadow:0 1px 10px #0a1e2880;line-height:1.4}
html.lp-new .rm-read span{display:block;text-transform:lowercase;font-size:1.375rem;letter-spacing:.01em;line-height:1.25;font-weight:600;color:#fff}
html.lp-new .rm-read b{display:block;margin-top:4px;font-size:1rem;letter-spacing:-.01em;line-height:1.25;color:#e6ebde;font-weight:500;overflow-wrap:anywhere}
html.lp-new .rm-pause{grid-area:word;align-self:end;justify-self:start;position:relative;z-index:2;width:36px;height:36px;border-radius:50%;border:1px solid #ffffff73;background:#0c1a0e66;color:#fff;display:grid;place-items:center;padding:0;cursor:pointer}
html.lp-new .rm-pause:focus-visible{outline:3px solid #b6cf8d;outline-offset:3px}
html.lp-new .rm-pause svg{width:14px;height:14px}
html.lp-new .rm-pause .rm-play,html.lp-new .rm-pause.is-paused .rm-pausei{display:none}
html.lp-new .rm-pause.is-paused .rm-play{display:block}
html.lp-new .rm-phone{grid-area:phone;align-self:start;justify-self:end;position:relative;box-sizing:content-box;padding:6px;aspect-ratio:1170/2532;background:#1b1a18;border-radius:30px;box-shadow:0 18px 40px #0000005c,0 0 0 1px #ffffff1f;transform:rotate(2deg);transform-origin:50% 100%}
html.lp-new .rm-screen{position:absolute;inset:6px;width:calc(100% - 12px);height:calc(100% - 12px);max-width:none;border-radius:24px;opacity:0;transition:opacity 1.2s ease;background:#faf9f5}
html.lp-new .rm-screen.is-on{opacity:1}
html.lp-new .rm-dock{display:none}
/* The sprite loads after the window load event (lp-remake.js adds .rm-bonsai-load), so it is not part of the first view. */
html.lp-new.rm-bonsai-load .rm-bonsai{background-image:url(/assets/lp-remake/bonsai-sprite.webp)}
html.lp-new .rm-bonsai{background:0 0/calc(var(--rm-bonsai-frames) * 100%) 100% no-repeat;background-position-x:calc(var(--rm-f, 9) / (var(--rm-bonsai-frames) - 1) * 100%);aspect-ratio:400/383}
html.lp-new .rm-bonsai-tile{position:fixed;z-index:38;border-radius:50%;opacity:0;visibility:hidden;transition:opacity .4s,visibility .4s;pointer-events:none}
/* The tile sits in the page margin, so only where the margin is wide enough (content is at most 1240px). */
html.lp-new .rm-bonsai-tile{display:none}
@media(min-width:1440px){html.lp-new .rm-bonsai-tile{display:block;bottom:20px;right:8px;width:84px;background-color:#f6f2e8e6;box-shadow:0 4px 14px #1d2c1b26}}
html.lp-new.rm-tile-on .rm-bonsai-tile{opacity:1;visibility:visible}

/* Phone and tablet: the App Store button stays docked at the bottom of the screen for the whole page. */
@media(max-width:899px){
  html.lp-new .site-header .button-small{display:none}
  html.lp-new .hero-layout{width:auto;margin:0;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto minmax(0,1fr);grid-template-areas:"copy copy" "word phone";gap:16px 12px;height:100svh;min-height:500px;padding:68px 16px calc(var(--rm-dock) + 10px) 22px}
  html.lp-new .hero .hero-copy{grid-area:copy}
  html.lp-new .hero h1{font-size:min(32px,8.2vw);line-height:1.08}
  html:is(:lang(zh),:lang(zh-Hant),:lang(th),:lang(ko)).lp-new .hero h1{line-height:1.2}
  html.lp-new .hero .lead{display:none}
  html.lp-new .rm-phone{height:min(calc(100% - 12px),calc((45vw - 12px) * 2532 / 1170),62svh)}
  html.lp-new .hero .hero-copy .button{position:fixed;z-index:40;left:16px;right:16px;bottom:calc(28px + env(safe-area-inset-bottom));min-height:54px;margin:0;border-radius:15px;font-size:1rem;font-weight:700}
  html.lp-new .hero .hero-copy .cta-note{position:fixed;z-index:40;left:16px;right:16px;bottom:calc(6px + env(safe-area-inset-bottom));margin:0;text-align:center;font-size:.6875rem;line-height:1.4;letter-spacing:.02em;color:#c7cfbd}
  html.lp-new .rm-dock{display:block;position:fixed;z-index:39;left:0;right:0;bottom:0;height:var(--rm-dock);background:linear-gradient(to bottom,#14211300,#142113 26%);pointer-events:none;transition:background .3s}
  html.lp-new.rm-light .rm-dock{background:linear-gradient(to bottom,#f6f2e800,#f6f2e8 26%)}
  html.lp-new.rm-light .hero .hero-copy .button{background:var(--forest);color:var(--paper)}
  html.lp-new.rm-light .hero .hero-copy .cta-note{color:var(--muted)}
  html.lp-new .site-footer{padding-bottom:calc(var(--rm-dock) + 16px)}
  /* Keyboard focus never lands under the fixed button (WCAG 2.4.11). */
  html.lp-new{scroll-padding-bottom:var(--rm-dock)}
}
@media(min-width:600px) and (max-width:899px){
  html.lp-new .hero-layout{padding:104px 32px calc(var(--rm-dock) + 16px) 28px}
  html.lp-new .hero h1{font-size:44px}
}
/* Narrow phones: keep the button label on one line so it never rises into the hero. */
@media(max-width:359px){
  html.lp-new .hero .hero-copy .button{font-size:.875rem;gap:12px;padding-inline:16px;white-space:nowrap}
}
/* Landscape phones: too short for a docked button over the hero, so the button sits in the hero copy and the page scrolls. */
@media(max-width:899px) and (max-height:450px){
  html.lp-new{scroll-padding-bottom:0}
  html.lp-new .hero-layout{height:auto;min-height:0;grid-template-columns:minmax(0,1fr) 150px auto;grid-template-rows:auto;grid-template-areas:"copy word phone";align-items:center;padding:64px 24px 24px}
  html.lp-new .hero .hero-copy .button,html.lp-new .hero .hero-copy .cta-note{position:static;margin-top:14px}
  html.lp-new .hero .hero-copy .cta-note{margin-top:8px;text-align:left}
  html.lp-new .rm-dock{display:none}
  html.lp-new .rm-phone{height:min(300px,calc(100vh - 88px))}
  html.lp-new .rm-word{height:min(300px,calc(100vh - 88px))}
  html.lp-new .site-footer{padding-bottom:32px}
}
@media(max-width:899px) and (max-height:600px){
  html.lp-new .hero-layout{padding-top:60px;gap:10px 12px}
  html.lp-new .hero h1{font-size:min(28px,7.4vw)}
  html.lp-new .rm-read span{font-size:1.25rem}
  html.lp-new .rm-read b{font-size:.9375rem}
}

/* PC: photo full-bleed; headline and button left, the vertical word in the middle, the phone right. */
@media(min-width:900px){
  html.lp-new .hero-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.62fr) auto;grid-template-areas:"copy word phone";align-items:center;gap:40px;height:100svh;min-height:640px;max-height:1000px;padding:96px 0 48px}
  html.lp-new .rm-photos:after{background:linear-gradient(90deg,#0c1a0ed9 0,#0c1a0e99 34%,#0c1a0e5c 55%,#0c1a0e26 75%,#0c1a0e40 100%),linear-gradient(to bottom,#0c1a0e99 0,#0c1a0e00 26%,#0c1a0e00 70%,#0c1a0e8c 100%)}
  html.lp-new .hero .hero-copy{grid-area:copy;align-self:center}
  html.lp-new .hero .eyebrow{font-size:.75rem;margin-bottom:20px}
  html.lp-new .hero h1{font-size:clamp(2.8rem,4.4vw,4.6rem)}
  html.lp-new .hero .lead{margin:24px 0 28px;color:#e6e9df;text-shadow:0 1px 12px #0c1a0e80}
  html.lp-new .rm-word{height:min(540px,calc(100svh - 240px));align-self:center}
  html.lp-new .rm-pause{position:absolute;left:0;bottom:24px}
  html.lp-new .rm-tate{font-size:min(40px,calc((100cqh - 170px) * .115))}
  html.lp-new .rm-kana{font-size:min(112px,calc((100cqh - 170px) / (var(--k) * 1.04)),calc(100cqw - 56px))}
  html.lp-new .rm-read span{font-size:1.75rem}
  html.lp-new .rm-read b{font-size:1.25rem}
  html.lp-new .rm-phone{align-self:center;height:min(680px,calc(100svh - 190px));border-radius:42px;padding:8px}
  html.lp-new .rm-screen{inset:8px;width:calc(100% - 16px);height:calc(100% - 16px);border-radius:34px}
}

/* Second screen onward: facts and the reading strip open #how; a large faint vertical word behind each section. */
html.lp-new main>section:not(.hero){position:relative;overflow:hidden}
html.lp-new main>section:not(.hero)>:not(.rm-bgword){position:relative;z-index:1}
html.lp-new .rm-bgword{position:absolute;z-index:0;right:4px;top:28px;writing-mode:vertical-rl;font-family:"Noto Serif JP",serif;font-weight:700;font-size:clamp(96px,13vw,190px);line-height:1;color:currentColor;opacity:.07;pointer-events:none;user-select:none}
html.lp-new .intro{display:flex;flex-direction:column;padding-top:56px}
html.lp-new .intro .rm-facts{order:-2}
html.lp-new .intro .reading-strip{order:-1;margin:0 0 56px}
html.lp-new .rm-facts{display:flex;justify-content:center;gap:48px;margin:0 0 32px;font-size:.875rem;color:var(--muted)}
html.lp-new .rm-facts strong{display:block;color:var(--forest);font-size:2.4rem;line-height:1.2;letter-spacing:-.03em}
html.lp-new .rm-bonsai-big{width:min(280px,72%);margin-top:28px}
@media(max-width:740px){
  html.lp-new .intro{padding-top:40px}
  html.lp-new .intro .reading-strip{margin-bottom:44px}
  html.lp-new .rm-facts{gap:32px}
  html.lp-new .rm-facts strong{font-size:2rem}
  html.lp-new .rm-bonsai-big{margin:20px auto 0}
}
@media(prefers-reduced-motion:reduce){
  html.lp-new .rm-photo,html.lp-new .rm-slide,html.lp-new .rm-slide.is-on,html.lp-new .rm-screen,html.lp-new .rm-bonsai-tile{transition:none}
  html.lp-new .rm-pause{display:none}
}
