:root {
    --bg-top: #cacac5;
    --bg-mid: #e4e4df;
    --bg-bottom: #c8c8c3;
    --text-primary: #1a1a1a;
    --text-secondary: #5a5a58;
    --text-muted: #7a7a78;
    --apple-blue-bg: #dbe3ff;
    --apple-mtn-1: #bfd0ff;
    --apple-mtn-2: #a3bcff;
    --apple-btn: #326cff;
    --ai-peach-bg: #fee2d9;
    --ai-mtn-1: #fdcbbe;
    --ai-mtn-2: #fbb7a5;
    --ai-btn: #ee573b;
    --comb-red: #e7402d;
    --comb-green: #1d9858;
    --line-blue: #3061e2;
    --pill-purple: #8e5cf6;
    --pill-cyan: #1982c4;
    --pill-orange: #f59e0b;
    --joint-amber: #f59e0b;
    --card-white: #ffffff;
    --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  }
  /* DOM Overlay Inside 9:16 Frame (Scaled proportionally via CSS container queries / percent positioning) */
  .overlay-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
  }

  /* Top Headline (Scene 1, 6, 7) */
  .scene-headline {
    position: absolute;
    top: 6.2%;
    left: 0;
    width: 100%;
    text-align: center;
    transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0;
    transform: translateY(-12px);
  }
  .scene-headline.visible {
    opacity: 1;
    transform: translateY(0);
  }
  .scene-headline h1 {
    font-size: clamp(26px, 4.8vh, 44px);
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #161616;
    line-height: 1.15;
  }
  .scene-headline .sub-year {
    font-size: clamp(13px, 2vh, 18px);
    font-weight: 600;
    color: #555552;
    margin-top: 4px;
  }

  /* Floating Figma Corner Smoothing Widget (Scene 8 & 12) */
  .figma-slider-card {
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: 13%;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 22px;
    padding: 16px 20px 22px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
    pointer-events: none;
    opacity: 0;
    transform: translateY(24px) scale(0.96);
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .figma-slider-card.visible {
    pointer-events:auto;
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  .figma-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
  }
  .figma-title-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }
  .figma-title-cn {
    font-size: clamp(15px, 2.2vh, 20px);
    font-weight: 800;
    color: #1a1a1a;
  }
  .figma-title-en {
    font-size: clamp(11px, 1.5vh, 14px);
    font-weight: 500;
    color: #888884;
  }
  .figma-val {
    font-size: clamp(15px, 2.2vh, 20px);
    font-weight: 800;
    color: #1a1a1a;
    font-variant-numeric: tabular-nums;
  }
  .figma-track-wrap {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
  }
  .figma-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e2e2de;
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
  }
  .figma-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #1d9858;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
    cursor: grab;
    transition: transform 0.15s ease;
  }
  .figma-range::-webkit-slider-thumb:active {
    transform: scale(1.15);
    cursor: grabbing;
  }
  .figma-ios-tick {
    position: absolute;
    left: 60%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 1;
  }
  .figma-ios-tick .tick-line {
    width: 2px;
    height: 14px;
    background: #999995;
    border-radius: 1px;
  }
  .figma-ios-tick .tick-label {
    margin-top: 14px;
    font-size: 11px;
    font-weight: 700;
    color: #666662;
  }

  /* Top Educational Overlay Cards (Scenes 10 & 11: Squircle CSS, Browser Support, SwiftUI) */
  .edu-modal-card {
    position: absolute;
    top: 7%;
    left: 5.5%;
    right: 5.5%;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 22px;
    padding: 18px 20px;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.05);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-20px) scale(0.96);
    transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1), transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .edu-modal-card.visible {
    pointer-events:auto;
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  .edu-caption {
    font-size: 12px;
    font-weight: 600;
    color: #888884;
    margin-bottom: 4px;
  }
  .edu-big-title {
    font-size: clamp(24px, 3.6vh, 34px);
    font-weight: 900;
    color: #181818;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 4px;
  }
  .edu-sub-formula {
    font-size: clamp(13px, 1.9vh, 17px);
    font-weight: 700;
    color: #333330;
    margin-bottom: 12px;
  }
  .code-pill-box {
    background: #f3f3f0;
    border-radius: 10px;
    padding: 9px 14px;
    font-family: var(--font-mono);
    font-size: clamp(12px, 1.7vh, 15px);
    font-weight: 700;
    color: #1d9858;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(0,0,0,0.05);
  }
  .copy-code-btn {
    border: none;
    background: #ffffff;
    color: #333;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.15s ease;
  }
  .copy-code-btn:hover {
    background: #1a1a1a;
    color: #fff;
  }

  /* Browser compatibility list rows */
  .browser-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: clamp(14px, 2vh, 17px);
    font-weight: 800;
    color: #1f1f1f;
  }
  .browser-row:last-child {
    border-bottom: none;
    padding-bottom: 2px;
  }
  .status-pill {
    font-size: 12px;
    font-weight: 800;
    padding: 4px 11px;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .status-pill.green { background: #1d9858; }
  .status-pill.orange { background: #f59e0b; }
  .status-pill.gray { background: #767672; }

  /* AI Prompt Comparison Bubbles (Scene 9 & 12) */
  .prompt-bubble-wrap {
    position: absolute;
    top: 7%;
    right: 6%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-14px);
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .prompt-bubble-wrap.visible {
    pointer-events:auto;
    opacity: 1;
    transform: translateY(0);
  }
  .prompt-label {
    font-size: 12px;
    font-weight: 700;
    color: #6e6e6a;
    align-self: flex-start;
    margin-bottom: -4px;
  }
  .prompt-pill {
    position: relative;
    padding: 11px 18px;
    border-radius: 16px;
    font-size: clamp(14px, 2vh, 18px);
    font-weight: 800;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
  }
  .prompt-pill:hover {
    transform: scale(1.03);
  }
  .prompt-pill.dark {
    background: #1f1f1f;
    color: #ffffff;
  }
  .prompt-pill.white-strike {
    background: #ffffff;
    color: #1f1f1f;
  }
  .prompt-pill.white-strike .strike-line {
    position: absolute;
    left: 14px;
    right: 14px;
    height: 2.5px;
    background: #e7402d;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 2px;
  }
  .prompt-pill.green-good {
    background: #1d9858;
    color: #ffffff;
  }
  .badge-corner-icon {
    position: absolute;
    left: -10px;
    top: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  }
  .badge-corner-icon.bad { background: #e7402d; }
  .badge-corner-icon.good { background: #1d9858; border: 2px solid #fff; }

  /* Outro Follow Modal Card (Scene 12: 02:09 - 02:15) */
  .outro-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(215, 215, 210, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 20;
  }
  .outro-modal-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }
  .ken-card {
    width: 68%;
    max-width: 280px;
    background: #ffffff;
    border-radius: 32px;
    padding: 28px 24px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0,0,0,0.05);
    transform: scale(0.92);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
  }
  .outro-modal-backdrop.visible .ken-card {
    transform: scale(1);
  }
  .ken-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #ee573b;
    color: #ffffff;
    font-size: 32px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: 0 8px 20px rgba(238, 87, 59, 0.35);
  }
  .ken-name {
    font-size: 28px;
    font-weight: 900;
    color: #181818;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
  }
  .ken-bio {
    font-size: 14px;
    font-weight: 600;
    color: #767672;
    margin-bottom: 22px;
  }
  .ken-follow-btn {
    width: 100%;
    padding: 13px 20px;
    border-radius: 999px;
    border: none;
    background: #ee573b;
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 20px rgba(238, 87, 59, 0.32);
    font-family: inherit;
    position: relative;
  }
  .ken-follow-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(238, 87, 59, 0.42);
  }
  .ken-follow-btn:active {
    transform: scale(0.95);
  }
  .ken-follow-btn.followed {
    background: #141413;
    color: #ffffff;
    box-shadow: 0 0 0 5px rgba(238, 87, 59, 0.16), 0 8px 20px rgba(0, 0, 0, 0.25);
  }

  /* Animated Pointer Cursor in Outro */
  .virtual-cursor {
    position: absolute;
    width: 26px;
    height: 26px;
    pointer-events: none;
    z-index: 25;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
    opacity: 0;
  }
  .virtual-cursor.visible {
    opacity: 1;
  }

  /* Subtitle Bar inside 9:16 frame (bottom center) */
  .subtitle-box {
    position: absolute;
    bottom: 2.8%;
    left: 6%;
    right: 6%;
    text-align: center;
    pointer-events: none;
    z-index: 28;
  }
  .subtitle-text {
    display: inline-block;
    font-size: clamp(13px, 2.05vh, 18px);
    font-weight: 800;
    color: #ffffff;
    text-shadow:
      0 2px 6px rgba(0, 0, 0, 0.65),
      -1px -1px 0 rgba(0, 0, 0, 0.75),
      1px -1px 0 rgba(0, 0, 0, 0.75),
      -1px 1px 0 rgba(0, 0, 0, 0.75),
      1px 1px 0 rgba(0, 0, 0, 0.75);
    padding: 4px 10px;
    border-radius: 8px;
    line-height: 1.35;
    letter-spacing: 0.02em;
  }

  /* Sidebar parameter controls: shared page always has a visible right panel. */
  .lab-section-title {
    font-size: 13px;
    font-weight: 800;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    padding-bottom: 6px;
  }
  .lab-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .lab-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: #444;
  }
  .lab-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e0e0dc;
    outline: none;
  }
  .lab-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1d9858;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    cursor: pointer;
  }
  .lab-toggle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .lab-chip-btn {
    border: 1px solid rgba(0,0,0,0.1);
    background: #f5f5f2;
    color: #333;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-align: center;
  }
  .lab-chip-btn.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
  }



*{box-sizing:border-box}
html,body{margin:0;min-width:0;font-family:var(--font-sans);color:#f1f3f0;background:radial-gradient(ellipse at 42% 28%,#323a3b 0%,#101615 80%)}
body{font-variant-numeric:tabular-nums}
button,input,textarea{font:inherit}button{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #56e5cd;outline-offset:3px}
.corner-shell{max-width:1330px;margin:auto;padding:clamp(14px,2.5vh,24px) clamp(14px,3vw,42px) 20px}
.corner-layout{align-items:start}
.corner-screen{position:absolute;inset:0;isolation:isolate;overflow:hidden;border-radius:40px;background:radial-gradient(ellipse 85% 65% at 38% 46%,#e7e7e2 0%,#d8d8d3 55%,#c6c6c1 100%)}
.viewport-frame{position:absolute;inset:0;overflow:hidden;touch-action:none;cursor:grab;container-type:size}
.viewport-frame:active{cursor:grabbing}
.stage-composition{position:absolute;left:50%;top:50%;width:min(100cqw,58.6667cqh);height:auto;aspect-ratio:720/1080;transform:translate(-50%,-50%);container-type:inline-size;pointer-events:none}
#stageCanvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.overlay-layer{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.corner-sidebar{background:#f5f5f1;color:#242927;border:1px solid #ffffff60;padding:22px 24px;box-shadow:0 22px 65px #0005;scrollbar-width:none}
.detail-panel-nav{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}.back-link{color:#187d66;text-decoration:none;font-size:12px;font-weight:700;white-space:nowrap}.back-link:hover{text-decoration:underline}.top-count{color:#397c67;font:700 12px var(--font-mono)}
.eyebrow{font:700 10px/1.3 var(--font-mono);letter-spacing:1.2px;color:#3a9d81}
.corner-sidebar h1{font-size:clamp(23px,2.5vw,30px);line-height:1.22;letter-spacing:-.6px;margin:10px 0}.corner-sidebar h1 small{display:block;font-size:.68em;color:#66756f;margin-top:4px}
.intro{font-size:13px;line-height:1.7;color:#5f6864;margin:0 0 15px}
.chapter-pills{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 16px}.chapter-btn{font-size:11px;font-weight:650;border:1px solid #d7dfd8;border-radius:11px;padding:8px 10px;color:#53625a;background:#fdfdfb;line-height:1.35;transition:background .15s,color .15s}.chapter-btn:hover{background:#e9f2ed}.chapter-btn.active{color:#fff;border-color:#216c58;background:#246d5a}
.mode-switch{display:flex;gap:5px;padding:4px;border-radius:13px;background:#e8ebe6;margin:0 0 14px}.mode-btn{flex:1;min-width:0;padding:10px 7px;border:0;border-radius:10px;color:#52605a;background:transparent;font-size:12px;font-weight:750}.mode-btn.active{color:#206e58;background:#fff;box-shadow:0 1px 8px #0001}
.player-panel{padding:16px;border-radius:18px;background:#fff;border:1px solid #e2e6e0;margin-bottom:16px}.player-head{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;color:#353d39}.time-readout{white-space:nowrap;font:700 11px var(--font-mono);color:#3f6659}
.timeline-slider{width:100%;height:27px;margin:10px 0 8px;accent-color:#208b6d;cursor:pointer}
.player-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.player-actions button{min-width:0;display:flex;justify-content:center;align-items:center;gap:5px;white-space:nowrap;border:1px solid #d9e3dc;background:#edf5ee;border-radius:10px;padding:10px 4px;color:#245b49;font-size:11px;font-weight:750}.player-actions button:hover{background:#e0efe5}.player-help{font-size:11px;line-height:1.5;color:#66736b;margin:11px 0 0;min-height:17px}
.lab-panel{display:flex;flex-direction:column;gap:14px;padding:17px;border-radius:18px;background:#fff;border:1px solid #e2e6e0;margin-bottom:17px;box-shadow:none;width:100%;height:auto;max-height:none;overflow:visible;min-width:0;color:#242927}
.lab-section-title{color:#2c3c34}.lab-control-group{min-width:0}.lab-label-row{line-height:1.45}.lab-chip-btn{min-width:0}.lab-chip-btn.active{background:#235e4c;border-color:#235e4c;color:#fff}
.prompt-box{padding:16px;border-radius:17px;background:#fff;border:1px solid #e2e6e0}.prompt-top{display:flex;gap:8px;justify-content:space-between;align-items:center}.prompt-top strong{color:#2b785e;font-size:12px}.prompt-top span{font-size:10px;color:#78837d}.prompt-text{padding:13px;border:1px solid #e6e9e4;border-radius:11px;white-space:pre-wrap;user-select:text;-webkit-user-select:text;overflow-wrap:anywhere;font-size:12px;line-height:1.85;color:#404a44;background:#f8faf7}.copy-row{display:grid;grid-template-columns:1fr 1fr;gap:9px}.copy-row button{border:0;border-radius:11px;background:#206951;color:white;padding:12px 8px;font-size:12px;font-weight:750}.copy-row button+button{background:#e1ede7;color:#266b53}
.skill-preview{margin-top:17px}.skill-preview label{display:block;color:#69766e;font-size:12px;margin-bottom:8px}.skill-preview textarea{width:100%;padding:12px;border:1px solid #dde5dc;background:#fff;border-radius:12px;color:#384c43;font:11px/1.7 var(--font-mono);resize:none;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;user-select:text;-webkit-user-select:text}
.accuracy-note{font-size:11px;line-height:1.7;color:#75817a;margin:16px 0 0}
/* Fit the full 720×1080 reference frame to the phone without horizontal cropping or stretching. */
.scene-headline h1{font-size:clamp(25px,5.6cqw,37px)}.scene-headline .sub-year{font-size:clamp(13px,2.7cqw,18px)}
.figma-slider-card{pointer-events:none}.figma-slider-card.visible{pointer-events:auto}
.edu-modal-card{pointer-events:none}.edu-modal-card.visible{pointer-events:auto}
.prompt-bubble-wrap{pointer-events:none}.prompt-bubble-wrap.visible{pointer-events:auto}
/* Only the visible composition can receive gesture input, and the dynamic island stays above it. */
@media(min-width:961px){html,body{height:100%;overflow:hidden}body{--demo-device-height:min(844px,calc(100dvh - 40px))}.corner-shell{padding-bottom:0}.corner-sidebar{height:var(--demo-device-height)}}
@media(max-width:960px){.corner-sidebar{height:auto;overflow:visible}.corner-shell{padding-bottom:30px}}
@media(max-width:420px){.corner-sidebar{padding:17px}.player-panel{padding:12px}.chapter-btn{font-size:10px;padding:8px}.lab-panel{padding:13px}.corner-shell{padding-left:12px;padding-right:12px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important}}
