/* Start screen (landing). Result first: the finished card and the hero motion lead, the two
   actions sit right under the headline. Only the landing entry uses it; invitation, camera
   preparation and the live views keep their own layouts. Colours come from the Habitus tokens, so
   the dark theme follows automatically; the example cards are printed artefacts and stay paper. */
.start-link,
.start-copy,
.start-visual { display: none; }
.start-actions { display: contents; }

html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .shell { max-width: 1240px; padding: 0 clamp(20px, 5vw, 64px); }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .masthead { height: 76px; border-bottom: 0; gap: 12px; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .brand { font-size: 26px; letter-spacing: -0.05em; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-link:hover { background: hsl(var(--muted) / 0.6); }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-link:focus-visible { outline: 3px solid hsl(var(--ring)); outline-offset: 2px; }

html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: ". visual" "copy visual" "actions visual" ". visual";
  grid-template-rows: 1fr auto auto 1fr;
  column-gap: clamp(32px, 6vw, 88px);
  align-content: center;
  align-items: start;
  min-height: calc(100dvh - 76px);
  padding: 0 0 max(48px, env(safe-area-inset-bottom));
}

/* copy */
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-copy { display: block; grid-area: copy; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-title {
  margin: 0 0 18px; font-size: clamp(40px, 4.8vw, 64px); font-weight: 800; line-height: 1.06;
  letter-spacing: -0.06em; color: var(--ink);
}
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-title span { display: block; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel .start-lede {
  position: static; margin: 0 0 30px; max-width: 30em; color: var(--muted-ink);
  font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6;
}

/* actions: the existing buttons and their wiring, restyled */
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel #camera-empty {
  grid-area: actions; position: static; display: flex; flex-direction: column; align-items: flex-start;
  gap: 12px; min-height: 0; margin: 0; padding: 0; background: transparent;
}
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-actions { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel #scene-mode {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: auto;
  min-height: 64px; padding: 0 30px; border-radius: 14px; font-size: 19px; font-weight: 700;
  letter-spacing: -0.03em; order: 0; margin: 0; transition: background-color 150ms, filter 150ms, transform 150ms;
}
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel #scene-mode { border: 1px solid transparent; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel #scene-mode:hover:not(:disabled) { filter: brightness(1.12); }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel #scene-mode:active:not(:disabled) { transform: translateY(1px); }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel #scene-mode:focus-visible { outline: 3px solid hsl(var(--ring)); outline-offset: 3px; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-ico { flex: none; }
/* The header "통화 초대" link presses this real button (data-forward), so it stays in the DOM, but the start screen offers one primary action. */
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel #create-room { display: none; }

/* visual: hero motion panel + finished cards */
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-visual { display: block; grid-area: visual; align-self: center; min-width: 0; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-hero {
  padding: 28px 24px 20px; border: 1px solid hsl(var(--border)); border-radius: 20px;
  background: hsl(var(--card));
}
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-hero .hero-motion { max-width: none; margin: 0; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-cards { position: relative; aspect-ratio: 540 / 330; margin-top: 18px; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-dots { display: none; }

/* example cards: paper, always light */
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc {
  position: absolute; overflow: hidden; container-type: inline-size; border-radius: 10px;
  background: #fff; color: #1c2a4a; box-shadow: 0 16px 40px rgb(20 26 44 / 0.22);
  font-family: inherit; letter-spacing: -0.02em;
}
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc svg { display: block; width: 100%; height: 100%; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-basic { left: 2%; top: 12%; width: 30%; aspect-ratio: 160 / 250; transform: rotate(-5deg); }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-stamp { left: 33%; top: 4%; width: 35%; aspect-ratio: 190 / 270; transform: rotate(2deg); z-index: 2; border-radius: 4px; background: #f3ede2; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-story { left: 71%; top: 8%; width: 26%; aspect-ratio: 140 / 250; transform: rotate(5deg); }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-photo { position: relative; overflow: hidden; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-chip {
  position: absolute; padding: 1.6cqw 4cqw; border-radius: 99px; background: rgb(20 26 44 / 0.66); color: #fff;
  font-size: 6.4cqw; font-weight: 600; line-height: 1.2; white-space: nowrap;
}
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-basic .sc-photo { position: absolute; inset: 0 0 auto 0; height: 38%; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-basic .sc-chip { left: 6cqw; top: 6cqw; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-basic .sc-map { position: absolute; inset: 38% 0 auto 0; height: 48%; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-foot {
  position: absolute; inset: auto 0 0 0; height: 14%; display: flex; align-items: center; justify-content: space-between;
  padding: 0 6cqw; background: #f4f1ea; font-size: 5.6cqw;
}
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-polaroid { position: absolute; inset: 5% 6% auto 6%; height: 56%; padding: 4cqw 4cqw 0; background: #fff; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-polaroid .sc-photo { height: 74%; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-caption { margin-top: 3cqw; color: #3b3226; font: 500 6.6cqw/1.2 Georgia, "Times New Roman", serif; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-ticket {
  position: absolute; left: 9%; bottom: 6%; width: 36%; aspect-ratio: 1; overflow: hidden; background: #fff;
  border: 2px dashed #c9bda6; border-radius: 6px;
}
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-ring {
  position: absolute; right: 6%; bottom: 4%; width: 42%; aspect-ratio: 1; display: grid; place-items: center;
  border: 3px solid #b5412f; border-radius: 50%; color: #b5412f; font-size: 5.2cqw; font-weight: 700;
  line-height: 1.25; text-align: center; transform: rotate(12deg);
}
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-ring::before { content: ""; position: absolute; inset: 4%; border: 1.5px solid #b5412f; border-radius: 50%; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-full { position: absolute; inset: 0; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-chip-top { left: 7cqw; top: 14cqw; font-size: 6.2cqw; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-chip-live { left: 7cqw; bottom: 9cqw; background: #fff; color: #1c2a4a; font-size: 5cqw; }
html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc-sticker {
  position: absolute; right: 7cqw; bottom: 20cqw; width: 38%; aspect-ratio: 1; overflow: hidden;
  border: 1.4cqw solid #fff; border-radius: 7%; transform: rotate(3deg);
}
@media (prefers-color-scheme: dark) {
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc { box-shadow: 0 16px 40px rgb(0 0 0 / 0.55); outline: 1px solid rgb(255 255 255 / 0.08); }
}

/* tablet: one centred column */
@media (max-width: 1023px) {
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "visual" "actions";
    grid-template-rows: none;
    justify-items: center; row-gap: 28px; min-height: 0; text-align: center;
  }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-copy { max-width: 640px; }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel .start-lede { margin-inline: auto; }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-title { font-size: clamp(40px, 7.4vw, 58px); }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-visual { width: min(100%, 640px); }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-hero { padding: 34px 30px 24px; }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel #camera-empty { align-items: center; width: min(100%, 640px); }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-actions { flex-wrap: nowrap; }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel #scene-mode { flex: 1; }
}

/* phone: swipeable cards, the primary action pinned to the bottom edge */
@media (max-width: 639px) {
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel { justify-items: stretch; row-gap: 20px; text-align: left; padding-bottom: calc(132px + env(safe-area-inset-bottom)); }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-title { font-size: clamp(32px, 9.4vw, 38px); margin-bottom: 8px; }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel .start-lede { margin: 0; font-size: 15px; }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-visual { width: 100%; }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-hero { padding: 18px 14px 12px; border-radius: 18px; }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-cards {
    display: flex; gap: 12px; height: 268px; aspect-ratio: auto; margin: 16px calc(-1 * clamp(20px, 5vw, 64px)) 0;
    padding: 6px clamp(20px, 5vw, 64px) 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-cards::-webkit-scrollbar { display: none; }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .sc { position: relative; inset: auto; flex: none; width: auto; height: 100%; transform: none; scroll-snap-align: center; }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-dots { display: flex; justify-content: center; gap: 6px; margin-top: 4px; }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-dots i { display: block; width: 7px; height: 7px; border-radius: 50%; background: hsl(var(--border)); transition: width 200ms, background-color 200ms; }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-dots i.on { width: 20px; border-radius: 4px; background: var(--ink); }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel #camera-empty { align-items: stretch; width: 100%; }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-actions {
    position: fixed; inset: auto 0 0 0; z-index: 20; flex-wrap: nowrap; gap: 0; width: auto;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid hsl(var(--border));
    background: hsl(var(--background));
  }
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel #scene-mode { min-height: 54px; font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) #entry-panel #scene-mode,
  html[data-entry="landing"] body:not([data-entry-kind="invitation"]):not(.session-active):not(.session-ended) .start-dots i { transition: none; }
}
