/* Shared page rhythm and theme surfaces, applied after the legacy page styles. */
:root{--page-width:1220px;--page-gutter:clamp(20px,4.2vw,52px);--bg:#fff;--surface:#fff;--surface-soft:#f7f8f5;--ink:#202522;--muted:#747a73;--line:#e5e8e2;--accent:#748b5c;color-scheme:light}
html{background:var(--bg)}
body{background:var(--bg);color:var(--ink);transition:background-color .22s ease,color .22s ease}
.site-header,.site-footer{width:min(100%,var(--page-width));background:var(--bg);border-color:var(--line)}
.site-header{height:82px;padding:0 var(--page-gutter);gap:clamp(18px,3vw,36px)}
.site-header nav{gap:clamp(16px,2.4vw,30px)}
.home-main,.content-main{width:min(100%,var(--page-width));max-width:var(--page-width);padding-left:var(--page-gutter);padding-right:var(--page-gutter)}
.content-main{padding-top:clamp(52px,6vw,72px);padding-bottom:clamp(64px,7vw,88px)}
.page-kicker{margin:0 0 15px;line-height:1.55}
.page-title{margin:0 0 16px;line-height:1.3}
.page-lead{margin:0 0 36px;line-height:1.9}
.f1-main .page-lead,.wec-main .page-lead{margin-bottom:28px}
.software-note{margin:0 0 30px}
.linglong-project{margin-top:0}
.wec-overview{margin:0 0 34px}
.f1-panel,.wec-data-panel{margin-top:26px}
.calendar-section,.history-section{padding-top:62px}
.article-body{padding-top:24px}
.site-footer{padding:22px var(--page-gutter) 28px;gap:18px}
.theme-toggle{display:grid;place-items:center;width:40px;height:40px;padding:0;border:1px solid var(--line);border-radius:50%;background:transparent;color:var(--ink);font:inherit;font-size:21px;line-height:1;cursor:pointer;transition:background-color .2s,border-color .2s,transform .2s}
.theme-toggle:hover{background:var(--surface-soft);transform:rotate(-10deg)}
.theme-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.intro-links{grid-template-columns:repeat(3,max-content);justify-content:start;gap:0 clamp(18px,2.6vw,30px);max-width:none}
.intro-links a{white-space:nowrap;font-size:16px;font-weight:400;line-height:1.7}
body.dark,:root:has(body.dark){--bg:#171c19;--surface:#1d241f;--surface-soft:#242c26;--ink:#e7eade;--muted:#a4ada3;--line:#394139;color-scheme:dark}
body.dark .site-header,body.dark .site-footer{background:var(--bg)}
body.dark .intro-mark:before{border-color:#394139}
body.dark .intro-mark:after{border-color:#313a33}
body.dark .project-visual{background:#252d27}
body.dark .software-note{background:#222a24}
body.dark .session-card{background:var(--surface);color:var(--muted)}
body.dark .session-card.selected{background:#283129}
body.dark .calendar-item:hover,body.dark .f1-table tbody tr:hover,body.dark .wec-table tbody tr:hover{background:#222a24}
body.dark .f1-table td,body.dark .wec-table td,body.dark .wec-drivers .wec-driver-entry+.wec-driver-entry{border-color:var(--line)}
body.dark select,body.dark option{background-color:var(--surface);color:var(--ink)}
body.dark .theme-toggle:hover{background:#29322b}
@media(max-width:760px){
  .site-header{height:auto;min-height:78px;padding:12px 20px 0;gap:10px}
  .site-header nav{gap:21px}
  .content-main{padding-top:46px;padding-bottom:62px}
  .page-kicker{margin-bottom:12px}
  .page-title{margin-bottom:13px}
  .page-lead{margin-bottom:28px}
  .f1-main,.wec-main{padding-top:46px}
  .f1-main .page-lead,.wec-main .page-lead{margin-bottom:24px}
  .software-note{margin-bottom:24px}
  .wec-overview{margin-bottom:26px}
  .f1-panel,.wec-data-panel{margin-top:22px}
  .calendar-section,.history-section{padding-top:48px}
  .site-footer{padding:20px}
  .intro-links{grid-template-columns:1fr;gap:0}
  .intro-links a{white-space:normal}
}
@media(prefers-reduced-motion:reduce){body,.theme-toggle{transition:none}}

.home-main .intro-links .link-arrow{display:inline-block;width:16px;height:16px;margin-left:12px;flex:none;fill:none;stroke:#748b5c;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;vertical-align:-3px;transition:transform .25s ease,stroke .25s ease}
.home-main .intro-links a:hover .link-arrow{transform:translate(3px,-3px);stroke:#52683c}
@media(prefers-reduced-motion:reduce){.home-main .intro-links .link-arrow{transition:none}}
