:root {
  font-family: var(--pm-font, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif);
  color: var(--pm-ink, #282722);
  background: var(--pm-canvas, #f8f7f5);
  --edge: clamp(20px, 4vw, 60px);
  --accent: var(--pm-accent, #a8385b);
  --rule: var(--pm-line, #e5e0de);
}

* { box-sizing: border-box; }
body { min-height: 100vh; min-height: 100svh; margin: 0; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
.wrap { width: min(1200px, calc(100% - var(--edge) * 2)); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--rule); background: var(--pm-surface, #fff); }
.masthead-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.masthead-inner { min-height: 72px; }
.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.brand strong { font-size: 22px; letter-spacing: -.06em; }
.brand span { font-size: 15px; font-weight: 550; color: var(--pm-muted, #665f61); }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0 clamp(12px, 2vw, 26px); }
nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; }
.masthead nav { gap: 2px; }
.masthead nav a { padding: 0 12px; border-radius: 999px; }
.masthead nav a[aria-current] { background: var(--pm-accent-soft, #f9edf1); color: var(--accent); }
main { flex: 1; }
.tool-intro {
  display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(18px, 4vw, 56px); padding-block: clamp(24px, 3.5vw, 48px);
}
h1 { font-size: clamp(34px, 3.5vw, 54px); line-height: 1.18; font-weight: 760; letter-spacing: -.05em; word-break: keep-all; }
.lead { margin-top: 16px; max-width: 25em; color: var(--pm-muted, #665f61); font-size: clamp(16px, 1.4vw, 19px); line-height: 1.65; }
.lead, .how-to p { word-break: keep-all; overflow-wrap: anywhere; }
.start {
  display: inline-flex; align-items: center; justify-content: center; gap: 15px;
  margin-top: 24px; min-height: 48px; padding: 11px 19px; border-radius: 10px;
  color: #fff; background: var(--accent); font-size: 15px; font-weight: 650;
}
.start:hover { color: #fff; background: #912949; }
.start span { font-size: 1.15em; }
.example { display: grid; place-items: center; padding: 0; overflow: hidden; border: 1px solid var(--rule); border-radius: 6px; }
.example.relationship { background: #f6f2f3; }
.example.cp { background: #eff5f4; }
.example.favorite-grid { background: #f3f1f6; }
.example img { display: block; width: 100%; height: auto; max-height: 300px; aspect-ratio: 320 / 216; }
.example:not(.favorite-grid) img { background: #fff; border-radius: 3px; }
.example.cp img { aspect-ratio: auto; object-fit: contain; }
.guide-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 20px; }
.guide-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.lineage-preview { display: grid; justify-items: center; padding-block: 12px; background: white; border: 1px solid var(--rule); border-radius: 6px; }
.lineage-preview img { display: block; width: min(100%, 290px); height: auto; }
.sample-intro { padding-block: clamp(24px, 4vw, 50px); }
.sample-parent { color: var(--pm-muted); margin-bottom: 4px; }
.sample-intro .lead { max-width: 36em; }
.sample-comparison { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr)); gap: clamp(16px, 3vw, 32px); padding-bottom: clamp(32px, 5vw, 60px); }
.sample-comparison figure { margin: 0; }
.sample-comparison figcaption { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.sample-comparison figcaption span { color: var(--pm-muted); font-size: 13px; }
.sample-comparison figcaption strong { font-size: 20px; }
.sample-comparison img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; }
.how-to { padding: clamp(20px, 2.5vw, 32px) 0 clamp(28px, 4vw, 48px); border-top: 1px solid var(--rule); }
h2 { font-size: clamp(22px, 2vw, 28px); line-height: 1.35; font-weight: 720; letter-spacing: -.04em; }
.how-to ol, .how-to .guide-scenes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(15px, 1.8vw, 24px); margin: 24px 0 0; padding: 0; list-style: none; }
.how-to li {
  min-width: 0;
  overflow: hidden;
  padding-bottom: 0;
}
.how-to li > :is(h3, p) { margin-inline: 0; }
.demo-player { position: relative; aspect-ratio: 16 / 9; margin-bottom: 8px; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: var(--pm-surface, #fff); }
.demo-player video { display: block; width: 100%; height: 100%; object-fit: contain; }
.demo-toggle { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; color: #fff; background: transparent; }
.demo-toggle svg { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; padding: 7px; border: 1px solid #ffffff80; border-radius: 50%; background: var(--pm-ink, #282722); fill: currentColor; }
.demo-toggle svg path { display: none; }
.demo-toggle[data-state=play] .play, .demo-toggle[data-state=pause] .pause, .demo-toggle[data-state=replay] .replay { display: block; }
.demo-toggle .replay { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.demo-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
h3 { font-size: 16px; line-height: 1.5; letter-spacing: -.025em; }
.how-to p { margin-top: 5px; color: var(--pm-muted, #665f61); font-size: 15px; line-height: 1.65; }
.guide-questions { margin-top: clamp(26px, 3vw, 40px); border-bottom: 1px solid var(--rule); }
.guide-basics { margin-top: 18px; }
.guide-questions details { border-top: 1px solid var(--rule); }
.guide-questions summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 2px; list-style: none; font-weight: 600; line-height: 1.55; cursor: pointer; }
.guide-questions summary::-webkit-details-marker { display: none; }
.guide-questions summary:hover, .guide-questions details[open] > summary { color: var(--accent); }
.guide-questions summary::after { content: ''; flex: 0 0 7px; height: 7px; margin-right: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.guide-questions details[open] > summary::after { transform: rotate(225deg); }
.guide-questions summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.guide-questions details > p { max-width: 65ch; margin: 0 0 18px 2px; }
.guide-questions details > ol { margin: 2px 0 22px; }
#layout-guide { scroll-margin-top: 18px; }
@media (min-width: 681px) and (max-width: 959px) {
  .how-to ol, .how-to .guide-scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
footer { border-top: 1px solid var(--rule); background: var(--pm-surface, #fff); color: var(--pm-muted, #665f61); }
.footer-inner { padding-block: 10px; font-size: 13px; }
.footer-inner a { font-size: 13px; font-weight: 500; }

@media (max-width: 680px) {
  .masthead-inner { min-height: 56px; }
  .brand { gap: 6px; }
  .brand strong { font-size: 20px; }
  .brand img { width: 29px; height: auto; }
  .brand span { display: none; }
  .masthead nav a { padding-inline: 8px; font-size: 13px; }
  .tool-intro { grid-template-columns: 1fr; gap: 16px; padding-block: 24px; }
  .lead { max-width: 33em; margin-top: 12px; }
  .start { margin-top: 18px; }
  .example img { max-height: 230px; }
  .how-to ol, .how-to .guide-scenes { grid-template-columns: 1fr; gap: 15px; margin-top: 18px; }
  .how-to p { margin-top: 3px; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 0; padding-block: 17px 8px; }
}
