/* Author homepage. Shared styles and other routes remain unchanged. */
.home-page {
  --bg: #010206; --text: #f7f5fc; --muted: #dbd5e7; --gold: #ff9d61;
  --orange: #ff6a13;
  --heading-font: 'Manrope', 'Avenir Next', 'Segoe UI', sans-serif;
  --display-font: 'Bad Script', 'Segoe Print', cursive;
  --line: rgba(255,106,19,.36);
  color-scheme: dark; color: var(--text);
  background:
    radial-gradient(ellipse at 10% 17%, rgba(12,40,91,.46), transparent 43%),
    radial-gradient(ellipse at 91% 31%, rgba(51,22,84,.28), transparent 37%),
    radial-gradient(ellipse at 75% 65%, rgba(10,32,83,.36), transparent 42%),
    radial-gradient(ellipse at 14% 90%, rgba(37,17,67,.25), transparent 38%),
    linear-gradient(148deg, #000103 0%, #061020 24%, #02030a 48%, #0d0718 72%, #000103 100%);
  font-size: 1rem; line-height: 1.65; overflow-x: clip; overflow-wrap: anywhere;
  isolation: isolate;
}
.home-page::before, .home-page::after {
  content: ""; display: block; position: fixed; z-index: -1; pointer-events: none;
  border-radius: 50%; filter: blur(72px); opacity: .65; animation: none;
}
.home-page::before { width: 45vw; height: 55vh; left: -18vw; top: 22vh; background: rgba(23,62,130,.23); }
.home-page::after { width: 48vw; height: 62vh; right: -25vw; top: 12vh; background: rgba(64,30,105,.16); }
.home-page :is(a,button,summary):focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
.home-page :is(button,a,summary) { -webkit-tap-highlight-color: transparent; }
.home-page button { font: inherit; cursor: pointer; }
.home-page [hidden] { display: none !important; }
.home-page .home-skip { position: fixed; top: 8px; left: 16px; z-index: 100; background: var(--gold); color: var(--bg); padding: 10px 16px; transform: translateY(-160%); border-radius: 8px; }
.home-page .home-skip:focus { transform: none; }
.home-page .page-shell { max-width: 1280px; padding: 0 40px 40px; }
.home-page .topbar {
  position: relative; background: linear-gradient(110deg, rgba(0,2,7,.80), rgba(8,18,38,.33), rgba(23,12,38,.24));
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 10px 36px rgba(0,0,0,.10), inset 0 1px rgba(255,255,255,.07);
  border-bottom: 1px solid var(--line);
}
.home-page .topbar-inner { max-width: 1280px; padding: 23px 40px 18px; display: grid; grid-template-columns: 1fr auto; gap: 17px 24px; }
.home-page .brand { grid-column: 1; grid-row: 1; gap: 1px; width: fit-content; }
.home-page .brand strong { font-family: var(--heading-font); font-size: 1.1875rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.4; }
.home-page .brand span { font-size: .875rem; color: var(--muted); }
.home-page .lang-switcher { grid-column: 2; grid-row: 1; gap: 4px; margin: 0; }
.home-page .lang-chip { min-width: 42px; min-height: 44px; padding: 8px; border-radius: 8px; border-color: transparent; background: none; font-size: .875rem; }
.home-page .lang-chip.active { color: var(--gold); background: rgba(159,203,244,.09); border-color: rgba(228,202,159,.25); box-shadow: inset 0 1px rgba(255,255,255,.08); }
.home-page .nav { grid-column: 1 / -1; grid-row: 2; gap: 6px 24px; align-items: center; }
.home-page .nav a { padding: 3px 0; font-size: .9375rem; border: 0; border-radius: 0; min-height: 36px; display: inline-flex; align-items: center; color: var(--muted); }
.home-page .nav a:hover, .home-page .nav a.active { color: var(--gold); background: none; box-shadow: none; transform: none; }
.home-page .nav a.active { border-bottom: 1px solid var(--gold); }
.home-hero { padding: 36px 0 28px; }
.home-page .hero-premium {
  display: grid; grid-template-columns: 1.17fr 1fr; align-items: center; gap: 12px;
  padding: 42px 42px 36px; position: relative; border-radius: 24px;
  background: linear-gradient(115deg, rgba(0,2,8,.62), rgba(12,30,58,.20) 56%, rgba(40,21,62,.13));
  border: 1px solid rgba(255,106,19,.55);
  box-shadow: inset 0 1px rgba(238,247,255,.14), inset -1px -1px rgba(216,230,255,.04), 0 30px 80px rgba(0,5,18,.32);
}
.home-page .hero-text { position: relative; z-index: 1; min-width: 0; }
.home-page .hero-premium .hero-text .hero-kicker {
  display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0;
  box-shadow: none; font-family: inherit; font-size: .875rem; letter-spacing: .16em;
  text-transform: uppercase; margin: 0 0 24px; color: var(--gold);
}
.home-page .hero-kicker::before { content: ""; width: 30px; height: 1px; background: var(--gold); }
.home-page .hero-premium .hero-text h1 { font-family: var(--display-font); font-size: clamp(2.75rem,5.15vw,4.4rem); font-weight: 400; font-style: normal; font-synthesis: none; line-height: 1.5; margin: 0 0 24px; letter-spacing: 0; }
.home-page .hero-premium .hero-text h1 em { font-style: normal; font-weight: inherit; color: var(--gold); }
.home-author-subtitle { font-size: 1.3125rem; line-height: 1.5; font-weight: 500; margin: 0 0 18px; }
.home-page .hero-premium .hero-text .hero-lede { font-size: 1rem; line-height: 1.8; max-width: 31em; margin: 0 0 28px; color: var(--muted); }
.home-page .hero-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0; }
.home-page .btn {
  min-height: 48px; display: inline-flex; justify-content: center; align-items: center; gap: 22px;
  border-radius: 10px; padding: 12px 19px; font: inherit; font-size: 1rem; font-weight: 500; line-height: 1.4;
  text-align: center; white-space: normal; transition: background .2s, border-color .2s, box-shadow .2s;
}
.home-page .btn::before, .home-page .btn::after { display: none; }
.home-page .btn-primary {
  background: linear-gradient(130deg, rgba(157,210,244,.14), rgba(122,151,220,.06));
  color: #f9e4bf; border: 1px solid rgba(237,207,160,.50);
  box-shadow: inset 0 1px rgba(255,243,221,.18), 0 8px 24px rgba(0,0,0,.12);
}
.home-page .btn-primary:hover { background: rgba(157,210,244,.21); border-color: var(--gold); transform: none; box-shadow: 0 8px 30px rgba(136,181,232,.12); }
.home-page .btn-secondary { border: 1px solid rgba(190,211,239,.28); background: rgba(206,227,255,.045); color: var(--text); box-shadow: inset 0 1px rgba(255,255,255,.08); }
.home-page .btn-secondary:hover { background: rgba(206,227,255,.12); border-color: rgba(214,232,255,.55); transform: none; }
.home-text-link { display: inline-flex; gap: 12px; align-items: center; padding: 8px 0; min-height: 44px; color: var(--text); background: none; border: 0; font-size: .9375rem; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: rgba(184,211,245,.5); }
.home-text-link:hover { color: var(--gold); text-decoration-color: var(--gold); }
.home-topics { font-size: .875rem; color: var(--muted); margin: 28px 0 0; padding-top: 21px; border-top: 1px solid var(--line); line-height: 1.9; }
.home-topics span { color: var(--gold); padding: 0 5px; }
.home-diagram { display: flex; flex-direction: column; align-items: center; min-width: 0; align-self: stretch; justify-content: center; position: relative; }
.home-scene { width: 100%; aspect-ratio: 1 / 1; min-height: 260px; position: relative; background: radial-gradient(ellipse, rgba(131,186,224,.11), transparent 69%); }
.home-scene canvas { display: block; width: 100%; height: 100%; }
.home-diagram-caption { margin: 0; color: #d8e4f2; font-size: .875rem; text-align: center; letter-spacing: .13em; }
.home-diagram-caption span { color: var(--gold); padding: 0 12px; }
.home-diagram-fallback { position: absolute; inset: 25% 12% auto; font-family: var(--heading-font); font-size: 1.75rem; font-weight: 500; line-height: 1.6; text-align: center; color: var(--gold); margin: 0; }
.has-diagram .home-diagram-fallback { display: none; }
.home-page .home-motion-toggle { color: var(--muted); border: 0; background: none; padding: 8px 10px; min-height: 44px; font-size: .875rem; margin-top: 8px; text-decoration: underline; text-decoration-color: rgba(193,206,224,.35); text-underline-offset: 4px; }
.home-eyebrow { display: block; color: var(--gold); font-size: .875rem; line-height: 1.5; margin-bottom: 12px; letter-spacing: .1em; text-transform: uppercase; }
.home-page h2 { font-family: var(--display-font); font-size: clamp(1.875rem,3vw,2.625rem); font-weight: 400; font-style: normal; font-synthesis: none; letter-spacing: 0; line-height: 1.55; margin: 0; }
.home-welcome, .home-entry, .home-contact {
  background: linear-gradient(128deg, rgba(79,112,162,.065), rgba(1,3,9,.46) 55%, rgba(30,15,49,.19));
  border: 1px solid var(--line); border-top-color: var(--orange); border-radius: 18px;
  backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
  box-shadow: inset 0 1px rgba(241,247,255,.07), 0 18px 40px rgba(1,6,18,.18);
}
.home-welcome { scroll-margin-top: 24px; display: grid; grid-template-columns: 1fr auto; gap: 12px 32px; padding: 28px 32px; }
.home-welcome .home-eyebrow { margin-bottom: 6px; }
.home-page .home-welcome h2 { font-size: 2rem; }
.home-welcome-copy p { color: var(--muted); margin: 10px 0 0; }
.home-audio-controls { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.home-audio-status { grid-column: 1 / -1; color: var(--muted); font-size: .875rem; line-height: 1.5; margin: 0; }
.home-audio-status strong { font-weight: 500; color: var(--text); }
.home-section { padding: 64px 0 0; }
.home-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.home-section-heading p { max-width: 350px; font-size: 1rem; color: var(--muted); margin: 0; }
.home-library { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; perspective: 1200px; }
.home-entry { min-width: 0; padding: 30px; transition: transform .25s, border-color .25s, box-shadow .25s; }
.home-entry-number { display: block; color: var(--gold); font-size: .875rem; letter-spacing: .08em; margin-bottom: 18px; }
.home-entry h3 { font-family: var(--display-font); font-size: 1.75rem; font-weight: 400; font-style: normal; font-synthesis: none; letter-spacing: 0; line-height: 1.55; margin: 0 0 12px; }
.home-entry h3 a { display: flex; gap: 20px; justify-content: space-between; align-items: baseline; }
.home-entry h3 a span { font-family: sans-serif; font-size: 1.125rem; font-weight: 400; color: var(--gold); }
.home-entry h3 a:hover { color: var(--gold); }
.home-entry p { color: var(--muted); font-size: 1rem; margin: 0 0 20px; max-width: 36em; }
.home-reading-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.home-reading-links a { font-size: .9375rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(195,221,255,.4); padding: 4px 0; }
.home-reading-links a:hover { color: var(--gold); text-decoration-color: var(--gold); }
.home-page .home-route { color: var(--muted); font-size: .875rem; background: none; border: none; padding: 8px 0; min-height: 44px; margin-top: 16px; text-align: left; }
.home-page .home-route:hover { color: var(--gold); }
.home-route span { margin-left: 12px; }
.home-voice-more { color: var(--muted); font-size: .875rem; padding-top: 12px; }
.home-voice-more summary { width: fit-content; cursor: pointer; padding: 10px 0; min-height: 44px; }
.home-voice-more .home-route { margin: 0 24px 0 0; }
.home-contact { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 32px; margin-top: 54px; }
.home-contact p { color: var(--muted); margin: 12px 0 0; }
.home-contact .btn { flex-shrink: 0; }
.home-page .footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; font-size: .875rem; line-height: 1.5; color: var(--muted); border: 0; margin: 0; padding: 28px 0 0; }
.home-counter-wrap { display: inline-flex; align-items: baseline; gap: 6px; }
.home-page .site-visit-counter { display: inline; min-width: 0; margin: 0; padding: 0; color: inherit; font-size: inherit; font-weight: 400; background: none; border: 0; box-shadow: none; }
.home-counter-wrap:not(:has([data-site-counter]:not([hidden]))) { display: none; }
.home-page .site-guide-launcher { background: rgba(24,41,66,.68); backdrop-filter: blur(16px); border: 1px solid rgba(237,207,160,.4); color: var(--gold); box-shadow: 0 8px 25px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.1); }
.home-page .site-guide-launcher:hover { transform: none; border-color: var(--gold); }
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  .home-entry:hover { transform: translateY(-5px) rotateX(1deg); border-color: rgba(211,231,255,.36); box-shadow: inset 0 1px rgba(255,255,255,.13), 0 26px 50px rgba(0,5,19,.3); }
}
@media (max-width:1100px) {
  .home-page .page-shell, .home-page .topbar-inner { padding-left: 28px; padding-right: 28px; }
  .home-page .hero-premium { padding: 32px 28px; grid-template-columns: 1.25fr 1fr; }
  .home-page .hero-premium .hero-text h1 { font-size: clamp(2.75rem,4.8vw,3.75rem); }
}
@media (max-width:820px) {
  .home-page .hero-premium { grid-template-columns: 1fr; gap: 18px; padding: 32px; }
  .home-page .hero-premium .hero-text h1 { font-size: clamp(2.75rem,7vw,4rem); }
  .home-page .hero-premium .hero-text .hero-lede { max-width: 38em; }
  .home-diagram { width: 100%; max-width: 380px; justify-self: center; }
  .home-scene { aspect-ratio: auto; height: 270px; min-height: 0; }
  .home-page .nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
  .home-page .nav a, .home-page .nav a.active { display: none; }
  .home-page .nav .mobile-menu-toggle { display: inline-flex; min-height: 44px; padding: 8px 14px; border-radius: 8px; background: rgba(213,232,255,.04); border: 1px solid var(--line); color: var(--text); font-size: .875rem; font-weight: 500; }
  .home-page .nav.mobile-menu-open { padding: 0 0 12px; border: 0; border-radius: 0; background: none; }
  .home-page .nav.mobile-menu-open a { display: inline-flex; }
  .home-page .nav:not(:has(.mobile-menu-toggle)) a { display: inline-flex; }
  .home-page .topbar-inner { gap: 12px; padding-top: 18px; padding-bottom: 14px; }
  .home-welcome { grid-template-columns: 1fr; gap: 18px; }
  .home-audio-controls { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 12px 24px; }
  .home-section-heading { align-items: start; flex-direction: column; gap: 16px; }
  .home-section-heading p { max-width: 40em; }
  .home-contact { align-items: start; flex-direction: column; gap: 24px; }
}
@media (max-width:560px) {
  .home-page .page-shell { padding: 0 16px 96px; }
  .home-page .topbar-inner { padding: 18px 20px 14px; grid-template-columns: 1fr auto; gap: 12px; }
  .home-page .brand { grid-column: 1 / -1; }
  .home-page .brand strong { font-size: 1.125rem; }
  .home-page .brand span { font-size: .875rem; }
  .home-page .nav { grid-column: 1; grid-row: 2; gap: 8px 16px; }
  .home-page .lang-switcher { grid-column: 2; grid-row: 2; align-self: start; }
  .home-page .nav.mobile-menu-open { grid-column: 1 / -1; padding-top: 0; padding-right: 102px; }
  .home-page .nav.mobile-menu-open a { flex-basis: 100%; }
  .home-hero { padding: 20px 0; }
  .home-page .hero-premium { padding: 26px 20px 18px; border-radius: 18px; gap: 18px; }
  .home-page .hero-premium .hero-text .hero-kicker { font-size: .875rem; letter-spacing: .1em; margin-bottom: 20px; }
  .home-page .hero-premium .hero-text h1 { font-size: clamp(2.125rem,8.6vw,3rem); margin-bottom: 20px; }
  .home-author-subtitle { font-size: 1.125rem; }
  .home-page .hero-premium .hero-text .hero-lede { font-size: 1rem; line-height: 1.75; margin-bottom: 22px; }
  .home-page .hero-actions { gap: 10px; }
  .home-page .hero-actions .btn { width: 100%; justify-content: space-between; }
  .home-topics { margin-top: 22px; padding-top: 18px; }
  .home-scene { height: 240px; }
  .home-diagram-caption { font-size: .875rem; letter-spacing: .05em; }
  .home-diagram-caption span { padding: 0 7px; }
  .home-welcome { padding: 24px 20px; gap: 14px; }
  .home-audio-controls { align-items: start; flex-direction: column; gap: 0; }
  .home-audio-controls .btn { width: 100%; padding: 12px 14px; font-size: .9375rem; gap: 10px; }
  .home-section { padding-top: 42px; }
  .home-section-heading { margin-bottom: 24px; padding: 0 4px; }
  .home-library { grid-template-columns: 1fr; gap: 16px; }
  .home-entry { padding: 25px 22px; }
  .home-contact { margin-top: 36px; padding: 25px 22px; }
  .home-page .footer { flex-direction: column; gap: 12px; overflow-wrap: anywhere; padding-left: 4px; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  .home-page *, .home-page *::before, .home-page *::after { animation: none !important; transition: none !important; }
}
@media (prefers-reduced-transparency:reduce) {
  .home-page .hero-premium, .home-welcome, .home-entry, .home-contact, .home-page .topbar { background: #050a15; backdrop-filter: none; }
}

/* Orange light traces, with one global motion control and a static fallback. */
.home-page::before { animation: violetDrift 24s ease-in-out infinite alternate paused; }
.home-page::after { animation: violetDrift 31s ease-in-out infinite alternate-reverse paused; }
.home-page.motion-active::before, .home-page.motion-active::after { animation-play-state: running; }
.home-page .hero-premium::after {
  content: ''; position: absolute; top: -1px; left: 8%; right: 8%; height: 2px;
  background: linear-gradient(90deg, transparent 0%, #ff6a13 42%, #ffbd87 50%, #ff6a13 58%, transparent 100%);
  background-size: 220% 100%; border-radius: 2px; pointer-events: none;
  box-shadow: 0 0 14px rgba(255,106,19,.40);
  animation: orangeTrace 9s ease-in-out infinite alternate paused;
}
.home-page.motion-active .hero-premium::after { animation-play-state: running; }
.home-page .topbar { border-bottom-color: var(--orange); }
.home-page .nav a.active { border-bottom-color: var(--orange); }
.home-page .hero-kicker::before { background: var(--orange); box-shadow: 0 0 12px #ff6a1366; }
.home-page .home-topics { border-top-color: rgba(255,106,19,.58); }
.home-page .lang-chip.active { background: rgba(124,85,171,.1); border-color: var(--orange); }
.home-page .btn-primary {
  background: linear-gradient(130deg, rgba(71,33,99,.20), rgba(15,7,26,.20));
  border-color: var(--orange); color: #ffe6d4;
  box-shadow: inset 0 1px rgba(255,179,125,.12), 0 0 18px rgba(255,106,19,.08);
}
.home-page .btn-primary:hover { background: rgba(81,40,115,.3); box-shadow: 0 0 24px rgba(255,106,19,.22); border-color: #ffac72; }
.home-page .btn-secondary { background: rgba(108,80,144,.06); border-color: rgba(255,106,19,.50); }
.home-page .btn-secondary:hover { background: rgba(95,63,129,.18); border-color: var(--orange); }
.home-page .home-reading-links a { text-decoration-color: rgba(255,106,19,.65); }
.home-page .home-entry-number { color: #ff9a5b; }
.home-page .home-scene { background: radial-gradient(ellipse, rgba(28,60,119,.20), rgba(53,26,88,.09) 45%, transparent 69%); }
.home-page .site-guide-launcher { background: rgba(23,11,39,.84); border-color: var(--orange); color: #ffad75; }
.home-page .home-motion-toggle {
  position: fixed; left: 18px; bottom: 18px; z-index: 81; margin: 0; padding: 10px 14px;
  max-width: calc(100vw - 110px); background: rgba(2,5,13,.96);
  border: 1px solid rgba(255,106,19,.65); border-radius: 10px; color: #f3eafc;
  backdrop-filter: blur(16px); text-decoration: none; box-shadow: 0 6px 24px #0006;
}
.home-page .page-shell { padding-bottom: 100px; }
@keyframes violetDrift { from { transform: translate3d(0,0,0) scale(.95); } to { transform: translate3d(8vw,8vh,0) scale(1.14); } }
@keyframes orangeTrace { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  .home-page.motion-active .home-entry:hover { transform: translateY(-6px) rotateX(1.5deg); border-color: var(--orange); box-shadow: inset 0 1px #ffab7277, 0 22px 48px #0006, 0 0 22px #ff6a1312; }
  .home-page:not(.motion-active) .home-entry:hover { transform: none; }
  .home-page .nav a { transition: color .2s, text-shadow .2s; }
  .home-page .nav a:hover { text-shadow: 0 0 16px #ff6a1355; }
}
@media (prefers-reduced-motion:reduce) {
  .home-page::before, .home-page::after, .home-page .hero-premium::after { animation: none !important; }
}
