/* 気配の三層 Preview 0.4 / home-only. Load AFTER existing style.css. */
/* The published Koyomi record uses --film: source 14% blended with the paper.
   Reuse that exact seasonal concentration for automatically changing surfaces. */
:root[data-kcd-atmo-state="ready"] body:has(.hero#top){
  --kcd-atmo-paper:#fbfcfa;
  --kcd-atmo-film:color-mix(in srgb,var(--kcd-air-source) 14%,var(--kcd-atmo-paper));
  --kcd-atmo-ink:color-mix(in srgb,var(--kcd-air-shadow) 3.5%,#17191a);
  --paper:var(--kcd-atmo-paper);
  --ink:var(--kcd-atmo-ink);
  --film:var(--kcd-atmo-film);
  --mark:color-mix(in srgb,var(--kcd-air-shadow) 24%,#757b77);
  --line:color-mix(in srgb,var(--kcd-air-water) 8%,#dae0db);
}
:root[data-kcd-atmo-state="ready"] body:has(.hero#top) .hero{
  background:
    radial-gradient(ellipse 45% 38% at 82% 19%,color-mix(in srgb,var(--kcd-air-sky) 4.2%,transparent),transparent 100%),
    radial-gradient(ellipse 36% 43% at 96% 55%,color-mix(in srgb,var(--kcd-air-water) 3.5%,transparent),transparent 100%),
    radial-gradient(ellipse 32% 30% at 68% 11%,color-mix(in srgb,var(--kcd-air-light) 5.6%,transparent),transparent 100%),
    linear-gradient(145deg,var(--kcd-atmo-paper),var(--kcd-atmo-film));
}
/* Seasonal time band and contact retain the same 14% source density as the record panel. */
:root[data-kcd-atmo-state="ready"] body:has(.hero#top) .time-band{
  background:
    radial-gradient(circle at 30% 30%,color-mix(in srgb,var(--kcd-air-sky) 5%,transparent),transparent 38%),
    radial-gradient(circle at 70% 65%,color-mix(in srgb,var(--kcd-air-water) 4%,transparent),transparent 48%),
    var(--kcd-atmo-film);
}
:root[data-kcd-atmo-state="ready"] body:has(.hero#top) .hero::before{display:none}
/* The nine registered swatches remain fully opaque; the atmospheric layers alone are blended. */
:root[data-kcd-atmo-state="ready"] body:has(.hero#top) .koyomi-badge .koyomi-mini-palette{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:3px;width:210px;max-width:100%;margin-top:10px;justify-self:end}
:root[data-kcd-atmo-state="ready"] body:has(.hero#top) .koyomi-badge .koyomi-mini-swatch{height:13px;border:1px solid rgba(17,17,17,.10)}
@media(max-width:560px){
  :root[data-kcd-atmo-state="ready"] body:has(.hero#top) .koyomi-badge{
    display:grid;left:var(--side);right:var(--side);bottom:22px;grid-template-columns:1fr;
    justify-items:start;gap:5px;text-align:left;font-size:10px;line-height:1.55;
  }
  :root[data-kcd-atmo-state="ready"] body:has(.hero#top) .koyomi-badge [data-koyomi-id],
  :root[data-kcd-atmo-state="ready"] body:has(.hero#top) .koyomi-badge [data-koyomi-period]{display:none}
  :root[data-kcd-atmo-state="ready"] body:has(.hero#top) .koyomi-badge .koyomi-mini-palette{
    grid-column:1;width:min(234px,100%);justify-self:start;margin-top:6px;
  }
}
:root[data-kcd-atmo-state="neutral"] body:has(.hero#top){--paper:#fbfcfa;--ink:#17191a;--film:#fbfcfa;--line:#dbe0dd;--mark:#777b79}
:root[data-kcd-atmo-state="neutral"] body:has(.hero#top) .hero,:root[data-kcd-atmo-state="neutral"] body:has(.hero#top) .time-band,:root[data-kcd-atmo-state="neutral"] body:has(.hero#top) .contact{background:#fbfcfa}
:root[data-kcd-atmo-state="neutral"] body:has(.hero#top) .hero::before,:root[data-kcd-atmo-state="neutral"] body:has(.hero#top) [data-koyomi-mini-palette]{display:none}

/* Keep the original two headline lines, but never crop their glyphs on narrow phones. */
@media(max-width:560px){
  :root[data-kcd-atmo-state="ready"] body:has(.hero#top) .hero h1{
    font-size:clamp(35px,9.8vw,42px);letter-spacing:.04em;line-height:1.42
  }
  :root[data-kcd-atmo-state="ready"] body:has(.hero#top) .hero-note{max-width:100%;font-size:13px;line-height:1.85}
  :root[data-kcd-atmo-state="ready"] body:has(.hero#top) .hero-note-line{
    display:block;white-space:normal;overflow-wrap:break-word
  }
}

/* The live palette takes its own row. Browser bars and larger text must never
   push it into the reading copy or the scroll invitation. */
@media(max-width:900px){
  body:has(.hero#top) .hero{
    align-content:center;row-gap:36px;padding-bottom:32px;
  }
  body:has(.hero#top) .hero-inner{order:0;gap:48px}
  :root[data-kcd-atmo-state="ready"] body:has(.hero#top) .koyomi-badge{
    position:static;inset:auto;order:1;justify-self:start;
    display:grid;grid-template-columns:1fr;justify-items:start;
    gap:5px;text-align:left;max-width:100%;margin-top:8px;
  }
  :root[data-kcd-atmo-state="ready"] body:has(.hero#top) .koyomi-badge .koyomi-mini-palette{
    grid-column:1;width:min(234px,100%);justify-self:start;
  }
  body:has(.hero#top) .scroll-mark{
    position:static;inset:auto;order:2;justify-self:start;margin:0;
  }
}
