{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "embossed-mark",
  "title": "Embossed Mark",
  "description": "The R mark and wordmark are debossed into a brushed grey surface as it lights up.",
  "dependencies": ["remotion", "@remotion/google-fonts"],
  "files": [
    {
      "path": "registry/remocn/embossed-mark/index.tsx",
      "content": "\"use client\";\n\nimport { loadFont as loadManrope } from \"@remotion/google-fonts/Manrope\";\nimport type React from \"react\";\nimport { useId } from \"react\";\nimport {\n  AbsoluteFill,\n  Easing,\n  interpolate,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\n\n// Brand face: the remocn.dev logo is the R mark + \"emocn\" in Manrope 600.\nconst manrope = loadManrope(\"normal\", {\n  weights: [\"600\"],\n  subsets: [\"latin\"],\n});\n\nconst REMOCN_R_PATH =\n  \"M 0.01 0.81 C 0.01 1.73, 0.36 2.79, 1.09 4.13 C 4.91 11.04, 13.45 17.16, 21.7 18.9 C 22.94 19.16, 23.18 19.16, 51.39 19.27 C 76.07 19.36, 80.02 19.4, 81.32 19.57 C 89.89 20.69, 96.2 24.68, 99.38 31.01 C 103.19 38.56, 102.53 50.1, 97.91 57.07 C 94.66 61.96, 89.68 64.99, 83.26 66 C 82.81 66.07, 70.18 66.83, 55.2 67.69 C 24.82 69.43, 27.03 69.23, 24.18 70.4 C 19.9 72.15, 14.84 75.7, 10.65 79.89 C 4.86 85.68, 1.3 91.91, 0.25 98.13 C 0.12 98.85, 0.08 103.13, 0.04 116.66 L 0 134.26 9.5 134.26 L 19 134.26 19.05 119.41 C 19.1 103.27, 19.08 103.82, 19.82 101.04 C 21.79 93.65, 27.86 88.75, 36.45 87.63 C 37.23 87.53, 39.41 87.5, 43.57 87.53 C 50.12 87.59, 50.75 87.65, 53.22 88.45 C 56.61 89.56, 59.67 91.86, 62.02 95.07 C 62.52 95.76, 69.35 103.85, 77.2 113.07 C 85.04 122.28, 91.63 130.04, 91.85 130.32 C 92.07 130.59, 92.5 131.34, 92.82 131.97 C 93.52 133.35, 94.11 133.93, 95.06 134.13 C 95.5 134.23, 98.97 134.26, 106.36 134.23 L 117.01 134.19 100.82 113.07 C 91.91 101.45, 84.52 91.78, 84.39 91.57 C 83.36 89.89, 83.66 87.53, 85.09 86 C 85.79 85.25, 86.36 84.94, 88.07 84.38 C 96.18 81.72, 104.15 76.62, 109.97 70.36 C 120.59 58.93, 124.06 44.32, 119.44 30.43 C 114.59 15.81, 101.93 4.02, 87.64 0.83 C 83.93 0.01, 88.09 0.08, 41.85 0.04 L 0.01 0 0.01 0.81 Z\";\nconst R_W = 124.06;\nconst R_H = 134.26;\n\n// gradients.sh \"silk\" palette: bg #030308, [#3b3fd8, #f3d6c0, #8a7bff].\n// Used once, as the foil pressed into the debossed R. The sheen band follows\n// the raking light.\nconst SILK = [\"#3b3fd8\", \"#f3d6c0\", \"#8a7bff\"] as const;\n\nexport interface EmbossedMarkProps {\n  /** Custom mark to deboss instead of the remocn R (square slot, black fill). */\n  logo?: React.ReactNode;\n  /** Letters printed after the mark. With the default R this completes \"Remocn\". */\n  name?: string;\n  accent?: string;\n  /** Frames between letters of `name` as they print. */\n  stagger?: number;\n  /** Depth of the deboss and press; 1 is the default relief. */\n  relief?: number;\n  /** Color of the name; overrides the theme ink. */\n  ink?: string;\n  /** Paper fill; \"transparent\" drops it. */\n  background?: string;\n  /** Typeface for the name. Load it yourself; Manrope (the logo face) by default. */\n  fontFamily?: string;\n  /** Size of the lockup, around the frame's center. */\n  scale?: number;\n  /** Frames to hold the first frame before anything moves. */\n  delay?: number;\n  /** Film grain over the scene. */\n  grain?: boolean;\n  theme?: \"dark\" | \"light\";\n  speed?: number;\n}\n\nconst EASE_IO = Easing.bezier(0.65, 0, 0.35, 1);\nconst EASE_OUT = Easing.bezier(0.22, 1, 0.36, 1);\nconst CLAMP = {\n  extrapolateLeft: \"clamp\",\n  extrapolateRight: \"clamp\",\n} as const;\n\nconst THEMES = {\n  dark: {\n    paper: \"#212124\",\n    floor: \"#1F1F22\",\n    ink: \"#E8E5DE\",\n    shadow: \"#000000\",\n    shadowA: 0.85,\n    hi: \"#FFFFFF\",\n    hiA: 0.32,\n    pool: \"rgba(255,255,255,0.1)\",\n    falloff: \"rgba(0,0,0,0.5)\",\n    tooth: 0.55,\n    foil: 0.94,\n    grain: 0.07,\n  },\n  light: {\n    paper: \"#EBE7DF\",\n    floor: \"#E7E3DA\",\n    ink: \"#1C1B19\",\n    shadow: \"#3C3020\",\n    shadowA: 0.5,\n    hi: \"#FFFFFF\",\n    hiA: 0.95,\n    pool: \"rgba(255,253,248,0.55)\",\n    falloff: \"rgba(60,48,30,0.16)\",\n    tooth: 0.6,\n    foil: 0.96,\n    grain: 0.05,\n  },\n} as const;\n\ntype Palette = (typeof THEMES)[keyof typeof THEMES];\n\nfunction Grain({ opacity }: { opacity: number }) {\n  const id = `g${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n  return (\n    <svg\n      width=\"100%\"\n      height=\"100%\"\n      style={{ position: \"absolute\", inset: 0, opacity }}\n      aria-hidden\n    >\n      <filter id={id}>\n        <feTurbulence\n          type=\"fractalNoise\"\n          baseFrequency=\"0.9\"\n          numOctaves={2}\n          seed={17}\n          stitchTiles=\"stitch\"\n        />\n        <feColorMatrix values=\"0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0.9 0\" />\n      </filter>\n      <rect width=\"100%\" height=\"100%\" filter={`url(#${id})`} />\n    </svg>\n  );\n}\n\nfunction ReliefFilter({\n  id,\n  p,\n  lx,\n  ly,\n  depth,\n  blur,\n  base,\n}: {\n  id: string;\n  p: Palette;\n  lx: number;\n  ly: number;\n  depth: number;\n  blur: number;\n  base: \"floor\" | \"source\";\n}) {\n  return (\n    <filter\n      id={id}\n      x=\"-20%\"\n      y=\"-20%\"\n      width=\"140%\"\n      height=\"140%\"\n      colorInterpolationFilters=\"sRGB\"\n    >\n      {base === \"floor\" ? (\n        <>\n          <feFlood floodColor={p.floor} result=\"fc\" />\n          <feComposite in=\"fc\" in2=\"SourceAlpha\" operator=\"in\" result=\"base\" />\n        </>\n      ) : (\n        <feOffset in=\"SourceGraphic\" dx={0} dy={0} result=\"base\" />\n      )}\n      <feComponentTransfer in=\"SourceAlpha\" result=\"inv\">\n        <feFuncA type=\"table\" tableValues=\"1 0\" />\n      </feComponentTransfer>\n      <feOffset in=\"inv\" dx={-lx * depth} dy={-ly * depth} result=\"invS\" />\n      <feGaussianBlur in=\"invS\" stdDeviation={blur} result=\"invSB\" />\n      <feFlood floodColor={p.shadow} floodOpacity={p.shadowA} />\n      <feComposite in2=\"invSB\" operator=\"in\" result=\"sh0\" />\n      <feComposite in=\"sh0\" in2=\"SourceAlpha\" operator=\"in\" result=\"sh\" />\n      <feOffset\n        in=\"inv\"\n        dx={lx * depth * 0.8}\n        dy={ly * depth * 0.8}\n        result=\"invH\"\n      />\n      <feGaussianBlur in=\"invH\" stdDeviation={blur * 0.6} result=\"invHB\" />\n      <feFlood floodColor={p.hi} floodOpacity={p.hiA} />\n      <feComposite in2=\"invHB\" operator=\"in\" result=\"hi0\" />\n      <feComposite in=\"hi0\" in2=\"SourceAlpha\" operator=\"in\" result=\"hi\" />\n      <feMerge>\n        <feMergeNode in=\"base\" />\n        <feMergeNode in=\"sh\" />\n        <feMergeNode in=\"hi\" />\n      </feMerge>\n    </filter>\n  );\n}\n\n/** The foreground at `scale`, around the frame's center; nothing extra at 1. */\nfunction ScaleLayer({\n  scale,\n  children,\n}: {\n  scale: number;\n  children: React.ReactNode;\n}) {\n  if (scale === 1) return children;\n  return (\n    <AbsoluteFill style={{ transform: `scale(${scale})` }}>\n      {children}\n    </AbsoluteFill>\n  );\n}\n\nexport function EmbossedMark({\n  logo,\n  name = \"emocn\",\n  accent = \"#3B5BFD\",\n  stagger = 3,\n  relief = 1,\n  ink,\n  background,\n  fontFamily = manrope.fontFamily,\n  scale = 1,\n  delay = 0,\n  grain = true,\n  theme = \"dark\",\n  speed = 1,\n}: EmbossedMarkProps) {\n  const t = Math.max(0, useCurrentFrame() - delay) * speed;\n  const { width, height } = useVideoConfig();\n  const p = THEMES[theme];\n  const fg = ink ?? p.ink;\n  const paper =\n    background === \"transparent\" ? \"transparent\" : (background ?? p.paper);\n  const u = height / 720;\n  const uid = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n  const debId = `deb${uid}`;\n  const pressId = `press${uid}`;\n  const toothId = `tooth${uid}`;\n  const foilId = `foil${uid}`;\n\n  // Logo geometry from remocn.dev: the R is 0.76em tall and sits on the\n  // baseline of \"emocn\"; the letters start 0.04em after it.\n  const fontSize = 214 * u;\n  const markH = fontSize * 0.76;\n  const markW = logo ? markH : (markH * R_W) / R_H;\n\n  const sweep = EASE_IO(interpolate(t, [0, 112], [0, 1], CLAMP));\n  const az = (196 + 104 * sweep) * (Math.PI / 180);\n  const lx = Math.cos(az);\n  const ly = Math.sin(az);\n  const elev = interpolate(sweep, [0, 1], [10, 34]);\n  const depth = interpolate(elev, [10, 34], [7.5, 3.6]) * u * relief;\n  const blur = interpolate(elev, [10, 34], [2.6, 1.8]) * u;\n\n  // Camera: starts centred on the mark, eases out to centre the lockup.\n  // translateX(%) resolves against the lockup's own width, so no text\n  // measuring is needed.\n  const cam = EASE_IO(interpolate(t, [56, 100], [0, 1], CLAMP));\n  const zoom = 1 + 0.1 * (1 - cam);\n  const camX = `calc(${(1 - cam) * 50}% - ${((1 - cam) * markW) / 2}px)`;\n\n  const foil = interpolate(t, [66, 84], [0, 1], { ...CLAMP, easing: EASE_OUT });\n  const sheen = 0.18 + 0.5 * sweep;\n  const letters = [...name];\n  const letterIn = (i: number) =>\n    interpolate(t, [80 + i * stagger, 90 + i * stagger], [0, 1], {\n      ...CLAMP,\n      easing: EASE_OUT,\n    });\n\n  const poolX = 50 + lx * 46;\n  const poolY = 50 + ly * 70;\n  const huge = {\n    position: \"absolute\",\n    left: -width * 1.5,\n    top: -height * 1.5,\n    width: width * 4,\n    height: height * 4,\n  } as const;\n\n  return (\n    <AbsoluteFill style={{ background: paper, overflow: \"hidden\" }}>\n      <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n        <defs>\n          <ReliefFilter\n            id={debId}\n            p={p}\n            lx={lx}\n            ly={ly}\n            depth={depth}\n            blur={blur}\n            base=\"floor\"\n          />\n          <ReliefFilter\n            id={pressId}\n            p={p}\n            lx={lx}\n            ly={ly}\n            depth={depth * 0.32}\n            blur={blur * 0.45}\n            base=\"source\"\n          />\n          <filter id={toothId} x=\"0\" y=\"0\" width=\"100%\" height=\"100%\">\n            <feTurbulence\n              type=\"fractalNoise\"\n              baseFrequency=\"0.55 0.75\"\n              numOctaves={3}\n              seed={5}\n              result=\"n\"\n            />\n            <feDiffuseLighting\n              in=\"n\"\n              surfaceScale={1.6}\n              diffuseConstant={1}\n              lightingColor=\"#FFFFFF\"\n            >\n              <feDistantLight azimuth={(az * 180) / Math.PI} elevation={elev} />\n            </feDiffuseLighting>\n          </filter>\n          <linearGradient\n            id={foilId}\n            x1=\"0\"\n            y1=\"0\"\n            x2=\"1\"\n            y2=\"1\"\n            gradientTransform={`rotate(${-18 + 30 * sweep} 0.5 0.5)`}\n          >\n            <stop offset=\"0\" stopColor={accent} />\n            <stop offset={Math.max(0, sheen - 0.2)} stopColor={SILK[2]} />\n            <stop offset={sheen} stopColor={SILK[1]} />\n            <stop offset={Math.min(1, sheen + 0.22)} stopColor={SILK[2]} />\n            <stop offset=\"1\" stopColor={SILK[0]} />\n          </linearGradient>\n        </defs>\n      </svg>\n      <ScaleLayer scale={scale}>\n        <div\n          style={{\n            position: \"absolute\",\n            inset: 0,\n            display: \"flex\",\n            alignItems: \"center\",\n            justifyContent: \"center\",\n          }}\n        >\n          <div\n            style={{\n              position: \"relative\",\n              display: \"flex\",\n              alignItems: \"baseline\",\n              fontFamily,\n              fontWeight: 600,\n              fontSize,\n              lineHeight: 1,\n              letterSpacing: \"-0.025em\",\n              color: fg,\n              transformOrigin: `${markW / 2}px 50%`,\n              transform: `translateX(${camX}) scale(${zoom})`,\n            }}\n          >\n            <div style={{ ...huge, background: paper }} />\n            <div\n              style={{\n                position: \"relative\",\n                flex: \"none\",\n                width: markW,\n                height: markH,\n              }}\n            >\n              <div\n                style={{\n                  position: \"absolute\",\n                  inset: 0,\n                  filter: `url(#${debId})`,\n                }}\n              >\n                {logo ?? (\n                  <svg\n                    width={markW}\n                    height={markH}\n                    viewBox={`0 0 ${R_W} ${R_H}`}\n                    style={{ display: \"block\" }}\n                    aria-hidden\n                  >\n                    <path d={REMOCN_R_PATH} fill=\"#000\" />\n                  </svg>\n                )}\n              </div>\n              {logo ? null : (\n                <svg\n                  width={markW}\n                  height={markH}\n                  viewBox={`0 0 ${R_W} ${R_H}`}\n                  style={{\n                    position: \"absolute\",\n                    inset: 0,\n                    display: \"block\",\n                    overflow: \"visible\",\n                    filter: `url(#${pressId})`,\n                    opacity: foil * p.foil,\n                  }}\n                  aria-hidden\n                >\n                  <path d={REMOCN_R_PATH} fill={`url(#${foilId})`} />\n                </svg>\n              )}\n            </div>\n            <div\n              style={{\n                position: \"relative\",\n                marginLeft: \"0.04em\",\n                whiteSpace: \"pre\",\n                filter: `url(#${pressId})`,\n              }}\n            >\n              {letters.map((ch, i) => (\n                <span key={`${ch}${i}`} style={{ opacity: letterIn(i) }}>\n                  {ch}\n                </span>\n              ))}\n            </div>\n            <svg\n              style={{\n                ...huge,\n                opacity: p.tooth,\n                mixBlendMode: \"soft-light\",\n                pointerEvents: \"none\",\n              }}\n              aria-hidden\n            >\n              <rect width=\"100%\" height=\"100%\" filter={`url(#${toothId})`} />\n            </svg>\n          </div>\n        </div>\n      </ScaleLayer>\n      <div\n        style={{\n          position: \"absolute\",\n          inset: 0,\n          background: `radial-gradient(ellipse 80% 110% at ${poolX}% ${poolY}%, ${p.pool}, rgba(0,0,0,0) 70%)`,\n        }}\n      />\n      <div\n        style={{\n          position: \"absolute\",\n          inset: 0,\n          background: `radial-gradient(ellipse 90% 120% at ${poolX}% ${poolY}%, rgba(0,0,0,0) 45%, ${p.falloff} 100%)`,\n        }}\n      />\n      {grain ? <Grain opacity={p.grain} /> : null}\n    </AbsoluteFill>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/remocn/embossed-mark.tsx"
    }
  ],
  "type": "registry:component"
}
