:root {
  color-scheme: light;
  --bg: #faf5e9;
  --surface: #fffdf6;
  --surface-muted: #f4f2e9;
  --button: #ece9dd;
  --rule: #244a3623;
  --text: #203f35;
  --muted: #58675d;
  --pine: #244f40;
  --pine-hover: #30624f;
  --accent: #ad472d;
  --accent-bright: #b7472c;
  --teal: #315d70;
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --radius: 22px;
  --shadow: 0 20px 50px rgba(32, 63, 53, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 245, 233, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.site-nav a {
  transition: color 0.18s ease;
}

.site-nav a:hover {
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.15s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--pine);
  color: #fffaf0;
  box-shadow: 0 8px 24px rgba(36, 79, 64, 0.22);
}

.btn-primary:hover {
  background: var(--pine-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(36, 79, 64, 0.28);
}

.btn-ghost {
  background: rgba(255, 253, 246, 0.82);
  color: var(--text);
  border: 1px solid rgba(32, 63, 53, 0.2);
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: rgba(32, 63, 53, 0.38);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 15px;
}

/* Hero */
.hero {
  position: relative;
  padding: clamp(44px, 7vh, 84px) 0 clamp(60px, 9vh, 108px);
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(250, 245, 233, 0.92) 0%, rgba(250, 245, 233, 0.72) 48%, rgba(250, 245, 233, 0.28) 100%),
    linear-gradient(180deg, rgba(250, 245, 233, 0.35) 0%, rgba(250, 245, 233, 0) 45%, rgba(250, 245, 233, 0.75) 100%),
    url("assets/dawn-print.jpg") center bottom / cover no-repeat;
  z-index: 0;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(32px, 5vw, 64px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 18px;
}

.eyebrow span {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(173, 71, 45, 0.11);
  color: var(--accent);
}

.hero-copy h1 {
  font-family: var(--font-serif);
  font-size: clamp(38px, 5.4vw, 62px);
  line-height: 1.22;
  letter-spacing: 0.04em;
  font-weight: 700;
  margin-bottom: 22px;
}

.hero-lead {
  font-size: clamp(15px, 1.5vw, 17px);
  color: #365045;
  max-width: 480px;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: 14px;
  background: rgba(255, 253, 246, 0.86);
  border: 1px solid var(--rule);
  backdrop-filter: blur(8px);
}

.meta-app-icon {
  border-radius: 7px;
  border: 1px solid rgba(32, 63, 53, 0.14);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.app-icon-rounded {
  border-radius: 22%;
  border: 1px solid rgba(32, 63, 53, 0.14);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

.meta-chip strong {
  display: block;
  font-size: 12px;
  line-height: 1.3;
}

.meta-chip span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

/* Device Mockup in Hero */
.hero-showcase {
  display: flex;
  justify-content: center;
}

.device-frame {
  position: relative;
  width: min(350px, 100%);
  padding: 12px;
  border-radius: 42px;
  background: #1b2a24;
  box-shadow:
    0 32px 72px rgba(20, 42, 34, 0.28),
    inset 0 0 0 2px rgba(255, 248, 232, 0.16);
}

.device-notch {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 20px;
  border-radius: 999px;
  background: #1b2a24;
  z-index: 3;
}

.device-screen {
  background: var(--bg);
  border-radius: 31px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mock-topbar {
  padding: 34px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.mock-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
}

.mock-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--button);
  color: var(--muted);
}

.mock-scene {
  position: relative;
  padding: 14px 16px 26px;
  background: #fce5b2 url("assets/dawn-print.jpg") center bottom / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mock-stage-label {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.mock-stage-label span {
  font-family: Georgia, serif;
  font-size: 30px;
  line-height: 1;
}

#heroDemoCanvas {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  display: block;
}

.mock-console {
  padding: 14px 16px 18px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mock-meter {
  display: flex;
  gap: 4px;
}

.mock-meter i {
  flex: 1;
  height: 4px;
  border-radius: 3px;
  background: var(--accent);
  transition: background 0.25s ease;
}

.mock-meter i.traced {
  background: #dddacd;
}

.mock-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.mock-controls span {
  padding: 9px 6px;
  border-radius: 11px;
  background: var(--button);
}

.mock-controls .mock-hint {
  background: var(--pine);
  color: #fffaf0;
}

/* Sections */
.section {
  padding: clamp(64px, 9vw, 108px) 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(32px, 5vw, 48px);
}

.section-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.32;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.section-lead {
  font-size: 15px;
  color: var(--muted);
}

/* Rules Grid */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.rule-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 26px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rule-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.rule-num {
  font-family: Georgia, serif;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.rule-diagram {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  place-items: center;
  margin: 4px 0 6px;
}

.rule-card h3 {
  font-family: var(--font-serif);
  font-size: 20px;
}

.rule-card p {
  font-size: 14px;
  color: var(--muted);
}

/* Features Bento */
.features-section {
  background: var(--surface-muted);
  border-block: 1px solid var(--rule);
}

.features-bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 26px;
}

.feature-wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 32px;
  background: linear-gradient(135deg, #fffdf6 0%, #f9f2e1 100%);
}

.stat-num {
  font-family: Georgia, serif;
  font-size: clamp(54px, 7vw, 76px);
  line-height: 1;
  color: var(--accent);
  white-space: nowrap;
  flex: none;
}

.stat-num span {
  font-family: var(--font-serif);
  font-size: 22px;
  margin-left: 4px;
  color: var(--text);
}

.feature-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  background: rgba(49, 93, 112, 0.1);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--muted);
}

/* Interactive Try Section */
.try-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.try-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.try-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.try-tab {
  text-align: left;
  padding: 13px 15px;
  border-radius: 15px;
  border: 1px solid var(--rule);
  background: var(--bg);
  display: grid;
  gap: 2px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.try-tab:hover {
  background: #f1ece0;
}

.try-tab.is-active {
  background: #dce7d6;
  border-color: #4c705d;
}

.tab-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
}

.try-tab strong {
  font-family: var(--font-serif);
  font-size: 16px;
}

.try-tab small {
  font-size: 12px;
  color: var(--muted);
}

.try-status-panel {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.try-counter {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.try-counter strong {
  font-size: 24px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.try-meter {
  display: flex;
  gap: 4px;
}

.try-meter i {
  flex: 1;
  height: 4px;
  border-radius: 3px;
  background: var(--accent);
  transition: background 0.18s ease;
}

.try-meter i.traced {
  background: #dddacd;
}

.try-guide {
  font-size: 12.5px;
  color: var(--muted);
  min-height: 3.2em;
}

.try-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.try-btn {
  min-height: 42px;
  border-radius: 12px;
  background: var(--button);
  font-size: 12.5px;
  font-weight: 700;
  transition: background 0.15s ease, transform 0.12s ease;
}

.try-btn:hover:not(:disabled) {
  background: #dbe4d5;
}

.try-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.try-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.try-btn-accent {
  background: var(--pine);
  color: #fffaf0;
}

.try-btn-accent:hover:not(:disabled) {
  background: var(--pine-hover);
}

.try-full-link {
  margin-top: auto;
  text-align: center;
  padding: 12px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--pine);
  border: 1px dashed rgba(36, 79, 64, 0.35);
  transition: background 0.15s ease;
}

.try-full-link:hover {
  background: rgba(36, 79, 64, 0.06);
}

.try-stage-wrap {
  border-radius: 20px;
  background: #fce5b2 url("assets/dawn-print.jpg") center bottom / cover no-repeat;
  border: 1px solid var(--rule);
  padding: 20px;
  display: grid;
  place-items: center;
  min-height: 420px;
}

.try-board {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1 / 1;
  user-select: none;
  -webkit-user-select: none;
}

.try-board.shake {
  animation: boardShake 0.28s ease;
}

@keyframes boardShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

#tryCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.try-clear-overlay {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: rgba(250, 245, 233, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.clear-stamp {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 3px double var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 800;
  transform: rotate(-10deg);
}

.try-clear-overlay p {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
}

.try-clear-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* Night Band */
.night-band {
  position: relative;
  padding: clamp(72px, 10vw, 120px) 0;
  color: #f4eedf;
  overflow: hidden;
}

.night-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(95deg, rgba(13, 25, 42, 0.88) 0%, rgba(13, 25, 42, 0.68) 55%, rgba(13, 25, 42, 0.78) 100%),
    url("assets/night-print.jpg") center bottom / cover no-repeat;
  z-index: 0;
}

.night-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 5vw, 60px);
  align-items: center;
}

.night-kicker {
  color: #e69d73;
}

.night-copy h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.8vw, 40px);
  line-height: 1.32;
  margin-bottom: 18px;
}

.night-copy p {
  color: rgba(244, 238, 223, 0.84);
  font-size: 15px;
  margin-bottom: 14px;
}

.night-card {
  background: rgba(18, 34, 54, 0.72);
  border: 1px solid rgba(255, 245, 225, 0.16);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 28px 26px;
}

.night-card-label {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: #f3c49d;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 245, 225, 0.14);
}

.trivia-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.trivia-points li strong {
  display: block;
  font-size: 15px;
  color: #fff6e4;
  margin-bottom: 2px;
}

.trivia-points li span {
  display: block;
  font-size: 13.5px;
  color: rgba(244, 238, 223, 0.78);
}

/* Final CTA */
.cta-box {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 30px;
  padding: clamp(40px, 6vw, 68px) 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.cta-mark {
  margin-bottom: 16px;
}

.cta-box h2 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.4vw, 34px);
  margin-bottom: 12px;
}

.cta-box p {
  color: var(--muted);
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto;
}

.cta-actions {
  margin-top: 26px;
}

.cta-note {
  margin-top: 18px !important;
  font-size: 12.5px !important;
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 28px 0 38px;
  font-size: 13px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  color: var(--text);
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a:hover {
  color: var(--text);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Responsive */
@media (max-width: 920px) {
  .hero-grid,
  .night-inner,
  .try-shell {
    grid-template-columns: 1fr;
  }

  .hero-showcase {
    margin-top: 8px;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }

  .features-bento {
    grid-template-columns: 1fr;
  }

  .feature-wide {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .try-tabs {
    flex-direction: row;
    overflow-x: auto;
  }

  .try-tab {
    flex: 1;
    min-width: 135px;
  }
}

@media (max-width: 680px) {
  .site-nav {
    display: none;
  }

  .br-desktop {
    display: none;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .try-shell {
    padding: 16px;
  }

  .try-stage-wrap {
    min-height: 320px;
    padding: 12px;
  }
}
