/* ===== 2026-09 新版首页专用样式(只由 index.html 加载) =====
   头脚样式在 site.css 末尾「新版公共头脚」段;字体用全站 var(--ui)。 */
@property --halo-breath {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

body.home-202609 {
  --kesa: #5a2a26;
  --kesa-dark: #361416;
  --kesa-deep: #260d10;
  --kesa-light: #7c3f31;
  --paper: #f7f0e2;
  --paper-bright: #fffaf0;
  --ink: #2d211d;
  --muted: #776961;
  --gold: #b88a3d;
  --gold-light: #d7b26a;
  --text-on-kesa-muted: rgba(255, 241, 218, .8);
  --text-on-dark-micro: rgba(247, 235, 216, .68);
  --footer-muted: #cbb9a5;
  --hero-black: #080808;
  --hero-white: #f4f4f0;
  --hero-gray: #777;
  --line: rgba(93, 53, 42, .18);
  --page: min(1240px, calc(100% - 64px));
  --type-display: clamp(36px, 4.2vw, 56px);
  --type-section: clamp(32px, 3.4vw, 42px);
  --type-title: clamp(24px, 2.3vw, 30px);
  --type-body: clamp(14px, 1.1vw, 15px);
  color: var(--ink);
  background: var(--paper);
  font-family: var(--ui);
  font-synthesis: none;
}

html { scroll-behavior: smooth; }
body.home-202609::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 50% 0, rgba(255,250,240,.9), transparent 34rem),
    repeating-linear-gradient(90deg, rgba(82,45,35,.018) 0 1px, transparent 1px 7px);
  opacity: .7;
}
.home-page img { display: block; max-width: 100%; }


.home-page { overflow: hidden; padding-bottom: 64px; }

/* The first sermon is the page itself, not a billboard placed on it. */
.hero-sanctum {
  position: relative; width: var(--page); aspect-ratio: 2.35 / 1;
  margin: 14px auto 0; overflow: hidden; background: var(--hero-black); border: 1px solid #111;
  border-radius: 4px 4px 28px 28px; box-shadow: 0 30px 80px rgba(51,17,18,.22); isolation: isolate;
}
.sermon-canvas {
  position: absolute; inset: 0; z-index: 3; display: block; width: 100%; height: 100%;
  object-fit: cover; background: #2a0e0c;
}
/* 静态图:页面初始即显示(脚本画出第一帧后移除 canvas-fallback);与 Canvas 同一张 WebP,只下载一次。
   不用 image-set(type()):Safari 15 不认 type(),会整层空白(2026-09-26 iPad 实例) */
.canvas-fallback { background: #2a0e0c url("hero-first-sermon-202609.webp") center / cover no-repeat; }
.canvas-fallback .sermon-canvas { visibility: hidden; }
.sermon-art { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--hero-black); }
.sermon-light-map { z-index: 3; pointer-events: none; }
.sermon-light-map :is(circle, path, use) { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.scene-ground { fill: var(--hero-black); }
.frame-linework { fill: none; stroke: #555; stroke-width: 1.15; opacity: .56; }
.frame-linework path { stroke-dasharray: 7 8; }
.forest-linework { fill: none; stroke: var(--hero-gray); stroke-width: 1.25; opacity: .62; }
.leaf-clusters path { fill: none !important; }
.mandala-linework { fill: none; stroke: var(--hero-gray); stroke-width: 1; opacity: .25; }
.mandala-linework circle:nth-child(2) { stroke-dasharray: 3 9; }
.rock-seat { fill: none; stroke: var(--hero-gray); stroke-width: 1.2; opacity: .8; }
.figure-fill, .monk-fill { fill: none !important; stroke: none; }
.figure-outline, .hair-line, .face-line, .robe-line, .hand-line, .lap-line { stroke: var(--hero-white); stroke-width: 1.55; }
.ushnisha-line, .hair-curls, .facial-detail, .buddha-robe-detail { fill: none; stroke: var(--hero-white); stroke-width: 1.15; }
.figure-outline { stroke-width: 2.1; }
.hair-line { fill: none !important; }
.hair-curls { stroke-width: .85; opacity: .9; }
.face-line { stroke-width: 1.2; }
.monk-base { stroke: var(--hero-gray); stroke-width: 1.2; opacity: .82; }
.monk-anatomy, .monk-robe-detail { fill: none; stroke: var(--hero-gray); stroke-width: 1.05; opacity: .86; }
.ground-horizon { stroke: var(--hero-gray); stroke-width: 1.2; opacity: .5; }
.buddha-field, .monk-trace, .monk-spark { mix-blend-mode: screen; }
.mask-field { fill: #fff !important; }
.buddha-cutout { fill: #000 !important; }
.radial-core { fill: url(#body-light) !important; opacity: 0; transform-box: fill-box; transform-origin: center; animation: halo-field-rise 4.8s cubic-bezier(.16,.68,.24,1) .25s forwards, halo-field-breathe 10s ease-in-out 5.1s infinite alternate; }
.body-halo { stroke: var(--hero-white); stroke-width: 1.35; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transform-origin: 961px 286px; filter: url(#gold-glow); animation: halo-ring-awaken 2.5s cubic-bezier(.18,.7,.2,1) forwards; }
.body-halo-1 { animation-delay: .45s; }
.body-halo-2 { animation-delay: 2.1s; }
.body-halo-3 { animation: halo-ring-awaken 2.5s cubic-bezier(.18,.7,.2,1) 3.6s forwards, halo-ring-settle 2.2s ease 6.1s forwards; }
.monk-trace { stroke: var(--hero-white); stroke-width: 1.65; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; filter: url(#gold-glow); animation: outline-awaken 1.45s cubic-bezier(.18,.72,.22,1) forwards; }
.monk-spark { stroke: #fff; stroke-width: 3.6; stroke-dasharray: .045 .955; stroke-dashoffset: 1; opacity: 0; filter: url(#gold-glow); animation: spark-walk 1.45s cubic-bezier(.18,.72,.22,1) forwards; }
.monk-3 { animation-delay: 5.25s; }
.monk-2 { animation-delay: 6.15s; }
.monk-4 { animation-delay: 7.05s; }
.monk-1 { animation-delay: 7.95s; }
.monk-5 { animation-delay: 8.85s; }
@keyframes halo-field-rise { 0% { opacity: 0; transform: scale(.52); } 45% { opacity: .26; } 100% { opacity: .42; transform: scale(1.04); } }
@keyframes halo-field-breathe { from { opacity: .34; transform: scale(1.01); } to { opacity: .48; transform: scale(1.08); } }
@keyframes halo-ring-awaken { 0% { opacity: 0; stroke-dashoffset: 1; transform: scale(.86); } 30% { opacity: .58; } 100% { opacity: .42; stroke-dashoffset: 0; transform: scale(1); } }
@keyframes halo-ring-settle { from { opacity: .42; } to { opacity: .13; } }
@keyframes outline-awaken { 0% { opacity: 0; stroke-dashoffset: 1; } 12% { opacity: 1; } 100% { opacity: .72; stroke-dashoffset: 0; } }
@keyframes spark-walk { 0% { opacity: 0; stroke-dashoffset: 1; } 8%,78% { opacity: 1; } 100% { opacity: 0; stroke-dashoffset: 0; } }
.hero-sanctum::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(circle at 50% 33%, transparent 0 20%, rgba(0,0,0,.04) 46%, rgba(0,0,0,.38) 100%);
}
.hero-sanctum::after {
  content: ""; position: absolute; inset: 10px; z-index: 2; pointer-events: none;
  border: 1px solid rgba(255,255,255,.18); border-radius: 2px 2px 20px 20px;
}

.canon-mandala { width: var(--page); margin: 64px auto 0; }
.rail-heading h2, .reading-principles h2 { margin: 0; color: var(--kesa-dark); font-family: var(--ui); font-weight: 600; letter-spacing: -.035em; }

.root-leaves { display: grid; gap: 12px; }
.root-leaf {
  position: relative; min-height: 150px; display: grid; grid-template-columns: minmax(180px,.8fr) minmax(210px,1fr) 44px;
  align-items: center; gap: 24px; overflow: hidden; padding: 28px 34px; color: #f8ead4;
  background: var(--kesa); border: 1px solid rgba(78,28,27,.78); border-radius: 12px;
  box-shadow: 0 12px 28px rgba(63,25,22,.1); transition: transform .3s ease, box-shadow .3s ease, background .3s ease;
}
.root-leaf:nth-child(2) { margin-inline: 0; background: var(--kesa); }
.root-leaf:nth-child(3) { margin-inline: 0; background: var(--kesa); }
.root-leaf::before {
  content: ""; position: absolute; inset: 8px 10px; border: 1px solid rgba(255,255,255,.16); border-radius: inherit; pointer-events: none;
}
.root-leaf::after {
  content: ""; display: none;
}
.root-leaf:hover { z-index: 2; transform: translateY(-4px); background: var(--kesa); box-shadow: 0 20px 42px rgba(59,19,20,.18); }
.leaf-hole, .leaf-thread { display: none; }
.leaf-name, .commentary-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; }
.leaf-name strong { font-family: var(--ui); font-size: var(--type-title); font-weight: 500; letter-spacing: .08em; }
.pali-name { font-size: var(--type-body); font-weight: 500; letter-spacing: .12em; line-height: 1.3; }
.leaf-name .pali-name { color: var(--text-on-kesa-muted); }
.commentary-name .pali-name { color: var(--muted); }
.leaf-note { color: var(--text-on-kesa-muted); font-size: var(--type-body); line-height: 1.75; }
.leaf-arrow { position: relative; z-index: 2; display: grid; place-items: center; width: 38px; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.36); border-radius: 50%; color: #fff; transition: transform .25s ease, background .25s ease; }
.root-leaf:hover .leaf-arrow { transform: rotate(45deg); background: rgba(255,255,255,.08); }

.commentary-layer { margin: 32px 0 0; }
.commentary-slips { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; background: var(--line); border: 5px solid var(--line); }
.commentary-slip { position: relative; min-height: 150px; display: grid; align-content: center; padding: 26px 28px; background: #fbf6ec; transition: background .25s ease; }
.commentary-slip:hover { background: var(--paper-bright); }
.commentary-slip strong { color: var(--kesa-dark); font-family: var(--ui); font-size: var(--type-title); font-weight: 600; }
.commentary-slip p { margin: 12px 0 0; color: var(--muted); font-size: var(--type-body); line-height: 1.7; }

.service-rail { margin: 64px 0 0; padding: 56px max(32px,calc((100vw - 1240px)/2)); color: var(--ink); background: var(--paper-bright); border-block: 1px solid var(--line); }
.rail-heading { display: flex; align-items: end; justify-content: flex-start; gap: 40px; margin-bottom: 28px; }
.rail-heading h2 { color: var(--kesa-dark); font-size: var(--type-section); }
.service-links { border-top: 5px solid var(--line); }
.service-link { display: grid; grid-template-columns: 1fr 50px; align-items: center; min-height: 88px; border-bottom: 5px solid var(--line); transition: padding .28s ease, background .28s ease; }
.service-link:hover { padding-inline: 18px; background: rgba(90,42,38,.035); }
.service-link div { display: grid; grid-template-columns: minmax(160px,240px) 1fr; align-items: center; gap: 18px; }
.service-link strong { color: var(--kesa-dark); font-family: var(--ui); font-size: var(--type-title); font-weight: 500; letter-spacing: .04em; }
.service-link p { margin: 0; color: var(--muted); font-size: var(--type-body); }
.service-link > b { justify-self: end; display: grid; place-items: center; width: 40px; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; color: var(--kesa); font-weight: 400; transition: transform .25s ease; }
.service-link:hover > b { transform: rotate(45deg); }

.reading-principles { position: relative; width: var(--page); margin: 64px auto 0; }
.reading-principles > header { position: relative; z-index: 2; max-width: 760px; margin: 0 0 28px; }
.reading-principles h2 { font-size: var(--type-section); line-height: 1.22; }
.principle-orbit { display: none; position: absolute; left: -12%; top: -145px; width: 520px; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; }
.principle-orbit::before, .principle-orbit::after, .principle-orbit span { content: ""; position: absolute; border: 1px solid rgba(184,138,61,.18); border-radius: 50%; }
.principle-orbit::before { inset: 16%; }
.principle-orbit::after { inset: 32%; background: radial-gradient(circle, rgba(184,138,61,.14), transparent 68%); }
.principle-orbit span { inset: 46%; background: var(--gold); border: 0; box-shadow: 0 0 36px rgba(184,138,61,.3); }
.principle-orbit i, .principle-orbit b { position: absolute; left: 50%; top: 50%; background: rgba(184,138,61,.23); transform-origin: left center; }
.principle-orbit i { width: 50%; height: 1px; transform: rotate(33deg); }
.principle-orbit b { width: 1px; height: 50%; transform: rotate(22deg); }
.principle-grid { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(2,1fr); gap: 5px; background: var(--line); border: 5px solid var(--line); }
.principle-item { min-height: 0; padding: 32px 36px; background: #fbf6ec; }
.principle-item h3 { margin: 0 0 12px; color: var(--kesa-dark); font-family: var(--ui); font-size: var(--type-title); font-weight: 600; }
.principle-item p { max-width: 420px; margin: 0; color: var(--muted); font-size: var(--type-body); line-height: 1.8; }




@media (max-width: 980px) {
  .root-leaf { grid-template-columns: minmax(150px,.8fr) 1fr 44px; }
  .leaf-note { grid-column: auto; margin-top: 0; }
  .leaf-arrow { grid-column: 3; grid-row: 1; }
  .root-leaf:nth-child(2), .root-leaf:nth-child(3) { margin-inline: 0; }
  .commentary-layer { margin-left: 0; }
  .service-link div { grid-template-columns: minmax(150px,220px) 1fr; }
}

/* 平板:注疏三栏的巴利名统一另起一行,三栏排版一致 */
@media (min-width: 761px) and (max-width: 1080px) {
  .commentary-name { flex-direction: column; align-items: flex-start; gap: 6px; }
}
/* 平板竖屏:原则卡左右内边距收窄,说明一行放下(说明文案已控制在 21 字内) */
@media (min-width: 761px) and (max-width: 1023px) {
  .principle-item { padding-inline: 20px; }
}

@media (max-width: 760px) {
  body.home-202609 { --page: calc(100% - 24px); --type-section: 24px; --type-title: 20px; }
  .home-page { padding-bottom: 40px; }
  .hero-sanctum { width: var(--page); aspect-ratio: 1923 / 818; border-radius: 3px 3px 18px 18px; }
  .hero-sanctum::after { inset: 6px; border-radius: 2px 2px 13px 13px; }
  .canon-mandala { margin-top: 40px; }
  .root-leaves { gap: 10px; }
  .root-leaf { min-height: 120px; grid-template-columns: 1fr 34px; gap: 13px; padding: 24px 18px 22px; border-radius: 8px; }
  .leaf-name strong { font-size: var(--type-title); }
  .leaf-note { grid-column: 1; margin: 0; font-size: var(--type-body); }
  .leaf-arrow { grid-column: 2; grid-row: 1 / span 2; }
  .leaf-arrow { width: 31px; }
  .commentary-layer { margin-top: 24px; }
  .commentary-slips { grid-template-columns: 1fr; }
  .commentary-slip { min-height: 0; padding: 22px 20px; }
  .service-rail { margin-top: 40px; padding: 40px 12px; }
  .rail-heading { display: block; margin-bottom: 20px; }
  .rail-heading h2 { font-size: var(--type-section); line-height: 1.25; }
  .service-link { grid-template-columns: 1fr 36px; min-height: 84px; }
  .service-link div { display: grid; grid-template-columns: 1fr; gap: 3px; }
  .service-link strong { font-size: var(--type-title); }
  .service-link p { font-size: var(--type-body); }
  .service-link > b { width: 34px; }
  .reading-principles { margin-top: 40px; }
  .reading-principles > header { margin: 0 0 20px; }
  .reading-principles h2 { font-size: var(--type-section); }
  .principle-orbit { left: 42%; top: -125px; width: 320px; opacity: .65; }
  .principle-grid { grid-template-columns: 1fr; }
  .principle-item { min-height: 0; padding: 24px 16px; }
  .leaf-name { column-gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
  .body-halo, .monk-trace { opacity: .32; stroke-dashoffset: 0; }
  .radial-core { opacity: .2; transform: none; }
  .monk-spark { display: none; }
}

/* 页面主标题只给搜索引擎与读屏用,视觉上由 Hero 画面承担 */
.home-h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 卡片说明文字:避免末行只剩一个字(手机上尤明显);balance 会拆词,不用 */
.principle-item p, .commentary-slip p, .leaf-note, .service-link p { text-wrap: pretty; }

/* 注疏三格:鼠标经过时一道「/」向 45° 暖金柔光从左往右斜扫而过(只在有鼠标的设备;减少动态时不播) */
.commentary-slip { overflow: hidden; }
.commentary-slip > * { position: relative; z-index: 1; }   /* 文字在光带之上,不被冲淡 */
.commentary-slip::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 230, 176, .7) 50%, transparent 60%) no-repeat;
  background-size: 260% 260%; background-position: 100% 100%;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .commentary-slip:hover::after {
    opacity: 1; background-position: 0% 0%;
    transition: background-position 2.4s cubic-bezier(.45, .05, .35, 1), opacity .4s ease;
  }
}
