.hero-canvas {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  isolation: isolate;
}
.hero-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--switch-on) 14%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--switch-on) 14%, transparent) 1px, transparent 1px);
  background-size: calc(var(--grid-size) / 2) calc(var(--grid-size) / 2);
  background-position: -1px -1px;
  opacity: 0;
  transition: opacity .6s ease;
  z-index: -1;
}
.hero-canvas.is-tidy::before { opacity: 1; }

.hc-stage {
  position: absolute;
  inset: 0;
}

.hc-word-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 7;
}
.hc-select {
  position: relative;
  padding: .06em .16em .02em;
  border: 1px dashed var(--selection);
  font-size: calc(clamp(84px, 15.5vw, 250px) * var(--ws, 1));
  will-change: transform;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .hc-select { cursor: move; }
}
.hc-select:hover,
.hc-select.is-active {
  border-style: solid;
  border-color: var(--switch-on);
}
.hc-select:hover .hc-handle,
.hc-select.is-active .hc-handle { border-color: var(--switch-on); }
.hc-select.is-editing { cursor: text; }
.hc-word {
  margin: 0;
  font-family: var(--title-font);
  font-weight: 800;
  font-size: 1em;
  line-height: .98;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 96;
  white-space: nowrap;
}
.hc-word .dot { color: var(--accent); margin-left: .03em; }
.hc-text { outline: none; caret-color: var(--accent); }
.hc-select.is-editing .hc-text {
  user-select: text;
  -webkit-user-select: text;
}
.hc-text::selection { background: color-mix(in srgb, var(--switch-on) 28%, transparent); }
.hc-handle {
  position: absolute;
  width: 9px; height: 9px;
  background: var(--tile);
  border: 1px solid var(--selection);
  transform: translate(-50%, -50%);
  touch-action: none;
  transition: border-color .2s ease;
}
.hc-handle::after {
  content: "";
  position: absolute;
  inset: -12px;
}
.hc-handle[data-h="nw"], .hc-handle[data-h="se"] { cursor: nwse-resize; }
.hc-handle[data-h="ne"], .hc-handle[data-h="sw"] { cursor: nesw-resize; }
.hc-handle[data-h="n"], .hc-handle[data-h="s"] { cursor: ns-resize; }
.hc-handle[data-h="e"], .hc-handle[data-h="w"] { cursor: ew-resize; }
.hc-select.is-editing .hc-handle { pointer-events: none; }

.hc-layer {
  position: absolute;
  left: -1px;
  bottom: calc(100% + 8px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--body-font);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: var(--switch-on);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.hc-layer b { font-family: var(--title-font); font-weight: 700; }
@media (hover: hover) and (pointer: fine) {
  .hc-select:hover .hc-layer { opacity: 1; transform: none; }
  .hc-select.is-editing .hc-layer,
  .hc-select.is-dragging .hc-layer { opacity: 0; }
}
.hc-handle[data-h="nw"] { left: 0;    top: 0; }
.hc-handle[data-h="n"]  { left: 50%;  top: 0; }
.hc-handle[data-h="ne"] { left: 100%; top: 0; }
.hc-handle[data-h="e"]  { left: 100%; top: 50%; }
.hc-handle[data-h="se"] { left: 100%; top: 100%; }
.hc-handle[data-h="s"]  { left: 50%;  top: 100%; }
.hc-handle[data-h="sw"] { left: 0;    top: 100%; }
.hc-handle[data-h="w"]  { left: 0;    top: 50%; }
.hc-badge {
  position: absolute;
  left: 50%;
  top: calc(100% + 14px);
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}

.hc-obj {
  position: absolute;
  left: 0; top: 0;
  z-index: 6;
  transform-origin: 50% 50%;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.hc-obj[data-cursor="drag"] { cursor: grab; }
.hc-obj.is-dragging { cursor: grabbing; }
.hc-obj.is-dragging > * { box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .35); }
.hc-obj.is-selected { outline-offset: 6px; border-radius: 14px; }
.hc-obj img, .hc-obj video { pointer-events: none; -webkit-user-drag: none; }

.hc-wire { width: 230px; }
.wire-body { padding: 12px; }
.hc-wire--profile .wire-body {
  position: relative;
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  overflow: hidden;
}
.hc-wire--profile .wire-body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 35%, color-mix(in srgb, var(--tile) 70%, transparent) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: wire-sheen 4.2s ease-in-out infinite 1.2s;
  pointer-events: none;
}
@keyframes wire-sheen {
  0%, 55% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.wire-side { display: grid; gap: 7px; align-content: start; }
.wire-side .sk { height: 6px; transition: width .6s var(--ease-spring); }
.wire-side .sk.short { width: 60%; }
.sk-avatar { width: 34px; height: 34px !important; border-radius: 50% !important; margin-bottom: 6px; }

.wire-grid {
  position: relative;
  height: 95px;
}
.wire-grid .sk {
  position: absolute;
  transition:
    left .7s var(--ease-spring), top .7s var(--ease-spring),
    width .7s var(--ease-spring), height .7s var(--ease-spring),
    background-color .6s ease;
}
.wire-grid[data-layout="a"] .g1 { left: 0; top: 0; width: calc(50% - 3.5px); height: 44px; }
.wire-grid[data-layout="a"] .g2 { left: calc(50% + 3.5px); top: 0; width: calc(50% - 3.5px); height: 95px; }
.wire-grid[data-layout="a"] .g3 { left: 0; top: 51px; width: calc(50% - 3.5px); height: 44px; }
.wire-grid[data-layout="b"] .g1 { left: 0; top: 0; width: calc(50% - 3.5px); height: 95px; }
.wire-grid[data-layout="b"] .g2 { left: calc(50% + 3.5px); top: 0; width: calc(50% - 3.5px); height: 44px; }
.wire-grid[data-layout="b"] .g3 { left: calc(50% + 3.5px); top: 51px; width: calc(50% - 3.5px); height: 44px; }
.wire-grid[data-layout="c"] .g1 { left: 0; top: 0; width: 100%; height: 44px; }
.wire-grid[data-layout="c"] .g2 { left: 0; top: 51px; width: calc(50% - 3.5px); height: 44px; }
.wire-grid[data-layout="c"] .g3 { left: calc(50% + 3.5px); top: 51px; width: calc(50% - 3.5px); height: 44px; }
.wire-grid[data-layout="a"] .g2,
.wire-grid[data-layout="b"] .g1,
.wire-grid[data-layout="c"] .g1 { background: color-mix(in srgb, var(--c-violet) 16%, transparent); }

.hc-wire--chat { width: 220px; }
.hc-wire--chat .wire-body { display: grid; gap: 11px; }
.wire-msgs {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 58px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 10px);
}
.wire-row { display: flex; align-items: center; gap: 8px; }
.wire-msgs .wire-row { flex: none; height: 12px; margin-top: 11px; }
.wire-row.indent { padding-left: 18px; }
.wire-row .sk { height: 6px; flex: 1; }
.wire-row .sk.short { flex: .55; }
.wire-msgs .wire-row .sk:not(.sk-dot) { flex: 0 1 var(--w, 100%); }
.wire-row.me { flex-direction: row-reverse; padding-left: 26px; }
.wire-row.me .sk:not(.sk-dot) { background: color-mix(in srgb, var(--switch-on) 26%, transparent); }
.wire-row.is-new { animation: row-in .45s var(--ease-spring) both; }
@keyframes row-in {
  from { height: 0; margin-top: 0; opacity: 0; transform: translateY(6px); }
  to   { height: 12px; margin-top: 11px; opacity: 1; transform: none; }
}
.wire-row .sk.is-grow { transform-origin: 0 50%; animation: bar-grow .4s var(--ease-out) both; }
@keyframes bar-grow { from { transform: scaleX(0); } }
.wire-dots {
  display: inline-flex;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--text) 7%, transparent);
}
.wire-dots i {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--muted-2);
  animation: dot-bounce 1s ease-in-out infinite;
}
.wire-dots i:nth-child(2) { animation-delay: .15s; }
.wire-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot-bounce {
  0%, 60%, 100% { transform: none; opacity: .5; }
  30% { transform: translateY(-2px); opacity: 1; }
}
.sk-dot { flex: none !important; width: 12px; height: 12px !important; border-radius: 50% !important; }
.wire-input {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.wire-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color .2s ease;
}
.wire-field.is-sent { border-color: var(--switch-on); }
.wire-typed {
  display: block;
  width: 0;
  height: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text) 16%, transparent);
  transition: width 1.4s steps(14, end);
}
.wire-caret {
  display: block;
  width: 1.5px;
  height: 11px;
  background: var(--accent);
  animation: caret-blink 1s steps(2, jump-none) infinite;
}
.wire-field.is-typing .wire-caret { animation: none; }
@keyframes caret-blink { 50% { opacity: 0; } }

.hc-code { width: 250px; }
.hc-code pre {
  box-sizing: border-box;
  height: calc(9.5px * 1.6 * 6 + 22px);
  margin: 0;
  padding: 10px 12px 12px;
  font-family: var(--mono-font);
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre;
  overflow: hidden;
}
.hc-code .k { color: var(--c-violet); }
.hc-code .f { color: var(--c-blue); }
.hc-code .n { color: var(--c-orange); }
.hc-code .s { color: var(--c-green); }
.hc-code .sel { background: color-mix(in srgb, var(--switch-on) 24%, transparent); }
.hc-code .cc {
  display: inline-block;
  width: 1.5px;
  height: 1.2em;
  margin-left: 1px;
  vertical-align: -.25em;
  background: var(--accent);
  animation: caret-blink 1s steps(2, jump-none) infinite;
}
.hc-code.is-typing .cc { animation: none; }
.hc-code .win-title { transition: opacity .2s ease; }

@media (prefers-reduced-motion: reduce) {
  .hc-wire--profile .wire-body::after,
  .wire-caret, .hc-code .cc, .wire-dots i { animation: none; }
}

.hc-laptop { width: 380px; }
.lp-screen {
  position: relative;
  aspect-ratio: 16 / 10.4;
  border-radius: 14px 14px 4px 4px;
  background: #0d0d10;
  padding: 9px 9px 14px;
  box-shadow: inset 0 0 0 1px #2a2a30;
}
.lp-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  filter: grayscale(.15);
}
.lp-base {
  position: relative;
  left: -9%;
  width: 118%;
  height: 13px;
  border-radius: 2px 2px 12px 12px;
  background: linear-gradient(to bottom, #d9d9dd, #a6a6ac);
  box-shadow: 0 14px 26px -12px rgba(0, 0, 0, .45);
}
.lp-base::before {
  content: "";
  position: absolute;
  left: 50%; top: 0;
  width: 16%; height: 5px;
  transform: translateX(-50%);
  border-radius: 0 0 6px 6px;
  background: #c3c3c8;
}

.hc-phone {
  width: 124px;
  aspect-ratio: 9 / 19;
  padding: 5px;
  border-radius: 25px;
  background: #0d0d10;
  box-shadow: inset 0 0 0 1.5px #2a2a30, 0 18px 40px -16px rgba(0, 0, 0, .45);
}
.ph-screen {
  position: relative;
  height: 100%;
  border-radius: 21px;
  overflow: hidden;
  background: #f2f3f5;
}
.ph-screen video { width: 100%; height: 100%; object-fit: cover; }
.ph-notch {
  position: absolute;
  top: 6px; left: 50%;
  width: 38px; height: 11px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #0d0d10;
  z-index: 2;
}

.hc-photo {
  margin: 0;
  width: 270px;
  padding: 7px;
  background: var(--tile);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-tile);
}
.hc-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 5px; }
.hc-photo.is-small { width: 210px; }

.hc-toast { width: 290px; }
.hc-toast .toast-msg { transition: opacity .25s ease, transform .25s ease; }
.hc-toast.is-swapping .toast-msg { opacity: 0; transform: translateY(4px); }

.hc-switch {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 18px;
  border-radius: 18px;
  background: var(--tile);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-tile);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.hc-switch .sw {
  position: relative;
  width: 44px; height: 26px;
  border-radius: 99px;
  background: var(--muted-2);
  transition: background-color .25s ease;
}
.hc-switch .sw i {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .3s var(--ease-spring);
}
.hc-switch[aria-checked="true"] .sw { background: var(--switch-on); }
.hc-switch[aria-checked="true"] .sw i { transform: translateX(18px); }

.mp-layer { transition: opacity .4s ease; }
.mp-layer.is-paused { opacity: .3; }

.hc-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 3.5vh, 36px);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 7;
  pointer-events: none;
  animation: hint-float 2.2s ease-in-out infinite;
}
.hc-hint::after {
  content: "";
  width: 1px; height: 22px;
  background: var(--accent);
}
@keyframes hint-float {
  0%, 100% { transform: translate(-50%, 0); opacity: .6; }
  50% { transform: translate(-50%, 5px); opacity: 1; }
}

@media (max-width: 759px) {
  .hc-select { padding: .08em .14em .04em; }
  .hc-badge { font-size: 11px; top: calc(100% + 10px); }
  .hc-toast { width: 250px; }
  .hc-photo { width: 200px; }
  .hc-switch { font-size: 13px; padding: 8px 10px 8px 14px; }
  .hc-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hc-hint { animation: none; }
}
