/* STELLAR STRAYS — one committed dark world: night sky over a scrapyard, coverall orange as the only colour.
   Layout: narrow column, logo small, art carries the page. */
:root {
  color-scheme: dark;
  --bg: #121110;        /* warm near-black, slightly brown like old iron */
  --panel: #1b1916;
  --line: #2e2a24;
  --ink: #ece8df;       /* logo cream */
  --muted: #a39d91;
  --accent: #ee8a2a;    /* SERO coverall orange */
  --display: "Chakra Petch", "Zen Kaku Gothic New", system-ui, sans-serif;
  --body: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --max: 68rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.8 var(--body); }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.narrow { max-width: 40rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* language */
[data-l] { display: none; }
html[lang="en"] [data-l="en"], html[lang="ja"] [data-l="ja"] { display: revert; }
html:not([lang="en"]):not([lang="ja"]) [data-l="en"] { display: revert; }

/* logos drawn from SVG masks so they take the cream ink */
.mark { display: block; background: var(--ink); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.mark.ss { --m: url(img/ss-logo.svg); aspect-ratio: 4976 / 1590; width: 9rem; }
.mark.ss.big { width: 26rem; max-width: 100%; }
.mark.be-logo { --m: url(img/be-logo.png); aspect-ratio: 631 / 1000; width: 100%; }
.mark.sero { --m: url(img/sero-logo.svg); aspect-ratio: 5352 / 2665; width: 20rem; max-width: 100%; }

/* header */
.top { border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; flex-wrap: wrap; }
.brand { display: block; font: 600 .95rem/1 var(--display); letter-spacing: .24em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand:hover { color: var(--accent); }
.brand .tm { font-size: .55em; letter-spacing: 0; vertical-align: .7em; margin-left: .15em; }
.nav { display: flex; align-items: center; gap: 1.25rem; font: 600 .8rem/1 var(--display); letter-spacing: .12em; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button { font: inherit; letter-spacing: .06em; background: none; color: var(--muted); border: 0; padding: .45rem .7rem; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* shared text */
.label { font: 600 .78rem/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin: 0 0 1.25rem; }
.motto { font-family: var(--display); font-weight: 500; letter-spacing: .04em; color: var(--muted); margin: 0; }
html[lang="ja"] .motto { font-family: var(--body); letter-spacing: .12em; }
.lead { font-size: 1.05rem; margin-top: 1.5rem; }
.pill { display: inline-block; font: 600 .78rem/1 var(--display); letter-spacing: .1em; padding: .55rem .9rem; border: 1px solid var(--accent); color: var(--accent); border-radius: 2px; }
html[lang="ja"] .pill { font-family: var(--body); letter-spacing: .06em; }
section { padding-block: clamp(3rem, 8vw, 5.5rem); }
section + section { border-top: 1px solid var(--line); }

/* home: series portal. Logo without subtitle on top, one card per work below. */
/* cosmos: the first screen. The galaxy keeps moving behind the logo, then tours the stars. */
.cosmos { position: relative; padding: 0; border: 0; }
.cosmos + section { border-top: 0; }
.cosmos-stage { position: relative; height: 100vh; height: 100svh; min-height: 32rem; overflow: hidden; background: #000; }
/* 最初にロゴ、そのあと銀河 */
.cosmos-stage::before { content: ""; position: absolute; inset: 0; background: url(img/galaxy.jpg) center 45% / cover no-repeat; animation: ss-in 1.6s ease 1.1s both; }
.cosmos-stage.live::before { display: none; }
.cosmos-gl { animation: ss-in 1.6s ease 1.1s both; }
.lead-cap { animation: ss-in 1.1s ease .15s both; }
@keyframes ss-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cosmos-stage::before, .cosmos-gl, .lead-cap { animation: none; } }
.cosmos-gl, .cosmos-ov { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cosmos-ov { pointer-events: none; }
.cosmos-stage::after { content: ""; position: absolute; inset: auto 0 0; height: 16vh; background: linear-gradient(transparent, var(--bg)); pointer-events: none; z-index: 1; }
.lead-cap { position: absolute; inset: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 40rem); place-content: center; justify-items: center; text-align: center; gap: 1.5rem; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); text-shadow: 0 0 14px #000; pointer-events: none; }
.lead-cap .mark.ss.big { width: 40rem; max-width: 100%; filter: drop-shadow(0 0 18px rgba(0,0,0,.6)); }
.cosmos-cap { position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); bottom: 7vh; max-width: min(30rem, calc(100% - 32px)); z-index: 3; opacity: 0; transform: translateY(8px); transition: opacity .9s ease, transform .9s ease; text-shadow: 0 0 12px #000, 0 0 3px #000; pointer-events: none; }
.cosmos-cap.on { opacity: 1; transform: none; pointer-events: auto; }
.cosmos-cap h2 { margin: 0 0 .3rem; font: 600 .95rem/1.2 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
html[lang="ja"] .cosmos-cap h2 { font-family: var(--body); font-weight: 700; letter-spacing: .14em; }
.cosmos-cap p { margin: 0; font-size: .85rem; color: #c9c4b8; }
.cosmos-cap.world h2 { color: var(--accent); font-size: 1.6rem; letter-spacing: .06em; text-transform: none; }
.cosmos-cap.world .go { margin-left: .5rem; text-decoration: none; }
@media (min-width: 1100px) { .cosmos-cap { left: calc((100% - var(--max)) / 2 + 16px); } }
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1.5rem; }
.work { display: grid; gap: 1.25rem; align-content: start; text-decoration: none; padding: clamp(1.25rem, 3vw, 1.75rem); background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.work:hover { border-color: var(--accent); }
.work-art { background: var(--bg); padding: clamp(2rem, 6vw, 3rem) 1.5rem; display: grid; place-items: center; }
.work-art .mark.sero { width: 100%; max-width: 18rem; }
.work:hover .work-art .mark { background: var(--accent); }
.work-body { display: grid; gap: .9rem; justify-items: start; min-width: 0; }
.work-body .mark.sero { width: 14rem; }
.work-body p { margin: 0; }
.go { font: 600 .85rem/1 var(--display); letter-spacing: .08em; color: var(--accent); }
html[lang="ja"] .go { font-family: var(--body); }

/* SERO hero: logo large on top, crew small below */
.hero-stack { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 1.5rem; }
.hero h1 { margin: 0; width: 100%; }
.hero .mark.be-logo { --m: url(img/be-logo.png); aspect-ratio: 631 / 1000; width: 100%; }
.hero .mark.sero { width: 38rem; margin-inline: auto; }
.lede { font-size: 1.15rem; line-height: 1.7; margin: 0; text-wrap: balance; }
.status { margin: 0; }
.crew { margin: 0 0 .5rem; width: 100%; max-width: 24rem; }

/* story */
.story p { margin: 0 0 1rem; font-size: 1.05rem; }
.story .motto { margin-bottom: 1.5rem; }

/* play */
.feats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.feats li { background: var(--bg); padding: 1.5rem; min-width: 0; }
.feats h3 { margin: 0 0 .5rem; font: 600 1.05rem/1.3 var(--display); letter-spacing: .03em; }
html[lang="ja"] .feats h3 { font-family: var(--body); font-weight: 700; }
.feats p { margin: 0; color: var(--muted); }

/* video + screenshots: Playdate screen is 400x240 (5:3), 1-bit, shown pixel-sharp */
.media { display: grid; gap: 1px; margin: 0 auto 2.5rem; max-width: 46rem; }
.screen { display: block; width: 100%; aspect-ratio: 5 / 3; height: auto; background: var(--panel); image-rendering: pixelated; }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 1px; }
.slot { display: grid; place-items: center; border: 1px dashed var(--line); color: var(--muted); font: 600 .72rem/1 var(--display); letter-spacing: .18em; text-transform: uppercase; }

/* workshop + engine */
.shop-row { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 3rem; align-items: center; }
.be { display: block; width: 100%; max-width: 12rem; justify-self: center; }
.be:hover .mark { background: var(--accent); }
.engine p { margin: 0 0 1rem; }
.more { color: var(--accent); text-decoration: none; font-weight: 500; }
.more:hover { text-decoration: underline; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem; margin: 1.75rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.facts dt { font: 600 .78rem/1.9 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
html[lang="ja"] .facts dt { font-family: var(--body); letter-spacing: .06em; }
.facts dd { margin: 0; }

/* footer */
footer { border-top: 1px solid var(--line); }
.foot { padding-block: 2.5rem 3rem; display: grid; gap: .9rem; font-size: .85rem; color: var(--muted); }
.foot p { margin: 0; }
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.links a { text-decoration: none; }
.links a:hover { color: var(--ink); }
.makers { display: flex; align-items: center; gap: 1.75rem; margin-top: .75rem; }
.makers a { display: block; }
.makers .mark { background: var(--muted); }
.makers a:hover .mark { background: var(--ink); }
.mark.bt { --m: url(img/bt-logo.png); aspect-ratio: 676 / 1000; width: 3.4rem; }
.mark.a440 { --m: url(img/a440-logo.png); aspect-ratio: 800 / 795; width: 3.2rem; }
.copy { color: var(--ink); }
.note { font-size: .78rem; }

@media (max-width: 760px) {
  .shop-row { grid-template-columns: minmax(0, 1fr); }
  .feats { grid-template-columns: minmax(0, 1fr); }
  .shop-row .be { max-width: 9rem; justify-self: start; }
  .nav { gap: .9rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* home: the header floats over the moving galaxy so the first screen is exactly one screen */
.top:has(+ main .cosmos) { position: absolute; top: 0; left: 0; right: 0; z-index: 10; border-bottom: 0; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.cosmos-stage:not(.live) .cosmos-gl, .cosmos-stage:not(.live) .cosmos-ov { display: none; }
