{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"laptop-frame","type":"registry:component","title":"Laptop Frame","description":"MacBook laptop mockup animation that opens and zooms into your screenshot or video. MacBook-style laptop that opens, runs a dynamic-island notch notification, then dives the camera into the screen until an image or video fills the frame.","dependencies":["remotion"],"docs":"Needs a Remotion project. If a frame renders black, the component is drawing on a transparent layer: put a background behind it, e.g. <AbsoluteFill style={{ background: \"#faf9f6\" }}><Component /></AbsoluteFill>. Pass mode=\"dark\" for dark frames.","registryDependencies":["https://kuchi.kalarislabs.com/r/kuchi-ui.json"],"files":[{"path":"components/kuchi/laptop-frame.tsx","type":"registry:component","target":"components/kuchi/laptop-frame.tsx","content":"/*! Portions Copyright (c) 2026 Sri Nath (snap-cn). MIT License. See THIRD_PARTY_LICENSES. */\n\"use client\";\r\n\r\nimport type { CSSProperties, ReactNode } from \"react\";\r\nimport {\r\n  Easing,\r\n  getRemotionEnvironment,\r\n  Img,\r\n  interpolate,\r\n  OffthreadVideo,\r\n  staticFile,\r\n  useCurrentFrame,\r\n  useVideoConfig,\r\n} from \"remotion\";\r\nimport {\r\n  mixOklch,\r\n  resolveFont,\r\n  type KuchiTheme,\r\n  useKuchiTheme,\r\n  withAlpha,\r\n} from \"@/lib/kuchi-ui\";\r\n\r\nexport type LaptopFrameEntrance = \"rise\" | \"open\" | \"none\";\r\nexport type LaptopFrameFinale = \"none\" | \"zoom-to-screen\";\r\nexport type NotchPhase = \"idle\" | \"loading\" | \"done\";\r\n\r\nexport interface LaptopFrameProps {\r\n  /** Screen content. Falls back to `screenSrc`, then a built-in hero placeholder. */\r\n  children?: ReactNode;\r\n  /**\r\n   * Image *or* video to fill the screen when `children` is omitted. Videos\r\n   * (.mp4/.webm/.mov/.m4v) play via `<OffthreadVideo>`, images via `<Img>` —\r\n   * both cover the screen and fade/un-blur in. A root-relative path\r\n   * (`/showcase-videos/x.mp4`) is served by Next in the Player and rewritten\r\n   * through `staticFile()` in Remotion Studio and a render.\r\n   */\r\n  screenSrc?: string;\r\n  /** How the laptop enters. `open` lifts the lid up from the deck. */\r\n  entrance?: LaptopFrameEntrance;\r\n  /**\r\n   * How the shot ends. `zoom-to-screen` dollies the camera into the screen and\r\n   * un-tilts it until the content fills the frame — a product \"screen takeover\".\r\n   * Assumes the frame is the whole composition (the cover scale is derived from\r\n   * `useVideoConfig`).\r\n   */\r\n  finale?: LaptopFrameFinale;\r\n  /** Lid shell + deck base color. Space-grey by default. */\r\n  /** Lid colour. Defaults to a dark neutral from the design system. */\r\n  bezelColor?: string;\r\n  /** Screen fill behind the content. */\r\n  /** Screen fill behind `children`. Defaults to the theme's `card`. */\r\n  screenColor?: string;\r\n  /** Design-system token overrides — applied to the screen's contents. */\r\n  theme?: Partial<KuchiTheme>;\r\n  mode?: \"light\" | \"dark\";\r\n  /**\r\n   * The face this scene paints its words in — a label from `fonts.ts`\r\n   * (\"Inter\", \"Space Grotesk\", \"Instrument Serif\") or a CSS family you have\r\n   * loaded yourself. Unset, the scene keeps the face it was designed around.\r\n   *\r\n   * Overrides `theme.fontFamily`, which is how a brand kit re-skins a whole\r\n   * timeline from one value.\r\n   */\r\n  fontFamily?: string;\r\n  /** Notch status indicator. The macOS system green is the look, not a token. */\r\n  indicatorColor?: string;\r\n  /** rotateX of the lid at rest, in degrees (positive tips the top back). */\r\n  restTilt?: number;\r\n  /** Lid top-corner radius. The bottom corners stay near-square (the hinge). */\r\n  radius?: number;\r\n  /** CSS box-shadow under the deck. Empty string disables it. */\r\n  shadow?: string;\r\n  /** Uniform size multiplier for the whole machine. */\r\n  scale?: number;\r\n  /** Render the notch notification pill. */\r\n  showNotch?: boolean;\r\n  /** Text shown in the notch's connected state. */\r\n  notchLabel?: string;\r\n  /** Battery fill (0–100) drawn green in the connected state. */\r\n  batteryLevel?: number;\r\n  /** Gentle vertical bob after the entrance settles. */\r\n  floatLoop?: boolean;\r\n  /** Peak float displacement in pixels. */\r\n  floatAmplitude?: number;\r\n  speed?: number;\r\n  className?: string;\r\n}\r\n\r\nconst FONT_FAMILY =\r\n  'Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif';\r\n\r\n/** Lid (screen panel) size — a 16:10 MacBook-style display. */\r\nexport const LID_WIDTH = 820;\r\nexport const LID_HEIGHT = 500;\r\n\r\n/** Dark shell thickness between the lid edge and the screen. */\r\nexport const BEZEL_WIDTH = 14;\r\n\r\n/** Deck (base) is a touch wider than the lid — the trapezoid under the hinge. */\r\nexport const DECK_WIDTH = 900;\r\nexport const DECK_HEIGHT = 22;\r\n\r\n/** Lid top-corner radius; bottom corners are near-square where the hinge is. */\r\nexport const LID_RADIUS = 22;\r\n\r\n/** rotateX of the lid at rest, and the perspective it is rendered through. */\r\nexport const REST_TILT = 18;\r\nexport const PERSPECTIVE = 1600;\r\n\r\n/** Frames the entrance takes before the machine is fully settled. */\r\nexport const ENTRANCE_FRAMES = 30;\r\n\r\n/** Camera \"screen takeover\" push: dolly + un-tilt from here to here. */\r\nexport const PUSH_START = 140;\r\nexport const PUSH_END = 185;\r\n\r\n/**\r\n * The camera-move easing. A *moderate* decelerate — not quint/expo-out, which\r\n * cover their travel in the first third and then spend frames moving < 0.5px,\r\n * i.e. freeze on a frame clock. See the motion-quality skill.\r\n */\r\nexport const CAMERA_EASE = Easing.bezier(0.2, 0.6, 0.35, 1);\r\n\r\n/**\r\n * Camera-box height: the lid + deck stack, which is what the outer wrapper\r\n * shrink-wraps and scales around. Used to find how far the screen centre sits\r\n * above the box centre so the zoom can recentre it in the frame.\r\n */\r\nexport const COLUMN_HEIGHT = LID_HEIGHT + DECK_HEIGHT;\r\n\r\n/** Seconds per full float-loop cycle. */\r\nexport const FLOAT_PERIOD_SECONDS = 5;\r\n\r\n/** Notch pill height, and its width in each of the three states. */\r\nexport const NOTCH_HEIGHT = 30;\r\nexport const NOTCH_IDLE_WIDTH = 116;\r\nexport const NOTCH_LOADING_WIDTH = 150;\r\nexport const NOTCH_DONE_WIDTH = 320;\r\n\r\n/** Default frame at which each notch state begins (before `speed`). */\r\nexport const NOTCH_TIMING = {\r\n  loadingStart: 72,\r\n  doneStart: 120,\r\n} as const;\r\n\r\nexport interface EntrancePose {\r\n  opacity: number;\r\n  translateY: number;\r\n  scale: number;\r\n}\r\n\r\n/**\r\n * Pure entrance schedule for the whole machine. Every entrance settles to the\r\n * identity pose by `ENTRANCE_FRAMES`, so the float loop takes over with no seam.\r\n * The lid-open rotation is a separate track — see `lidTilt`.\r\n */\r\nexport function entrancePose(\r\n  frame: number,\r\n  entrance: LaptopFrameEntrance,\r\n): EntrancePose {\r\n  const clamp = {\r\n    extrapolateLeft: \"clamp\",\r\n    extrapolateRight: \"clamp\",\r\n  } as const;\r\n  const easeOut = Easing.out(Easing.cubic);\r\n\r\n  if (entrance === \"none\") {\r\n    return { opacity: 1, translateY: 0, scale: 1 };\r\n  }\r\n\r\n  if (entrance === \"open\") {\r\n    // The travel is small — the drama is in the lid lifting (lidTilt).\r\n    return {\r\n      opacity: interpolate(frame, [0, 10], [0, 1], clamp),\r\n      translateY: interpolate(frame, [0, 24], [24, 0], {\r\n        ...clamp,\r\n        easing: easeOut,\r\n      }),\r\n      scale: 1,\r\n    };\r\n  }\r\n\r\n  // rise (default)\r\n  return {\r\n    opacity: interpolate(frame, [0, 12], [0, 1], clamp),\r\n    translateY: interpolate(frame, [0, 26], [70, 0], {\r\n      ...clamp,\r\n      easing: easeOut,\r\n    }),\r\n    scale: 1,\r\n  };\r\n}\r\n\r\n/**\r\n * rotateX of the lid (degrees). `open` swings it from closed-ish to rest, hinged\r\n * at the deck (the lid's transform-origin is its bottom edge). `zoom-to-screen`\r\n * then flattens it back to 0 during the push, so the takeover ends on a flat,\r\n * head-on screen rather than a foreshortened one.\r\n */\r\nexport function lidTilt(\r\n  frame: number,\r\n  entrance: LaptopFrameEntrance,\r\n  finale: LaptopFrameFinale = \"none\",\r\n  restTilt: number = REST_TILT,\r\n): number {\r\n  const opened =\r\n    entrance === \"open\"\r\n      ? interpolate(frame, [0, ENTRANCE_FRAMES], [82, restTilt], {\r\n          extrapolateLeft: \"clamp\",\r\n          extrapolateRight: \"clamp\",\r\n          easing: Easing.out(Easing.cubic),\r\n        })\r\n      : restTilt;\r\n\r\n  if (finale !== \"zoom-to-screen\" || frame < PUSH_START) return opened;\r\n\r\n  return interpolate(frame, [PUSH_START, PUSH_END], [restTilt, 0], {\r\n    extrapolateLeft: \"clamp\",\r\n    extrapolateRight: \"clamp\",\r\n    easing: CAMERA_EASE,\r\n  });\r\n}\r\n\r\nexport interface CameraPose {\r\n  scale: number;\r\n  translateY: number;\r\n}\r\n\r\n/**\r\n * The \"screen takeover\" camera. `zoom-to-screen` dollies in (scale) and slides\r\n * up (translateY) so the screen's inner rect grows to *cover* the composition\r\n * and stays centred as it does. The scale is derived from the composition size,\r\n * so the content lands exactly filling the frame — verified by rendering frames,\r\n * not eyeballed (motion-quality Rule 0).\r\n */\r\nexport function cameraPose(\r\n  frame: number,\r\n  finale: LaptopFrameFinale,\r\n  baseScale: number,\r\n  compWidth: number,\r\n  compHeight: number,\r\n): CameraPose {\r\n  if (finale !== \"zoom-to-screen\") return { scale: 1, translateY: 0 };\r\n\r\n  const p = interpolate(frame, [PUSH_START, PUSH_END], [0, 1], {\r\n    extrapolateLeft: \"clamp\",\r\n    extrapolateRight: \"clamp\",\r\n    easing: CAMERA_EASE,\r\n  });\r\n\r\n  // Screen inner, at the resting base scale, must cover the whole frame.\r\n  const innerW = (LID_WIDTH - 2 * BEZEL_WIDTH) * baseScale;\r\n  const innerH = (LID_HEIGHT - 2 * BEZEL_WIDTH) * baseScale;\r\n  const cover = Math.max(compWidth / innerW, compHeight / innerH);\r\n  const scale = 1 + (cover - 1) * p;\r\n\r\n  // The screen centre sits `d` px above the camera-box centre (the deck pulls the\r\n  // box centre down). Countering `d * cover` as we scale keeps it centred: the\r\n  // screen centre tracks from (centre − d) to (centre) exactly.\r\n  const d = (COLUMN_HEIGHT / 2 - LID_HEIGHT / 2) * baseScale;\r\n  const translateY = d * cover * p;\r\n\r\n  return { scale, translateY };\r\n}\r\n\r\n/**\r\n * Deterministic float-loop offset in pixels. Starts at 0 with an upward drift\r\n * at `startFrame`, so it blends seamlessly out of the entrance. (Same math as\r\n * the phone-frame float — kept inline so the copied component has no deps.)\r\n */\r\nexport function floatOffset(\r\n  frame: number,\r\n  fps: number,\r\n  amplitude: number,\r\n  startFrame = 0,\r\n  periodSeconds: number = FLOAT_PERIOD_SECONDS,\r\n): number {\r\n  const local = Math.max(0, frame - startFrame);\r\n  const value =\r\n    Math.sin((local / (fps * periodSeconds)) * Math.PI * 2) * amplitude;\r\n  // Negative = upward drift; the `=== 0` guard avoids returning -0.\r\n  return value === 0 ? 0 : -value;\r\n}\r\n\r\nexport interface NotchState {\r\n  phase: NotchPhase;\r\n  /** Pill width in pixels, morphing between the three states. */\r\n  width: number;\r\n  /** Cross-fade weights for the three content layers. */\r\n  idle: number;\r\n  loading: number;\r\n  done: number;\r\n}\r\n\r\n/**\r\n * Pure notch schedule: which state is showing, the morphing pill width, and the\r\n * cross-fade weights of the three content layers. The pill holds its loading\r\n * width, then expands to fit the connected label — the dynamic-island morph.\r\n */\r\nexport function notchState(\r\n  frame: number,\r\n  timing: { loadingStart: number; doneStart: number } = NOTCH_TIMING,\r\n): NotchState {\r\n  const { loadingStart, doneStart } = timing;\r\n  const clamp = {\r\n    extrapolateLeft: \"clamp\",\r\n    extrapolateRight: \"clamp\",\r\n  } as const;\r\n\r\n  const phase: NotchPhase =\r\n    frame < loadingStart ? \"idle\" : frame < doneStart ? \"loading\" : \"done\";\r\n\r\n  const width = interpolate(\r\n    frame,\r\n    [loadingStart - 8, loadingStart, doneStart - 4, doneStart + 12],\r\n    [\r\n      NOTCH_IDLE_WIDTH,\r\n      NOTCH_LOADING_WIDTH,\r\n      NOTCH_LOADING_WIDTH,\r\n      NOTCH_DONE_WIDTH,\r\n    ],\r\n    { ...clamp, easing: Easing.inOut(Easing.cubic) },\r\n  );\r\n\r\n  const idle = interpolate(\r\n    frame,\r\n    [loadingStart - 6, loadingStart],\r\n    [1, 0],\r\n    clamp,\r\n  );\r\n  const loading = interpolate(\r\n    frame,\r\n    [loadingStart - 6, loadingStart, doneStart - 6, doneStart],\r\n    [0, 1, 1, 0],\r\n    clamp,\r\n  );\r\n  const done = interpolate(\r\n    frame,\r\n    [doneStart - 4, doneStart + 6],\r\n    [0, 1],\r\n    clamp,\r\n  );\r\n\r\n  return { phase, width, idle, loading, done };\r\n}\r\n\r\n/**\r\n * Built-in placeholder: a full-bleed product hero. Full-bleed on purpose — the\r\n * `zoom-to-screen` finale dives into the screen, so the content has to reward\r\n * filling the frame, not sit as a small card on empty canvas. Elements stagger\r\n * in during the open, then hold. Pass `imageSrc`/`children` to use your own.\r\n */\r\nfunction PlaceholderScreen({ frame, t }: { frame: number; t: KuchiTheme }) {\r\n  const rise = (delay: number) => {\r\n    const r = interpolate(frame, [delay, delay + 14], [0, 1], {\r\n      extrapolateLeft: \"clamp\",\r\n      extrapolateRight: \"clamp\",\r\n      easing: Easing.out(Easing.cubic),\r\n    });\r\n    return { opacity: r, transform: `translateY(${(1 - r) * 14}px)` };\r\n  };\r\n\r\n  return (\r\n    <div\r\n      style={{\r\n        position: \"absolute\",\r\n        inset: 0,\r\n        background: `linear-gradient(165deg, ${t.card} 0%, ${mixOklch(\r\n          t.card,\r\n          t.primary,\r\n          0.06,\r\n        )} 100%)`,\r\n        color: t.foreground,\r\n        display: \"flex\",\r\n        flexDirection: \"column\",\r\n      }}\r\n    >\r\n      {/* App bar */}\r\n      <div\r\n        style={{\r\n          display: \"flex\",\r\n          alignItems: \"center\",\r\n          justifyContent: \"space-between\",\r\n          padding: \"22px 34px\",\r\n          ...rise(6),\r\n        }}\r\n      >\r\n        <div style={{ display: \"flex\", alignItems: \"center\", gap: 9 }}>\r\n          <div\r\n            style={{\r\n              width: 24,\r\n              height: 24,\r\n              borderRadius: 7,\r\n              background: `linear-gradient(135deg, ${t.primary}, ${mixOklch(\r\n                t.primary,\r\n                t.foreground,\r\n                0.18,\r\n              )})`,\r\n            }}\r\n          />\r\n          <span\r\n            style={{ fontSize: 17, fontWeight: 700, letterSpacing: \"-0.02em\" }}\r\n          >\r\n            Acme\r\n          </span>\r\n        </div>\r\n        <div style={{ display: \"flex\", alignItems: \"center\", gap: 20 }}>\r\n          {[\"Product\", \"Pricing\", \"Docs\"].map((l) => (\r\n            <span key={l} style={{ fontSize: 13.5, color: t.mutedForeground }}>\r\n              {l}\r\n            </span>\r\n          ))}\r\n          <div\r\n            style={{\r\n              padding: \"7px 14px\",\r\n              borderRadius: 8,\r\n              backgroundColor: t.foreground,\r\n              color: t.background,\r\n              fontSize: 13,\r\n              fontWeight: 600,\r\n            }}\r\n          >\r\n            Sign in\r\n          </div>\r\n        </div>\r\n      </div>\r\n\r\n      {/* Hero */}\r\n      <div\r\n        style={{\r\n          flex: 1,\r\n          display: \"flex\",\r\n          flexDirection: \"column\",\r\n          alignItems: \"center\",\r\n          justifyContent: \"center\",\r\n          textAlign: \"center\",\r\n          padding: \"0 40px\",\r\n          gap: 18,\r\n        }}\r\n      >\r\n        <div\r\n          style={{\r\n            display: \"inline-flex\",\r\n            alignItems: \"center\",\r\n            gap: 7,\r\n            padding: \"5px 12px\",\r\n            borderRadius: 999,\r\n            border: `1px solid ${t.border}`,\r\n            backgroundColor: t.card,\r\n            fontSize: 12.5,\r\n            fontWeight: 600,\r\n            color: t.primary,\r\n            ...rise(12),\r\n          }}\r\n        >\r\n          <span\r\n            style={{\r\n              width: 6,\r\n              height: 6,\r\n              borderRadius: 999,\r\n              backgroundColor: t.primary,\r\n            }}\r\n          />\r\n          Now in public beta\r\n        </div>\r\n        <div\r\n          style={{\r\n            fontSize: 46,\r\n            fontWeight: 700,\r\n            letterSpacing: \"-0.03em\",\r\n            lineHeight: 1.05,\r\n            maxWidth: 560,\r\n            ...rise(16),\r\n          }}\r\n        >\r\n          Ship demos that sell.\r\n        </div>\r\n        <div\r\n          style={{\r\n            fontSize: 16.5,\r\n            lineHeight: 1.5,\r\n            color: t.mutedForeground,\r\n            maxWidth: 440,\r\n            ...rise(20),\r\n          }}\r\n        >\r\n          Turn your product into a polished launch video in minutes — no editor,\r\n          no render farm.\r\n        </div>\r\n        <div style={{ display: \"flex\", gap: 10, marginTop: 6, ...rise(24) }}>\r\n          <div\r\n            style={{\r\n              padding: \"11px 20px\",\r\n              borderRadius: 10,\r\n              background: `linear-gradient(135deg, ${t.primary}, ${mixOklch(\r\n                t.primary,\r\n                t.foreground,\r\n                0.18,\r\n              )})`,\r\n              color: t.primaryForeground,\r\n              fontSize: 14.5,\r\n              fontWeight: 600,\r\n              boxShadow: `0 10px 24px ${withAlpha(t.primary, 0.32)}`,\r\n            }}\r\n          >\r\n            Get started\r\n          </div>\r\n          <div\r\n            style={{\r\n              padding: \"11px 20px\",\r\n              borderRadius: 10,\r\n              border: `1px solid ${t.border}`,\r\n              backgroundColor: t.card,\r\n              fontSize: 14.5,\r\n              fontWeight: 600,\r\n            }}\r\n          >\r\n            Watch demo\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n  );\r\n}\r\n\r\nconst isVideo = (src: string) => /\\.(mp4|webm|mov|m4v)(\\?|$)/i.test(src);\r\n\r\n/**\r\n * A root-relative asset (`/showcase-videos/x.mp4`) is served at the origin root\r\n * by Next in the Player, but Remotion Studio and a render serve `public/` through\r\n * `staticFile()` alone — so rewrite local paths everywhere but the Player, and pass\r\n * http(s)/data/blob URLs straight through.\r\n */\r\nfunction resolveSrc(src: string): string {\r\n  const isLocal = src.startsWith(\"/\") && !src.startsWith(\"//\");\r\n  if (!isLocal || getRemotionEnvironment().isPlayer) return src;\r\n  // A value that already came out of staticFile() carries the static base\r\n  // (`/static-<hash>/…`); running it through again would prefix it twice.\r\n  const base = staticFile(\"_\").slice(0, -2);\r\n  if (base && src.startsWith(`${base}/`)) return src;\r\n  try {\r\n    return staticFile(src.replace(/^\\/+/, \"\"));\r\n  } catch {\r\n    return src;\r\n  }\r\n}\r\n\r\n/** Fills the screen with an image or a video, fading and un-blurring it in. */\r\nfunction ScreenMedia({ src, frame }: { src: string; frame: number }) {\r\n  const t = interpolate(frame, [4, 22], [0, 1], {\r\n    extrapolateLeft: \"clamp\",\r\n    extrapolateRight: \"clamp\",\r\n  });\r\n  const style: CSSProperties = {\r\n    position: \"absolute\",\r\n    inset: 0,\r\n    width: \"100%\",\r\n    height: \"100%\",\r\n    // Tailwind's preflight sets `img { max-width: 100% }`, which can collapse a\r\n    // media element we size ourselves to 0px wide. Opt out. (motion-quality skill.)\r\n    maxWidth: \"none\",\r\n    objectFit: \"cover\",\r\n    opacity: t,\r\n    filter: `blur(${(1 - t) * 8}px)`,\r\n  };\r\n  const resolved = resolveSrc(src);\r\n  return isVideo(src) ? (\r\n    <OffthreadVideo src={resolved} muted style={style} />\r\n  ) : (\r\n    <Img src={resolved} style={style} />\r\n  );\r\n}\r\n\r\nfunction Dot({\r\n  size,\r\n  color,\r\n  style,\r\n}: {\r\n  size: number;\r\n  color: string;\r\n  style?: CSSProperties;\r\n}) {\r\n  return (\r\n    <div\r\n      style={{\r\n        width: size,\r\n        height: size,\r\n        borderRadius: 999,\r\n        backgroundColor: color,\r\n        ...style,\r\n      }}\r\n    />\r\n  );\r\n}\r\n\r\n/** The notch pill notification, morphing idle → loading → connected. */\r\nfunction Notch({\r\n  frame,\r\n  label,\r\n  batteryLevel,\r\n  t,\r\n  indicatorColor,\r\n}: {\r\n  frame: number;\r\n  label: string;\r\n  batteryLevel: number;\r\n  /** Resolved in dark mode — the notch is a dark pill whatever the app theme. */\r\n  t: KuchiTheme;\r\n  indicatorColor: string;\r\n}) {\r\n  const state = notchState(frame);\r\n  const layer: CSSProperties = {\r\n    position: \"absolute\",\r\n    inset: 0,\r\n    display: \"flex\",\r\n    alignItems: \"center\",\r\n    justifyContent: \"center\",\r\n  };\r\n\r\n  return (\r\n    <div\r\n      style={{\r\n        position: \"absolute\",\r\n        top: 9,\r\n        left: \"50%\",\r\n        translate: \"-50% 0px\",\r\n        width: state.width,\r\n        height: NOTCH_HEIGHT,\r\n        borderRadius: 999,\r\n        backgroundColor: t.background,\r\n        overflow: \"hidden\",\r\n        zIndex: 10,\r\n      }}\r\n    >\r\n      {/* idle — camera dot + sensor dot */}\r\n      <div style={{ ...layer, gap: 6, opacity: state.idle }}>\r\n        <Dot\r\n          size={9}\r\n          color={mixOklch(t.background, t.foreground, 0.12)}\r\n          style={{\r\n            border: `1px solid ${mixOklch(t.background, t.foreground, 0.2)}`,\r\n          }}\r\n        />\r\n        <Dot size={5} color={mixOklch(t.background, t.foreground, 0.06)} />\r\n      </div>\r\n\r\n      {/* loading — three pulsing dots */}\r\n      <div style={{ ...layer, gap: 4, opacity: state.loading }}>\r\n        {[0, 1, 2].map((i) => (\r\n          <Dot\r\n            key={i}\r\n            size={5}\r\n            color={t.foreground}\r\n            style={{\r\n              opacity: 0.4 + 0.6 * (0.5 + 0.5 * Math.sin(frame / 4 - i * 0.9)),\r\n            }}\r\n          />\r\n        ))}\r\n      </div>\r\n\r\n      {/* done — label + battery */}\r\n      <div style={{ ...layer, gap: 8, opacity: state.done }}>\r\n        <span\r\n          style={{\r\n            fontSize: 12,\r\n            fontWeight: 500,\r\n            letterSpacing: \"-0.01em\",\r\n            color: t.foreground,\r\n            whiteSpace: \"nowrap\",\r\n          }}\r\n        >\r\n          {label}\r\n        </span>\r\n        <div\r\n          style={{\r\n            width: 22,\r\n            height: 11,\r\n            borderRadius: 3,\r\n            border: `1.5px solid ${indicatorColor}`,\r\n            padding: 1.5,\r\n            display: \"flex\",\r\n            alignItems: \"center\",\r\n          }}\r\n        >\r\n          <div\r\n            style={{\r\n              width: `${Math.max(0, Math.min(100, batteryLevel))}%`,\r\n              height: \"100%\",\r\n              borderRadius: 1,\r\n              backgroundColor: indicatorColor,\r\n            }}\r\n          />\r\n        </div>\r\n      </div>\r\n    </div>\r\n  );\r\n}\r\n\r\nexport function LaptopFrame({\r\n  children,\r\n  screenSrc,\r\n  entrance = \"rise\",\r\n  finale = \"none\",\r\n  bezelColor,\r\n  screenColor,\r\n  theme,\r\n  mode,\r\n  fontFamily,\r\n  indicatorColor = \"#30D158\",\r\n  restTilt = REST_TILT,\r\n  radius = LID_RADIUS,\r\n  shadow,\r\n  scale = 0.95,\r\n  showNotch = true,\r\n  notchLabel = \"AirPods Connected\",\r\n  batteryLevel = 85,\r\n  floatLoop = true,\r\n  floatAmplitude = 4,\r\n  speed = 1,\r\n  className,\r\n}: LaptopFrameProps) {\r\n  const frame = useCurrentFrame() * speed;\r\n  // The screen shows an app, so it follows the app theme. The lid, the notch\r\n  // and the drop shadow are a physical object photographed on a desk: they take\r\n  // the dark end of the system whatever mode the screen is in.\r\n  const t = useKuchiTheme(theme, mode);\r\n  const face = resolveFont(fontFamily ?? t.fontFamily) ?? FONT_FAMILY;\r\n  const shell = useKuchiTheme(theme, \"dark\");\r\n  const lid = bezelColor ?? mixOklch(shell.background, shell.foreground, 0.09);\r\n  const glass = screenColor ?? t.card;\r\n  const drop = shadow ?? `0 40px 80px ${withAlpha(shell.background, 0.45)}`;\r\n  const { fps, width, height } = useVideoConfig();\r\n  const isRendering = getRemotionEnvironment().isRendering;\r\n\r\n  const pose = entrancePose(frame, entrance);\r\n  const tilt = lidTilt(frame, entrance, finale, restTilt);\r\n  const camera = cameraPose(frame, finale, scale, width, height);\r\n  // The float loop would fight the camera push, so it stops when the dive starts.\r\n  const bob =\r\n    floatLoop && !(finale === \"zoom-to-screen\" && frame >= PUSH_START)\r\n      ? floatOffset(frame, fps, floatAmplitude, ENTRANCE_FRAMES)\r\n      : 0;\r\n  // The notch is at the top of the screen; fade it out as we dive past it.\r\n  const notchFade =\r\n    finale === \"zoom-to-screen\"\r\n      ? interpolate(frame, [PUSH_START, PUSH_START + 10], [1, 0], {\r\n          extrapolateLeft: \"clamp\",\r\n          extrapolateRight: \"clamp\",\r\n        })\r\n      : 1;\r\n\r\n  const screenContent =\r\n    children ??\r\n    (screenSrc ? (\r\n      <ScreenMedia src={screenSrc} frame={frame} />\r\n    ) : (\r\n      <PlaceholderScreen frame={frame} t={t} />\r\n    ));\r\n\r\n  return (\r\n    <div\r\n      className={className}\r\n      style={{\r\n        position: \"absolute\",\r\n        inset: 0,\r\n        display: \"flex\",\r\n        alignItems: \"center\",\r\n        justifyContent: \"center\",\r\n        fontFamily: face,\r\n      }}\r\n    >\r\n      {/* Camera: the screen-takeover dolly. `geometricPrecision` keeps any scaled\r\n          text from boiling; will-change helps the live Player but is wrong in a\r\n          render (it rasterises type across parallel tabs) — motion-quality skill. */}\r\n      <div\r\n        style={{\r\n          transform: `translateY(${camera.translateY}px) scale(${camera.scale})`,\r\n          transformOrigin: \"center center\",\r\n          textRendering: \"geometricPrecision\",\r\n          ...(isRendering ? {} : { willChange: \"transform\" as const }),\r\n        }}\r\n      >\r\n        {/* Entrance + float rig */}\r\n        <div\r\n          style={{\r\n            opacity: pose.opacity,\r\n            translate: `0px ${pose.translateY + bob}px`,\r\n            scale: `${pose.scale * scale}`,\r\n          }}\r\n        >\r\n          {/* Perspective stage: the lid tilts inside it, the deck stays flat */}\r\n          <div\r\n            style={{\r\n              display: \"flex\",\r\n              flexDirection: \"column\",\r\n              alignItems: \"center\",\r\n              perspective: PERSPECTIVE,\r\n            }}\r\n          >\r\n            {/* Lid — hinged at its bottom edge */}\r\n            <div\r\n              style={{\r\n                width: LID_WIDTH,\r\n                height: LID_HEIGHT,\r\n                borderRadius: `${radius}px ${radius}px 6px 6px`,\r\n                backgroundColor: lid,\r\n                padding: BEZEL_WIDTH,\r\n                transformOrigin: \"center bottom\",\r\n                transform: `rotateX(${tilt}deg)`,\r\n              }}\r\n            >\r\n              {/* Screen */}\r\n              <div\r\n                style={{\r\n                  position: \"relative\",\r\n                  width: \"100%\",\r\n                  height: \"100%\",\r\n                  borderRadius: `${Math.max(4, radius - BEZEL_WIDTH)}px ${Math.max(\r\n                    4,\r\n                    radius - BEZEL_WIDTH,\r\n                  )}px 4px 4px`,\r\n                  backgroundColor: glass,\r\n                  overflow: \"hidden\",\r\n                }}\r\n              >\r\n                {screenContent}\r\n                {showNotch && notchFade > 0 && (\r\n                  <div style={{ opacity: notchFade }}>\r\n                    <Notch\r\n                      t={shell}\r\n                      indicatorColor={indicatorColor}\r\n                      frame={frame}\r\n                      label={notchLabel}\r\n                      batteryLevel={batteryLevel}\r\n                    />\r\n                  </div>\r\n                )}\r\n              </div>\r\n            </div>\r\n\r\n            {/* Deck — wider than the lid, with the lift-lip on top */}\r\n            <div\r\n              style={{\r\n                position: \"relative\",\r\n                width: DECK_WIDTH,\r\n                height: DECK_HEIGHT,\r\n                borderRadius: \"6px 6px 40px 40px\",\r\n                background: `linear-gradient(to bottom, ${withAlpha(\r\n                  shell.foreground,\r\n                  0.16,\r\n                )}, ${withAlpha(shell.background, 0)} 34%, ${withAlpha(\r\n                  shell.background,\r\n                  0.34,\r\n                )}), ${lid}`,\r\n                ...(shadow === \"\" ? {} : { boxShadow: drop }),\r\n              }}\r\n            >\r\n              <div\r\n                style={{\r\n                  position: \"absolute\",\r\n                  top: 0,\r\n                  left: \"50%\",\r\n                  translate: \"-50% 0px\",\r\n                  width: 132,\r\n                  height: 8,\r\n                  borderRadius: \"0 0 6px 6px\",\r\n                  backgroundColor: withAlpha(shell.background, 0.28),\r\n                }}\r\n              />\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n  );\r\n}\r\n"}]}