.birthfilm-page {
  --bf-paper: #f7f3e9;
  --bf-sheet: #fffdf8;
  --bf-ink: #233c31;
  --bf-muted: #536457;
  --bf-line: #c9c7b5;
  --bf-sage: #dce4d2;
  --bf-clay: #8a4c40;
  --bf-serif: "Noto Serif KR", "Batang", Georgia, serif;
  --bf-hand: "Nanum Pen Script", Freesentation, sans-serif;
  --bf-code: ui-monospace, Consolas, monospace;
  --bf-story-paper: #fff4ec;
  --bf-story-ink: #202b30;
  --bf-story-accent: #be4131;
  --bf-story-border: #efd6c7;
  background: #fff;
  color: var(--bf-ink);
}

.birthfilm-page button, .birthfilm-page select { font: inherit; color: inherit; cursor: pointer; }
.birthfilm-page :is(a, button, select):focus-visible { outline: 2px solid var(--bf-clay); outline-offset: 4px; }
.birthfilm-page [hidden] { display: none !important; }
.birthfilm-page .menu-toggle { display: none; }
.bf-defs { position: absolute; }
.bf-shell { --bf-shell-gutter: 24px; width: min(100%, 760px); margin: 0 auto; padding: 25px var(--bf-shell-gutter) 64px; }
.bf-path { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--bf-muted); }
.bf-path a { font-weight: 700; letter-spacing: .08em; }
.bf-path a:hover { text-decoration: underline; }
.bf-feature { max-width: 470px; margin: 26px auto 0; }
.bf-feature > :is(#entry, .bf-reveal) { border-top: 1px solid var(--bf-ink); }
.bf-feature > section:focus { outline: none; }

.bf-toolbar > span {
  font: 500 11px/1.5 var(--bf-code);
  letter-spacing: .1em;
}

.bf-hero { padding: 25px 0 23px; text-align: center; }
.bf-hero h1 {
  margin: 11px 0 12px;
  font: 800 clamp(36px, 9.6vw, 50px)/1.12 var(--bf-serif);
  letter-spacing: -.05em;
  word-break: keep-all;
}
.bf-hero h1 small { display: block; margin-bottom: 5px; color: var(--bf-muted); font-size: 15px; font-weight: 500; letter-spacing: -.02em; }
.bf-lead { color: var(--bf-muted); font-size: clamp(14px, 3.5vw, 16px); line-height: 1.65; margin: 0; word-break: keep-all; }
.bf-illustration { display: block; width: 108px; max-width: 65%; height: auto; margin: 0 auto; }
.bf-reel { transform-box: view-box; transform-origin: 60px 56px; }
.bf-illustration .bf-reel { animation: bf-spin 26s linear infinite; }

.bf-collect { padding: 4px; border: 1px solid #839185; background: var(--bf-sheet); }
.bf-collect-inner { padding: 11px clamp(10px, 4vw, 20px) 12px; border: 1px solid #839185; }
.bf-collect-head, .bf-preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bf-collect-head { padding: 0 0 8px; border-bottom: 1px solid #9ca79a; }
.bf-collect-head h2, .bf-preview-head h2 { margin: 0; font: 700 15px/1.4 var(--bf-serif); }
.bf-collect-head i { color: var(--bf-muted); font: italic 15px/1.4 Georgia, serif; }
.bf-date-controls { display: flex; align-items: end; justify-content: center; margin: 14px 0 16px; color: var(--bf-muted); font: 15px/1.5 var(--bf-serif); }
.bf-date-controls label { display: inline-flex; align-items: end; gap: 6px; }
.bf-date-controls label + label { margin-left: 12px; }
.bf-date-controls label > :last-child, .bf-date-ending { padding-bottom: 6px; }
.bf-date-ending { white-space: nowrap; }
.bf-date-select { position: relative; width: clamp(55px, 17vw, 74px); }
.bf-date-select::after { content: ""; position: absolute; right: 1px; bottom: 17px; width: 5px; height: 5px; border: solid var(--bf-muted); border-width: 0 1px 1px 0; transform: rotate(45deg); pointer-events: none; }
.birthfilm-page .bf-date-select select {
  appearance: none;
  width: 100%;
  min-height: 49px;
  padding: 0 9px 0 0;
  border: 0;
  border-bottom: 1px solid #839185;
  border-radius: 0;
  background: transparent;
  color: var(--bf-ink);
  font: 400 clamp(32px, 9.2vw, 44px)/1 Georgia, serif;
  font-variant-numeric: lining-nums tabular-nums;
  text-align: center;
  text-align-last: center;
}
.bf-date-select option { font: 16px/1.4 Freesentation, sans-serif; }
.bf-input-note { margin: 8px 0 0; color: var(--bf-muted); font-size: 12px; line-height: 1.5; text-align: center; }
.birthfilm-page .bf-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 51px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 1px;
  background: var(--bf-ink);
  color: var(--bf-sheet);
  font-size: 16px;
  font-weight: 650;
}
.birthfilm-page .bf-primary:not(:disabled):hover { background: #375749; }
.bf-primary:disabled { opacity: .65; cursor: default; }
.bf-primary > span { font-size: 18px; font-weight: 400; }
.bf-preview { margin: 26px 0 0; }
.bf-preview-head { padding: 0 0 8px; border-bottom: 1px solid #839185; }
.bf-preview-head > span { flex: none; color: var(--bf-muted); font: 11px/1.5 var(--bf-code); }
.bf-preview ul { margin: 0; padding: 0; list-style: none; }
.bf-preview li { border-bottom: 1px solid #e4dfd3; }
.bf-preview a { display: grid; grid-template-columns: 43px minmax(0, 1fr) auto; align-items: baseline; gap: 8px; min-height: 44px; padding: 11px 5px; font-size: 13px; }
.bf-preview a:hover { background: var(--bf-paper); }
.bf-preview a > :first-child { color: var(--bf-muted); font: 16px/1.25 Georgia, serif; }
.bf-preview a > :last-child { color: var(--bf-clay); font: 13px/1.5 var(--bf-serif); text-align: right; }

.bf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 47px;
  color: var(--bf-muted);
  border-bottom: 1px solid var(--bf-line);
}
.bf-toolbar button {
  min-height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--bf-ink);
  font-size: 13px;
  font-weight: 650;
}
.bf-toolbar button:hover { text-decoration: underline; text-underline-offset: 3px; }
.bf-reveal {
  padding: 0 clamp(13px, 5vw, 28px) 32px;
  background: var(--bf-sage);
  text-align: center;
}
.bf-reveal .bf-toolbar { border-color: #b4c1ad; }
.bf-date-caption { margin: 0; color: var(--bf-muted); font: 17px/1.4 Georgia, var(--bf-serif); }
.bf-reveal .bf-date-caption { margin-top: 31px; font-size: 19px; }
.bf-reveal h2, .bf-result-intro h2 {
  margin: 5px 0 0;
  font: 750 clamp(23px, 6.2vw, 32px)/1.4 var(--bf-serif);
  letter-spacing: -.045em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.bf-bloom { display: block; width: 214px; max-width: 75%; height: auto; margin: 25px auto 14px; }
.bf-growing-stem { stroke-dasharray: 120; animation: bf-grow 1.1s ease-out both; }
.bf-leaf { transform-box: fill-box; animation: bf-pop .6s .9s ease-out both; }
.bf-leaf-left { transform-origin: right bottom; }
.bf-leaf-right { transform-origin: left bottom; }
.bf-growing-detail { animation: bf-appear .4s 1.2s linear both; }
.bf-petals use {
  transform-box: view-box;
  transform-origin: 0 0;
  animation: bf-pop .3s calc(1.6s + var(--i) * .4s) cubic-bezier(.3,1.6,.5,1) both;
}
.bf-bloom .bf-reel { animation: bf-turn 1.1s 3.9s ease-in-out both; }
.bf-reveal-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.bf-reveal-steps li { padding: 4px 8px; border: 1px solid #8fa18b; border-radius: 16px; color: var(--bf-muted); font-size: 11px; }
.bf-reveal-action { margin-top: 22px; animation: bf-action-in .4s 4s ease-out both; }

.bf-results {
  --bf-ink: var(--bf-story-ink);
  --bf-muted: #655951;
  --bf-sheet: #fffdfc;
  --bf-clay: var(--bf-story-accent);
  --bf-result-soft: #ffe5d8;
  --bf-story-serif: "Nanum Myeongjo", var(--bf-serif);
  --bf-story-english: "Instrument Serif", Georgia, serif;
  padding: 24px 24px 60px;
  border-top: 1px solid #233c31;
  background: var(--bf-story-paper);
  color: var(--bf-ink);
}
.bf-result-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 24px; }
.bf-results:has(#film-result:not([hidden])) .bf-result-toolbar { display: none; }
.bf-result-toolbar button {
  min-height: 40px;
  padding: 6px 13px;
  border: 1px solid var(--bf-story-border);
  border-radius: 24px;
  background: var(--bf-sheet);
  font-size: 13px;
}
.bf-result-toolbar button:hover { background: var(--bf-result-soft); }
.bf-result-toolbar button span { margin-right: 3px; }
.bf-result-date { padding: 6px 12px; border-radius: 24px; background: var(--bf-result-soft); color: var(--bf-clay); font-size: 13px; font-weight: 650; }
.bf-result-intro { margin: 0 0 17px; }
.bf-still { margin: 0; }
.bf-still-art { position: relative; }
.bf-frame-window { position: relative; overflow: hidden; aspect-ratio: 3 / 2; background: #373d40; }
.bf-frame-visual { position: absolute; inset: 0; display: grid; place-items: center; animation: bf-still-in .55s ease-out both; }
.bf-frame-window img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#still-placeholder { display: grid; justify-items: center; gap: 7px; color: #fff4ec; font-size: 12px; text-align: center; }
.bf-frame-date {
  position: absolute;
  inset: 0 auto auto 0;
  margin: 0;
  padding: 11px 24px 12px 14px;
  color: #fff4ec;
  font: 16px/1.2 var(--bf-story-english);
  text-shadow: 0 1px 3px #202b30;
}
.bf-photo-credit { margin: 6px 0 0; color: var(--bf-muted); font-size: 11px; line-height: 1.4; text-align: left; overflow-wrap: anywhere; }
.bf-photo-credit a:hover { text-decoration: underline; text-underline-offset: 2px; }
.bf-film-identity { margin-top: 19px; animation: bf-result-rise .45s .17s ease-out both; }
.bf-film-kicker { margin: 0 0 6px; color: var(--bf-muted); font-size: 12px; }
.bf-film-identity h2 {
  margin: 0;
  font: 800 clamp(27px, 8.72vw, 39px)/1.2 var(--bf-story-serif);
  letter-spacing: -.04em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.bf-film-original { margin: 7px 0 0; color: var(--bf-muted); font: italic 18px/1.35 var(--bf-story-english); overflow-wrap: anywhere; }
.bf-film-line {
  margin: 14px 0 0;
  color: var(--bf-ink);
  font: 400 15px/1.7 var(--bf-story-serif);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.bf-film-word {
  margin-top: 22px;
  padding: 16px 0 20px;
  border-top: 1px solid var(--bf-ink);
  border-bottom: 1px solid var(--bf-story-border);
  animation: bf-result-rise .45s .4s ease-out both;
}
.bf-result-flower { position: absolute; width: 40px; height: 80px; right: 24px; bottom: -20px; pointer-events: none; }
.bf-result-stalk { transform-box: fill-box; transform-origin: center top; animation: bf-stalk-in .25s .52s ease-out both; }
.bf-result-leaf { transform-box: fill-box; transform-origin: right bottom; animation: bf-pop .22s .65s ease-out both; }
.bf-result-flower-head { transform-box: view-box; transform-origin: 28px 28px; animation: bf-head-in .34s .71s cubic-bezier(.2,.85,.33,1.25) both; }
.bf-film-word p { margin: 0; }
.bf-result-label { color: var(--bf-muted); font-size: 12px; line-height: 1.45; }
.bf-film-word p + p { margin-top: 7px; }
#film-word {
  display: inline-block;
  max-width: 100%;
  color: var(--bf-clay);
  font: 400 clamp(31px, 11.3vw, 46px)/1.15 var(--bf-hand);
  word-break: keep-all;
  overflow-wrap: anywhere;
  animation: bf-write .58s .64s steps(12) both;
}
.bf-film-intro {
  margin-top: 18px;
  color: var(--bf-muted);
  font-size: 15px;
  line-height: 1.8;
  word-break: keep-all;
  animation: bf-result-rise .4s .98s ease-out both;
}
.bf-film-intro p { margin: 0; }
.bf-film-intro .bf-film-meta { margin-top: 13px; font-size: 12px; line-height: 1.5; }

.bf-result-actions { margin: 22px 0 0; }
.bf-action-icon { flex: none; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.bf-secondary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.birthfilm-page .bf-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid #839185;
  border-radius: 1px;
  background: var(--bf-sheet);
  color: var(--bf-ink);
  font-size: 14px;
  font-weight: 650;
  text-align: center;
  word-break: keep-all;
}
.birthfilm-page .bf-secondary:hover { background: #edf0e2; }
.bf-source { margin: 14px 0 0; font-size: 11px; color: var(--bf-muted); }
.bf-source a { text-decoration: underline; text-underline-offset: 3px; }
.bf-another { width: 100%; margin: 16px 0 0; }

.bf-empty > p { color: var(--bf-muted); font-size: 15px; line-height: 1.7; word-break: keep-all; }
.bf-empty h3 { margin: 24px 0 10px; font: 700 17px/1.4 var(--bf-serif); }
.bf-empty ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bf-empty a {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 12px 35px 12px 13px;
  border: 1px solid #c7caba;
  background: var(--bf-sheet);
}
.bf-empty a:hover { border-color: var(--bf-muted); }
.bf-empty a::after { content: "→"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.bf-empty a small { color: var(--bf-clay); font-size: 12px; }
.bf-empty a span { color: var(--bf-muted); font-size: 13px; }

.bf-feedback { margin-top: 27px; padding: 20px; border: 1px solid var(--bf-story-border); background: var(--bf-sheet); }
.bf-feedback::before { content: ""; display: block; width: 28px; height: 3px; margin: 3px 0 14px; background: #ff8b75; }
.bf-feedback h3 { margin: 0; font: 730 clamp(18px, 5vw, 23px)/1.38 Freesentation, system-ui, sans-serif; letter-spacing: -.025em; word-break: keep-all; }
.bf-feedback > p { margin: 9px 0 15px; color: var(--bf-muted); font-size: 14px; line-height: 1.65; word-break: keep-all; }
.bf-feedback label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 650; }
.bf-feedback textarea, .bf-dialog input {
  display: block;
  width: 100%;
  border: 1px solid #839185;
  background: var(--bf-sheet);
  color: var(--bf-ink);
  padding: 10px;
  font: inherit;
}
.bf-feedback textarea { resize: vertical; min-height: 106px; border-color: #e9bcaa; background: #fdf7f2; }
.bf-feedback textarea:focus-visible, .bf-dialog input:focus-visible { outline: 2px solid var(--bf-clay); outline-offset: 2px; }
.bf-feedback-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
#feedback-count, #feedback-status { color: var(--bf-muted); font-size: 12px; }
.bf-feedback-bottom .bf-primary { width: auto; min-height: 44px; font-size: 14px; }
#feedback-status { margin: 8px 0 0; line-height: 1.5; }
#feedback-status:empty { margin: 0; }

.bf-dialog {
  width: min(calc(100% - 24px), 430px);
  max-height: calc(100% - 24px);
  padding: 15px;
  border: 1px solid var(--bf-story-border);
  background: var(--bf-story-paper);
  color: var(--bf-story-ink);
}
.bf-dialog::backdrop { background: #17261fc2; }
.bf-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.bf-dialog-head h2 { margin: 0; font: 750 19px/1.4 var(--bf-serif); word-break: keep-all; }
.bf-dialog-head button { min-width: 38px; min-height: 38px; padding: 0; border: 1px solid #839185; background: var(--bf-sheet); font-size: 22px; }
.bf-dialog p { color: var(--bf-muted); font-size: 13px; line-height: 1.5; }
#card-preview { width: auto; height: auto; max-height: 58vh; margin: 0 auto; object-fit: contain; }
.bf-dialog .bf-primary { min-height: 46px; padding-inline: 10px; font-size: 14px; }
.bf-dialog #download-card:only-child, .bf-dialog #confirm-share[hidden] + a { grid-column: 1 / -1; }
.birthfilm-page :is(.bf-results, .bf-dialog) .bf-primary { background: var(--bf-story-ink); color: #fff4ec; }
.birthfilm-page :is(.bf-results, .bf-dialog) .bf-primary:not(:disabled):hover { background: #36444a; }
.bf-results #share-card { min-height: 54px; }
.bf-results .bf-action-icon { color: #ff8b75; }
.birthfilm-page .bf-results .bf-secondary { border-color: var(--bf-ink); }
.birthfilm-page .bf-results .bf-secondary:hover { background: var(--bf-result-soft); }
.birthfilm-page .bf-results .bf-another { border-color: transparent; background: transparent; color: var(--bf-ink); }
.bf-another span { color: var(--bf-clay); }
.bf-results .bf-empty a { border-color: var(--bf-story-border); }
#bf-toast {
  position: fixed;
  z-index: 60;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 0;
  padding: 10px 14px;
  border-radius: 3px;
  background: var(--bf-ink);
  color: var(--bf-sheet);
  font-size: 14px;
}

@keyframes bf-spin { to { transform: rotate(360deg); } }
@keyframes bf-grow { from { stroke-dashoffset: 120; } to { stroke-dashoffset: 0; } }
@keyframes bf-appear { from { opacity: 0; } }
@keyframes bf-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes bf-turn { to { transform: rotate(60deg); } }
@keyframes bf-action-in {
  from { visibility: hidden; opacity: 0; transform: translateY(8px); }
  to { visibility: visible; opacity: 1; transform: translateY(0); }
}
@keyframes bf-still-in { from { opacity: 0; transform: scale(1.04); } }
@keyframes bf-stalk-in { from { transform: scaleY(0); } }
@keyframes bf-head-in { from { transform: rotate(-60deg) scale(0); } }
@keyframes bf-result-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes bf-write {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@media (max-width: 620px) {
  .bf-shell { --bf-shell-gutter: 16px; padding: 18px var(--bf-shell-gutter) 46px; }
  .bf-feature { margin-top: 21px; }
  .bf-shell:has(#results:not([hidden])) {
    padding-bottom: 0;
    background: var(--bf-story-paper);
  }
  .bf-shell:has(#results:not([hidden])) .bf-path { padding-inline: 8px; }
  .bf-feature:has(#results:not([hidden])) { max-width: none; margin-top: 0; }
  .bf-results { margin-inline: calc(-1 * var(--bf-shell-gutter)); padding-top: 20px; border-top: 0; }
  .birthfilm-page .topbar__inner { grid-template-columns: 1fr auto; }
  .birthfilm-page .menu-toggle {
    display: grid;
    place-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    border: 1px solid #0002;
    border-radius: 50%;
    background: white;
  }
  .birthfilm-page .menu-toggle span { width: 15px; height: 1.5px; background: currentColor; }
  .birthfilm-page .menu-toggle.is-open span:first-child { transform: translateY(5.5px) rotate(45deg); }
  .birthfilm-page .menu-toggle.is-open span:nth-child(2) { opacity: 0; }
  .birthfilm-page .menu-toggle.is-open span:last-child { transform: translateY(-5.5px) rotate(-45deg); }
  .birthfilm-page .nav.is-open {
    position: absolute;
    inset: 100% 0 auto;
    display: flex;
    justify-content: space-around;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--bf-line);
    background: white;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bf-feature *, .bf-feature *::before, .bf-feature *::after { animation: none !important; }
}

@media (max-width: 300px) {
  .birthfilm-page .topbar__inner { gap: 8px; padding-inline: 12px; }
  .birthfilm-page .brand__logo { width: min(100%, 104px); }
  .birthfilm-page .nav.is-open { flex-wrap: wrap; }
  .bf-shell { --bf-shell-gutter: 12px; }
  .bf-shell:has(#results:not([hidden])) .bf-path { padding-inline: 4px; }
  .bf-results { padding-inline: 16px; }
  .bf-hero h1 { font-size: clamp(29px, 16vw, 38px); }
  .bf-date-ending { display: none; }
  .bf-date-controls { font-size: 13px; }
  .bf-date-controls label { gap: 4px; }
  .bf-date-controls label + label { margin-left: 8px; }
  .bf-date-select { width: clamp(36px, 22vw, 58px); }
  .birthfilm-page .bf-date-select select { font-size: 30px; }
  .bf-preview a { grid-template-columns: 34px minmax(0, 1fr); gap: 3px 6px; }
  .bf-preview a > :last-child { grid-column: 2; text-align: left; }
  .bf-result-intro h2 { font-size: clamp(18px, 9.5vw, 23px); }
  .bf-result-flower { right: 14px; }
  .bf-feedback { padding-inline: 13px; }
  .bf-secondary-actions { grid-template-columns: 1fr; }
  .bf-result-actions #share-card { padding-inline: 8px; font-size: 14px; }
}
