@font-face {
  font-family: 'Studio Song';
  src: url('./studio-song.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Studio Song JP';
  src: url('./studio-song-jp.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:lang(ja) .header-inner nav { gap: clamp(.35rem, 3.3vw, 3.5rem); }

:root {
  color-scheme: dark;
  --page: #18151b;
  --surface: #201b23;
  --ink: #f4eadd;
  --muted: #c2b7b5;
  --gold: #e4bd83;
  --line: rgb(237 213 189 / 18%);
  --display: 'Studio Song', 'Noto Serif SC', 'Songti SC', SimSun, Georgia, serif;
  --body: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans', Meiryo, sans-serif;
  --wrap: min(100% - 8.8vw, 1264px);
  background: var(--page);
  color: var(--ink);
  font: 16px/1.65 var(--body);
}

:lang(en) { --display: Georgia, 'Times New Roman', serif; }
:lang(ja) { --display: 'Studio Song JP', 'Noto Serif JP', 'Yu Mincho', 'Hiragino Mincho ProN', serif; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
button, summary { cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
section[id] { scroll-margin-top: 94px; }
.container { width: var(--wrap); margin-inline: auto; }
.skip { position: fixed; z-index: 12; padding: .7rem 1rem; top: .5rem; left: .5rem; background: var(--surface); transform: translateY(-160%); }
.skip:focus { transform: translateY(0); }

.site-header { position: sticky; z-index: 8; top: 0; background: #1b171d; border-bottom: 1px solid var(--line); }
.header-inner { height: 73px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2rem; }
.brand { min-height: 44px; display: flex; align-items: center; justify-self: start; }
.brand img { width: 133px; height: auto; }
.header-inner nav { display: flex; align-items: center; gap: clamp(1rem, 4.2vw, 4.4rem); font-size: .91rem; }
.header-inner nav a { display: grid; place-items: center; min-height: 44px; white-space: nowrap; color: var(--muted); }
.header-inner nav a:hover, .site-footer a:hover { color: var(--gold); }
.language { justify-self: end; position: relative; }
.language summary { display: flex; align-items: center; justify-content: center; gap: .7rem; list-style: none; min-width: 79px; min-height: 44px; border: 1px solid var(--line); padding-inline: .75rem; font-size: .85rem; }
.language summary::-webkit-details-marker { display: none; }
.language summary::after { content: ''; width: 6px; height: 6px; border: solid var(--gold); border-width: 0 1px 1px 0; transform: translateY(-2px) rotate(45deg); }
.language[open] summary, .language summary:hover { border-color: var(--gold); }
.language-list { position: absolute; inset: calc(100% + 6px) 0 auto auto; min-width: 134px; padding: .25rem; background: #27202a; border: 1px solid var(--line); box-shadow: 0 12px 30px #110b15a6; }
.language-list a { display: flex; align-items: center; min-height: 44px; padding: .3rem .65rem; white-space: nowrap; font-size: .9rem; }
.language-list a:hover, .language-list a[aria-current] { color: var(--gold); background: #342936; }

.hero { position: relative; isolation: isolate; min-height: clamp(620px, 74vh, 756px); display: flex; overflow: hidden; background: #211924; }
.hero::before, .hero::after, .studio::before { content: ''; position: absolute; inset: 0; pointer-events: none; }
.hero::before { z-index: -2; background: linear-gradient(90deg, #1d1721 0%, #1d1721fa 14%, #1d1721e8 27%, #1c1620a0 44%, #24172226 67%, #21182213 100%), linear-gradient(0deg, #211923 0%, #211923e0 8%, #21192325 39%, transparent 75%, #241a264f); }
.hero::after, .studio::before { z-index: -1; opacity: .048; background: url('./grain.webp'); mix-blend-mode: soft-light; }
.scene-stack { z-index: -3; position: absolute; inset: 0 0 0 14%; overflow: hidden; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 50%; opacity: 0; transition: opacity .6s ease; filter: saturate(.89); }
.scene.is-active { opacity: 1; }
.scene[data-image='belles'] { object-position: 54% 50%; }
.hero-particles { z-index: -1; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-frame { position: absolute; inset: 23px 23px 20px; z-index: -1; border: 1px solid rgb(253 213 174 / 16%); pointer-events: none; }
.hero-frame::before, .hero-frame::after { content: ''; position: absolute; width: 12px; height: 12px; border: solid #edc18ca1; }
.hero-frame::before { inset: -1px auto auto -1px; border-width: 1px 0 0 1px; }
.hero-frame::after { inset: auto -1px -1px auto; border-width: 0 1px 1px 0; }
.hero-layout { display: grid; grid-template-rows: 1fr auto; position: relative; }
.hero-copy { align-self: center; padding-block: 2.9rem 1rem; }
.eyebrow { display: flex; align-items: center; gap: .8rem; margin-bottom: clamp(1.3rem, 4vh, 2.1rem); color: var(--gold); font-size: .83rem; letter-spacing: .15em; }
.eyebrow span { width: 23px; height: 1px; background: currentColor; }
.hero h1 { max-width: 11ch; font: 700 clamp(3.9rem, 6.45vw, 6.35rem)/1.07 var(--display); letter-spacing: -.067em; text-shadow: 0 4px 32px #1e1227a6; }
.hero h1 em { display: block; color: var(--gold); font-style: normal; }
html[lang='en'] .hero h1 { max-width: none; font-size: clamp(3.8rem, 6.3vw, 6.55rem); line-height: .99; }
html[lang='ja'] .hero h1 { max-width: none; font-size: clamp(3.4rem, 5.3vw, 5.5rem); letter-spacing: -.09em; }
.hero-intro { max-width: 33ch; margin: 1.55rem 0 1.8rem; font-size: 1.05rem; color: #e4d8d9; line-height: 1.8; }
html[lang='en'] .hero-intro { max-width: 40ch; }
.hero-actions, .game-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .64rem; min-height: 47px; padding: .59rem 1.13rem; border: 1px solid transparent; background: transparent; font-size: .94rem; font-weight: 600; white-space: nowrap; transition: background-color .18s ease, border-color .18s ease, color .18s ease; }
.button--accent { background: var(--gold); color: #281d21; }
.button--accent:hover { background: #f3d0a0; }
.button--hero { border-color: #edcdbb5e; background: #201923b8; }
.button--hero:hover, .button--outline:hover { border-color: var(--gold); color: var(--gold); }
.button--outline { border-color: var(--line); }
.button--text { padding-inline: .73rem; color: var(--muted); }
.button--text:hover { color: var(--gold); }
.play-icon { width: 0; height: 0; border: solid transparent; border-width: 5px 0 5px 8px; border-left-color: currentColor; }

.scene-footer { justify-self: end; display: grid; justify-items: end; gap: .35rem; padding: 0 0 2.15rem; text-align: right; }
.scene-caption { color: #f1ddd0; font-size: .78rem; letter-spacing: .14em; }
.scene-control { max-width: 100%; display: flex; background: #211a26de; border: 1px solid var(--line); }
.scene-control button { display: flex; align-items: center; gap: .65rem; padding: .52rem .92rem; min-height: 44px; background: transparent; color: var(--muted); border: 0; font-size: .84rem; text-align: start; }
.scene-control button + button { border-left: 1px solid var(--line); }
.scene-control button span, .game-status span { display: inline-block; flex: 0 0 5px; width: 5px; height: 5px; transform: rotate(45deg); border: 1px solid currentColor; }
.scene-control button:hover, .scene-control button[aria-pressed='true'] { color: var(--gold); }
.scene-control button[aria-pressed='true'] span { background: currentColor; }

.work { padding-block: clamp(3.2rem, 7vw, 6.6rem) clamp(4rem, 9vw, 8rem); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: .8rem 2rem; border-bottom: 1px solid var(--line); padding-bottom: 1.24rem; margin-bottom: 1.8rem; }
.section-heading h2, .studio h2, .contact h2 { font: 700 clamp(2.15rem, 4.2vw, 4.05rem)/1.16 var(--display); letter-spacing: -.045em; }
.section-heading p { color: var(--muted); }
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 4.5rem); }
.game-card { min-width: 0; display: grid; grid-template-rows: auto 1fr; }
.game-art { position: relative; overflow: hidden; border: 1px solid var(--line); background: #272129; }
.game-art img { width: 100%; height: auto; aspect-ratio: 1.95; object-fit: cover; }
.game-card--blade .game-art img { object-position: center 52%; }
.game-card--belles .game-art img { object-position: center 40%; }
.game-status { position: absolute; inset: .95rem auto auto .95rem; display: inline-flex; align-items: center; gap: .6rem; padding: .33rem .65rem; border: 1px solid #edd3bf68; background: #241c28f0; color: var(--gold); font-size: .78rem; }
.game-status span { background: currentColor; }
.game-info { border-bottom: 1px solid var(--line); padding: 1.45rem 0 1.65rem; display: flex; flex-direction: column; align-items: start; }
.genre { color: var(--gold); font-size: .84rem; letter-spacing: .045em; }
.game-info h3 { margin-top: .35rem; font: 700 clamp(1.55rem, 2.6vw, 2.7rem)/1.24 var(--display); letter-spacing: -.055em; }
.alternate { color: var(--muted); margin-top: .29rem; font-size: .875rem; }
.summary { color: var(--muted); line-height: 1.85; max-width: 49ch; margin: .85rem 0 1.2rem; }
.game-actions { margin-top: auto; }

.studio { isolation: isolate; position: relative; border-block: 1px solid var(--line); background: #211b24; }
.studio-inner { padding-block: clamp(3rem, 7vw, 6.6rem); display: grid; align-items: center; grid-template-columns: 1.32fr .85fr; gap: clamp(2rem, 8vw, 8.5rem); }
.studio-copy p { color: var(--muted); max-width: 55ch; margin-top: 1.2rem; line-height: 1.95; }
.studio-facts { border-top: 1px solid var(--line); }
.studio-facts div { display: grid; grid-template-columns: minmax(6.5rem, .9fr) 1.35fr; gap: .8rem; padding: 1rem .1rem; border-bottom: 1px solid var(--line); }
.studio-facts dt { color: var(--gold); }
.contact { display: flex; justify-content: space-between; align-items: start; gap: 2rem; padding-block: clamp(3rem, 8vw, 6.6rem); }
.contact-options { display: flex; align-items: start; gap: clamp(1.35rem, 4vw, 3.5rem); }
.contact-options p { line-height: 1.65; color: var(--muted); }
.contact-address { color: var(--ink); }
.contact-status { color: var(--muted); font-size: .8rem; margin-inline-start: .65rem; white-space: nowrap; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 1.65rem; align-items: center; min-height: 110px; padding-block: 1rem; }
.footer-inner img { width: 110px; height: auto; }
.footer-inner p, .footer-inner a { color: var(--muted); font-size: .87rem; }
.footer-inner a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }

.game-dialog { position: fixed; width: min(940px, 100% - 2rem); max-height: min(88dvh, 1100px); max-width: none; padding: 0; color: var(--ink); background: #251e29; border: 1px solid var(--line); overscroll-behavior: contain; }
.game-dialog::backdrop { background: #100c13de; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-content { padding: clamp(1rem, 3.4vw, 2.6rem); }
.dialog-header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.dialog-header h2 { margin-top: .35rem; font: 700 clamp(1.55rem, 3.4vw, 2.7rem)/1.17 var(--display); }
.close-dialog { flex: 0 0 44px; height: 44px; padding: 0; background: #302633; border: 1px solid var(--line); font-size: 1.65rem; line-height: 1; }
.close-dialog:hover, .gallery-step:hover { color: var(--gold); border-color: var(--gold); }
.media-controls { display: flex; margin-top: 1.2rem; margin-bottom: .8rem; gap: 1.2rem; border-bottom: 1px solid var(--line); }
.media-controls button { min-height: 44px; padding: .35rem .25rem; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); }
.media-controls button[aria-pressed='true'] { color: var(--gold); border-bottom-color: var(--gold); }
.gallery-image, .game-dialog video { display: block; width: 100%; height: auto; max-height: 58dvh; aspect-ratio: 16/9; object-fit: contain; background: #17131c; }
.gallery-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .45rem; }
.gallery-caption { color: var(--muted); font-size: .9rem; }
.gallery-nav, .gallery-dots { display: flex; align-items: center; }
.gallery-step, .gallery-dots button { position: relative; width: 44px; height: 44px; border: 1px solid transparent; background: transparent; color: var(--muted); }
.gallery-step::after { content: ''; position: absolute; width: 8px; height: 8px; left: 17px; top: 16px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(-45deg); }
.gallery-prev::after { left: 18px; transform: rotate(135deg); }
.gallery-dots button { width: 34px; }
.gallery-dots button::after { content: ''; position: absolute; inset: 17px auto auto 12px; width: 8px; height: 8px; border: 1px solid currentColor; border-radius: 50%; }
.gallery-dots button:hover, .gallery-dots button[aria-pressed='true'] { color: var(--gold); }
.gallery-dots button[aria-pressed='true']::after { background: var(--gold); }
.game-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; border-top: 1px solid var(--line); margin-top: 1.1rem; padding-top: 1.15rem; }
.game-features dt { color: var(--ink); font-weight: 700; }
.game-features dd, .video-error { margin-top: .4rem; color: var(--muted); }

@media (max-width: 900px) {
  :root { --wrap: calc(100% - 9vw); }
  .hero { min-height: 615px; }
  .hero-frame { inset-inline: 12px; }
  .scene-stack { left: 3%; }
  .contact-options { flex-wrap: wrap; }
}

@media (max-width: 650px) {
  :root { --wrap: calc(100% - 2.25rem); }
  .header-inner { height: 58px; gap: .5rem; }
  .brand img { width: 89px; }
  .header-inner nav { gap: clamp(.45rem, 2.1vw, 1.2rem); font-size: .83rem; }
  :lang(ja) .header-inner nav { gap: .42rem; font-size: .77rem; }
  .language summary { min-width: 54px; padding-inline: .48rem; gap: .42rem; font-size: .79rem; }
  .hero { min-height: 610px; }
  .scene-stack { inset: 0 0 14%; }
  .scene { object-position: 57% 48%; }
  .hero::before { background: linear-gradient(90deg, #201923d7, #20192332 80%), linear-gradient(0deg, #211923 1%, #211923 13%, #211923ea 31%, #21192369 63%, #2119232b); }
  .hero-frame { inset: 9px 8px; }
  .hero-copy { padding-top: 8.8rem; }
  .eyebrow { font-size: .75rem; letter-spacing: .09em; margin-bottom: .95rem; }
  .hero h1 { font-size: clamp(3.35rem, 10.6vw, 4.15rem); }
  html[lang='en'] .hero h1 { font-size: clamp(2.7rem, 9vw, 4.05rem); }
  html[lang='ja'] .hero h1 { font-size: clamp(2.5rem, 8.7vw, 3.8rem); }
  .hero-intro { margin: 1rem 0 1.3rem; font-size: 1rem; }
  .scene-footer { justify-self: stretch; justify-items: start; padding: 1.2rem 0 1.25rem; text-align: left; }
  .scene-control { width: fit-content; }
  .scene-control button { font-size: .8rem; padding: .46rem .63rem; }
  .section-heading { flex-direction: column; align-items: start; }
  .work-grid { grid-template-columns: minmax(0, 1fr); gap: 2.15rem; }
  .game-info { padding-top: 1rem; }
  .game-info h3 { font-size: clamp(1.6rem, 5.6vw, 2.35rem); }
  .studio-inner { grid-template-columns: minmax(0, 1fr); }
  .contact { flex-direction: column; gap: 1rem; }
  .contact-options { gap: 1rem; }
  .footer-inner { grid-template-columns: 1fr auto; gap: .3rem 1rem; }
  .footer-inner img { grid-column: 1; grid-row: 1; }
  .footer-inner p { grid-column: 1 / -1; grid-row: 2; overflow-wrap: anywhere; }
  .footer-inner a { grid-column: 2; grid-row: 1; }
  .game-features { grid-template-columns: minmax(0, 1fr); }
  .gallery-dots button { width: 32px; }
}

@media (max-width: 355px) {
  .header-inner { width: calc(100% - 1.1rem); }
  .brand img { width: 73px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .hero-particles { visibility: hidden; }
}
