/* ============================================================
   PAGE: home (/{locale}/) — 2026 teaser redesign
   Sections: hero (artwork frame + glass label), why (wall of Louvre works),
   tours (accordion / carousel), faq, final.
   Markup: scripts/build-home.mjs · behaviour: js/home.js.
   Nav and footer come from patterns.css like every other page.
   Classes that would collide with components.css (.tours, .tour-*,
   .faq-*, .btn-primary) carry an m- prefix here.
   ============================================================ */

:root { --ease: cubic-bezier(.2, .8, .2, 1); }

#hero, #why, #tours, #faq { scroll-margin-top: 76px; }

.section-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(32px, 4vw, 46px); line-height: 1.12; letter-spacing: -.02em;
  margin: 0; text-wrap: balance;
}
.section-title em { font-style: italic; color: var(--forest); }

/* Display italics are Playfair-only. CJK has no italic, and a synthesized
   slant looks broken — keep the colour accent, drop the slant. */
html:lang(ja) em, html:lang(zh) em,
html:lang(ja) .tab[aria-selected="true"], html:lang(zh) .tab[aria-selected="true"],
html:lang(ja) .label-title, html:lang(zh) .label-title,
html:lang(ja) .nm-w.is-key, html:lang(zh) .nm-w.is-key { font-style: normal; }
/* Katakana names (オランジュリー) run about twice as wide as the Latin ones */
html:lang(ja) .tab { font-size: 13px; }
html:lang(ja) .tab[aria-selected="true"] { font-size: 18px; }

.cta-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 28px;
  border-radius: var(--radius-pill); background: var(--ink); color: #fff;
  font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  box-shadow: 0 10px 24px rgba(31, 31, 31, .16);
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(31, 31, 31, .22); }
.cta-btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.cta-btn:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }

/* ----- HERO -------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%); isolation: isolate; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; z-index: -1; display: block; opacity: 0; transition: opacity 1.2s ease; }
.hero-bg.is-ready { opacity: 1; }
.hero-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
  padding-top: 72px; padding-bottom: 72px; min-height: min(760px, calc(100svh - 68px));
}
.hero-inner > * { min-width: 0; }

.hero-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(42px, 5.6vw, 72px); line-height: 1.04; letter-spacing: -.025em;
  margin: 0; text-wrap: balance; overflow-wrap: break-word; hyphens: auto;
}
.hero-title em { font-style: italic; color: var(--forest); }
html:lang(ja) .hero-title, html:lang(zh) .hero-title { font-size: clamp(38px, 4.6vw, 60px); line-height: 1.18; letter-spacing: 0; }
.hero-sub { font-size: 18px; line-height: 1.6; color: var(--stone); margin: 22px 0 0; max-width: 440px; text-wrap: pretty; }
.hero-cta { display: flex; align-items: center; gap: 22px; margin-top: 34px; }
.hero-store { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--stone); line-height: 1.45; }
.qr { width: 64px; height: 64px; border-radius: 12px; background: #fff; padding: 6px; box-shadow: inset 0 0 0 1px rgba(31, 31, 31, .08), 0 6px 16px rgba(47, 79, 67, .10); }
/* Numbers on one quiet line under the CTA */
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 28px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--stone); }
.hero-facts b { font-family: var(--font-display); font-weight: 500; font-size: 22px; color: var(--ink); margin-right: 2px; font-variant-numeric: lining-nums; }

/* Artwork stage: one fixed frame (no size jumps between works) + a glass
   label card over its lower-right corner, tabs underneath. */
.stage { position: relative; justify-self: center; width: 100%; max-width: 540px; display: flex; flex-direction: column; align-items: center; gap: 44px; }
.art { position: relative; width: min(380px, calc(100% - 140px)); margin-right: 140px; }
.frame {
  position: relative; border-radius: 22px; overflow: hidden; background: #e9e3d6; aspect-ratio: 4 / 5;
  box-shadow: 0 30px 70px rgba(47, 79, 67, .18), 0 6px 16px rgba(31, 31, 31, .08);
}
.frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; opacity: 0; transform: scale(1.04);
  transition: opacity .8s ease, transform 6s ease-out;
}
.frame img.is-on { opacity: 1; transform: scale(1); }
.label {
  position: absolute; right: -140px; bottom: -32px; z-index: 2; width: 280px; box-sizing: border-box; padding: 20px;
  border-radius: 20px; background: var(--glass-card-bg);
  -webkit-backdrop-filter: var(--glass-card-blur); backdrop-filter: var(--glass-card-blur); box-shadow: var(--glass-card-shadow);
}
.label p { margin: 0; }
.label-title { font-family: var(--font-display); font-style: italic; font-size: 25px; line-height: 1.18; color: var(--ink); }
.label-artist { margin-top: 4px !important; font-size: 13px; color: #4A4740; }
.label-cap { margin-top: 10px !important; min-height: 4.65em; font-size: 14px; line-height: 1.55; color: #3F3D38; }
.label-note { display: flex; align-items: center; gap: 8px; margin-top: 14px !important; padding-top: 12px; border-top: 1px solid rgba(31, 31, 31, .08); font-size: 13px; font-weight: 500; color: var(--slate); }
.label-note svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Museum picker: text only + a thin progress line; the chosen one grows into Playfair italic */
.tabs {
  position: relative; align-self: stretch; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 0 4px;
  /* Long localized names on narrow phones: the row scrolls instead of spilling out (js keeps the chosen tab in view) */
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; border: 0; background: none; padding: 6px 2px 12px; font: inherit; font-size: 14px; font-weight: 500;
  color: var(--stone); cursor: pointer; white-space: nowrap; transition: color .3s, font-size .45s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 22px; color: var(--forest); }
.tab .tick { position: absolute; left: 2px; bottom: 2px; height: 2px; width: 0; border-radius: 2px; background: var(--forest); }
.tab[aria-selected="true"]::before { content: ""; position: absolute; left: 2px; right: 2px; bottom: 2px; height: 2px; border-radius: 2px; background: rgba(47, 79, 67, .14); }
.tab:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }

/* ----- WHY: a wall of Louvre works ---------------------------
   Without a guide: every name the same grey. With MuseCat: the rest fade
   back and the five route stops light up in walking order. */
.diff { background: var(--paper); padding: 112px 0 104px; }
.diff-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 72px; align-items: center; }
.diff-tabs { display: flex; gap: 22px; margin-top: 32px; border-bottom: 1px solid var(--line-2); }
.diff-tabs button { position: relative; border: 0; background: none; padding: 0 0 12px; min-height: 44px; font: inherit; font-size: 15px; font-weight: 600; color: var(--stone); cursor: pointer; }
.diff-tabs button[aria-selected="true"] { color: var(--ink); }
.diff-tabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.diff-tabs button[aria-selected="true"]::after { transform: none; }
.diff-tabs button:focus-visible { outline: 2px solid var(--forest); outline-offset: 4px; }
.diff-line { display: grid; margin: 22px 0 0; font-size: 19px; line-height: 1.55; color: #3F3D38; }
.diff-line span { grid-area: 1 / 1; transition: opacity .35s ease, transform .45s var(--ease); }
.v-off { opacity: 0; transform: translateY(8px); }
[data-mode="without"] .v-off { opacity: 1; transform: none; }
[data-mode="without"] .v-on { opacity: 0; transform: translateY(-8px); }

.names { margin: 0; font-family: var(--font-display); font-size: 21px; line-height: 2.05; }
.nm { white-space: nowrap; }
.nm-sep { color: #C9C2B3; white-space: pre; }
.nm-w {
  color: rgba(110, 106, 96, .78); transition: color .6s ease, background-size .7s var(--ease);
  background: linear-gradient(var(--gold), var(--gold)) no-repeat 0 92% / 0 2px;
}
.nm-w sup { margin-left: 3px; font: 700 11px var(--font-body); font-style: normal; color: #A8842F; opacity: 0; transition: opacity .5s ease; }
[data-mode="with"] .nm-w { color: rgba(110, 106, 96, .30); }
[data-mode="with"] .nm-w.is-key { color: var(--ink); font-style: italic; font-weight: 500; }
[data-mode="with"] .nm-w.is-key sup { opacity: 1; }
/* The gold underline draws in, stop by stop, once the section is on screen */
.diff.is-on [data-mode="with"] .nm-w.is-key { background-size: 100% 2px; transition-delay: 0s, calc(.2s + var(--i) * .25s); }

/* ----- TOURS ------------------------------------------------- */
.mtours { background: var(--paper-2); padding: 96px 0 104px; }
.mtours-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.mtours-foot { margin: 0; font-size: 14px; color: var(--stone); }
/* Desktop: the hovered museum widens (accordion) */
.mtours-rail { display: flex; gap: 14px; max-width: var(--container); margin: 40px auto 0; padding: 0 32px; }
.mtour { flex: 1 1 0; min-width: 0; display: block; text-decoration: none; color: inherit; transition: flex-grow .55s var(--ease), opacity .4s; }
.mtour-img { position: relative; height: 340px; border-radius: var(--radius); overflow: hidden; background: #e9e3d6; transition: box-shadow .4s; }
.mtour-img img { width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; transition: transform .8s var(--ease), filter .4s; }
.mtour-name { font-family: var(--font-display); font-size: 21px; font-weight: 500; margin: 14px 0 0; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtour-meta { margin: 4px 0 0; font-size: 13px; color: var(--stone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) and (min-width: 901px) {
  .mtours-rail:hover .mtour, .mtours-rail:focus-within .mtour { flex-grow: .8; }
  .mtours-rail:hover .mtour:hover, .mtours-rail:focus-within .mtour:focus-visible { flex-grow: 2.6; }
  .mtours-rail:hover .mtour:not(:hover) .mtour-img img { filter: saturate(.75) brightness(.97); }
  .mtour:hover .mtour-img { box-shadow: 0 22px 44px rgba(31, 31, 31, .18); }
  .mtour:hover .mtour-img img { transform: scale(1.03); }
}
.mtour-badge {
  position: absolute; left: 10px; top: 10px; padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--ink);
  background: rgba(255, 255, 255, .7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.mtour-dots { display: none; }
.mtour:focus-visible { outline: 2px solid var(--forest); outline-offset: 4px; border-radius: var(--radius); }

/* ----- FAQ --------------------------------------------------- */
.mfaq { background: var(--paper); padding: 104px 0; }
.mfaq-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 64px; align-items: start; }
.mfaq-list { border-top: 1px solid var(--line-2); }
.mfaq-item { border-bottom: 1px solid var(--line-2); }
.mfaq-item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; font-size: 17px; font-weight: 600; }
.mfaq-item summary::-webkit-details-marker { display: none; }
.mfaq-item summary:focus-visible { outline: 2px solid var(--forest); outline-offset: 4px; }
.chev { flex: none; width: 10px; height: 10px; border-right: 1.6px solid var(--stone); border-bottom: 1.6px solid var(--stone); transform: rotate(45deg) translateY(-3px); transition: transform .25s var(--ease); }
.mfaq-item[open] .chev { transform: rotate(-135deg) translateY(-1px); }
.mfaq-a { padding: 0 40px 22px 0; font-size: 16px; line-height: 1.65; color: var(--stone); }

/* ----- FINAL ------------------------------------------------- */
.final { background: var(--paper-2); padding: 112px 0 72px; overflow: hidden; text-align: center; }
.final-inner { display: flex; flex-direction: column; align-items: center; }
.final h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.1; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.final h2 em { color: var(--forest); }
.final-btn { margin-top: 32px; }
.final-trail { position: relative; width: min(640px, 100%); height: 150px; margin-top: 28px; }
.paws { position: absolute; left: 0; bottom: 6px; width: 72%; height: auto; overflow: visible; }
.paws .paw { fill: var(--gold); opacity: 0; }
.final.is-on .paw { animation: pawIn .4s ease-out forwards; animation-delay: calc(var(--i) * .22s); }
@keyframes pawIn { from { opacity: 0; } to { opacity: .55; } }
.final-cat { position: absolute; right: 0; bottom: 0; width: 190px; height: 190px; overflow: visible; }
.breath { transform-box: view-box; transform-origin: 120px 188px; animation: breath 3.4s ease-in-out infinite; }
@keyframes breath { 50% { transform: scaleY(1.035); } }
.final-cat .z { font: italic 600 18px var(--font-display); fill: var(--forest); opacity: 0; animation: zz 3.4s ease-out infinite; }
.final-cat .z2 { font-size: 13px; animation-delay: 1.1s; }
@keyframes zz { 0% { opacity: 0; transform: translate(0, 6px); } 30% { opacity: .8; } 100% { opacity: 0; transform: translate(8px, -16px); } }

/* ----- Responsive -------------------------------------------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; padding-bottom: 48px; min-height: 0; }
  .hero-sub { font-size: 16px; }
  .hero-cta { margin-top: 24px; }
  .hero-store .qr, .hero-store .qr-text { display: none; }
  /* Numbers become one small centred line under the button */
  .hero-facts { justify-content: center; gap: 0; margin-top: 10px; font-size: 12px; }
  .hero-facts b { font-family: var(--font-body); font-size: inherit; font-weight: 500; color: inherit; margin: 0; }
  .hero-facts li + li::before { content: "·"; margin: 0 6px; }
  /* Phone: tabs above the frame, label card under it (same width), no app note — the bottom sheet does that job */
  .stage { max-width: 420px; gap: 14px; }
  .tabs { order: -1; }
  .art { width: 100%; margin-right: 0; }
  .frame { aspect-ratio: 7 / 6; border-radius: 18px; }
  .label { position: relative; right: auto; bottom: auto; width: 100%; min-height: 120px; margin-top: -40px; padding: 16px 18px; border-radius: 18px; }
  .label-title { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .label-artist { font-size: 12px; }
  .label-cap { min-height: 0; margin-top: 6px !important; font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .label-note { display: none; }

  .diff { padding: 72px 0 64px; }
  /* Phone order: title, tabs, the names, then the sentence */
  .diff-grid { display: flex; flex-direction: column; align-items: stretch; gap: 22px; }
  .diff-copy { display: contents; }
  .diff-tabs { order: 1; margin-top: 0; }
  .names { order: 2; font-size: 15px; line-height: 1.95; }
  .diff-line { order: 3; margin-top: 0; font-size: 16px; }

  .mtours { padding: 72px 0; }
  .mtours-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  /* Mobile: swipe carousel, the centred card grows */
  .mtours-rail { overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; padding: 8px 19% 12px; margin-top: 24px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .mtours-rail::-webkit-scrollbar { display: none; }
  .mtour { flex: 0 0 62%; scroll-snap-align: center; transform: scale(.9); opacity: .55; transition: transform .35s var(--ease), opacity .35s; }
  .mtour.is-active { transform: none; opacity: 1; }
  .mtour-img { height: auto; aspect-ratio: 4 / 5; }
  .mtour:not(.is-active) .mtour-meta { visibility: hidden; }
  .mtour-meta { white-space: normal; }
  .mtour-dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
  .mtour-dots button { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 3px; background: #CFC8B9; transition: width .3s var(--ease), background .3s; }
  .mtour-dots button[aria-current="true"] { width: 18px; background: var(--ink); }

  .mfaq { padding: 72px 0; }
  .mfaq-wrap { grid-template-columns: 1fr; gap: 24px; }
  .mfaq-item summary { font-size: 16px; padding: 18px 0; }
  .mfaq-a { padding-right: 0; font-size: 15px; }

  .final { padding: 80px 0 48px; }
  .final-btn { width: 100%; justify-content: center; }
  .final-trail { height: 120px; margin-top: 20px; }
  .final-cat { width: 150px; height: 150px; }
  .paws { width: 66%; }
}
@media (max-width: 560px) {
  .hero-title { font-size: 44px; }
  html:lang(ja) .hero-title, html:lang(zh) .hero-title { font-size: 38px; }
  .cta-btn { width: 100%; justify-content: center; }
  .hero-cta { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-store { justify-content: center; }
  .tab { font-size: 13px; }
  .tab[aria-selected="true"] { font-size: 19px; }
  html:lang(ja) .tabs { gap: 2px; padding: 0; }
  html:lang(ja) .tab { font-size: 12px; }
  html:lang(ja) .tab[aria-selected="true"] { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .frame img { transition: opacity .2s; transform: none !important; }
  .nm-w, .nm-w sup, .diff-line span { transition: none !important; }
  .breath, .final-cat .z { animation: none; }
  .final .paw { opacity: .55; animation: none !important; }
}
