@layer components {
  .hero-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 28px auto 0;
    overflow: hidden;
    border: 1px solid #d9cabb;
    border-radius: 16px;
    background: #e9dfd3;
    box-shadow: 0 12px 36px #342d2710;
  }

  .workflow-film {
    --film-stage: #e9dfd3;
    --film-stage-ink: #342d27;
    --film-stage-muted: #6d5d50;
    --film-glow-soft: #fffdfa80;
    --film-glow-warm: #a8463014;
    --film-dot: #8a6f5729;
    --film-paper: #fffdfa;
    --film-surface: #f4eee7;
    --film-surface-hover: #ece0d4;
    --film-ink: #342d27;
    --film-text: #5a4c40;
    --film-muted: #6d5d50;
    --film-brand: #a84630;
    --film-line: #d9cabb;
    --film-line-soft: #e8ddd1;
    --film-accent: #a84630;
    --film-accent-hover: #8d3927;
    --film-accent-ink: #ffffff;
    --film-accent-line: #8d3927;
    --film-accent-ring: #a8463026;
    --film-progress-track: #e1d2c3;
    --film-progress-ring: #b78d76;
    --film-outer-shadow: #342d2710;
    --film-paper-shadow: #63462b16;
    width: 100%;
    margin: 28px auto 0;
    overflow: hidden;
    border: 1px solid var(--film-line);
    border-radius: 16px;
    background: var(--film-paper);
    box-shadow: 0 12px 36px var(--film-outer-shadow);
    text-align: center;
    isolation: isolate;
  }
  .film-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    isolation: isolate;
    background: var(--film-stage);
  }

  .film-stage::before {
    content: "";
    position: absolute;
    inset: -18px;
    z-index: 0;
    pointer-events: none;
    background:
      radial-gradient(ellipse at 2% 4%, var(--film-glow-soft), transparent 54%),
      radial-gradient(ellipse at 100% 96%, var(--film-glow-warm), transparent 48%);
    transform: translate(var(--film-halo-x, 0px), var(--film-halo-y, 0px));
  }

  .film-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(var(--film-dot) .7px, transparent .8px);
    background-size: 22px 22px;
    opacity: .45;
  }

  .film-scene {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    align-items: center;
    gap: 56px;
    width: min(1160px, 100%);
    height: 100%;
    margin-inline: auto;
    padding: 48px;
  }

  .film-story {
    min-width: 0;
    text-align: center;
  }

  .film-step-label {
    display: block;
    color: var(--film-stage-muted);
    font-size: 14px;
    font-weight: 550;
    letter-spacing: .08em;
    line-height: 1.5;
  }

  .film-story h2 {
    margin-top: 18px;
    color: var(--film-stage-ink);
    font-size: clamp(30px, 3.2vw, 44px);
    font-weight: 550;
    letter-spacing: -.025em;
    line-height: 1.4;
  }

  .film-story p {
    margin-top: 18px;
    color: var(--film-stage-muted);
    font-size: 16px;
    line-height: 1.8;
  }

  .film-art {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    width: 100%;
    height: 360px;
  }

  .film-paper {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 18px;
    width: 440px;
    max-width: 100%;
    height: 360px;
    padding: 28px 28px 24px;
    border: 1px solid var(--film-line);
    border-radius: 14px;
    background: var(--film-paper);
    box-shadow: 0 12px 30px var(--film-paper-shadow);
    text-align: center;
  }

  .film-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    min-height: 0;
  }

  .film-card-heading {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 40px;
    color: var(--film-ink);
  }

  .film-card-heading strong {
    font-size: 16px;
    font-weight: 550;
    line-height: 1.55;
  }

  .film-symbol {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 7px;
    background: var(--film-surface-hover);
    color: var(--film-brand);
  }

  .film-symbol svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .film-wallet svg { width: 32px; height: 32px; }

  .film-field {
    display: grid;
    gap: 5px;
    margin-top: 12px;
    color: var(--film-text);
    font-size: 13px;
    line-height: 1.4;
  }

  .film-input {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 40px;
    padding: 8px 16px;
    overflow: hidden;
    border: 1px solid var(--film-line);
    border-radius: 4px;
    background: var(--film-surface);
    color: var(--film-text);
    font-size: 14px;
    line-height: 1;
  }

  .film-password { letter-spacing: .16em; }

  .film-typing-line {
    position: absolute;
    inset: auto 16px 3px;
    height: 1px;
    border-radius: 1px;
    background: var(--film-progress-ring);
    transform-origin: left center;
  }

  .film-action {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 44px;
    margin-top: 0;
    padding: 10px 16px;
    border-radius: 4px;
    background: var(--film-accent);
    color: var(--film-accent-ink);
    box-shadow: 0 0 0 var(--film-action-ring-size, 0px) var(--film-accent-ring);
    font-size: 14px;
    font-weight: 550;
    line-height: 1.5;
  }

  .film-action .icon { width: 17px; height: 17px; }

  .film-floating-note {
    position: absolute;
    z-index: 2;
    inset: -16px 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: max-content;
    max-width: calc(100% - 20px);
    min-height: 32px;
    margin-inline: auto;
    padding: 5px 14px;
    border: 1px solid var(--film-line);
    border-radius: 5px;
    background: var(--film-surface);
    color: var(--film-text);
    box-shadow: 0 3px 10px var(--film-paper-shadow);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
  }

  .film-floating-note .icon { width: 16px; height: 16px; }

  .film-task-product {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    padding: 12px;
    border: 1px solid var(--film-line-soft);
    border-radius: 5px;
    background: var(--film-surface);
  }

  .film-task-product img {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border: 1px solid var(--film-line-soft);
    border-radius: 4px;
    object-fit: cover;
  }

  .film-task-product > div { min-width: 0; }
  .film-task-product strong { display: block; color: var(--film-ink); font-size: 15px; font-weight: 550; line-height: 1.5; }
  .film-task-product > div > span { display: block; margin-top: 5px; color: var(--film-muted); font-size: 13px; line-height: 1.5; }

  .film-task-lines {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 18px;
    color: var(--film-text);
    font-size: 13px;
    line-height: 1.6;
  }

  .film-task-lines > span { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
  .film-task-lines .icon { width: 16px; height: 16px; color: var(--film-brand); }

  .film-checklist { display: grid; gap: 15px; margin-top: 24px; }
  .film-checklist > div { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--film-text); font-size: 15px; line-height: 1.6; }
  .film-check-circle { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--film-line); border-radius: 50%; background: var(--film-surface); color: var(--film-brand); }
  .film-check-circle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

  .film-commission-copy { margin-top: 24px; color: var(--film-text); font-size: 17px; line-height: 1.8; }
  .film-free-tags { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
  .film-free-tags > span { padding: 4px 12px; border: 1px solid var(--film-line); border-radius: 4px; background: var(--film-surface); color: var(--film-text); font-size: 13px; line-height: 1.6; }

  .film-chapters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 48px;
    border-top: 1px solid var(--film-line);
    background: var(--film-surface);
  }

  .film-chapters > button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    min-height: 48px;
    padding: 8px 6px;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--film-text);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    transition: background 160ms, color 160ms, border-color 160ms;
  }

  .film-chapters > button + button { border-left: 1px solid var(--film-line-soft); }
  .film-chapters > button > span { color: var(--film-muted); font-family: Arial, sans-serif; font-size: 11px; }
  .film-chapters > button:hover { background: var(--film-surface-hover); color: var(--film-ink); }
  .film-chapters > button[aria-pressed="true"] { border-bottom-color: var(--film-accent-line); background: var(--film-brand); color: var(--film-accent-ink); }
  .film-chapters > button[aria-pressed="true"] > span { color: var(--film-accent-ink); }
  .film-chapters > button[aria-pressed="true"]:hover { background: var(--film-accent-hover); }
  .film-chapters > button:focus-visible { position: relative; z-index: 1; outline-offset: -5px; }

  .film-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 50px;
    padding: 2px 12px;
    border-top: 1px solid var(--film-line-soft);
    background: var(--film-paper);
  }

  .film-control-button {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: transparent;
    color: var(--film-brand);
    transition: background 160ms;
  }

  .film-control-button:hover { background: var(--film-surface-hover); color: var(--film-accent-hover); }
  .film-control-button:focus-visible { outline-offset: -4px; }
  .film-control-button .icon { width: 17px; height: 17px; }
  .film-control-button [data-film-play-icon] { fill: currentColor; stroke-width: 1; }
  .film-time { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; color: var(--film-text); font-family: Arial, sans-serif; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .film-time > span:first-child { color: var(--film-ink); }
  .film-playback-state { min-width: 48px; color: var(--film-muted); font-size: 11px; white-space: nowrap; }

  .film-progress {
    --film-progress: 0%;
    appearance: none;
    -webkit-appearance: none;
    flex: 1 1 0;
    min-width: 24px;
    height: 44px;
    margin: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    accent-color: var(--film-brand);
    cursor: pointer;
    touch-action: pan-y;
  }

  .film-progress::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, var(--film-brand) var(--film-progress), var(--film-progress-track) var(--film-progress)); }
  .film-progress::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid var(--film-paper); border-radius: 50%; background: var(--film-brand); box-shadow: 0 0 0 1px var(--film-progress-ring); }
  .film-progress::-moz-range-track { height: 3px; border-radius: 3px; background: var(--film-progress-track); }
  .film-progress::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--film-brand); }
  .film-progress::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid var(--film-paper); border-radius: 50%; background: var(--film-brand); box-shadow: 0 0 0 1px var(--film-progress-ring); }
  .film-progress:focus-visible { outline-offset: 1px; }

  .film-fallback { padding: 12px 16px; border-top: 1px solid var(--film-line-soft); color: var(--film-text); font-size: 11px; line-height: 1.8; }
  .film-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; border: 0; clip-path: inset(50%); white-space: nowrap; }
}

@layer responsive {
  .hero.hero-with-film { padding-block: 32px 48px; }
  .hero.hero-with-film .hero-copy { width: min(1296px, calc(100% - 64px)); }
  .hero.hero-with-film h1 { margin-top: 0; font-size: clamp(32px, 3.2vw, 46px); line-height: 1.42; letter-spacing: -.035em; }
  .hero.hero-with-film h1 > span { display: inline; margin-inline-start: .25em; }
  .hero.hero-with-film .hero-description { max-width: 660px; margin-top: 26px; padding-inline: 20px; font-size: 16px; line-height: 1.85; }
  .hero.hero-with-film .desktop-break { display: none; }
  .hero.hero-with-film .hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(440px, calc(100% - 32px)); margin: 24px auto 0; gap: 14px; }
  .hero.hero-with-film .hero-actions > * { min-width: 0; min-height: 54px; gap: 12px; }
  .hero.hero-with-film .button-secondary { border: 1px solid var(--line); background: var(--surface); color: var(--accent); }
  .hero.hero-with-film .button-secondary:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); }
  .hero.hero-with-film .button-secondary .icon { width: 17px; height: 17px; }
  .hero.hero-with-film .hero-note { margin-top: 14px; padding-inline: 16px; }
  .work-dialog .workflow-film { margin: 0 auto 28px; }
  .work-dialog .film-task-lines { flex-wrap: wrap; }

  @media (min-width: 801px) {
    .work-dialog .film-scene { gap: 28px; padding: 32px; }
    .work-dialog .film-story h2 { margin-top: 18px; font-size: 32px; line-height: 1.4; }
    .work-dialog .film-story p { font-size: 14px; }
    .work-dialog .film-art, .work-dialog .film-paper { height: 320px; }
    .work-dialog .film-paper { width: 400px; padding: 24px; gap: 16px; }
  }

  @media (max-width: 1080px) {
    .hero.hero-with-film .hero-copy { width: calc(100% - 48px); }
    .film-scene { gap: 28px; padding: 32px; }
    .film-story h2 { font-size: 34px; }
    .film-story p { font-size: 14px; }
    .film-art, .film-paper { height: 320px; }
    .film-paper { width: 400px; padding: 24px; gap: 16px; }
  }

  @media (max-width: 800px) {
    .hero.hero-with-film { padding-top: 24px; }
    .hero.hero-with-film .hero-copy { width: calc(100% - 32px); }
    .hero.hero-with-film h1 { font-size: 32px; }
    .film-scene { gap: 24px; padding: 24px; }
    .film-art, .film-paper { height: 286px; }
    .film-paper { width: 360px; padding: 22px 18px; gap: 12px; }
    .film-story h2 { font-size: 27px; }
    .film-story p { font-size: 13px; }
    .film-step-label { font-size: 12px; }
    .film-card-heading { min-height: 32px; gap: 8px; }
    .film-card-heading strong { font-size: 14px; }
    .film-symbol { width: 32px; height: 32px; }
    .film-symbol svg { width: 24px; height: 24px; }
    .film-field { margin-top: 9px; font-size: 12px; }
    .film-input { height: 34px; font-size: 12px; }
    .film-action { min-height: 38px; padding-block: 8px; font-size: 12px; }
    .film-task-product { gap: 10px; margin-top: 16px; padding: 9px; }
    .film-task-product img { width: 46px; height: 46px; }
    .film-task-product strong { font-size: 13px; }
    .film-task-product > div > span { font-size: 11px; }
    .film-task-lines { gap: 12px; margin-top: 12px; font-size: 11px; }
    .film-task-lines .icon { width: 13px; height: 13px; }
    .film-checklist { margin-top: 18px; gap: 12px; }
    .film-checklist > div { font-size: 13px; }
    .film-check-circle { width: 24px; height: 24px; }
    .film-commission-copy { margin-top: 18px; font-size: 15px; }
    .film-free-tags { margin-top: 14px; }
    .film-free-tags > span { font-size: 12px; }
    .film-floating-note { min-height: 28px; inset-block-start: -14px; padding: 4px 10px; font-size: 11px; }
    .work-dialog .film-stage { aspect-ratio: auto; height: 326px; }
    .work-dialog .film-scene { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 20px 12px; }
    .work-dialog .film-story { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .work-dialog .film-art { width: min(400px, calc(100% - 12px)); height: 286px; max-height: none; margin-inline: auto; }
    .work-dialog .film-paper { width: 100%; height: 100%; }
  }

  @media (max-width: 700px) {
    .hero.hero-with-film { padding-block: 24px 32px; }
    .hero.hero-with-film .hero-copy { width: calc(100% - 8px); }
    .hero.hero-with-film h1 { padding-inline: 20px; font-size: 30px; line-height: 1.3; letter-spacing: -.025em; }
    .hero.hero-with-film h1 > span { display: block; margin-inline-start: 0; }
    .hero.hero-with-film .hero-description { max-width: 440px; margin-top: 22px; padding-inline: 22px; font-size: 14px; line-height: 1.85; }
    .hero.hero-with-film .hero-actions { margin-top: 20px; gap: 12px; }
    .hero.hero-with-film .hero-actions > * { min-height: 50px; padding: 12px 18px; font-size: 14px; gap: 10px; }
    .hero.hero-with-film .hero-note { max-width: none; margin-top: 12px; font-size: 11px; }
    .hero.hero-with-film .hero-media { margin-top: 22px; border-radius: 12px; }
    .film-scene { position: relative; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 12px; }
    .film-story { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .film-art { width: min(360px, calc(100% - 12px)); height: 100%; max-height: 240px; margin-inline: auto; }
    .film-paper { width: 100%; height: 100%; padding: 12px 16px 10px; gap: 8px; border-radius: 8px; }
    .film-card-heading { min-height: 25px; gap: 7px; }
    .film-card-heading strong { font-size: 13px; }
    .film-symbol { width: 25px; height: 25px; border-radius: 5px; }
    .film-symbol svg { width: 19px; height: 19px; }
    .film-wallet svg { width: 21px; height: 21px; }
    .film-field { grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; line-height: 1.4; }
    .film-input { height: 26px; padding: 4px 8px; font-size: 12px; }
    .film-typing-line { bottom: 2px; }
    .film-action { min-height: 28px; padding: 4px 10px; font-size: 12px; }
    .film-action .icon { width: 13px; height: 13px; }
    .film-floating-note { inset: -12px 6px auto; max-width: calc(100% - 12px); min-height: 22px; gap: 5px; padding: 3px 8px; font-size: 10px; }
    .film-floating-note .icon { width: 11px; height: 11px; }
    .film-task-product { gap: 9px; margin-top: 7px; padding: 5px 8px; }
    .film-task-product img { width: 34px; height: 34px; }
    .film-task-product strong { font-size: 12px; }
    .film-task-product > div > span { margin-top: 2px; font-size: 11px; }
    .film-task-lines { gap: 12px; margin-top: 6px; font-size: 11px; }
    .film-task-lines > span { gap: 3px; }
    .film-task-lines .icon { width: 11px; height: 11px; }
    .film-checklist { gap: 5px; margin-top: 7px; }
    .film-checklist > div { gap: 7px; font-size: 12px; }
    .film-check-circle { width: 17px; height: 17px; }
    .film-check-circle svg { width: 11px; height: 11px; }
    .film-commission-copy { margin-top: 8px; font-size: 13px; line-height: 1.6; }
    .film-free-tags { gap: 7px; margin-top: 6px; }
    .film-free-tags > span { padding: 1px 8px; font-size: 11px; }
    .film-chapters { min-height: 44px; }
    .film-chapters > button { min-height: 44px; padding: 7px 3px; font-size: 12px; }
    .film-chapters > button > span { display: none; }
    .film-controls { min-height: 46px; gap: 6px; padding: 0 5px; }
    .film-time { font-size: 11px; }
    .film-time > span + span, .film-playback-state { display: none; }
    .film-control-button { width: 44px; height: 44px; }
    .film-control-button .icon { width: 16px; height: 16px; }
    .film-progress { height: 44px; }
    .work-dialog .workflow-film { margin-bottom: 24px; border-radius: 12px; }
    .work-dialog .film-stage { height: 280px; }
    .work-dialog .film-art { width: min(360px, calc(100% - 12px)); height: 240px; }
    .work-dialog .film-paper { padding: 16px; gap: 10px; }
    .work-dialog .film-field, .work-dialog .film-task-lines, .work-dialog .film-task-product > div > span, .work-dialog .film-free-tags > span { font-size: 12px; }
    .work-dialog .film-task-lines { gap: 4px 12px; }
    .work-dialog .film-action { min-height: 28px; font-size: 12px; }
    .work-dialog .film-floating-note { font-size: 11px; }
  }

  @media (max-width: 360px) {
    .hero.hero-with-film h1 { font-size: 27px; }
    .hero.hero-with-film .hero-description { padding-inline: 20px; font-size: 13px; }
    .film-scene { padding: 10px; }
    .film-paper { padding: 10px 12px 8px; gap: 6px; }
    .film-field { margin-top: 4px; }
    .film-input { height: 24px; }
    .film-card-heading { min-height: 24px; }
    .film-symbol { width: 24px; height: 24px; }
    .film-task-product { margin-top: 5px; }
    .film-task-product > div > span { margin-top: 0; }
    .film-task-product img { width: 28px; height: 28px; }
    .film-task-lines { margin-top: 4px; }
    .film-floating-note { inset-block-start: -10px; }
    .film-checklist { gap: 4px; margin-top: 5px; }
    .film-commission-copy { margin-top: 5px; font-size: 12px; }
    .film-free-tags { margin-top: 4px; }
    .film-action { min-height: 26px; font-size: 11px; }
    .film-chapters > button { font-size: 12px; letter-spacing: -.025em; }
    .film-controls { gap: 4px; }
  }

  @media (prefers-reduced-motion: reduce) {
    .film-chapters > button, .film-control-button { transition: none; }
  }
}
