@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #f4f1eb;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --line: rgba(20, 21, 24, 0.08);
  --line-strong: rgba(20, 21, 24, 0.14);
  --text: #17181b;
  --muted: #6b6f76;
  --accent: #5b3828;
  --accent-soft: rgba(91, 56, 40, 0.12);
  --shadow: 0 24px 70px rgba(29, 31, 37, 0.10);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 32%),
    linear-gradient(180deg, #efeae2 0%, #f7f4ef 42%, #f2efe9 100%);
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

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

.demo-shell {
  width: min(1400px, 100%);
  margin: 0 auto;
}

.demo-hero,
.demo-section {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.demo-hero {
  position: relative;
  padding: clamp(24px, 5vw, 48px);
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.demo-hero::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), transparent 45%),
    radial-gradient(circle at 85% 12%, rgba(91, 56, 40, 0.14), transparent 28%);
  content: "";
  pointer-events: none;
}

.demo-hero > * {
  position: relative;
  z-index: 1;
}

.demo-eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.demo-hero__row,
.section-heading,
.card-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.demo-title {
  max-width: 760px;
  margin: 0;
  font-size: clamp(34px, 7vw, 50px);
  font-weight: normal;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.demo-lead {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.status-badge,
.section-note,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.status-badge {
  padding: 10px 14px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-badge::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #478b65;
  box-shadow: 0 0 0 5px rgba(71, 139, 101, 0.12);
  content: "";
}

.demo-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.demo-nav a {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: 180ms ease;
}

.demo-nav a:hover,
.demo-nav a[aria-current="page"] {
  border-color: rgba(91, 56, 40, 0.3);
  background: var(--accent-soft);
  color: var(--accent);
}

.demo-main {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.demo-section {
  padding: clamp(20px, 4vw, 32px);
  border-radius: var(--radius-xl);
}

.section-heading {
  margin-bottom: 20px;
}

.section-title,
.card-title {
  margin: 0;
  font-weight: normal;
  letter-spacing: -0.035em;
}

.section-title {
  font-size: clamp(24px, 4vw, 36px);
}

.section-copy,
.card-copy,
.helper-text {
  color: var(--muted);
}

.section-copy {
  max-width: 720px;
  margin: 8px 0 0;
  font-size: 14px;
}

.section-note,
.chip {
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

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

.demo-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.demo-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
}

.card-heading {
  align-items: flex-start;
  margin-bottom: 16px;
}

.card-title {
  font-size: 18px;
}

.card-copy {
  margin: 6px 0 0;
  font-size: 13px;
}

.button-row,
.button-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.button {
  appearance: none;
  min-height: 44px;
  padding: 11px 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), #7a5040);
  box-shadow: 0 14px 30px rgba(91, 56, 40, 0.18);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  box-shadow: 0 18px 36px rgba(91, 56, 40, 0.24);
  transform: translateY(-1px);
}

.button--ghost {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
  color: var(--text);
}

.button--small {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 12px;
}

.demo-shell .demo-source {
  display: none;
}

.status-panel,
.event-log {
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(247, 244, 239, 0.82);
  color: var(--muted);
  font-size: 12px;
}

.event-log {
  max-height: 190px;
  overflow: auto;
  list-style-position: inside;
}

.event-log:empty::before {
  content: "Events will appear here.";
}

.code-panel {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
}

.code-panel summary {
  padding: 15px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.code-panel pre {
  max-height: 420px;
  margin: 0;
  padding: 20px;
  overflow: auto;
  background: #17181b;
  color: #f4f4ee;
  font: 12px/1.7 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.modal-card {
  width: 100%;
  padding: clamp(24px, 5vw, 48px);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
  color: var(--text);
  text-align: left;
}

.modal-card h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: normal;
  letter-spacing: -0.04em;
}

.modal-card p {
  margin: 0;
  color: var(--muted);
}

.modal-card img {
  display: block;
  width: 100%;
  margin: 20px auto 0;
  border-radius: var(--radius-md);
}

.group-stack {
  display: grid;
  gap: 12px;
}

.group-item {
  padding: 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f5eee8, #fff);
  border: 1px solid rgba(91, 56, 40, 0.12);
}

.group-item strong {
  display: block;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.inline-stage {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(91, 56, 40, 0.06), transparent 42%),
    rgba(247, 244, 239, 0.78);
}

.inline-stage__content {
  display: grid;
  min-height: 310px;
  padding: 20px;
  place-items: center;
  text-align: center;
}

.inline-stage .m-modal__close-btn {
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
}

.inline-stage .m-modal__close-btn::before,
.inline-stage .m-modal__close-btn::after {
  top: 8px;
  height: 28px;
}

.video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #111;
}

.video-frame .video-js,
.video-frame iframe,
.video-frame video {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
}

.demo-footer {
  padding: 28px 0 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 820px) {
  body {
    padding: 14px;
  }

  .demo-hero__row,
  .section-heading,
  .card-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .demo-grid,
  .demo-grid--three,
  .button-grid {
    grid-template-columns: 1fr;
  }

  .status-badge,
  .section-note {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
