/* v2 extends the existing reading system; final shared layer. */
body { padding-bottom: 76px; }
.back-to-index { display: inline-flex; align-items: center; min-height: 44px; margin-top: 20px; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 5px; }
.back-to-index:hover { color: var(--ink); }
.back-to-index { gap: 8px; text-decoration: none; }
.back-to-index svg { width: 18px; height: 18px; }
.back-to-index:hover span { text-decoration: underline; text-underline-offset: 4px; }
.home-main { max-width: 1100px; }
.home-intro { padding: clamp(38px, 6vh, 72px) 0 36px; max-width: 760px; }
.home-intro h1 { margin: 0 0 10px; font-size: clamp(30px, 4vw, 48px); font-weight: 500; line-height: 1.35; letter-spacing: -.025em; }
.home-english { margin: 0 0 26px; font-size: 15px; color: var(--muted); line-height: 1.65; }
html[data-theme=dark] .home-english { color: var(--accent); }
.home-description { max-width: 680px; font-size: 15px; color: var(--muted); line-height: 1.9; }
.home-description p { margin: 0 0 22px; }
#home-search-form { max-width: none; }
.home-quick-links { gap: 12px 20px; font-size: 12px; margin-top: 14px; }
.home-quick-links a { min-height: 30px; display: inline-flex; align-items: center; }
nav.category-entries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; overflow: visible; padding: 0; border: 0; }
.category-entries > a { display: flex; flex-direction: column; align-items: stretch; min-width: 0; min-height: 338px; padding: 28px; gap: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); transition: border-color 180ms ease-out, background-color 180ms ease-out; }
.category-entries > a:hover { background: var(--soft); border-color: var(--strong-line); }
.category-entries .category-symbol { width: 36px; height: 36px; color: var(--ink); stroke: none; fill: currentColor; }
.category-entries h2 { margin: 0 0 12px; font-size: 23px; font-weight: 500; line-height: 1.45; }
.category-entries p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.85; }
.category-entries .entry-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; }
.category-entries .entry-open { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.category-entries .entry-open svg { width: 18px; height: 18px; }
.category-entries > a:hover .entry-open { text-decoration: underline; text-underline-offset: 5px; }
html[data-theme=dark] .category-entries > a:hover { border-color: var(--accent); }
html[data-theme=dark] .category-entries .category-symbol { color: var(--accent); }
.home-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; margin: 24px 0 38px; }
.home-result-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 0 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.home-result-heading p { margin: 0; color: var(--muted); }
.home-result-heading button { padding: 8px 0; text-decoration: underline; text-underline-offset: 5px; white-space: nowrap; }
.home-search-result { display: block; padding: 24px 0; border-bottom: 1px solid var(--line); }
.home-search-result h3 { font-size: 18px; font-weight: 500; line-height: 1.65; margin: 8px 0; }
.home-search-result:hover h3 { text-decoration: underline; text-underline-offset: 5px; }
.home-search-result-category { color: var(--muted); font-size: 12px; }
.home-search-result-excerpt { color: var(--muted); font-size: 14px; line-height: 1.9; margin: 0; overflow-wrap: anywhere; max-width: 80ch; }
.home-search-result mark { background: var(--accent); color: var(--accent-ink); }

.category-policy .specimen-scene, .category-feedback .specimen-scene { display: none; }
.category-policy .hero { grid-template-columns: minmax(0, 760px); padding: 26px 0 34px; }
.category-feedback .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 4vw, 64px); padding: 26px 0 34px; }
.feedback-scene { margin: 0; min-width: 0; }
.feedback-artwork { --feedback-height: clamp(280px, 32vw, 420px); position: relative; display: grid; justify-items: center; height: var(--feedback-height); background: var(--paper); isolation: isolate; overflow: hidden; }
.theme-transition .feedback-artwork { transition: background-color .42s ease; }
.feedback-artwork::before { content: ''; position: absolute; inset: 0; z-index: -1; background: url('./assets/manual-paper.webp') repeat; background-size: 620px; opacity: var(--texture-opacity); pointer-events: none; }
.feedback-print { position: relative; width: calc(var(--feedback-height) * 1122 / 1402); max-width: 100%; height: 100%; mix-blend-mode: multiply; transform-origin: 50% 60%; transition: transform 280ms cubic-bezier(.16,1,.3,1); }
.feedback-artwork img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.feedback-night { visibility: hidden; }
html[data-theme=dark] .feedback-print { mix-blend-mode: screen; }
.feedback-paper { position: absolute; pointer-events: none; transition: transform 280ms cubic-bezier(.16,1,.3,1); }
.feedback-paper-back { inset: 42px 32px 28px; background: #dfe2d9; border: 1px solid #abb19f; clip-path: polygon(3% 0,98% 3%,100% 97%,0 100%); transform: rotate(-5deg); }
.feedback-paper-front { inset: 50px 48px 32px; background: linear-gradient(115deg,#e8eadeaa,#f3f2e980),url('./assets/manual-paper.webp'); background-size: auto,620px; border: 1px solid #b8bead; transform: rotate(3deg); }
.feedback-tape { position: absolute; left: calc(50% + var(--feedback-height) * 1122 / 2804 + 2px); top: calc(26% - 6px); width: 38px; height: 12px; background: #b7bdae90; transform: translate(-50%,-50%) rotate(45deg); pointer-events: none; }
html[data-theme=dark] .feedback-paper-back { background: #141414; border-color: #454543; }
html[data-theme=dark] .feedback-paper-front { background: #0b0b0b; border-color: #333331; }
html[data-theme=dark] .feedback-tape { background: #77777240; }
.feedback-artwork[data-engaged=true] .feedback-print { transform: translateY(-3px) rotate(-.7deg); }
.feedback-artwork[data-engaged=true] .feedback-paper-back { transform: rotate(-7deg); }
.feedback-artwork[data-engaged=true] .feedback-paper-front { transform: rotate(4deg); }
.feedback-effects { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; fill: none; }
.feedback-lamp-matrix { display: none; }
.feedback-print:has(.feedback-lamp:is(:hover,:focus-visible)) .feedback-lamp-matrix { animation: feedback-lamp-flash 800ms ease-in-out both paused; }
.feedback-artwork[data-motion-active=true] .feedback-print:has(.feedback-lamp:is(:hover,:focus-visible)) .feedback-lamp-matrix { animation-play-state: running; }
html[data-theme=dark] .feedback-lamp-matrix { display: block; }
.lamp-pixel { fill: var(--accent); stroke: none; opacity: .48; animation: feedback-led 2.7s ease-in-out infinite alternate paused; }
.lamp-pixel-1 { animation-delay: -.9s; }
.lamp-pixel-2 { animation-delay: -1.8s; }
.feedback-artwork[data-motion-active=true] .lamp-pixel { animation-play-state: running; }
.feedback-artwork[data-engaged=true] .lamp-pixel { fill: #e5ffc4; opacity: 1; }
.feedback-signal-track { stroke: #748d32; stroke-width: 3; opacity: 0; transition: opacity 180ms ease-out; }
.feedback-signal-pulse { stroke: #657d25; stroke-width: 7; stroke-dasharray: 4 96; opacity: 0; animation: feedback-transmit 2.4s linear infinite paused; }
html[data-theme=dark] .feedback-signal-track { stroke: var(--accent); }
html[data-theme=dark] .feedback-signal-pulse { stroke: #e5ffc4; }
.feedback-artwork[data-engaged=true] .feedback-signal-track { opacity: .5; }
.feedback-artwork[data-engaged=true] .feedback-signal-pulse { opacity: 1; }
.feedback-artwork[data-engaged=true][data-motion-active=true] .feedback-signal-pulse { animation-play-state: running; }
.feedback-lamp { position: absolute; left: 28.8%; top: 14.2%; transform: translate(-50%,-50%); width: 24%; height: 10%; min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: transparent; }
.feedback-lamp:focus-visible { outline: none; }
.feedback-lamp-rim { opacity: 0; stroke: var(--ink); stroke-width: 3; stroke-dasharray: 7 5; }
.feedback-print:has(.feedback-lamp:focus-visible) .feedback-lamp-rim { opacity: 1; }
html[data-theme=dark] .feedback-lamp-rim { stroke: var(--accent); }
@keyframes feedback-lamp-flash { 0% { opacity: .3; } 30% { opacity: 1; } 65% { opacity: .12; } 100% { opacity: 1; } }
@keyframes feedback-led { from { opacity: .48; } to { opacity: .95; } }
@keyframes feedback-transmit { to { stroke-dashoffset: -100; } }
@media(prefers-reduced-motion:reduce) {
  .feedback-print,.feedback-paper,.feedback-signal-track,.theme-transition .feedback-artwork { transition: none; }
  .feedback-artwork[data-engaged=true] .feedback-print { transform: none; }
  .feedback-artwork[data-engaged=true] .feedback-paper-back { transform: rotate(-5deg); }
  .feedback-artwork[data-engaged=true] .feedback-paper-front { transform: rotate(3deg); }
  .lamp-pixel,.feedback-signal-pulse,
  .feedback-print:has(.feedback-lamp:is(:hover,:focus-visible)) .feedback-lamp-matrix { animation: none; }
}
html[data-theme=dark] .feedback-day { visibility: hidden; }
html[data-theme=dark] .feedback-night { visibility: visible; }
.feedback-scene figcaption { margin: 12px 0 0; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; gap: 16px; }
.category-policy .hero-narrative, .category-feedback .hero-narrative { margin-bottom: 24px; }
.category-policy .reading-layout, .category-feedback .reading-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
.manual-home-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.category-policy .hero-narrative p, .category-feedback .hero-narrative p { font-size: 15px; }
.legal-main { max-width: 860px; }
.legal-document { margin: 24px 0 64px; font-size: 15px; line-height: 1.95; overflow-wrap: anywhere; }
.legal-document h1 { margin: 18px 0 30px; font-size: clamp(26px, 3vw, 36px); line-height: 1.5; font-weight: 500; letter-spacing: -.02em; }
.legal-document h2 { font-size: 22px; font-weight: 500; margin: 42px 0 16px; line-height: 1.6; }
.legal-document h3 { font-size: 18px; margin: 30px 0 12px; }
.legal-document a { text-decoration: underline; text-underline-offset: 4px; }
.document-meta { color: var(--muted); font-size: 12px; }
footer.site-legal { position: fixed; inset: auto 0 0; z-index: 20; max-width: none; margin: 0; padding: 10px 32px max(10px, env(safe-area-inset-bottom)); min-height: 48px; display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 12px; background: var(--paper); color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.site-legal .legal-item { position: relative; display: inline-flex; align-items: center; min-height: 28px; margin: 0; border: 0; color: inherit; }
.site-legal a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.site-legal > .legal-dot { display: inline; }
.legal-short { display: none; }
.legal-tip { display: none; position: absolute; bottom: calc(100% + 12px); left: 0; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 6px; white-space: nowrap; font-size: 10px; pointer-events: none; }
.legal-item:hover .legal-tip, .legal-item:focus-visible .legal-tip { display: block; }
.toast { bottom: 76px; }
@media (orientation: portrait) {
  .legal-full { display: none; }
  .legal-short { display: inline; }
  footer.site-legal { padding-left: 22px; padding-right: 22px; gap: 10px; }
  .site-legal .legal-item { min-height: 32px; min-width: 24px; justify-content: center; }
}
@media (max-width: 760px) {
  .category-feedback .hero { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .feedback-artwork { --feedback-height: 290px; }
  .feedback-scene { max-width: 340px; width: 100%; justify-self: center; }
  .home-intro { padding: 30px 0 26px; }
  .home-english { font-size: 13px; margin-bottom: 22px; }
  .home-quick-links { gap: 8px 14px; font-size: 12px; }
  nav.category-entries { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .home-description { font-size: 14px; }
  .category-entries > a { padding: 22px; min-height: 0; gap: 16px; display: grid; grid-template-columns: 32px minmax(0, 1fr); }
  .category-entries .category-symbol { width: 32px; height: 32px; }
  .category-entries .entry-action { grid-column: 1 / -1; }
  .category-entries h2 { font-size: 20px; }
  .category-entries p { font-size: 13px; }
  .category-entries .entry-action { flex-direction: row; gap: 8px; padding-top: 14px; }
  .home-meta { flex-wrap: wrap; font-size: 11px; }
  .legal-document { margin-top: 18px; }
  .legal-document h2 { font-size: 20px; }
  .legal-document ul, .legal-document ol { padding-left: 24px; }
}
