:root {
  color-scheme: light;
  --ink: #171917;
  --ink-soft: #414840;
  --paper: #fffef9;
  --paper-cool: #f4f7f2;
  --desk: #e8ece4;
  --green: #147a49;
  --green-deep: #0d5b36;
  --green-soft: #ccebd8;
  --blue: #185da4;
  --blue-deep: #104777;
  --blue-soft: #d9e8f7;
  --coral: #d95745;
  --coral-soft: #fde0da;
  --line: 2px solid var(--ink);
  --shadow-paper: 8px 12px 24px rgba(23, 25, 23, 0.14);
  --shadow-slip: 4px 6px 10px rgba(23, 25, 23, 0.12);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--desk);
  font-family:
    Pretendard,
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    sans-serif;
  color: var(--ink);
}

body {
  min-height: 100dvh;
  margin: 0;
  background: var(--desk);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
  transition: transform 160ms var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 32px, 1040px);
  margin: 0 auto;
  padding: 20px 0 10px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.wordmark__name {
  font-size: clamp(1.3rem, 3.5vw, 1.75rem);
  font-weight: 900;
  letter-spacing: -0.035em;
}

.wordmark__product {
  color: var(--green-deep);
  font-size: 0.82rem;
  font-weight: 800;
}

.help-trigger {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 40;
  min-width: 58px;
  min-height: 48px;
  border: var(--line);
  border-radius: 2px;
  background: var(--coral-soft);
  color: #7c251a;
  font-weight: 900;
  box-shadow: 3px 4px 8px rgba(88, 29, 20, 0.14);
  cursor: pointer;
}

.help-trigger:hover {
  background: #f9c8bf;
  transform: translateY(-1px);
}

.app-shell {
  width: min(100% - 24px, 820px);
  margin: 30px auto 0;
}

.calendar {
  position: relative;
  isolation: isolate;
}

.calendar::before,
.calendar::after {
  position: absolute;
  inset: 78px 12px -10px;
  z-index: -2;
  border: var(--line);
  border-radius: 5px;
  background: #e3e9e0;
  content: "";
}

.calendar::after {
  inset: 70px 6px -4px;
  z-index: -1;
  background: #f1f2eb;
}

.calendar__rings {
  position: absolute;
  top: -34px;
  left: 0;
  z-index: 3;
  display: flex;
  justify-content: space-around;
  width: 100%;
  padding-inline: 15%;
  pointer-events: none;
}

.calendar__rings span {
  display: block;
  width: 38px;
  height: 68px;
  border: 8px solid var(--ink);
  border-radius: 24px;
  background: transparent;
  box-shadow: 2px 3px 7px rgba(23, 25, 23, 0.24);
}

.step-rail {
  margin: 0 18px -2px;
}

.step-rail ol {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-rail li {
  min-width: 0;
  padding: 12px 8px 11px;
  border: var(--line);
  border-bottom: 0;
  background: #dfe4dc;
  color: #616861;
  text-align: center;
}

.step-rail li b,
.step-rail li span {
  display: block;
}

.step-rail li b {
  font-size: 0.88rem;
  letter-spacing: -0.02em;
}

.step-rail li span {
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 700;
}

.step-rail li[data-state="current"] {
  background: var(--paper);
  color: var(--green-deep);
}

.step-rail li[data-state="complete"] {
  background: var(--green-soft);
  color: var(--green-deep);
}

.step-rail li[data-state="complete"] b::after {
  margin-left: 4px;
  content: "✓";
}

.calendar__leaf {
  position: relative;
  min-height: min(690px, calc(100dvh - 150px));
  padding: clamp(52px, 8vw, 76px) clamp(24px, 7vw, 68px) clamp(30px, 6vw, 56px);
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 5px;
  background-color: var(--paper);
  background-image: url("./assets/paper-fiber.svg");
  box-shadow: var(--shadow-paper);
  transform-origin: top center;
  transition:
    transform 210ms var(--ease-out),
    opacity 160ms ease,
    clip-path 210ms var(--ease-out),
    box-shadow 210ms var(--ease-out);
  clip-path: inset(0 0 0 0);
}

.calendar__leaf.is-leaving {
  opacity: 0.16;
  box-shadow: 2px 3px 7px rgba(23, 25, 23, 0.08);
  transform: perspective(900px) rotateX(-8deg) translateY(-10px);
  clip-path: inset(0 0 94% 0);
}

.calendar__leaf.is-entering {
  opacity: 0.5;
  transform: perspective(900px) rotateX(3deg) translateY(6px);
  clip-path: inset(0 0 26% 0);
}

.leaf__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: clamp(32px, 6vw, 52px);
  padding-bottom: 14px;
  border-bottom: 2px solid var(--green);
  color: var(--green-deep);
  font-size: 0.88rem;
  font-weight: 900;
}

#progress-count {
  font-size: clamp(1.8rem, 7vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

#privacy-note {
  padding: 7px 9px;
  border: 2px solid currentColor;
  border-radius: 2px;
  transform: rotate(-1deg);
}

.screen {
  width: min(100%, 650px);
  margin: 0 auto;
}

.intro-copy h1,
.question h1,
.result h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.25rem, 8.8vw, 4.3rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.intro-copy p,
.question__lead,
.result__lead {
  max-width: 58ch;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.5vw, 1.12rem);
  font-weight: 650;
  line-height: 1.7;
  word-break: keep-all;
}

.notice-block {
  margin-top: clamp(28px, 6vw, 48px);
  padding: 18px 20px;
  border: 2px dashed #6b7469;
  background: var(--paper-cool);
}

.notice-block strong {
  font-size: 1rem;
}

.notice-block p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.65;
}

.start-actions,
.screen-actions {
  display: grid;
  gap: 12px;
  margin-top: clamp(28px, 6vw, 48px);
}

.welcome-mascots,
.step-mascots {
  display: block;
  width: min(52%, 220px);
  height: auto;
  margin: 20px auto -18px;
  filter: drop-shadow(4px 7px 7px rgba(23, 25, 23, 0.15));
}

.step-mascots {
  width: min(42%, 170px);
  margin-top: 18px;
}

.paper-cta,
.paper-secondary,
.outcome-button {
  min-height: 58px;
  border: var(--line);
  border-radius: 2px;
  font-weight: 900;
  cursor: pointer;
}

.paper-cta {
  padding: 15px 28px;
  background: var(--green-soft);
  color: var(--green-deep);
  box-shadow: var(--shadow-slip);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
}

.paper-cta:hover {
  background: #b7e3c8;
  transform: translateY(-2px);
}

.paper-secondary {
  padding: 14px 22px;
  background: var(--paper);
  color: var(--ink);
}

.paper-secondary:hover {
  background: var(--paper-cool);
}

.text-action {
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--coral);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.quiet-action {
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.question__step {
  margin: 0 0 12px;
  color: var(--green-deep);
  font-size: 1.05rem;
  font-weight: 900;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(30px, 7vw, 56px);
}

.choice {
  position: relative;
  min-height: 112px;
  padding: 22px 24px;
  border: var(--line);
  border-radius: 1px;
  background: var(--paper);
  box-shadow: var(--shadow-slip);
  font-size: clamp(1rem, 3vw, 1.16rem);
  font-weight: 900;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}

.choice::after {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-bottom: var(--line);
  border-left: var(--line);
  background: var(--desk);
  content: "";
}

.choice:hover {
  background: var(--green-soft);
  color: var(--green-deep);
  transform: translateY(-2px);
}

.choice small {
  display: block;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 750;
}

.back-row {
  margin-top: 28px;
}

.back-button {
  min-height: 48px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--blue-deep);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.action-slip {
  position: relative;
  margin-top: clamp(28px, 6vw, 48px);
  padding: 36px clamp(22px, 6vw, 44px) 28px;
  border: 3px solid var(--blue-deep);
  border-radius: 3px;
  background: var(--blue-soft);
  color: #102f4d;
  box-shadow: 7px 10px 18px rgba(16, 71, 119, 0.16);
  transform: rotate(-0.5deg);
}

.action-slip::before {
  position: absolute;
  top: -18px;
  left: 50%;
  width: 72px;
  height: 28px;
  border: 3px solid var(--ink);
  border-bottom-width: 7px;
  border-radius: 14px 14px 4px 4px;
  background: #aeb9c3;
  content: "";
  transform: translateX(-50%);
}

.action-slip__time {
  display: inline-block;
  margin-bottom: 18px;
  padding: 7px 10px;
  border: 2px solid currentColor;
  border-radius: 2px;
  font-size: 0.82rem;
  font-weight: 900;
}

.action-slip__review {
  display: block;
  margin: 0 0 12px;
  color: var(--blue-deep);
  font-size: 0.78rem;
  font-weight: 850;
}

.action-slip h2 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.action-slip p {
  margin: 18px 0 0;
  font-weight: 700;
  line-height: 1.7;
  word-break: keep-all;
}

.selection-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 22px 0 0;
  padding: 0;
  color: var(--ink-soft);
  font-size: 0.87rem;
  font-weight: 750;
  list-style: none;
}

.selection-summary li::before {
  margin-right: 6px;
  color: var(--green);
  content: "•";
}

.outcome-list {
  display: grid;
  gap: 11px;
  margin-top: 28px;
}

.outcome-button {
  padding: 14px 18px;
  background: var(--paper);
  text-align: left;
}

.outcome-button:hover {
  background: var(--green-soft);
  color: var(--green-deep);
}

.outcome-button--help {
  border-color: var(--coral);
  color: #812b20;
  background: var(--coral-soft);
}

.result {
  text-align: center;
}

.result h1 {
  max-width: 12ch;
  margin-inline: auto;
}

.result__lead {
  margin-inline: auto;
}

.result__characters {
  display: block;
  width: min(76%, 320px);
  height: auto;
  margin: 26px auto 0;
}

.result__privacy {
  margin: 18px auto 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 750;
}

.age-boundary {
  text-align: center;
}

.age-boundary h1 {
  max-width: 12ch;
  margin-inline: auto;
  font-size: clamp(2.1rem, 8vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.age-boundary p {
  max-width: 52ch;
  margin: 24px auto 0;
  color: var(--ink-soft);
  font-weight: 650;
  line-height: 1.7;
}

.prototype-note {
  width: min(100% - 32px, 820px);
  margin: 24px auto 38px;
  color: #4f574e;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.help-dialog {
  width: min(92vw, 600px);
  max-height: min(88dvh, 760px);
  padding: 0;
  overflow: auto;
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 10px 16px 34px rgba(23, 25, 23, 0.28);
}

.help-dialog::backdrop {
  background: rgba(23, 25, 23, 0.58);
}

.help-dialog__paper {
  padding: clamp(24px, 6vw, 42px);
}

.help-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.help-dialog h2 {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 2.35rem);
  line-height: 1.16;
  letter-spacing: -0.03em;
}

.help-dialog p {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-weight: 650;
  line-height: 1.7;
}

.dialog-close {
  min-width: 56px;
  min-height: 48px;
  border: var(--line);
  border-radius: 2px;
  background: var(--paper);
  font-weight: 900;
  cursor: pointer;
}

.help-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.help-links a {
  min-height: 100px;
  padding: 16px;
  border: 2px solid var(--coral);
  background: var(--coral-soft);
  color: #70251b;
  text-decoration: none;
}

.help-links a:hover {
  background: #f9c8bf;
}

.help-links b,
.help-links span {
  display: block;
}

.help-links b {
  font-size: 1.55rem;
}

.help-links span {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.4;
}

.help-dialog__source {
  font-size: 0.8rem;
}

.help-dialog__source a {
  color: var(--blue-deep);
  font-weight: 900;
}

@media (max-width: 560px) {
  .site-header {
    width: min(100% - 28px, 1040px);
    padding-top: 14px;
  }

  .wordmark__product {
    display: none;
  }

  .app-shell {
    width: min(100% - 16px, 820px);
    margin-top: 26px;
  }

  .calendar__rings {
    top: -29px;
  }

  .calendar__rings span {
    width: 32px;
    height: 58px;
    border-width: 7px;
  }

  .step-rail {
    margin-inline: 6px;
  }

  .step-rail li {
    padding: 10px 3px 9px;
  }

  .step-rail li b {
    font-size: 0.78rem;
  }

  .step-rail li span {
    font-size: 0.65rem;
  }

  .calendar__leaf {
    min-height: calc(100dvh - 140px);
    padding-inline: 20px;
  }

  .leaf__meta {
    align-items: flex-end;
  }

  #privacy-note {
    max-width: 104px;
    text-align: center;
  }

  .intro-copy h1,
  .question h1,
  .result h1 {
    font-size: clamp(2.1rem, 11vw, 3.2rem);
  }

  .choice {
    min-height: 102px;
    padding: 18px 16px;
  }

  .choice-grid--situations,
  .choice-grid--actions {
    grid-template-columns: 1fr;
  }

  .help-links {
    grid-template-columns: 1fr;
  }
}

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