/* Page shell v4: nav, section rhythm, footer, prototype bar. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; font-optical-sizing: auto; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 3px; border-radius: 6px; }

/* G21 nav: floating glass bar like relovisa.co (blurred translucent surface, soft border and shadow, one sharp corner) */
.nav { position: sticky; top: 0; z-index: 50; padding: 14px 20px 0; pointer-events: none; }
.nav-in { position: relative; pointer-events: auto; max-width: 1320px; height: 62px; margin: 0 auto; padding: 0 10px 0 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; border-radius: 18px 18px 18px 6px; }
.nav-in::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: rgba(255, 255, 255, .62); border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: 0 1px 2px rgba(27, 23, 19, .04), 0 12px 32px -18px rgba(60, 30, 10, .22);
  backdrop-filter: blur(12px) saturate(1.15); -webkit-backdrop-filter: blur(12px) saturate(1.15); transition: background-color .2s, box-shadow .2s; }
.nav.scrolled .nav-in::before { background: rgba(255, 255, 255, .74); box-shadow: 0 1px 2px rgba(27, 23, 19, .05), 0 16px 36px -18px rgba(60, 30, 10, .28); }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }  /* G21: colour Tobira icon in nav and footer */
.brand b { font: 700 21px/1 var(--font); letter-spacing: -0.045em; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links > a, .nav-more-btn { display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; text-decoration: none; font: 500 14.5px/1 var(--font); color: var(--ink-2); cursor: pointer; transition: color .15s, background-color .15s; }
.nav-links > a:hover, .nav-more-btn:hover, .nav-more.open .nav-more-btn { color: var(--ink); background: rgba(255, 255, 255, .7); }
.nav-more { position: relative; }
.nav-more-btn svg { transition: transform .18s var(--ease); }
.nav-more.open .nav-more-btn svg { transform: rotate(180deg); }
.nav-drop { position: absolute; top: calc(100% + 12px); left: 50%; width: 300px; padding: 8px; border-radius: 16px 16px 16px 5px;
  background: rgba(255, 255, 255, .94); border: 1px solid rgba(255, 255, 255, .8); box-shadow: 0 1px 2px rgba(27, 23, 19, .05), 0 22px 48px -20px rgba(60, 30, 10, .3);
  backdrop-filter: blur(18px) saturate(1.1); -webkit-backdrop-filter: blur(18px) saturate(1.1);
  opacity: 0; visibility: hidden; transform: translate(-50%, -4px); transition: opacity .18s var(--ease), transform .18s var(--ease), visibility 0s .18s; }
.nav-more.open .nav-drop, .nav-more:focus-within .nav-drop { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
@media (hover: hover) and (pointer: fine) { .nav-more:hover .nav-drop { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; } }
.nav-more::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; }  /* hover bridge to the menu */
.nav-drop-i { display: grid; gap: 3px; padding: 11px 12px; border-radius: 10px; text-decoration: none; transition: background-color .15s; }
.nav-drop-i:hover { background: var(--soft-2); }
.nav-drop-i b { font: 600 14.5px/1.2 var(--font); color: var(--ink); }
.nav-drop-i span { font: 400 13px/1.35 var(--font); color: var(--muted); }
.nav-mobile-extra { display: none; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-potd { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 8px; border-radius: 8px; background: #1B1713; color: #fff;
  text-decoration: none; font: 600 11.5px/1 var(--font); letter-spacing: -0.005em; white-space: nowrap; }
.nav-potd img { width: 15px; height: 15px; }
.nav-potd small { font-size: 11.5px; opacity: .6; margin-right: 1px; }
/* v7 language picker (js/shell.js): globe + code button, dropdown with each language in its own script. Always left to right. */
.lang-pick { position: relative; direction: ltr; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 11px; border: 0; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font: 600 12px/1 var(--font);
  cursor: pointer; transition: background-color .15s, color .15s; }
.lang-btn:hover, .lang-pick.open .lang-btn { background: #fff; color: var(--ink); }
.lang-btn svg:last-child { opacity: .6; transition: transform .2s var(--ease); }
.lang-pick.open .lang-btn svg:last-child { transform: rotate(180deg); }
.lang-code { font-weight: 600; letter-spacing: .02em; min-width: 16px; }
.lang-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 70; width: 212px; padding: 6px; display: grid; gap: 1px;
  border-radius: 14px; background: rgba(255, 255, 255, .98); box-shadow: 0 22px 48px -20px rgba(60, 30, 10, .3), 0 0 0 1px var(--line);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .16s var(--ease), transform .16s var(--ease), visibility 0s .16s; }
.lang-pick.open .lang-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.lang-up .lang-menu { top: auto; bottom: calc(100% + 8px); transform: translateY(4px); }
.lang-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
  border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: 500 14px/1 var(--font); text-align: left; cursor: pointer; }
.lang-opt span { font-family: "Inter", "Noto Sans SC", "Noto Sans JP", "Noto Sans Devanagari", system-ui, sans-serif; }
.lang-opt small { font: 600 10.5px/1 var(--font); letter-spacing: .04em; color: var(--faint); }
.lang-opt:hover, .lang-opt:focus-visible { background: rgba(27, 23, 19, .05); color: var(--ink); outline: none; }
.lang-opt[aria-selected="true"] { background: var(--ink); color: #fff; }
.lang-opt[aria-selected="true"] small { color: rgba(255, 255, 255, .6); }
.nav-mobile-lang { display: none; }
.nav-burger { display: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; position: relative; }
.nav-burger i { position: absolute; left: 11px; right: 11px; height: 1.6px; border-radius: 2px; background: var(--ink); transition: transform .25s var(--ease), top .25s var(--ease); }
.nav-burger i:first-child { top: 15px; } .nav-burger i:last-child { top: 23px; }
.nav.menu-open .nav-burger i:first-child { top: 19px; transform: rotate(45deg); }
.nav.menu-open .nav-burger i:last-child { top: 19px; transform: rotate(-45deg); }
@media (max-width: 1220px) { .nav-potd { display: none; } .nav-links > a, .nav-more-btn { padding: 0 9px; } }
@media (max-width: 900px) {
  .nav { padding: 10px 10px 0; }
  .nav-in { height: 56px; padding: 0 6px 0 14px; gap: 10px; border-radius: 15px 15px 15px 5px; }
  .nav-burger { display: block; }
  .nav-right .lang-pick { display: none; }
  .nav-links { position: absolute; top: calc(100% + 8px); left: 0; right: 0; display: grid; gap: 0; padding: 8px;
    border-radius: 16px 16px 16px 5px; background: rgba(255, 255, 255, .96); box-shadow: 0 22px 48px -20px rgba(60, 30, 10, .3), 0 0 0 1px var(--line);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s .2s; }
  .nav-links { max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); overflow-y: auto; overscroll-behavior: contain; }
  .nav.menu-open .nav-links { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav-links > a { height: 48px; padding: 0 12px; font-size: 16.5px; color: var(--ink); border-radius: 10px; }
  .nav-more { display: none; }
  .nav-mobile-extra { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; padding: 14px 12px 6px; border-top: 1px solid var(--line); }
  .nav-mobile-extra a { font: 500 14.5px/1.6 var(--font); color: var(--ink-2); text-decoration: none; }
  .nav-mobile-lang { display: block; margin-top: 6px; padding: 12px 4px 4px; border-top: 1px solid var(--line); }
  .nav-mobile-lang > span { display: block; padding: 0 8px 8px; font: 600 12px/1 var(--font); color: var(--muted); }
  .lang-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; direction: ltr; }
  .lang-list .lang-opt { height: 40px; font-size: 15px; }
}

/* sections: each section module renders inside .sec > .tbv-body */
.sec { position: relative; }
.sec + .sec { margin-top: 0; }
.tbv-body { position: relative; }
.tbv-missing { margin: 40px auto; max-width: 1240px; min-height: 180px; display: grid; place-items: center; border: 1px dashed var(--line-2);
  border-radius: 20px; color: var(--muted); font: 500 14px var(--font); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.sec-pad { padding: 120px 0 0; }

/* G11: one heading font everywhere. Sections keep their sizes; family, weight and tracking come from the font switcher.
   The widget keeps its own UI font. */
:where(main, .foot) :is(h1, h2, .tb-h2, .tb-num):not([class*="tbw"] *) {
  font-family: var(--h-font) !important; font-weight: var(--h-weight) !important; letter-spacing: var(--h-track) !important; }
:where(main, .foot) :is(h3, .tb-h3):not([class*="tbw"] *) {
  font-family: var(--h3-font) !important; font-weight: var(--h3-weight) !important; }
.tb-num { font-variant-numeric: tabular-nums lining-nums; }
html.font-serif :where(main) :is(h1, h2, .tb-h2) { line-height: 1.08; }
/* v7: CJK and Devanagari need more room between lines (Devanagari marks sit above and below the line) */
html:is([data-script="zh"], [data-script="ja"]) :where(main) :is(h1, h2, .tb-h2) { line-height: 1.22; }
html[data-script="hi"] :where(main) :is(h1, h2, .tb-h2) { line-height: 1.3; }
html:is([data-script="zh"], [data-script="ja"], [data-script="hi"]) body { line-height: 1.7; }

/* G12: blur-in reveal on scroll (added by js/shell.js, removed after it plays) */
.tb-rv { transition: opacity .5s var(--ease), translate .55s var(--ease), filter .5s var(--ease) !important;
  transition-delay: var(--rv-d, 0ms) !important; }
.tb-rv:not(.in) { opacity: 0; translate: 0 14px; filter: blur(8px); }
@media (prefers-reduced-motion: reduce) { .tb-rv:not(.in) { opacity: 1; translate: none; filter: none; } }

/* G21 footer: brand + four link columns, copyright and language */
.foot { max-width: 1240px; margin: 120px auto 0; padding: 56px 32px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot-top { display: grid; grid-template-columns: minmax(220px, 1fr) 2.2fr; gap: 48px; }
.foot-about p { margin: 16px 0 0; max-width: 300px; font: 400 14.5px/1.5 var(--font); color: var(--muted); }
.foot-brand img { width: 26px; height: 26px; border-radius: 7px; }
.foot-brand b { font-size: 19px; color: var(--ink); }
.foot-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.foot-cols h4 { margin: 0 0 14px; font: 600 13px/1.2 var(--font); color: var(--ink); letter-spacing: 0; }
.foot-cols div { display: grid; align-content: start; gap: 10px; }
.foot-cols a { font: 400 14.5px/1.3 var(--font); }
.foot-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); }
.foot .sources { margin: 18px 0 0; font-size: 12px; color: var(--faint); }
.foot .sources:empty { display: none; }
@media (max-width: 900px) {
  .foot { padding: 44px 20px 120px; margin-top: 88px; }
  .foot-top { grid-template-columns: 1fr; gap: 32px; }
  .foot-cols { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
}

/* G20 confetti canvas (js/shell.js) */
.tb-confetti { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; width: 100vw; height: 100vh; }

.proto-bar { position: fixed; left: 16px; bottom: 16px; z-index: 60; display: inline-flex; gap: 8px; align-items: center;
  padding: 6px 6px 6px 14px; border-radius: var(--r-pill); background: rgba(27, 23, 19, .9); color: #fff; font: 600 12px/1 var(--font); }
.proto-bar button[aria-pressed="true"] { background: var(--brand-grad); }
.proto-seg { display: inline-flex; align-items: center; gap: 4px; padding-left: 6px; }
.proto-seg button { min-width: 30px; padding: 0 8px; }
.proto-font-btns, .proto-btn-btns { display: inline-flex; align-items: center; gap: 3px; }
.proto-btn-btns button { min-width: 26px; padding: 0 6px; }
.proto-btn-name { margin-left: 4px; opacity: .75; font-weight: 500; white-space: nowrap; }
.proto-font-btns button { min-width: 26px; padding: 0 6px; }
.proto-font-name { margin-left: 6px; padding: 0 10px 0 8px; height: 30px; display: inline-flex; align-items: center; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .12); font-weight: 500; white-space: nowrap; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.proto-bar button { border: 0; background: #fff; color: #1B1713; border-radius: var(--r-pill); height: 30px; padding: 0 12px; font: 600 12px/1 var(--font); cursor: pointer; }

@media (max-width: 900px) {
  .wrap { padding: 0 18px; }
  .sec-pad { padding-top: 88px; }
  .tbv-chrome { top: 8px; right: 10px; }
  .sec.grp-start { margin-top: 48px; }
  .sec.grp-end { padding-bottom: 44px; }
  .sec.grp-start > .tbv-body > :first-child.sec-pad, .sec.grp-start .sec-pad:first-child { padding-top: 40px; }
  :root { --fade-h: 140px; }
}
@media (max-width: 640px) {
  .proto-bar { left: 10px; bottom: 92px; padding: 4px 4px 4px 10px; font-size: 11px; }
  .proto-bar button { height: 26px; padding: 0 10px; font-size: 11px; }
  .proto-bar { flex-wrap: wrap; right: 10px; border-radius: 18px; }
  .proto-font-btns button { min-width: 22px; padding: 0 4px; }
  .proto-font-name { display: none; }
  .sec.grp::before { left: 8px; right: 8px; }
  .sec.grp-start::before { border-top-left-radius: 28px; border-top-right-radius: 28px; }
  .sec.grp-end::before { border-bottom-left-radius: 28px; border-bottom-right-radius: 28px; }
}

/* G2: the hero wash fades softly into the page instead of ending with a hard edge.
   The wash is moved to a pseudo layer (behind content) and masked at the bottom; content stays fully opaque. */
#hero .tb-wash, #hero .tb-wash-soft { position: relative; isolation: isolate; background: none; }
#hero .tb-wash::after, #hero .tb-wash-soft::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - var(--fade-h)), transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - var(--fade-h)), transparent 100%); }
#hero .tb-wash::after { background: var(--wash); }
#hero .tb-wash-soft::after { background: var(--wash-soft); }
/* any section can opt in to the same fade with .tb-fade-end on its own wash layer */
.tb-fade-end { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--fade-h)), transparent);
                       mask-image: linear-gradient(to bottom, #000 calc(100% - var(--fade-h)), transparent); }

/* G7: only three backgrounds. White page; a light beige plate or a dark plate (inset, large radius) on some sections.
   Never two plates in a row (index.html data-bg1/2). Sections of one group share one continuous plate without a seam. */
.sec.grp::before { content: ""; position: absolute; z-index: 0; pointer-events: none; top: 0; bottom: 0;
  left: max(16px, calc(50% - 700px)); right: max(16px, calc(50% - 700px)); background: var(--grp-bg, var(--bg-beige)); }
.sec.grp { display: flow-root; }  /* no margin collapse, so plates of one group join without a seam */
.sec.grp > .tbv-body { z-index: 1; }
.sec.grp-start { margin-top: 72px; }
.sec.grp-start::before { border-top-left-radius: 40px; border-top-right-radius: 40px; }
.sec.grp-end { padding-bottom: 104px; }
.sec.grp-end::before { border-bottom-left-radius: 40px; border-bottom-right-radius: 40px; }
.sec.grp-start > .tbv-body > :first-child.sec-pad, .sec.grp-start .sec-pad:first-child { padding-top: 104px; }
.sec.grp-beige { --grp-bg: var(--bg-beige); }
.sec.grp-dark  { --grp-bg: var(--bg-dark); color: #fff; }

/* dark plate: white text; white cards inside keep their own dark text */
.sec.grp-dark .tb-h2, .sec.grp-dark .tb-kicker, .sec.grp-dark .sec-head .tb-h2 { color: #fff; }
.sec.grp-dark .tb-kicker::before { background: #fff; }
.sec.grp-dark .tb-lead, .sec.grp-dark .tr-note, .sec.grp-dark .sec-badge span { color: rgba(255, 255, 255, .7); }
.sec.grp-dark .tb-btn-ghost { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.sec.grp-dark .tb-btn-ghost:hover { background: rgba(255, 255, 255, .16); }
.sec.grp-dark .tr-card, .sec.grp-dark .sec-col { color: var(--ink); }

/* floating Tobira dock hides while the hero, the demo widget or the final booking is on screen */
.tbw-dockroot { transition: opacity .25s ease, transform .25s ease; }
body.hide-dock .tbw-dockroot:not([data-open]) { opacity: 0; transform: translateY(14px); pointer-events: none; }

/* lead 01.10: reserve height for sections until JS mounts them, so the footer does not flash at the top (CLS) */
main .sec[data-section]:empty { min-height: 100vh; }

/* lead 02.10 (L-61), phones: air inside plates. The plate sits 8px from the screen edge; content keeps ~22px inside it,
   so headings and cards never touch the plate edge. The glass nav stays light and readable over dark plates. */
@media (max-width: 700px) {
  .sec.grp .wrap { padding-left: 30px; padding-right: 30px; }
  .nav-in::before, .nav.scrolled .nav-in::before { background: rgba(255, 255, 255, .9); border-color: rgba(255, 255, 255, .95);
    backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
}
