:root {
  --ink: #2c2416;
  --muted: #7a6248;
  --paper: #f6efe4;
  --crust: #c47a32;
  --chip: #efe4d4;
  --line: #e0d0ba;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

html[lang="ja"] body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

.stage {
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, min(58vw, calc(100dvh * 0.75))) minmax(300px, 1fr);
  background: var(--paper);
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

.art {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 0;
  cursor: pointer;
  background: #c47a32;
}

.poster {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
}

.poster.is-on { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .poster { transition: opacity 220ms ease; }
}

.panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(12px, 2dvh, 20px);
  padding: clamp(28px, 5dvh, 64px) clamp(28px, 4vw, 56px);
  background: var(--paper);
}

.topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.mark {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.lang {
  display: flex;
  gap: 14px;
  font-size: 0.94rem;
}

.lang a {
  color: var(--muted);
  text-decoration: none;
}

.lang a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--crust);
}

.copy h1 {
  margin: 0.7rem 0 0;
  max-width: 12ch;
  font-weight: 600;
  font-size: clamp(2rem, 5dvh, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.022em;
}

.lead {
  margin: 0.7rem 0 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 1.06rem;
  font-weight: 400;
  line-height: 1.47;
}

.demo {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  justify-items: center;
  align-content: center;
  gap: 10px;
}

.phone-slot {
  container-type: size;
  width: min(100%, 240px);
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}

.phone {
  position: relative;
  height: min(100cqh, calc(100cqw * 2.175));
  aspect-ratio: 1206 / 2622;
  border-radius: 1.6rem;
  overflow: hidden;
  background: var(--chip);
  box-shadow: 0 0 0 1px var(--line);
  touch-action: pan-y;
}

.app-screenshot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.app-screenshot.active { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .app-screenshot { transition: opacity 280ms ease; }
}

.scene {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 420px);
}

#screen-label {
  flex: 1;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.35;
}

.scene button,
.get {
  font: inherit;
  font-weight: 400;
}

.scene button {
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 980px;
  background: var(--chip);
  color: var(--ink);
  cursor: pointer;
}

.scene button:focus-visible,
.get:focus-visible,
.lang a:focus-visible,
.meta a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}

.dots span.active { background: var(--crust); }

.scene button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

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

.get {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 0 1.25rem;
  border-radius: 980px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 1.06rem;
  font-weight: 600;
  box-shadow: 0 3px 0 var(--crust);
}

@media (prefers-reduced-motion: no-preference) {
  .get { transition: transform 160ms ease, box-shadow 160ms ease; }
  .get:hover,
  .get:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--crust); }
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.meta a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--crust);
  text-underline-offset: 3px;
}

@media (max-width: 860px), (max-aspect-ratio: 4/5) {
  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .art {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    max-height: 34dvh;
  }

  .phone-slot { min-height: 26dvh; }

  .panel { padding: 20px 22px 16px; }

  .copy h1 { font-size: clamp(1.7rem, 4.4dvh, 2.25rem); }

  .lead { font-size: 0.98rem; }

  .phone-slot { width: min(100%, 190px); }
}

@media (max-height: 680px) and (min-width: 861px) {
  .panel { padding-top: 20px; padding-bottom: 20px; }
  .copy h1 { font-size: 1.85rem; }
  .lead { font-size: 0.95rem; }
}
