/* Layout: a brew label under moonlight. Left-aligned editorial columns on an espresso ground; the hero pairs the thesis with tonight's real moon (tap to stir), then the two games as batch-numbered labels, the house recipe, the four moon phases of how we work, and the studio label. */
:root {
  --night: #1A110C;
  --night-deep: #120B08;
  --night-raised: #271A12;
  --dusk: #33201A;
  --sea: #1D2A21;
  --line: #3D2B20;
  --moon: #F3E7D4;
  --moon-glow: #FFF6E8;
  --mist: #B7A08B;
  --brew: #E9A75C;
  --brew-deep: #B8742E;
  --brew-haze: rgba(233, 167, 92, 0.16);
  --crema: #EAC898;
  --roast: #6E4428;
  --foam: #9CC7B5;
  --on-brew: #1B1206;
  --star: rgba(243, 231, 212, 0.6);
  --shadow: rgba(0, 0, 0, 0.45);

  --font-display: "Caprasimo", "Cooper Black", Georgia, serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --text-xs: 0.6875rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.5rem, 1.25rem + 0.9vw, 1.875rem);
  --text-2xl: clamp(2.1rem, 1.5rem + 2.4vw, 3.25rem);
  --text-hero: clamp(2.9rem, 1.5rem + 4.6vw, 5rem);

  --radius: 6px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--night); }
:root {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body {
  margin: 0;
  background: var(--night);
  color: var(--moon);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 400; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brew); outline-offset: 3px; }

.wrap {
  max-width: 74rem;
  margin-inline: auto;
  padding-left: max(clamp(16px, 4vw, 40px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(16px, 4vw, 40px), env(safe-area-inset-right, 0px));
}

.eyebrow, .mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow { color: var(--brew); }

.logo { display: block; color: var(--moon); flex: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--brew);
  background: var(--brew);
  color: var(--on-brew);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--moon-glow); border-color: var(--moon-glow); }
.btn-ghost { background: transparent; color: var(--moon); border-color: var(--line); }
.btn-ghost:hover { background: transparent; border-color: var(--moon); }

/* Header */
.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
  padding-block: 1.1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-right: auto;
  text-decoration: none;
}
.brand .logo { width: 40px; height: 40px; }
.brand-name { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; }
.brand-tag { color: var(--mist); padding-top: 0.2rem; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.75rem; }
.nav a { color: var(--mist); text-decoration: none; font-size: 0.9375rem; font-weight: 500; transition: color .2s; }
.nav a:hover { color: var(--moon); }

/* Hero */
.hero {
  border-bottom: 1px solid var(--line);
  background-image:
    radial-gradient(circle 1.5px at 6% 14%, var(--star), transparent),
    radial-gradient(circle 1px at 18% 64%, var(--star), transparent),
    radial-gradient(circle 1px at 31% 8%, var(--star), transparent),
    radial-gradient(circle 1.5px at 44% 88%, var(--star), transparent),
    radial-gradient(circle 1px at 52% 30%, var(--star), transparent),
    radial-gradient(circle 1px at 63% 6%, var(--star), transparent),
    radial-gradient(circle 1.5px at 74% 92%, var(--star), transparent),
    radial-gradient(circle 1px at 86% 12%, var(--star), transparent),
    radial-gradient(circle 1px at 94% 48%, var(--star), transparent),
    radial-gradient(circle 1.5px at 97% 80%, var(--star), transparent);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem);
}
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.hero h1 {
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-size: var(--text-hero);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.hero h1 em { font-style: normal; color: var(--brew); }
.lede { margin-top: 1.5rem; max-width: 34rem; color: var(--mist); font-size: var(--text-lg); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero-note { margin-top: 1.75rem; color: var(--mist); font-size: var(--text-sm); }
.hero-note .phase-icon { width: 16px; height: 16px; margin-right: 0.5rem; vertical-align: -3px; }
.hero-note a { color: var(--brew); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--brew-deep); }
.hero-note a:hover { border-color: var(--brew); }

.moon-figure { margin: 0; width: 100%; max-width: 30rem; justify-self: center; display: flex; flex-direction: column; gap: 1rem; }
.moon-stage { width: 100%; max-width: 100%; aspect-ratio: 1; }
#moon { display: block; width: 100%; height: 100%; border-radius: 50%; cursor: pointer; touch-action: manipulation; }
.moon-cap {
  display: grid;
  gap: 0.3rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--mist);
  letter-spacing: 0.08em;
}
.moon-reading { color: var(--moon); }
.moon-hint { color: var(--brew); }

/* Section scaffolding */
.band { padding-block: clamp(4rem, 9vw, 7rem); }
.band-deep { background: var(--night-deep); border-block: 1px solid var(--line); }
.section-head { display: grid; gap: 0.9rem; max-width: 40rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head h2, .studio-copy h2 { font-family: var(--font-display); font-size: var(--text-2xl); line-height: 1.08; }
.section-sub { color: var(--mist); }

/* Games */
.games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.game {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--night-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .25s;
}
.game:hover { border-color: var(--brew-deep); }
.game-art { aspect-ratio: 2 / 1; max-width: 100%; border-bottom: 1px solid var(--line); }
.game-art svg { display: block; width: 100%; height: 100%; }
.art-tekasi { background: linear-gradient(180deg, var(--night-deep), var(--sea)); }
.art-sumigrid { background: linear-gradient(180deg, var(--night-deep), var(--dusk)); }
.game-body { flex: 1; display: flex; flex-direction: column; gap: 0.85rem; padding: 1.4rem 1.4rem 1.5rem; min-width: 0; }
.game-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; }
.batch { color: var(--mist); }
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem 0.3rem 0.4rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  letter-spacing: 0.06em;
}
.status .phase-icon { width: 14px; height: 14px; }
.status .pi-lit { fill: currentColor; }
.status-live { color: var(--brew); }
.status-soon { color: var(--foam); }
.game-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.9rem; }
.game h3 { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.15; }
.game-kind { color: var(--mist); }
.game-desc { color: var(--mist); font-size: var(--text-sm); max-width: 34rem; }
.specs { margin: auto 0 0; padding-top: 0.9rem; border-top: 1px dashed var(--line); display: grid; gap: 0.5rem; }
.specs div { display: grid; grid-template-columns: 7.75rem minmax(0, 1fr); gap: 0.75rem; align-items: baseline; }
.specs dt { color: var(--mist); letter-spacing: 0.08em; }
.specs dd { margin: 0; font-size: 0.9375rem; }
.game-foot { margin-top: 0.35rem; min-height: 1.6em; }
.game-link {
  color: var(--brew);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.game-link:hover { border-color: var(--brew); }
.game-soon { color: var(--foam); letter-spacing: 0.08em; }

/* Phase icons (shared) */
.phase-icon { display: inline-block; flex: none; }
.phase-icon svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pi-lit { fill: var(--moon); }
.pi-dark { fill: var(--night-deep); }
.pi-rim { fill: none; stroke: var(--mist); stroke-opacity: 0.55; stroke-width: 1; }

/* Recipe */
.recipe { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.ingredient { display: flex; flex-direction: column; gap: 0.6rem; padding-top: 1.25rem; border-top: 1px solid var(--line); min-width: 0; }
.measure { color: var(--brew); }
.ingredient h3 { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.15; }
.ingredient p:last-child { color: var(--mist); font-size: var(--text-sm); }

/* Process */
.phases { list-style: none; margin: 0; padding: 0; position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
.phases::before { content: ""; position: absolute; top: 22px; left: 22px; right: 0; height: 1px; background: var(--line); }
.phase { position: relative; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.phase .phase-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--night-deep); box-shadow: 0 0 0 8px var(--night-deep); }
.phase-name { margin-top: 0.75rem; color: var(--brew); }
.phase h3 { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.15; }
.phase-body { color: var(--mist); font-size: var(--text-sm); }
.phase-out { color: var(--moon); letter-spacing: 0.08em; }

/* Studio */
.studio-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(2.5rem, 6vw, 5.5rem); align-items: center; }
.studio-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; min-width: 0; }
.studio-copy p { color: var(--mist); max-width: 36rem; }
.studio-copy .big { color: var(--moon); font-size: var(--text-lg); max-width: 34rem; }
.label-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(circle at 90% 8%, var(--brew-haze), transparent 45%), var(--night-raised);
}
.label-head { display: flex; align-items: center; gap: 0.9rem; }
.label-head .logo { width: 44px; height: 44px; }
.label-head p:first-child { color: var(--brew); }
.label-name { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; }
.label-card .specs { margin: 0; }

/* Footer */
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 2.5rem;
  color: var(--mist);
  font-size: 0.875rem;
}
.footer-brand { display: inline-flex; align-items: center; gap: 0.75rem; }
.footer-brand .logo { width: 32px; height: 32px; color: var(--mist); }

/* Responsive */
@media (max-width: 960px) {
  .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 3rem; }
  .phases::before { display: none; }
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .moon-figure { max-width: 24rem; justify-self: start; }
  .studio-grid { grid-template-columns: minmax(0, 1fr); }
  .games { grid-template-columns: minmax(0, 1fr); }
  .recipe { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
}
@media (max-width: 720px) {
  .nav-wrap { order: 3; width: 100%; }
  .nav { gap: 1.4rem; }
}
@media (max-width: 600px) {
  .phases { grid-template-columns: minmax(0, 1fr); row-gap: 2.5rem; }
}
@media (max-width: 480px) {
  .brand-tag { display: none; }
  .specs div { grid-template-columns: 6.75rem minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Language menu */
.lang { position: relative; }
.lang summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--moon);
  cursor: pointer;
  list-style: none;
  transition: border-color .2s;
  user-select: none;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { border-color: var(--brew); }
.lang summary .mono { letter-spacing: 0.1em; }
.lang-globe, .lang-chev { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lang-globe { color: var(--mist); }
.lang-chev { width: 13px; height: 13px; stroke-width: 2.4; color: var(--mist); transition: transform .2s; }
.lang[open] .lang-chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 20;
  min-width: 13rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--night-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px var(--shadow);
}
.lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  color: var(--moon);
  font-size: 0.9375rem;
  text-decoration: none;
}
.lang-menu a:hover { background: var(--night); }
.lang-menu a[aria-current="true"] { color: var(--brew); }
.lang-tag { color: var(--mist); letter-spacing: 0.1em; }
.lang-menu a[aria-current="true"] .lang-tag { color: var(--brew); }

/* Japanese and Korean: Latin text keeps the brand fonts, CJK characters fall back to
   fonts that have them (loaded only on those pages). Lines break at words/phrases. */
:root:lang(ja) {
  --font-display: "Caprasimo", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  --font-body: "Figtree", "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-mono: "Martian Mono", "Zen Kaku Gothic New", "Hiragino Sans", monospace;
}
:root:lang(ko) {
  --font-display: "Caprasimo", "Jua", "Apple SD Gothic Neo", sans-serif;
  --font-body: "Figtree", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-mono: "Martian Mono", "Noto Sans KR", "Apple SD Gothic Neo", monospace;
}
:lang(ja) { word-break: auto-phrase; line-break: strict; }
:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
:lang(ja) .hero h1, :lang(ko) .hero h1 { line-height: 1.22; }
/* Japanese headline: break at the comma, and size it so each half fits on one line. */
:lang(ja) .hero h1 { font-size: clamp(2.2rem, 1.2rem + 4vw, 4.2rem); }
:lang(ja) .hero h1 em { display: block; }
:lang(ja) h2, :lang(ja) h3, :lang(ko) h2, :lang(ko) h3 { line-height: 1.3; }
:lang(ja) .mono, :lang(ja) .eyebrow, :lang(ko) .mono, :lang(ko) .eyebrow { letter-spacing: 0.04em; }

/* German and French: allow hyphenation in headings so long words fit on phones. */
:lang(de) h1, :lang(de) h2, :lang(de) h3, :lang(fr) h1, :lang(fr) h2, :lang(fr) h3 { hyphens: auto; }
