/* =====================================================================
   hagu.dev — ドット絵RPG風スタイル
   昼／夜の配色は :root[data-theme] で切り替える（theme.js が設定）
   ===================================================================== */

:root,
:root[data-theme="day"] {
  --page-bg: #a5d8ff;
  --sky: #4dabf7;
  --sky-text: #0b2a5c;
  --heading: #0b2a5c;
  --heading-mark: #c92a2a;
  --hill-far: #2f9e44;
  --hill-mid: #37b24d;
  --ground: #40c057;
  --ground-top: #8ce99a;
  --path: #e6c088;
  --castle-window: #343a40;
}

:root[data-theme="night"] {
  --page-bg: #0b0f2e;
  --sky: #0b0f2e;
  --sky-text: #dbe4ff;
  --heading: #f8f9fa;
  --heading-mark: #f8d030;
  --hill-far: #1e3a2b;
  --hill-mid: #245236;
  --ground: #2f6b3f;
  --ground-top: #51cf66;
  --path: #c9a06a;
  --castle-window: #ffd43b;
}

:root {
  --ink: #f8f9fa;
  --ink-sub: #dee2e6;
  --label: #a5d8ff;
  --gold: #f8d030;
  --window-bg: #000;
  --hover-bg: #1b2257;
  --font-body: "DotGothic16", sans-serif;
  --font-logo: "Press Start 2P", monospace;
  color-scheme: light dark;
}

/* ---------------------------------------------------------------- ベース */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.8;
}

a {
  color: var(--gold);
}

a:hover {
  color: #ffe98a;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.pixel {
  image-rendering: pixelated;
  shape-rendering: crispEdges;
}

.blink {
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blink {
    animation: none;
  }
}

/* ---------------------------------------------------------------- ウィンドウとコマンド */

.win {
  background: var(--window-bg);
  border: 4px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 0 0 4px #000;
  color: var(--ink);
}

.win--dashed {
  border-style: dashed;
}

.cmd {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.cmd--boxed {
  border: 2px solid var(--ink);
}

.cmd:hover,
.cmd:focus-visible {
  background: var(--hover-bg);
  color: var(--gold);
  outline: none;
}

.cmd__cursor {
  visibility: hidden;
  color: var(--gold);
}

.cmd:hover .cmd__cursor,
.cmd:focus-visible .cmd__cursor,
.cmd--active .cmd__cursor {
  visibility: visible;
}

.badge {
  padding: 6px 8px;
  border-radius: 4px;
  font-family: var(--font-logo);
  font-size: 10px;
  line-height: 1.4;
}

.badge--online {
  background: #69db7c;
  color: #000;
}

.badge--building {
  background: var(--gold);
  color: #000;
}

.badge--soon {
  background: #495057;
  color: var(--ink);
}

/* ---------------------------------------------------------------- ヘッダー・フッター */

.site-header {
  background: #000;
  border-bottom: 4px solid var(--ink);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.site-header__menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.logo {
  color: var(--gold);
  font-family: var(--font-logo);
  font-size: 20px;
  letter-spacing: 2px;
  text-decoration: none;
}

.site-footer {
  background: #000;
  border-top: 4px solid var(--ink);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding-top: 20px;
  padding-bottom: 20px;
  color: #ced4da;
  font-size: 14px;
}

.stage-label {
  color: #ff8787;
}

/* ---------------------------------------------------------------- タイトル画面 */

.hero {
  position: relative;
  height: 560px;
  overflow: hidden;
  background: var(--sky);
  border-bottom: 4px solid #000;
}

.hero__scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  height: 100%;
  padding-top: 72px;
  text-align: center;
}

.hero__eyebrow {
  margin: 0;
  color: var(--sky-text);
  font-family: var(--font-logo);
  font-size: 14px;
  letter-spacing: 4px;
}

.hero__title {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-logo);
  font-size: clamp(36px, 7vw, 72px);
  line-height: 1.2;
  text-shadow: 4px 4px 0 #c92a2a, 8px 8px 0 #000;
}

.hero__lead {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  text-shadow: 2px 2px 0 #000;
}

.start-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-top: 12px;
  padding: 0 24px;
  background: #000;
  border: 4px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  font-size: 20px;
  text-decoration: none;
}

.start-button:hover,
.start-button:focus-visible {
  color: var(--gold);
}

.start-button__cursor {
  color: var(--gold);
}

.sprite {
  position: absolute;
  bottom: 64px;
}

.sprite--hero {
  left: calc(50% - 132px);
  width: 72px;
  height: 84px;
}

.sprite--samoyed {
  left: calc(50% + 46px);
  width: 60px;
  height: 70px;
}

.sprite--poodle {
  left: calc(50% + 140px);
  width: 60px;
  height: 60px;
}

/* 空の昼夜切り替え（SVG 内のグループ） */
.sky-night {
  display: none;
}

:root[data-theme="night"] .sky-day {
  display: none;
}

:root[data-theme="night"] .sky-night {
  display: inline;
}

/* 地形と城の配色（SVG 内） */
.t-hill-far { fill: var(--hill-far); }
.t-hill-mid { fill: var(--hill-mid); }
.t-ground { fill: var(--ground); }
.t-ground-top { fill: var(--ground-top); }
.t-path { fill: var(--path); }
.t-castle { fill: #868e96; }
.t-castle-light { fill: #adb5bd; }
.t-castle-line { fill: #6c757d; }
.t-castle-base { fill: #495057; }
.t-castle-gate { fill: #343a40; }
.t-castle-window { fill: var(--castle-window); }
.t-flag { fill: #e03131; }

/* ---------------------------------------------------------------- 本文 */

.main-sections {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 64px;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 28px;
}

.message__speaker {
  margin: 0;
  color: var(--gold);
}

.message__text {
  margin: 0;
  font-size: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--heading);
  font-size: 28px;
}

.section-title__mark {
  color: var(--heading-mark);
}

.works {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.works__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
}

.work-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.work-card__domain {
  color: var(--label);
  font-size: 14px;
}

.work-card__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.4;
}

.work-card__text {
  margin: 0;
  color: var(--ink-sub);
  font-size: 16px;
}

.work-card__equip {
  margin: 0;
  color: var(--gold);
  font-size: 14px;
}

.work-card__action {
  align-self: flex-start;
  margin-top: auto;
}

.panel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.panel {
  display: flex;
  flex: 1 1 340px;
  flex-direction: column;
  gap: 12px;
  padding: 24px 28px;
}

.panel__title {
  margin: 0;
  font-size: 24px;
}

.panel__text {
  margin: 0;
  color: var(--ink-sub);
  font-size: 16px;
}

.status-list {
  display: grid;
  grid-template-columns: 7em 1fr;
  row-gap: 6px;
  margin: 0;
  font-size: 17px;
}

.status-list dt {
  color: var(--label);
}

.status-list dd {
  margin: 0;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
}

.log-list li {
  display: flex;
  gap: 12px;
}

.log-list time {
  flex: none;
  color: var(--label);
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------------------------------------------------------------- 作品詳細 */

.detail {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 48px;
  padding-bottom: 64px;
}

.detail__icon {
  display: flex;
  flex: 1 1 280px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  background: #10163d;
}

.detail__icon img {
  width: 168px;
  height: 168px;
}

.detail__summary {
  display: flex;
  flex: 999 1 520px;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 28px 32px;
}

.detail__domain {
  margin: 0;
  color: var(--label);
  font-size: 14px;
}

.detail__title {
  margin: 0;
  font-size: 34px;
  line-height: 1.3;
}

.detail__text {
  margin: 0;
  color: var(--ink-sub);
}

.detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 17px;
}

.feature-list li {
  display: flex;
  gap: 10px;
}

.feature-list li::before {
  content: "◆";
  color: var(--gold);
}

/* ---------------------------------------------------------------- 404 */

.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-top: 96px;
  padding-bottom: 96px;
  text-align: center;
}

.not-found__code {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-logo);
  font-size: clamp(32px, 6vw, 56px);
  text-shadow: 4px 4px 0 #000;
}
