:root {
  color-scheme: dark;
  --ink: #0e0b1f;
  --raised: #1d1738;
  --line: #3a3160;
  --text: #ffffff;
  --muted: #bdb7d4;
  --amber: #f7a823;
  --red: #f5153f;
  --font: "Montserrat", "Noto Sans JP", "Hiragino Sans", sans-serif;
}

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

html, body { margin: 0; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.5;
}

:lang(ja) { font-family: "Noto Sans JP", "Hiragino Sans", "Montserrat", sans-serif; }

a { color: inherit; }

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

:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* Landing */

.landing main {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 48px);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--amber);
  font-size: 0.875rem;
  font-weight: 700;
}

h1 {
  margin: 0 0 clamp(32px, 5vw, 56px);
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.decks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
}

.cover { display: block; transition: opacity 0.15s ease; }
.cover:hover { opacity: 0.88; }

.deck h2 { margin: 20px 0 2px; font-size: 1.5rem; font-weight: 700; }
.deck .sub { margin: 0 0 16px; color: var(--muted); }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin: 0;
}

.actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  text-underline-offset: 4px;
}

.actions .primary {
  padding: 0 22px;
  border-radius: 999px;
  background: var(--red);
  text-decoration: none;
}

.actions .primary:hover { background: #d70e34; }

@media (max-width: 720px) {
  .decks { grid-template-columns: minmax(0, 1fr); }
}

/* Viewer */

.viewer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
  background: var(--ink);
  font-size: 0.9375rem;
}

.top { justify-content: space-between; min-height: 48px; padding-top: env(safe-area-inset-top); }
.bottom { justify-content: center; min-height: 56px; padding-bottom: env(safe-area-inset-bottom); position: relative; }

.bar a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.bar a:hover { color: var(--amber); }

.tools { display: flex; gap: 8px; }

.bar button {
  min-width: 56px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.bar button:hover:not(:disabled) { border-color: var(--amber); }
.bar button:disabled { opacity: 0.35; cursor: default; }

#counter {
  min-width: 72px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.bar .full { position: absolute; right: max(12px, env(safe-area-inset-right)); }

.track {
  display: flex;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.track::-webkit-scrollbar { display: none; }

.slide {
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

:fullscreen .top { display: none; }

@media (max-width: 480px) {
  .bar .full { display: none; }
}
