:root {
  color-scheme: light;
  --paper: #FFFCF5;
  --ink: #343E35;
  --mint: #88D6BA;
  --mint-soft: #E4F1E8;
  --mint-dark: #315F50;
  --muted: #68766B;
  --line: #D9E2D6;
  --home-actions-bottom: max(64px, env(safe-area-inset-bottom));
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; margin: 0; overflow-x: clip; isolation: isolate; }
body::before { content: ''; position: fixed; z-index: 0; inset: 0; background: #e6ead5 url('/assets/backgrounds/shrine-path-v2/shrine-path-centered.webp') var(--shrine-background-position, 50%) var(--shrine-background-position-y, center) / var(--shrine-background-size, cover) no-repeat; pointer-events: none; }
body::after { content: ''; position: fixed; z-index: 0; inset: 0; background: linear-gradient(90deg, #fffdf448, transparent 45%), linear-gradient(#fffdf42e, transparent 22%); pointer-events: none; }
a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--mint-dark); outline-offset: 5px; }
::selection { background: var(--mint); color: var(--ink); }
.wrap { width: min(1120px, calc(100% - 96px)); margin-inline: auto; }
.skip-link { position: fixed; left: 16px; top: -70px; z-index: 8; padding: 12px 20px; border-radius: 8px; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 16px; }
.site-header { position: relative; z-index: 4; min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.language-switch { display: flex; align-items: center; flex: 0 0 auto; gap: 4px; margin-left: auto; padding: 4px; border: 1px solid #fffdf5b3; border-radius: 100px; background: #fffdf5d9; box-shadow: 0 3px 18px #253c3312; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.language-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 13px; border: 0; border-radius: 100px; background: transparent; color: var(--mint-dark); font-size: 13px; font-weight: 500; line-height: 1.4; white-space: nowrap; transition: color .2s, background .2s, box-shadow .2s; }
.language-tab:hover { background: #315f5010; }
.language-tab[aria-current="page"] { background: var(--mint-dark); color: var(--paper); box-shadow: 0 2px 8px #253c331a; }
.language-tab:focus-visible { outline-offset: 2px; }
.language-flag { display: block; flex: 0 0 auto; width: 21px; height: 14px; overflow: hidden; border-radius: 2px; box-shadow: 0 0 0 1px #243c321a; }
main { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; flex: 1; pointer-events: none; }
.cast-stage { position: fixed; z-index: 2; inset: 0; width: 100%; height: 100vh; height: 100svh; pointer-events: none; }
#home-cast { display: block; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.cast-stage.is-ready #home-cast { opacity: 1; transition: opacity .95s ease-out; }
.cast-loading { position: fixed; z-index: 3; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 12px; max-width: calc(100% - 40px); padding: 17px 23px; border: 1px solid #d9e2d6b3; border-radius: 100px; background: #fffdf5ed; color: var(--mint-dark); box-shadow: 0 8px 32px #253c331c; font-size: 13px; line-height: 1.6; letter-spacing: .04em; pointer-events: none; }
.cast-loading-indicator { flex: 0 0 22px; width: 22px; height: 22px; border: 2px solid #315f5026; border-top-color: var(--mint-dark); border-radius: 50%; animation: cast-loading-spin .9s linear infinite; }
@keyframes cast-loading-spin { to { transform: rotate(360deg); } }
.cast-fallback-frame { position: absolute; bottom: 150px; right: 10%; width: 360px; max-width: 80%; height: 450px; overflow: hidden; }
.cast-fallback { display: block; position: absolute; bottom: 0; left: 50%; height: 100%; width: auto; max-width: none; transform: translateX(-50%); }
.page-actions { position: fixed; z-index: 5; bottom: var(--home-actions-bottom); left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 40px)); text-align: center; pointer-events: auto; }
.action-buttons { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; width: min(280px, 100%); min-height: 70px; padding: 18px 40px; border-radius: 100px; background: #294e40; color: var(--paper); box-shadow: 0 8px 30px #253c3324, 0 1px 4px #253c3320; font-size: 18px; font-weight: 600; letter-spacing: .06em; transition: background .2s, box-shadow .2s; }
.button:hover { background: #244A3D; box-shadow: 0 3px 12px #315F5026; }
.retry-cast { color: var(--mint-dark); padding: 12px 21px; font-size: 12px; letter-spacing: .03em; border: 1px solid var(--line); border-radius: 100px; background: var(--paper); min-height: 52px; white-space: nowrap; transition: background .2s; }
.retry-cast:hover { background: var(--mint-soft); }
.cast-status { margin-top: 10px; display: inline-block; padding: 4px 9px; border-radius: 8px; color: #3a5142; background: #fffdf5dc; font-size: 12px; line-height: 1.8; letter-spacing: .05em; }
@media (max-width: 1000px) {
  .wrap { width: calc(100% - 64px); }
}
@media (max-width: 680px) {
  :root { --home-actions-bottom: max(24px, env(safe-area-inset-bottom)); }
  .wrap { width: calc(100% - 40px); }
  body::after { background: linear-gradient(#fffdf470, transparent 20%), linear-gradient(0deg, #fffdf554, transparent 20%); }
  .site-header { min-height: 88px; gap: 14px; }
  .language-switch { gap: 2px; padding: 3px; }
  .language-tab { gap: 6px; padding-inline: 9px; font-size: 12px; }
  .language-flag { width: 18px; height: 12px; }
  .button { min-height: 62px; padding: 16px 32px; font-size: 17px; }
  .retry-cast { min-height: 46px; padding-inline: 14px; font-size: 11px; }
  .action-buttons { gap: 8px; }
  .cast-fallback-frame { width: 300px; height: 320px; bottom: 155px; right: 8%; }
  .cast-status { margin-top: 9px; font-size: 11px; }
}
@media (max-width: 360px) {
  .site-header { gap: 10px; }
  .language-tab { gap: 5px; padding-inline: 7px; }
  .language-flag { width: 16px; height: 11px; }
  .retry-cast { padding-inline: 12px; }
}
@media (max-width: 340px) {
  .site-header { gap: 8px; }
  .language-tab { padding-inline: 5px; }
}
@media (max-height: 600px) {
  :root { --home-actions-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .cast-loading-indicator { animation: none; }
}

/* Introductory copy beside the shrine, with a translucent mobile panel. */
.home-intro-layout { --hero-shift: clamp(160px, 21vw, 340px); }
.home-intro-layout .home-hero { min-height: 640px; }
.home-intro-layout .home-hero::before {
  background-image: url('/assets/backgrounds/shrine-path-v2/shrine-path-centered.webp'), url('/assets/backgrounds/shrine-path-v2/shrine-path-centered.webp');
  background-size: var(--shrine-background-size, cover), cover;
  background-position: calc(50% + var(--hero-shift)) var(--shrine-background-position-y, center), center;
}
.home-intro-layout .home-hero::after {
  background: linear-gradient(90deg, #fffcf5fc 0%, #fffcf5ed 22%, #fffcf5cc 38%, #fffcf555 51%, transparent 65%);
}
.home-intro-layout .home-hero .cast-stage { transform: translateX(var(--hero-shift)); }
.home-intro-layout .home-hero .cast-loading { left: calc(50% + var(--hero-shift)); }
.home-intro-layout .hero-intro {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: max(48px, calc((100% - 1120px) / 2));
  transform: translateY(-43%);
  width: min(50%, 580px);
  pointer-events: auto;
}
.home-intro-layout .hero-intro h1 {
  margin: 0;
  color: #173e32;
  font-family: var(--serif);
  font-size: clamp(30px, 3.2vw, 48px);
  font-weight: 600;
  line-height: 1.52;
  letter-spacing: .015em;
}
.home-intro-layout .hero-intro h1 span { display: block; }
.home-intro-layout .hero-intro-description {
  max-width: 470px;
  margin: 20px 0 30px;
  color: #56625a;
  font-size: 18px;
  line-height: 1.95;
  letter-spacing: .01em;
  white-space: normal;
  text-wrap: pretty;
}
.home-intro-layout .hero-intro .page-actions {
  position: static;
  width: min(420px, 100%);
  margin-inline: auto;
  transform: none;
}
.home-intro-layout .hero-intro .button { position: relative; width: 100%; font-size: 20px; }
.home-intro-layout .hero-intro .button::after { content: '›'; position: absolute; right: 28px; top: 50%; transform: translateY(-53%); font-family: sans-serif; font-size: 31px; font-weight: 300; }
.home-intro-layout .cast-fallback-frame { left: 50%; right: auto; bottom: 0; width: 360px; height: 80%; transform: translateX(-50%); }
.home-intro-layout .conversation-copy h2 { margin: 0; color: #294e40; font-family: var(--serif); font-size: clamp(27px, 2.6vw, 35px); font-weight: 600; line-height: 1.65; letter-spacing: .02em; }
.home-intro-layout .conversation-copy h2 span { display: block; }
.home-intro-layout #demo-cast { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.home-intro-layout .response-bubble { align-items: flex-start; }
.home-intro-layout #demo-reply { line-height: 1.95; }

@media (max-width: 1000px) and (min-width: 761px) {
  .home-intro-layout { --hero-shift: 22vw; }
  .home-intro-layout .hero-intro { left: 32px; width: 51%; }
  .home-intro-layout .hero-intro-description { font-size: 15px; }
}
@media (max-width: 760px) {
  .home-intro-layout { --hero-shift: 0px; }
  .home-intro-layout .home-hero { min-height: 820px; height: 100svh; }
  .home-intro-layout .site-header { min-height: 88px; align-items: center; }
  .home-intro-layout .home-hero::after {
    background: linear-gradient(180deg, #fffcf53b 0%, transparent 38%, #fffcf589 51%, #fffcf5ed 67%, #fffcf5 100%);
  }
  .home-intro-layout .hero-intro {
    top: auto;
    bottom: 20px;
    left: 50%;
    width: min(480px, calc(100% - 32px));
    padding: 22px 20px 18px;
    border: 1px solid #ffffff80;
    border-radius: 20px;
    background: linear-gradient(115deg, #fffcf5e0 0%, #fffcf5d1 46%, #fffcf599 78%, #fffcf54d 100%);
    box-shadow: 0 10px 36px #243b2a14;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    transform: translateX(-50%);
  }
  .home-intro-layout .hero-intro h1 { font-size: clamp(24px, 6.4vw, 32px); line-height: 1.5; }
  .home-intro-layout .hero-intro-description { max-width: 440px; margin: 13px auto 20px; color: #3d4d42; font-size: 14px; line-height: 1.9; text-align: center; text-wrap: balance; }
  .home-intro-layout .hero-intro .page-actions { width: min(340px, 100%); }
  .home-intro-layout .hero-intro .button { min-height: 60px; font-size: 17px; }
  .home-intro-layout .conversation-copy h2 { font-size: clamp(25px, 5.7vw, 32px); }
  .home-intro-layout .conversation-layout { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); }
  .home-intro-layout .portrait-frame { border-width: 7px; }
  .home-intro-layout .response-bubble { min-height: 182px; padding: 16px; }
}
@media (max-width: 380px) {
  .home-intro-layout .hero-intro { width: calc(100% - 24px); padding-inline: 16px; }
  .home-intro-layout .hero-intro h1 { font-size: 21px; }
}
