/* Direct home navigation; content pages use one predictable home link. */
.back-home { display:inline-flex; justify-self:start; align-items:center; gap:6px; width:max-content; min-height:40px; padding:8px 12px; border:1px solid var(--line,#dedfe1); border-radius:999px; background:var(--control,var(--image-control,#f1f1f1)); font-size:12px; line-height:1.4; text-decoration:none; white-space:nowrap; }
.image-home { position:fixed; top:18px; left:18px; z-index:3; }

html:has(body[data-home-layout="direct"]) { height:100%; overflow:hidden; }
body[data-home-layout="direct"] { height:100dvh; overflow:hidden; --home-control:#f1f1f1; --home-control-hover:#fff; --home-news-surface:rgba(246,248,247,.94); }
html[data-theme="dark"] body[data-home-layout="direct"] { --home-control:#30343b; --home-control-hover:#3c424a; --home-news-surface:rgba(29,34,39,.95); }
body[data-home-layout="direct"] main { height:100%; }
html body[data-home-layout="direct"] .stage-frame { position:relative; height:100%; width:100%; z-index:0; clip-path:none; transform:none; }
html body[data-home-layout="direct"] .stage { height:100%; min-height:0; clip-path:none; animation:none; touch-action:auto; }
html body[data-home-layout="direct"] .stage-frame { touch-action:auto; }
body[data-home-layout="direct"] .stage-header { position:fixed; z-index:100; inset:0 40px auto; height:80px; color:var(--home-ink); }
body[data-home-layout="direct"] .stage-logo { grid-column:2; grid-row:1; }
body[data-home-layout="direct"] .stage-logo .brand-word { display:block; width:110px; height:auto; }
body[data-home-layout="direct"] .stage-tools { grid-column:3; grid-row:1; }
body[data-home-layout="direct"] .theme-toggle { width:36px; height:36px; background:var(--home-control); color:var(--home-ink); backdrop-filter:none; }
body[data-home-layout="direct"] .theme-toggle:hover { background:var(--home-control-hover); }
.home-nav { position:relative; z-index:5; display:flex; flex-direction:column; align-items:flex-start; gap:10px; justify-self:start; align-self:center; grid-column:1; grid-row:1 / 3; font-size:13px; line-height:1.5; }
.home-nav-link,.home-projects>summary { display:flex; align-items:center; justify-content:center; gap:7px; min-height:44px; padding:10px 16px; border:1px solid transparent; border-radius:999px; background:var(--home-control); color:var(--home-ink); white-space:nowrap; cursor:pointer; transition:background-color .18s ease,border-color .18s ease; }
.home-nav-link:hover,.home-projects>summary:hover,.home-projects[open]>summary { background:var(--home-control-hover); border-color:var(--home-line); }
.home-nav :focus-visible,body[data-home-layout="direct"] .theme-toggle:focus-visible { outline:2px solid #15945a; outline-offset:3px; }
.home-projects { position:relative; }
.home-projects>summary { list-style:none; }
.home-projects>summary::-webkit-details-marker { display:none; }
.home-projects>summary svg { width:14px; height:14px; stroke:currentColor; stroke-width:1.6; fill:none; transition:transform .18s ease; }
.home-projects[open]>summary svg { transform:rotate(180deg); }
.home-project-list { position:fixed; top:var(--projects-top,80px); left:var(--projects-left,20px); display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; width:min(360px,calc(100vw - 40px)); max-height:calc(100dvh - 32px); overflow-y:auto; overscroll-behavior:contain; padding:12px; border:1px solid var(--home-line); border-radius:16px; background:var(--home-surface); color:var(--home-ink); box-shadow:0 16px 46px #00000020; }
.home-projects:not([open]) .home-project-list { display:none; }
.home-project-list a { display:flex; justify-content:space-between; align-items:center; gap:12px; min-height:44px; padding:10px 12px; border-radius:8px; font-size:14px; }
.home-project-list a:hover,.home-project-list a:focus-visible { background:var(--home-control); }

body[data-home-layout="direct"] .stage-content { position:relative; z-index:1; display:grid; grid-template-columns:120px minmax(0,1fr) 250px; grid-template-rows:minmax(0,1fr) auto; gap:24px clamp(32px,4vw,64px); height:100%; min-height:0; padding:124px 112px 64px 40px; }
html body[data-home-layout="direct"] .stage:not(.has-case-preview) .stage-title-wrap { position:static; inset:auto; grid-column:2; grid-row:2; align-self:end; justify-self:center; width:max-content; max-width:100%; min-width:0; }
html body[data-home-layout="direct"] .stage:not(.has-case-preview) [data-case-title] { font-size:clamp(40px,5.5vw,88px); line-height:1.22; letter-spacing:-.055em; }
html body[data-home-layout="direct"] .stage-intro { position:static; inset:auto; grid-column:2; grid-row:1; align-self:center; justify-self:center; width:min(360px,100%); margin:0; }
html body[data-home-layout="direct"] .stage:not(.has-case-preview) .stage-intro-text { font-size:15px; line-height:1.85; color:var(--home-muted); }
html body[data-home-layout="direct"] .home-news { position:relative; grid-column:3; grid-row:1 / 3; justify-self:stretch; align-self:center; display:flex; flex-direction:column; gap:8px; width:100%; max-height:100%; min-height:0; overflow-x:hidden; overflow-y:auto; padding:4px 0; transform:none; opacity:1; visibility:visible; scrollbar-width:thin; overscroll-behavior:contain; touch-action:pan-y pinch-zoom; }
html body[data-home-layout="direct"] .home-news>.menu-label { display:block; flex:none; margin:0 0 5px; color:var(--home-muted); font:12px/1.6 'Space Grotesk','Microsoft YaHei',sans-serif; letter-spacing:.04em; }
html body[data-home-layout="direct"] .home-news article { position:relative; flex:none; display:grid; grid-template-columns:1fr; grid-template-areas:"copy" "media"; align-items:center; gap:8px; min-height:0; padding:12px; border-radius:10px; background:var(--home-news-surface); }
html body[data-home-layout="direct"] .home-news article[hidden] { display:none; }
html body[data-home-layout="direct"] .home-news .menu-news-copy { grid-area:copy; min-width:0; padding-right:20px; }
html body[data-home-layout="direct"] .home-news time { display:block; margin:0 0 5px; color:var(--home-muted); font:10px/1.3 'Space Grotesk',sans-serif; }
html body[data-home-layout="direct"] .home-news strong { display:block; color:var(--home-ink); font:12px/1.55 'Space Grotesk','Microsoft YaHei',sans-serif; }
html body[data-home-layout="direct"] .home-news .menu-news-media { grid-area:media; display:block; width:100%; height:auto; aspect-ratio:16/9; object-fit:cover; border-radius:4px; }
html body[data-home-layout="direct"] .home-news article.menu-news-compact { grid-template-columns:52px minmax(0,1fr); grid-template-areas:"media copy"; }
html body[data-home-layout="direct"] .home-news .menu-news-compact .menu-news-media { aspect-ratio:1; }
html body[data-home-layout="direct"] .home-news article>button { position:absolute; z-index:2; right:4px; top:3px; width:28px; height:28px; border:0; padding:4px; color:var(--home-muted); background:transparent; font-size:19px; line-height:20px; }
html body[data-home-layout="direct"] .home-news .menu-news-link { position:absolute; z-index:1; inset:0; border-radius:inherit; }
html body[data-home-layout="direct"] .home-news .menu-news-link:hover { outline:1px solid var(--home-line); outline-offset:-1px; }
html body[data-home-layout="direct"] .home-news button:focus-visible,html body[data-home-layout="direct"] .home-news a:focus-visible { outline:2px solid #15945a; outline-offset:-2px; }

/* News joins the controls only after the existing opening animation settles. */
html[data-home-intro]:not([data-page-transition-visit]) body[data-home-layout="direct"] :is(.home-nav,.home-news) { opacity:0; visibility:hidden; pointer-events:none; animation:intro-content-fallback .01s step-end 6.5s forwards; }
html[data-home-return="pending"] body[data-home-layout="direct"] :is(.home-nav,.home-news) { opacity:0; visibility:hidden; }
@media (min-width:768px) and (max-width:1100px) {
  body[data-home-layout="direct"] .stage-header { inset:0 24px auto; }
  body[data-home-layout="direct"] .stage-content { padding:112px 96px 40px 24px; grid-template-columns:104px minmax(0,1fr) 210px; column-gap:24px; }
  html body[data-home-layout="direct"] .stage:not(.has-case-preview) [data-case-title] { font-size:clamp(32px,4.9vw,54px); }
}
@media (max-width:767px) {
  .back-home { padding:8px 10px; }
  body[data-home-layout="direct"] .stage-header { inset:0 20px auto; height:80px; }
  body[data-home-layout="direct"] .stage-logo .brand-word { width:104px; }
  .home-nav { grid-column:1; grid-row:3; align-self:start; margin-top:32px; font-size:12px; }
  .home-nav-link,.home-projects>summary { padding:10px 13px; gap:5px; }
  .home-project-list { gap:2px; padding:10px; }
  .home-project-list a { min-height:44px; font-size:13px; padding:10px; }
  body[data-home-layout="direct"] .stage-content { grid-template-columns:96px minmax(0,1fr); grid-template-rows:auto auto minmax(0,1fr); gap:18px 16px; padding:112px 20px 16px; }
  html body[data-home-layout="direct"] .stage:not(.has-case-preview) .stage-title-wrap { grid-column:1 / -1; grid-row:1; justify-self:start; }
  html body[data-home-layout="direct"] .stage:not(.has-case-preview) [data-case-title] { font-size:clamp(32px,9.6vw,44px); line-height:1.25; }
  html body[data-home-layout="direct"] .stage-intro { grid-column:1 / -1; grid-row:2; justify-self:start; width:100%; margin:0; }
  html body[data-home-layout="direct"] .stage:not(.has-case-preview) .stage-intro-text { font-size:13px; line-height:1.75; max-width:330px; }
  html body[data-home-layout="direct"] .home-news { grid-column:2; grid-row:3; align-self:stretch; width:100%; height:100%; max-height:none; padding:2px 0 calc(76px + env(safe-area-inset-bottom,0px)); }
  html body[data-home-layout="direct"] .home-news article,html body[data-home-layout="direct"] .home-news article.menu-news-compact { grid-template-columns:52px minmax(0,1fr); grid-template-areas:"media copy"; min-height:96px; gap:10px; padding:12px 10px; }
  html body[data-home-layout="direct"] .home-news .menu-news-copy { padding-right:8px; }
  html body[data-home-layout="direct"] .home-news .menu-news-media,html body[data-home-layout="direct"] .home-news .menu-news-compact .menu-news-media { width:52px; height:52px; aspect-ratio:1; }
  html body[data-home-layout="direct"] .home-news article>button { right:0; top:0; width:24px; height:24px; font-size:16px; }
}
@media (max-width:359px) {
  body[data-home-layout="direct"] .stage-content { grid-template-columns:90px minmax(0,1fr); column-gap:12px; padding-inline:18px; }
  .home-nav-link,.home-projects>summary { padding-inline:11px; }
  html body[data-home-layout="direct"] .home-news article,html body[data-home-layout="direct"] .home-news article.menu-news-compact { grid-template-columns:40px minmax(0,1fr); gap:8px; }
  html body[data-home-layout="direct"] .home-news .menu-news-media,html body[data-home-layout="direct"] .home-news .menu-news-compact .menu-news-media { width:40px; height:48px; }
}
@media (max-height:650px) and (max-width:767px) {
  body[data-home-layout="direct"] .stage-content { padding-top:96px; row-gap:12px; }
  html body[data-home-layout="direct"] .stage:not(.has-case-preview) [data-case-title] { font-size:30px; }
}
@media (max-height:500px) and (min-width:768px) {
  body[data-home-layout="direct"] .stage-content { padding-top:96px; padding-bottom:24px; }
  html body[data-home-layout="direct"] .stage-intro { margin:0; }
}
@media (min-width:560px) and (max-width:767px) and (max-height:500px) {
  body[data-home-layout="direct"] .stage-content { grid-template-columns:96px minmax(0,1fr) 180px; grid-template-rows:minmax(0,1fr) auto; gap:16px 20px; padding:88px 76px 18px 18px; }
  .home-nav { grid-column:1; grid-row:1 / 3; align-self:center; margin:0; gap:8px; }
  html body[data-home-layout="direct"] .stage:not(.has-case-preview) .stage-title-wrap { grid-column:2; grid-row:2; }
  html body[data-home-layout="direct"] .stage:not(.has-case-preview) [data-case-title] { font-size:clamp(24px,4.6vw,34px); }
  html body[data-home-layout="direct"] .stage-intro { grid-column:2; grid-row:1; }
  html body[data-home-layout="direct"] .home-news { grid-column:3; grid-row:1 / 3; padding-bottom:4px; }
  html body[data-home-layout="direct"] .home-news article,html body[data-home-layout="direct"] .home-news article.menu-news-compact { grid-template-columns:40px minmax(0,1fr); gap:8px; }
  html body[data-home-layout="direct"] .home-news .menu-news-media,html body[data-home-layout="direct"] .home-news .menu-news-compact .menu-news-media { width:40px; height:48px; }
}
@media (prefers-reduced-motion:reduce) {
  body[data-home-layout="direct"] .stage-header { transition:none; animation:none; }
  .home-nav-link,.home-projects>summary,.home-projects>summary svg { transition:none; }
  html[data-home-intro]:not([data-page-transition-visit]) body[data-home-layout="direct"] :is(.home-nav,.home-news) { opacity:1; visibility:visible; pointer-events:auto; animation:none; }
}
