
:root {
  --font-serif: "Fraunces", Georgia, serif;
  --font-grotesk: "Bricolage Grotesque", "Geist", system-ui, sans-serif;
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", monospace;

  --ink-950: #101114;
  --ink-850: #242830;
  --ink-700: #3f4652;
  --ink-500: #66707f;
  --ink-300: #a6afba;
  --ink-100: #e8ebef;

  --gradient: linear-gradient(153deg, #a855f7, #5f9a8e 34%, #00ffcb, #a855f7);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html,
html[data-theme="light"] {
  color-scheme: light;
  --canvas: #f6f3ed;
  --paper: #fffdfa;
  --panel: #ece7df;
  --text: var(--ink-950);
  --text-2: var(--ink-700);
  --text-3: var(--ink-500);
  --line: rgb(16 17 20 / 0.12);
  --line-strong: rgb(16 17 20 / 0.26);
  --primary: #008066;
  --secondary: #a855f7;
  --tertiary: #33bec9;
  --info: #2563eb;
  --warning: #d97706;
  --glow-a: rgb(0 255 203 / 0.55);
  --glow-b: rgb(168 85 247 / 0.45);
  --artifact: rgb(16 17 20 / 0.16);
  --artifact-accent: #008066;
  --focus: #2563eb;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #101114;
  --paper: #171a20;
  --panel: #20242b;
  --text: #fffdfa;
  --text-2: var(--ink-100);
  --text-3: var(--ink-300);
  --line: rgb(255 253 250 / 0.14);
  --line-strong: rgb(255 253 250 / 0.28);
  --primary: #00ffcb;
  --secondary: #c084fc;
  --tertiary: #33bec9;
  --info: #60a5fa;
  --warning: #fbbf24;
  --glow-a: rgb(0 255 203 / 0.6);
  --glow-b: rgb(192 132 252 / 0.55);
  --artifact: rgb(255 253 250 / 0.14);
  --artifact-accent: #00ffcb;
  --focus: #60a5fa;
}

html[data-theme="contrast"] {
  color-scheme: dark;
  --canvas: #000;
  --paper: #000;
  --panel: #000;
  --text: #fff;
  --text-2: #fff;
  --text-3: #fff;
  --line: #fff;
  --line-strong: #fff;
  --primary: #ffe600;
  --secondary: #00f0ff;
  --tertiary: #00f0ff;
  --info: #00f0ff;
  --warning: #ffe600;
  --glow-a: transparent;
  --glow-b: transparent;
  --artifact: rgb(255 255 255 / 0.35);
  --artifact-accent: #ffe600;
  --focus: #ffe600;
  --gradient: linear-gradient(#ffe600, #ffe600);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

html[data-theme="contrast"] a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Parallax layer: spans the whole document, artifacts lag behind the scroll. */
.artifacts {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.artifact {
  position: absolute;
  color: var(--artifact);
  will-change: translate;
}

html[data-theme="contrast"] .artifact {
  opacity: 0.5;
}

main,
header,
footer {
  position: relative;
  z-index: 1;
}

/* Placeholder sections: each one is designed in its own session. */
.placeholder {
  min-height: 90vh;
  display: grid;
  align-content: center;
  padding: 6rem clamp(1.25rem, 6vw, 6rem);
}

.placeholder__box {
  max-width: 44rem;
  padding: 1.5rem 1.75rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  backdrop-filter: blur(6px);
}

.placeholder__box p {
  margin: 0 0 0.5rem;
  color: var(--text-2);
}

.placeholder__box ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text);
}

.placeholder__note {
  font-size: 0.875rem;
  color: var(--text-3) !important;
}

/* Theme switcher: three states, rendered differently per direction. */
.theme-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
}

.theme-switch button {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.theme-switch button:hover {
  color: var(--text);
}

.theme-switch button[aria-pressed="true"] {
  background: var(--text);
  color: var(--canvas);
}

.theme-switch svg {
  width: 1rem;
  height: 1rem;
}

.socials {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.socials a {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  transition: color 0.2s, border-color 0.2s, transform 0.3s var(--ease-spring);
}

.socials a:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.socials svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Canvas v2: the page is a design-tool canvas. Fraunces for the title, Geist + Geist Mono for everything else. */

:root {
  --rail: 26vw;
  --bar-h: 52px;
  --title-size: clamp(3rem, 5.3vw, 6rem);
  --dock: 0;
}

/* App bar: a design-tool file header. */
.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--bar-h);
  padding: 0 clamp(1rem, 2.5vw, 1.75rem);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  font-size: 0.875rem;
}

.bar__file {
  display: flex;
  border-radius: 6px;
  color: var(--text);
  transition: scale 0.3s var(--ease-spring);
}

.bar__file:hover {
  scale: 1.08;
}

.bar__file:active {
  scale: 0.94;
}

/* The logo's own stylesheet only colours it as a favicon; here it follows the page. */
.bar__logo {
  --logo-ink: currentColor;
  width: 1.6rem;
  height: 1.6rem;
  fill: currentColor;
}

/*
 * Section jumps, centred on the bar, one per wheel step. The pill is one element that JS slides
 * under the link for the section in the middle of the viewport.
 */
.bar__nav {
  position: absolute;
  left: 50%;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  translate: -50% 0;
}

.bar__nav a {
  position: relative;
  display: grid;
  place-items: center;
  height: 2rem;
  padding: 0 clamp(0.6rem, 0.9vw, 0.95rem);
  border-radius: 999px;
  color: var(--text-3);
  font: 500 0.8125rem/1 var(--font-sans);
  text-decoration: none;
  transition: color 0.25s var(--ease-out);
}

.bar__nav a:hover,
.bar__nav a[aria-current="true"] {
  color: var(--text);
}

.bar__nav-pill {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: var(--pill-w, 0);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 0 0 1px var(--line);
  opacity: 0;
  translate: var(--pill-x, 0) 0;
  transition: translate 0.45s var(--ease-out), width 0.45s var(--ease-out), opacity 0.3s var(--ease-out);
}

.bar__nav.has-current .bar__nav-pill {
  opacity: 1;
}

/* Until the first section is reached the pill has nowhere to come from, so it only fades in. */
.bar__nav:not(.has-moved) .bar__nav-pill {
  transition-property: opacity;
}

html[data-theme="contrast"] .bar__nav-pill {
  background: #000;
  box-shadow: 0 0 0 1px #fff;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

.bar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.facepile {
  display: flex;
  padding-right: 0.25rem;
}

.facepile > * {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--paper);
}

.facepile img {
  object-fit: cover;
  object-position: 50% 25%;
  box-shadow: 0 0 0 2px var(--secondary);
}

.facepile span {
  display: grid;
  place-items: center;
  margin-left: -6px;
  background: var(--info);
  color: #fff;
  font: 600 0.6rem/1 var(--font-sans);
}

html[data-theme="contrast"] .facepile span {
  color: #000;
}

/* Gives the centred section nav room on narrow desktops. */
@media (max-width: 1099px) {
  .facepile {
    display: none;
  }
}

.bar .theme-switch {
  border-color: transparent;
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

/*
 * "Say hi": a gradient ring (masked to a 1.5px border); on hover a gradient fill irises open from the
 * centre, while the gradient angle turns and a soft glow blooms. The registered angle makes it interpolate.
 */
@property --cta-angle {
  syntax: "<angle>";
  inherits: true;
  initial-value: 135deg;
}

.cta {
  --stops: #a855f7, #5f9a8e 38%, #00ffcb 72%, #a855f7;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.15rem 0.72rem 1.3rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  color: var(--text);
  font: 600 0.95rem/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  transition:
    --cta-angle 1.1s var(--ease-out),
    color 0.35s var(--ease-out) 0.08s,
    scale 0.3s var(--ease-spring);
}

.cta::before,
.cta::after,
.cta__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(var(--cta-angle), var(--stops));
  pointer-events: none;
}

.cta::before,
.cta::after {
  content: "";
}

.cta__glow {
  inset: 3px;
  z-index: -2;
  filter: blur(16px);
  opacity: 0.18;
  scale: 0.85;
  transition: opacity 0.6s var(--ease-out), scale 0.7s var(--ease-out);
}

/* The fill: clipped to nothing at rest, opens from the centre. */
.cta::before {
  clip-path: inset(50% 50% round 12px);
  transition: clip-path 0.55s var(--ease-out);
}

/* The ring: content-box excluded from the mask, so padding is the border width. */
.cta::after {
  padding: 1.5px;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
}

.cta svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: translate 0.45s var(--ease-spring);
}

.cta:is(:hover, :focus-visible) {
  --cta-angle: 315deg;
  color: #0b0b0c;
}

.cta:is(:hover, :focus-visible)::before {
  clip-path: inset(0 0 round 12px);
}

.cta:is(:hover, :focus-visible) .cta__glow {
  opacity: 0.65;
  scale: 1.08;
}

.cta:is(:hover, :focus-visible) svg {
  translate: 3px 0;
}

.cta:active {
  scale: 0.97;
}

html[data-theme="light"] .cta__glow {
  opacity: 0.12;
}

html[data-theme="light"] .cta:is(:hover, :focus-visible) .cta__glow {
  opacity: 0.5;
}

html[data-theme="contrast"] .cta {
  --stops: #ffe600, #ffe600;
}

html[data-theme="contrast"] .cta::after {
  padding: 2px;
}

html[data-theme="contrast"] .cta__glow {
  display: none;
}

html[data-theme="contrast"] .cta:is(:hover, :focus-visible) {
  color: #000;
}

.cta--compact {
  padding: 0.5rem 0.9rem;
  border-radius: 9px;
  font-size: 0.85rem;
}

.cta--compact::before {
  clip-path: inset(50% 50% round 9px);
}

.cta--compact:is(:hover, :focus-visible)::before {
  clip-path: inset(0 0 round 9px);
}

/*
 * The bar's copy only shows once the hero's button has scrolled away. Its slot collapses to zero
 * width (including the flex gap) while hidden, then opens and pushes the other controls aside.
 * The padding/negative margin give the glow room inside the clipped slot.
 */
.bar__cta-slot {
  display: grid;
  grid-template-columns: 0fr;
  margin: -12px -12px -12px calc(-12px - 0.75rem);
  padding: 12px;
  overflow: hidden;
  transition: grid-template-columns 0.45s var(--ease-out), margin 0.45s var(--ease-out);
}

html.is-past-hero .bar__cta-slot {
  grid-template-columns: 1fr;
  margin-left: -12px;
}

.bar__cta-slot > div {
  min-width: 0;
}

.bar__cta {
  opacity: 0;
  visibility: hidden;
  translate: 0 -6px;
  transition:
    --cta-angle 1.1s var(--ease-out),
    color 0.35s var(--ease-out) 0.08s,
    scale 0.3s var(--ease-spring),
    opacity 0.35s var(--ease-out),
    translate 0.35s var(--ease-out),
    visibility 0s 0.35s;
}

html.is-past-hero .bar__cta {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
  transition-delay: 0s;
}

/* The title: an iOS-style picker wheel for the prefix, plus a fixed "Engineer" label. */
.title {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 31;
  display: flex;
  align-items: center;
  gap: 0.26em;
  font-family: var(--font-serif);
  font-size: var(--title-size);
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform;
}

.title::before {
  content: "";
  position: absolute;
  inset: -0.02em -0.22em;
  border-radius: 0.2em;
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

html[data-theme="contrast"] .title::before {
  background: transparent;
  border: 2px solid var(--text);
}

.wheel {
  position: relative;
  height: 1.1em;
  perspective: 7em;
  transition: width 0.7s var(--ease-out);
}

.wheel__drum {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.85s var(--ease-out);
}

.wheel__item {
  position: absolute;
  top: 0;
  left: 0;
  height: 1.1em;
  font-weight: 640;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  backface-visibility: hidden;
  opacity: var(--o, 0);
  transition: opacity 0.6s var(--ease-out), color 0.6s var(--ease-out);
}

.wheel__item:not(.is-active) {
  color: var(--text-3);
}

.title.is-compact .wheel__item:not(.is-active) {
  opacity: calc(var(--o, 0) * 0.55);
}

.title.is-compact::before {
  opacity: 0;
}

.title__engineer {
  position: relative;
  font-style: italic;
  font-weight: 300;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  color: var(--text-2);
}

/* Ruler along the docked title column (desktop). */
.rail-ruler {
  position: fixed;
  top: calc(var(--bar-h) + 20px);
  bottom: 0;
  left: calc(var(--rail) - 12px);
  z-index: 2;
  width: 12px;
  border-left: 1px solid var(--line);
  background:
    repeating-linear-gradient(180deg, var(--line-strong) 0 1px, transparent 1px 40px) left / 10px 100% no-repeat,
    repeating-linear-gradient(180deg, var(--line) 0 1px, transparent 1px 8px) left / 5px 100% no-repeat;
  opacity: var(--dock);
  pointer-events: none;
}

/* Hero. */
.hero {
  position: relative;
  overflow-x: clip;
  min-height: min(100svh, 980px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 4vw, 4rem);
  padding: calc(var(--bar-h) + 20px + 3.5rem) clamp(1.25rem, 6vw, 6rem) 3rem;
}

.hero__name {
  margin: 0;
  font-size: clamp(1.1rem, 1.4vw, 1.35rem);
  font-weight: 520;
  color: var(--text-2);
}

/* The nickname: the dzhunka cursor's purple, with a pronunciation tooltip. */
.nick {
  --nick: #7e22ce;
  position: relative;
  z-index: 7;
  display: inline-block;
  border-radius: 6px;
  cursor: help;
}

html[data-theme="dark"] .nick {
  --nick: var(--secondary);
}

html[data-theme="contrast"] .nick {
  --nick: var(--secondary);
}

.nick code {
  display: inline-block;
  padding: 0.06em 0.4em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--secondary) 14%, transparent);
  color: var(--nick);
  font: 500 0.88em/1.2 var(--font-mono);
  letter-spacing: -0.01em;
}

html[data-theme="contrast"] .nick code {
  outline: 1.5px solid var(--nick);
}

.nick__tip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  display: block;
  padding: 6px 11px 7px;
  border-radius: 9px;
  background: var(--text);
  color: var(--canvas);
  font: 0.72rem/1.2 var(--font-mono);
  white-space: nowrap;
  box-shadow: 0 12px 28px -12px rgb(0 0 0 / 0.45);
  opacity: 0;
  visibility: hidden;
  translate: -50% -4px;
  transition: opacity 0.18s var(--ease-out), translate 0.18s var(--ease-out), visibility 0s 0.18s;
}

/* Caret, plus an invisible bridge so the pointer can move onto the tooltip. */
.nick__tip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  translate: -50% 0;
  border: 6px solid transparent;
  border-bottom-color: var(--text);
}

.nick__tip::after {
  content: "";
  position: absolute;
  inset: -12px 0 100%;
}

.nick__tip > [aria-hidden] {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nick:is(:hover, :focus-visible):not(.is-dismissed) .nick__tip {
  opacity: 1;
  visibility: visible;
  translate: -50% 0;
  transition-delay: 0s;
}

html[data-theme="contrast"] .nick__tip {
  border: 2px solid var(--canvas);
  box-shadow: 0 0 0 2px var(--text);
}

.hero__slot {
  margin: 1.7em 0 1.5em;
  font-size: var(--title-size);
  line-height: 1.1;
}

/* Socials first, "Say hi" on its own line below; the gap leaves room for the socials' hover tags. */
.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2.1rem;
}

/*
 * Socials: hovering "selects" the icon like a layer in Figma: a selection box with handles
 * snaps around it and a layer-name tag drops in below, while the icon tilts.
 */
.hero .socials {
  gap: 0.85rem;
}

.hero .socials a {
  position: relative;
  border-color: var(--line);
  transition: color 0.25s, border-color 0.25s, background-color 0.25s;
}

.hero .socials a::before {
  content: "";
  position: absolute;
  inset: -7px;
  outline: 1px solid var(--info);
  outline-offset: -3px;
  background:
    linear-gradient(var(--info) 0 0) 0 0 / 5px 5px no-repeat,
    linear-gradient(var(--info) 0 0) 100% 0 / 5px 5px no-repeat,
    linear-gradient(var(--info) 0 0) 0 100% / 5px 5px no-repeat,
    linear-gradient(var(--info) 0 0) 100% 100% / 5px 5px no-repeat;
  opacity: 0;
  scale: 1.25;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out), scale 0.35s var(--ease-out);
}

.hero .socials a::after {
  content: attr(aria-label);
  position: absolute;
  top: calc(100% + 11px);
  left: 50%;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--info);
  color: #fff;
  font: 500 0.65rem/1.4 var(--font-mono);
  white-space: nowrap;
  opacity: 0;
  translate: -50% -4px;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out), translate 0.3s var(--ease-out);
}

.hero .socials svg {
  transition: rotate 0.45s var(--ease-spring), scale 0.45s var(--ease-spring);
}

.hero .socials a:is(:hover, :focus-visible) {
  transform: none;
  border-color: transparent;
  background: color-mix(in srgb, var(--info) 9%, transparent);
  color: var(--text);
}

.hero .socials a:is(:hover, :focus-visible)::before {
  opacity: 1;
  scale: 1;
}

.hero .socials a:is(:hover, :focus-visible)::after {
  opacity: 1;
  translate: -50% 0;
}

.hero .socials a:is(:hover, :focus-visible) svg {
  rotate: -10deg;
  scale: 1.12;
}

html[data-theme="contrast"] .hero .socials a::after {
  color: #000;
}

.hero__lede {
  max-width: 36ch;
  margin: 0 0 1.75rem;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--text-2);
  text-wrap: pretty;
}

/* Portrait: a frame that loads as a pixel mosaic, then gets styled live by the cursor. */
.portrait {
  position: relative;
  justify-self: center;
  width: min(400px, 100%);
  aspect-ratio: 4 / 5;
  margin: 0;
}

/*
 * Where I am: the hero sits on a faint map of Bulgaria that fades out at the edges, with the
 * GMT+1 | GMT+2 meridian running down the gap between the intro and the photo.
 * script.js (placeLocale) sizes and positions it; the % offsets of the labels below
 * mirror the coordinates in assets/bulgaria.svg (viewBox 1200 × 800).
 * Other placements, kept for later: design/map-placements/.
 */
.locale {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  aspect-ratio: 3 / 2;
  pointer-events: none;
  opacity: clamp(0, 1 - var(--lift, 0) * 2.4, 1);
}

.locale__map {
  display: block;
  width: 100%;
  height: 100%;
  mask-image: radial-gradient(closest-side at 50% 48%, #000 30%, transparent 92%);
}

html[data-theme="contrast"] .locale__map {
  opacity: 0.45;
}

.locale__land {
  fill: color-mix(in srgb, var(--text) 3.5%, transparent);
}

.locale__borders {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}

.locale__country {
  fill: color-mix(in srgb, var(--primary) 7%, transparent);
  stroke: color-mix(in srgb, var(--primary) 45%, transparent);
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.locale__meridian {
  stroke: var(--line-strong);
  stroke-width: 1;
  stroke-dasharray: 5 6;
}

.locale__zone,
.locale__label {
  position: absolute;
  color: var(--text-3);
  font: 0.68rem/1.35 var(--font-mono);
  white-space: nowrap;
}

/* GMT+1 | GMT+2 straddling the 22.5°E meridian, which happens to trace Bulgaria's western border. */
.locale__zone {
  left: 26.84%;
  top: 70%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0.75rem;
  width: 11rem;
  translate: -50% 0;
}

.locale__zone > :first-child {
  text-align: end;
}

.locale__pin {
  position: absolute;
  left: 33.4%;
  top: 50.85%;
}

.locale__pin::before,
.locale__pin::after {
  content: "";
  position: absolute;
  inset: -3.5px;
  border-radius: 50%;
  background: var(--primary);
}

.locale__pin::after {
  inset: -9px;
  background: none;
  border: 1px solid var(--primary);
  opacity: 0;
  animation: locale-ping 3.2s var(--ease-out) infinite;
}

@keyframes locale-ping {
  0% { opacity: 0.7; scale: 0.4; }
  70%, 100% { opacity: 0; scale: 1.6; }
}

.locale__label {
  top: 12px;
  left: 0;
  display: grid;
  justify-items: center;
  translate: -50% 0;
}

.locale__label b {
  color: var(--text-2);
  font-weight: 500;
}

/* The frame's real size lives in --w / --h, so W × H is always actual pixels. */
.frame {
  --w: 100%;
  --h: 100%;
  --tx: 0px;
  --ty: 0px;
  --rot: 0deg;
  --radius: 0px;
  --stroke: 0px;
  --stroke-on: 0;
  --shadow: 0;
  --glow: 0;
  position: absolute;
  top: calc(50% - var(--h) / 2);
  left: calc(50% - var(--w) / 2);
  width: var(--w);
  height: var(--h);
  transform: translate(var(--tx), var(--ty)) rotate(var(--rot));
  touch-action: none;
}

.frame.is-loaded {
  cursor: grab;
}

/* While a visitor drags anything, keep the gesture's cursor everywhere. */
html.is-manipulating,
html.is-manipulating * {
  cursor: var(--drag-cursor) !important;
  user-select: none;
}

.frame__glow {
  position: absolute;
  inset: 8% 4% -2%;
  border-radius: var(--radius);
  background: var(--gradient);
  background-size: 300% 100%;
  filter: blur(42px);
  opacity: calc(var(--glow) * 0.85);
  animation: drift 20s ease-in-out infinite;
}

html[data-theme="light"] .frame__glow {
  opacity: calc(var(--glow) * 0.6);
}

.frame__stroke {
  position: relative;
  height: 100%;
  padding: var(--stroke);
  border-radius: calc(var(--radius) + var(--stroke));
  box-shadow: 0 calc(var(--shadow) * 26px) calc(var(--shadow) * 50px) -14px rgb(0 0 0 / calc(var(--shadow) * 0.45));
}

.frame__stroke::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--gradient);
  background-size: 300% 100%;
  opacity: var(--stroke-on);
  animation: drift 20s ease-in-out infinite;
}

.frame__media {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: #141519;
}

.frame__pixels,
.frame__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.frame__pixels {
  image-rendering: pixelated;
}

.frame__img {
  object-fit: cover;
  object-position: 50% 28%;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
  pointer-events: none;
}

.frame.is-loaded .frame__img {
  opacity: 1;
}

@keyframes drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

html[data-theme="contrast"] .frame__glow {
  display: none;
}

html[data-theme="contrast"] .frame__stroke {
  box-shadow: none;
}

/* Selection chrome around the frame. */
.frame__sel {
  position: absolute;
  inset: -1px;
  border: 1px solid var(--info);
  pointer-events: none;
}

.frame__sel i {
  position: absolute;
}

.frame.is-loaded .frame__sel :is(i, b) {
  pointer-events: auto;
}

/* Corner handles: visible squares with a larger invisible hit area. */
.frame__sel :is([data-resize="nw"], [data-resize="ne"], [data-resize="se"], [data-resize="sw"]) {
  z-index: 2;
  width: 9px;
  height: 9px;
  background: #fff;
  border: 1px solid var(--info);
}

.frame__sel [data-resize]::before {
  content: "";
  position: absolute;
  inset: -6px;
}

.frame__sel [data-resize="nw"] { top: -5px; left: -5px; }
.frame__sel [data-resize="ne"] { top: -5px; right: -5px; }
.frame__sel [data-resize="se"] { bottom: -5px; right: -5px; }
.frame__sel [data-resize="sw"] { bottom: -5px; left: -5px; }

/* Edges: invisible strips along each side. */
.frame__sel [data-resize="n"] { top: -4px; left: 10px; right: 10px; height: 8px; }
.frame__sel [data-resize="s"] { bottom: -4px; left: 10px; right: 10px; height: 8px; }
.frame__sel [data-resize="e"] { right: -4px; top: 10px; bottom: 10px; width: 8px; }
.frame__sel [data-resize="w"] { left: -4px; top: 10px; bottom: 10px; width: 8px; }

.frame__sel :is([data-resize="n"], [data-resize="s"], [data-resize="e"], [data-resize="w"])::before {
  inset: 0;
}

/* Rotation zones: just outside each corner, like in Figma. */
.frame__sel [data-rotate] {
  width: 22px;
  height: 22px;
}

.frame__sel [data-rotate="nw"] { top: -24px; left: -24px; }
.frame__sel [data-rotate="ne"] { top: -24px; right: -24px; }
.frame__sel [data-rotate="se"] { bottom: -24px; right: -24px; }
.frame__sel [data-rotate="sw"] { bottom: -24px; left: -24px; }

@media (pointer: coarse) {
  .frame__sel [data-resize]::before {
    inset: -12px;
  }

  .frame__sel [data-rotate] {
    width: 30px;
    height: 30px;
  }
}

.frame__radius {
  z-index: 2;
  position: absolute;
  top: calc(14px + var(--radius) * 0.29);
  left: calc(14px + var(--radius) * 0.29);
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--info);
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: opacity 0.3s;
}

.frame.is-loaded .frame__radius {
  opacity: 1;
}

.frame__label {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 6px;
  translate: -50% 0;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--info);
  color: #fff;
  font: 500 0.72rem/1.4 var(--font-mono);
  white-space: nowrap;
  pointer-events: none;
}

.frame__radius::before {
  content: "";
  position: absolute;
  inset: -7px;
}

html[data-theme="contrast"] .frame__label,
html[data-theme="contrast"] .frame__sel :is([data-resize="nw"], [data-resize="ne"], [data-resize="se"], [data-resize="sw"]),
html[data-theme="contrast"] .frame__radius {
  color: #000;
  background: var(--info);
}

.spinner {
  width: 9px;
  height: 9px;
  border: 1.5px solid rgb(255 255 255 / 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.frame.is-loaded .spinner {
  display: none;
}

@keyframes spin {
  to { rotate: 1turn; }
}

/* A small inspector panel the cursor uses to style the frame. */
/* Frosted panels floating over the canvas: the inspector and the library switcher. */
.glass {
  --glass-edge: rgb(255 255 255 / 0.55);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgb(255 255 255 / 0.18), transparent 45%),
    color-mix(in srgb, var(--paper) 48%, transparent);
  backdrop-filter: blur(22px) saturate(1.8);
  box-shadow:
    inset 0 1px 0 var(--glass-edge),
    inset 0 0 0 1px rgb(255 255 255 / 0.06),
    0 24px 48px -20px rgb(0 0 0 / 0.45);
}

html[data-theme="dark"] .glass {
  --glass-edge: rgb(255 255 255 / 0.12);
  background:
    linear-gradient(160deg, rgb(255 255 255 / 0.07), transparent 45%),
    color-mix(in srgb, var(--paper) 45%, transparent);
}

html[data-theme="contrast"] .glass {
  border: 2px solid var(--text);
  background: var(--canvas);
  backdrop-filter: none;
  box-shadow: none;
}

.inspector {
  position: absolute;
  top: 40%;
  left: calc(100% - 44px);
  z-index: 4;
  width: 212px;
  padding: 0.35rem 0;
  font: 0.72rem/1.3 var(--font-sans);
  color: var(--text-2);
  opacity: 0;
  translate: 8px 0;
  transition: opacity 0.4s var(--ease-out), translate 0.4s var(--ease-out);
}

.inspector.is-visible {
  opacity: 1;
  translate: 0 0;
}

.inspector__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  border-top: 1px solid var(--line);
}

.inspector__head {
  border-top: 0;
}

.inspector strong {
  color: var(--text);
  font-weight: 600;
}

.inspector__head span {
  color: var(--text-3);
  font-family: var(--font-mono);
}

.inspector__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 0.15rem 0.75rem 0.55rem;
}

/* Editable values. Drag the label to scrub, like in Figma. */
.field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 3px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--text) 5%, transparent);
  outline: 1px solid transparent;
  transition: outline-color 0.15s;
}

.field:hover {
  outline-color: var(--line-strong);
}

.field:focus-within {
  outline: 1.5px solid var(--info);
}

.field [data-scrub] {
  flex: none;
  min-width: 0.8em;
  color: var(--text-3);
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
}

.field input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 500 0.72rem/1.3 var(--font-mono);
}

.field i {
  color: var(--text-3);
  font: 500 0.72rem/1.3 var(--font-mono);
}

.inspector__toggle {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-2);
  font-size: 0.9rem;
  transition: background-color 0.15s;
}

.inspector__toggle:hover,
.inspector__reset:not(:disabled):hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.inspector .is-pressed {
  background: color-mix(in srgb, var(--info) 25%, transparent);
}

.inspector__prop {
  display: grid;
  grid-template-columns: auto 1fr 58px;
  align-items: center;
  gap: 8px;
  max-height: 0;
  padding: 0 0.75rem;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-out), padding 0.35s var(--ease-out);
}

.inspector__prop.is-on {
  max-height: 2.4rem;
  padding: 0.1rem 0.75rem 0.5rem;
}

.inspector__prop .field {
  margin: 2px;
}

.swatch {
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 4px;
  background: rgb(0 0 0 / 0.45);
  border: 1px solid var(--line);
}

.swatch.is-gradient {
  background: var(--gradient);
}

button.swatch {
  outline-offset: 2px;
}

.inspector__foot {
  padding: 0.35rem 0.5rem 0.1rem;
  border-top: 1px solid var(--line);
}

.inspector__reset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: 500 0.72rem/1.3 var(--font-sans);
  transition: background-color 0.15s, opacity 0.2s;
}

.inspector__reset svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inspector__reset:disabled {
  opacity: 0.4;
}

/* Ruler along the top of the canvas, highlighting the selected frame. */
.top-ruler {
  position: fixed;
  top: var(--bar-h);
  left: 0;
  right: 0;
  z-index: 29;
  height: 20px;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 100px) bottom / 100% 10px no-repeat,
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 10px) bottom / 100% 5px no-repeat,
    color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  font: 0.6rem/1 var(--font-mono);
  color: var(--text-3);
  overflow: hidden;
}

.top-ruler span {
  position: absolute;
  top: 3px;
  padding-left: 3px;
}

.top-ruler__hl {
  position: absolute;
  inset: 0 auto 0 0;
  border-inline: 1px solid var(--info);
  background: color-mix(in srgb, var(--info) 16%, transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.top-ruler__hl.is-visible {
  opacity: 1;
}

.hero__frame-label {
  position: absolute;
  top: calc(var(--bar-h) + 20px + 1rem);
  left: clamp(1.25rem, 6vw, 6rem);
  margin: 0;
  color: var(--text-3);
  font: 0.72rem/1 var(--font-mono);
}

.hero__frame-label span {
  margin-left: 0.5rem;
  opacity: 0.7;
}

/* While the title lifts out of the hero, the rest of the intro steps back. */
.hero__name,
.hero__lede,
.hero__actions,
.hero__frame-label {
  opacity: clamp(0, 1 - var(--lift, 0) * 2.4, 1);
  translate: 0 calc(var(--lift, 0) * -16px);
}

/* The multiplayer cursor, driven from script.js. */
.cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  color: var(--secondary);
  pointer-events: none;
  will-change: transform;
}

.cursor span {
  margin-top: 14px;
  padding: 2px 8px;
  border-radius: 4px 999px 999px 999px;
  background: var(--secondary);
  color: #fff;
  font: 500 0.75rem/1.4 var(--font-mono);
  transition: scale 0.2s var(--ease-spring);
}

.cursor.is-grabbing span {
  scale: 0.92;
}

/* Tool glyphs, centred on the hotspot and turned to match the handle. */
.cursor__tool {
  position: absolute;
  top: -12px;
  left: -12px;
  display: none;
  rotate: var(--a, 0deg);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cursor__tool .o {
  stroke: var(--canvas);
  stroke-width: 5;
}

.cursor__tool .i {
  stroke: currentColor;
  stroke-width: 2;
}

.cursor[data-mode="resize"] .cursor__resize,
.cursor[data-mode="rotate"] .cursor__rotate {
  display: block;
}

.cursor:not([data-mode="arrow"]) .cursor__arrow {
  visibility: hidden;
}

html[data-theme="contrast"] .cursor span {
  color: #000;
}

/* Sections sit to the right of the docked title on desktop. */
.placeholder {
  padding-left: calc(var(--rail) + clamp(1.5rem, 4vw, 4rem));
}

/* Frame name in the top-left corner of a section, like the hero's. */
.section__label {
  position: absolute;
  top: 4.5rem;
  left: calc(var(--rail) + clamp(1.5rem, 4vw, 4rem));
  margin: 0;
  color: var(--text-3);
  font: 0.72rem/1 var(--font-mono);
}

/* ---------- Design Engineer: one set of components, four libraries ---------- */

.design {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "copy libraries"
    "stage stage"
    "cta cta";
  align-items: end;
  gap: 2.5rem clamp(1.5rem, 4vw, 3rem);
  padding: 8rem clamp(1.25rem, 6vw, 6rem) 6rem calc(var(--rail) + clamp(1.5rem, 4vw, 4rem));
}

.design__copy {
  grid-area: copy;
  max-width: 38rem;
}

.design__title {
  margin: 0 0 1.25rem;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 3.6vw, 3.4rem);
  font-weight: 640;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.design__title em {
  font-weight: 300;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  color: var(--text-2);
}

.design__copy p {
  max-width: 44ch;
  margin: 0 0 1rem;
  color: var(--text-2);
  font-size: 1.1rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.quirks {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.08em;
  font-style: italic;
  font-variation-settings: "SOFT" 100, "opsz" 72;
  text-decoration: underline wavy #a855f7 1.5px;
  text-underline-offset: 0.28em;
  text-decoration-skip-ink: none;
}

html[data-theme="dark"] .quirks {
  text-decoration-color: #c084fc;
}

html[data-theme="contrast"] .quirks {
  text-decoration-color: #ffe600;
}

.design__copy .design__hint {
  margin: 0;
  color: var(--text-3);
  font-size: 0.95rem;
}

/*
 * Library switcher, like a design tool's "Swap library" panel. It's the one thing to touch here, so it
 * gets the CTA's gradient as a slowly turning ring, a glow behind it, and a hand-drawn arrow.
 */
@property --ring-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.libraries-wrap {
  grid-area: libraries;
  position: relative;
  z-index: 2;
  isolation: isolate;
  width: 250px;
}

.libraries-wrap::before {
  content: "";
  position: absolute;
  inset: 12% 6%;
  z-index: -1;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #00ffcb);
  filter: blur(36px);
  opacity: 0.32;
  pointer-events: none;
}

.libraries {
  --stops: #a855f7, #5f9a8e 38%, #00ffcb 72%, #a855f7;
  position: relative;
  padding: 0.35rem;
  font: 0.8rem/1.3 var(--font-sans);
  color: var(--text-2);
}

.libraries::after {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1.5px;
  border-radius: 15px;
  background: conic-gradient(from var(--ring-angle), var(--stops));
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
  pointer-events: none;
  animation: ring-turn 8s linear infinite;
}

@keyframes ring-turn {
  to {
    --ring-angle: 360deg;
  }
}

.libraries__swoosh {
  position: absolute;
  top: 1.25rem;
  right: calc(100% + 0.5rem);
  width: 120px;
  fill: none;
  stroke: #a855f7;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  rotate: -4deg;
  pointer-events: none;
}

.libraries__swoosh path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.9s var(--ease-out);
}

.libraries__swoosh path + path {
  transition-duration: 0.3s;
  transition-delay: 0.8s;
}

.libraries-wrap.is-drawn .libraries__swoosh path {
  stroke-dashoffset: 0;
}

html[data-theme="dark"] .libraries__swoosh {
  stroke: #c084fc;
}

html[data-theme="contrast"] .libraries-wrap::before {
  display: none;
}

html[data-theme="contrast"] .libraries {
  --stops: #ffe600, #ffe600;
}

html[data-theme="contrast"] .libraries__swoosh {
  stroke: #ffe600;
}

@media (max-width: 1239px) {
  .libraries__swoosh {
    display: none;
  }
}

.libraries__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.55rem 0.55rem;
  font-size: 0.72rem;
}

.libraries__head strong {
  color: var(--text);
  font-weight: 600;
}

.libraries__head span {
  color: var(--text-3);
  font-family: var(--font-mono);
}

.library {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 9px;
  transition: background-color 0.2s var(--ease-out), scale 0.2s var(--ease-spring);
}

.library__pick {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.5rem 0.55rem;
  cursor: pointer;
}

.library input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.library:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.library:has(input:checked) {
  background: color-mix(in srgb, var(--info) 14%, transparent);
}

.library:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.library.is-pressed {
  scale: 0.97;
}

.library__mark {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--mark);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.18);
}

.library__name {
  display: grid;
  flex: 1;
  color: var(--text);
  font-weight: 560;
}

.library__name small {
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 400;
}

.library__link {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 0.3rem;
  border-radius: 7px;
  color: var(--text-3);
  transition: color 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}

.library__link:is(:hover, :focus-visible) {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}

.library__link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: translate 0.3s var(--ease-spring);
}

.library__link:hover svg {
  translate: 1px -1px;
}

.library__tag {
  flex: none;
  margin-right: 0.55rem;
  padding: 0.2rem 0.35rem;
  border: 1px dashed color-mix(in srgb, var(--text) 30%, transparent);
  border-radius: 5px;
  color: var(--text-3);
  font: normal 0.62rem/1 var(--font-mono);
  letter-spacing: 0.04em;
}

.library:has(input:checked) :is(.library__link, .library__tag) {
  color: var(--info);
}

.library:has(input:checked) .library__tag {
  border-color: color-mix(in srgb, var(--info) 50%, transparent);
}

.design__stage {
  grid-area: stage;
  min-width: 0;
  margin: 0 -18px;
}

.design__frame {
  display: block;
  width: 100%;
  height: 640px;
  border: 0;
  transition: height 0.5s var(--ease-out);
}

.design__cta {
  grid-area: cta;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.design__cta p {
  margin: 0;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 1.8vw, 1.6rem);
  font-weight: 500;
  font-variation-settings: "SOFT" 100, "opsz" 72;
  letter-spacing: -0.01em;
}

.design__cursor {
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.design__cursor.is-visible {
  opacity: 1;
}

@media (max-width: 1099px) {
  .design {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "libraries"
      "stage"
      "cta";
  }
}

/* ---------- AI Engineer: humans and machines ---------- */

.ai {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 20rem);
  grid-template-areas:
    "copy photo"
    "demo demo"
    "features features"
    "cta cta";
  align-items: start;
  gap: 3.5rem clamp(2rem, 4vw, 4rem);
  padding: 8rem clamp(1.25rem, 6vw, 6rem) 6rem calc(var(--rail) + clamp(1.5rem, 4vw, 4rem));
}

.ai__copy {
  grid-area: copy;
  max-width: 40rem;
}

.ai__copy > p:not(.ai__links) {
  max-width: 46ch;
  margin: 0 0 1.25rem;
  color: var(--text-2);
  font-size: 1.1rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.ai__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
}

.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  font-weight: 560;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.25em;
  transition: text-decoration-color 0.2s var(--ease-out);
}

.ext-link:hover {
  text-decoration-color: currentColor;
}

.ext-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: translate 0.3s var(--ease-spring);
}

.ext-link:hover svg {
  translate: 1px -1px;
}

/* Figma-style frame name above a figure. */
.frame-name {
  margin: 0 0 0.5rem;
  color: var(--text-3);
  font: 0.72rem/1 var(--font-mono);
}

/* Three supporting ideas, zig-zagging around the engine. */
.features {
  grid-area: features;
  display: grid;
  gap: 4rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem clamp(2rem, 5vw, 4.5rem);
}

.feature:nth-child(even) .feature__visual {
  order: 2;
}

.feature__visual {
  min-width: 0;
  margin: 0;
}

.feature__copy h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 1.8vw, 1.6rem);
  font-weight: 560;
  font-variation-settings: "SOFT" 100, "opsz" 72;
  line-height: 1.15;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.feature__copy p:not(.ai__links) {
  max-width: 42ch;
  margin: 0 0 1rem;
  color: var(--text-2);
  line-height: 1.55;
  text-wrap: pretty;
}

.mini {
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
}

html[data-theme="contrast"] .mini {
  border: 2px solid var(--text);
}

/* Tokens: hover a line to find what it styles, or the other way around. */
.mini--tokens {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.mini__human {
  display: grid;
  align-content: center;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--mer-surface);
}

.mini__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mini__machine {
  display: grid;
  align-content: center;
  gap: 0.6rem;
  padding: 1.25rem;
  background: var(--text);
  color: var(--canvas);
  font: 0.7rem/1.4 var(--font-mono);
}

.mini__machine span {
  justify-self: start;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: default;
}

.mini--tokens [data-t] {
  outline: 1.5px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}

.mini--tokens:not(:has([data-t]:hover)) [data-t="primary"],
.mini--tokens:has([data-t="primary"]:hover) [data-t="primary"],
.mini--tokens:has([data-t="secondary"]:hover) [data-t="secondary"],
.mini--tokens:has([data-t="rounded"]:hover) [data-t="rounded"] {
  outline-color: var(--info);
}

.mini--tokens:not(:has([data-t]:hover)) .mini__machine [data-t="primary"],
.mini--tokens:has([data-t="primary"]:hover) .mini__machine [data-t="primary"],
.mini--tokens:has([data-t="secondary"]:hover) .mini__machine [data-t="secondary"],
.mini--tokens:has([data-t="rounded"]:hover) .mini__machine [data-t="rounded"] {
  background: color-mix(in srgb, var(--info) 35%, transparent);
}

.mer-input {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 0.75rem;
  overflow: hidden;
  border: 1px solid var(--mer-border-alt);
  border-radius: 0.375rem;
  background: var(--mer-app);
  font-size: 0.875rem;
  white-space: nowrap;
}

.mer-chip {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--mer-secondary);
  color: var(--mer-on-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.mer-btn {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 1rem;
  border: 1px solid var(--mer-border-alt);
  border-radius: 0.375rem;
  background: var(--mer-base);
  font-size: 0.875rem;
  font-weight: 500;
}

.mer-btn--primary {
  border-color: var(--mer-primary);
  background: var(--mer-primary);
  color: var(--mer-on-primary);
}

/* Tools: a reply that's an interface, and a napkin that's a reply. */
.mini--tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 1rem;
}

.mini__card {
  display: grid;
  align-content: start;
  gap: 0.6rem;
}

.mini__ask {
  justify-self: end;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 12px 12px 4px 12px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  font-size: 0.8rem;
  white-space: nowrap;
}

.mini__reply {
  display: grid;
  padding: 0.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  font-size: 0.82rem;
}

.mini__reply label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
  cursor: pointer;
}

.mini__reply label:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.mini__reply input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
}

.mini__reply label:has(:checked) {
  color: var(--text-3);
  text-decoration: line-through;
}

.mini__napkin {
  width: 100%;
  height: auto;
  padding: 0.5rem;
  border: 1px solid rgb(36 40 48 / 0.18);
  border-radius: 10px;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgb(36 40 48 / 0.06) 50%, transparent calc(50% + 0.5px)),
    #fbf8f1;
  fill: none;
  stroke: #242830;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini__napkin path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.4s var(--ease-out);
}

.mini__napkin path + path {
  stroke-width: 1.2;
  opacity: 0.5;
  transition-delay: 1.1s;
  transition-duration: 0.5s;
}

.mini--tools.is-drawn .mini__napkin path {
  stroke-dashoffset: 0;
}

/* Intent: a comment on the canvas becomes a change in code. */
.mini--intent {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
}

.mini__canvas {
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 14px 14px;
}

.intent__card {
  position: relative;
  display: grid;
  gap: 0.1rem;
  padding: 0.6rem;
  border: 1px solid var(--mer-border);
  border-radius: 0.25rem;
  background: var(--mer-surface-alt);
  box-shadow: var(--mer-elevation-1);
  transition: padding 0.9s var(--ease-spring), border-radius 0.9s var(--ease-out);
}

.intent__card span {
  color: var(--mer-subtle);
  font-size: 0.75rem;
}

.intent__card strong {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.mini--intent.is-applied .intent__card {
  padding: 1.25rem;
  border-radius: 0.75rem;
}

.intent__pin {
  position: absolute;
  top: -13px;
  right: -13px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--paper);
  border-radius: 50% 50% 50% 4px;
  background: var(--secondary);
  color: #fff;
  font: normal 600 0.7rem/1 var(--font-sans);
}

html[data-theme="contrast"] .intent__pin {
  color: #000;
}

.mini__thread {
  display: grid;
  align-content: center;
  gap: 0.6rem;
  padding: 1rem;
  border-left: 1px solid var(--line);
  font-size: 0.85rem;
}

.mini__thread p {
  margin: 0;
}

.intent__diff {
  margin: 0;
  padding: 0.4rem 0;
  overflow: hidden;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 5%, transparent);
  font: 0.66rem/1.7 var(--font-mono);
  transition: opacity 0.5s var(--ease-out), translate 0.5s var(--ease-out);
}

.mini--intent:not(.is-replied) .intent__diff {
  opacity: 0;
  translate: 0 6px;
}

.intent__diff :is(del, ins) {
  display: block;
  padding: 0 0.6rem;
  text-decoration: none;
  white-space: nowrap;
}

.intent__diff del::before {
  content: "−  ";
}

.intent__diff ins::before {
  content: "+  ";
}

.intent__diff del {
  background: rgb(229 72 77 / 0.1);
  color: color-mix(in srgb, #e5484d 75%, var(--text));
}

.intent__diff ins {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}

/* Kendo Meridian, scoped: the tokens from the plugin's DESIGN.md. */
.mer {
  --mer-app: #fff;
  --mer-on: #232a36;
  --mer-subtle: #64748b;
  --mer-surface: #f9fafb;
  --mer-surface-alt: #fff;
  --mer-border: #b4bdc959;
  --mer-border-alt: #b4bdc980;
  --mer-base: #f3f5f7;
  --mer-base-hover: #e4e8ee;
  --mer-primary: #334155;
  --mer-primary-hover: #1e293b;
  --mer-on-primary: #fff;
  --mer-secondary: #5558e8;
  --mer-on-secondary: #fff;
  --mer-success-subtle: #c9e4db;
  --mer-success-on-subtle: #034932;
  --mer-elevation-1: 0 0 4px 1px rgb(56 66 80 / 0.05), 0 4px 6px -2px rgb(56 66 80 / 0.06);
  color: var(--mer-on);
  font: 400 1rem/1.5 "Inter", system-ui, sans-serif;
}

html[data-theme="dark"] .mer {
  --mer-app: oklch(13.85% 0.0249 273.24deg);
  --mer-on: oklch(95.1% 0.0063 255deg);
  --mer-subtle: oklch(76% 0.0122 259.82deg);
  --mer-surface: oklch(23.28% 0.0218 272.75deg);
  --mer-surface-alt: oklch(18.03% 0.0232 272.17deg);
  --mer-border: oklch(55.85% 0.0301 257.07deg / 0.25);
  --mer-border-alt: oklch(55.85% 0.0301 257.07deg / 0.5);
  --mer-base: oklch(31.71% 0.0286 265.25deg);
  --mer-base-hover: oklch(36% 0.0286 265.25deg);
  --mer-primary: oklch(86.9% 0.0198 252.89deg);
  --mer-primary-hover: oklch(92% 0.0198 252.89deg);
  --mer-on-primary: oklch(21% 0.0336 265deg);
  --mer-success-subtle: oklch(32% 0.06 163deg);
  --mer-success-on-subtle: oklch(90% 0.06 163deg);
  --mer-elevation-1: 0 4px 6px -2px rgb(0 0 0 / 0.4);
}

html[data-theme="contrast"] .mer {
  --mer-app: #000;
  --mer-on: #fff;
  --mer-subtle: #fff;
  --mer-surface: #000;
  --mer-surface-alt: #000;
  --mer-border: #fff;
  --mer-border-alt: #fff;
  --mer-base: #000;
  --mer-base-hover: #222;
  --mer-primary: #ffe600;
  --mer-primary-hover: #fff;
  --mer-on-primary: #000;
  --mer-secondary: #00f0ff;
  --mer-on-secondary: #000;
  --mer-success-subtle: #000;
  --mer-success-on-subtle: #fff;
  --mer-elevation-1: none;
}

.snapshot {
  grid-area: photo;
  margin: 0.5rem 0 0;
}

.snapshot__frame {
  padding: 1.5px;
  border-radius: 14px;
  background: var(--gradient);
  box-shadow: 0 22px 40px -22px var(--glow-b);
  rotate: 2deg;
}

.snapshot__frame img {
  width: 100%;
  height: auto;
  border-radius: 12.5px;
}

.snapshot figcaption {
  margin-top: 0.9rem;
  color: var(--text-3);
  font-size: 0.85rem;
  line-height: 1.45;
}

.snapshot figcaption a {
  color: var(--text);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.2em;
}

.snapshot figcaption a:hover {
  text-decoration-color: currentColor;
}

/* GenUI: a recorded run of the engine, replayed op by op. */
.genui {
  grid-area: demo;
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: 0 30px 60px -36px rgb(0 0 0 / 0.4);
}

html[data-theme="contrast"] .genui {
  border: 2px solid var(--text);
}

.genui__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  font: 0.78rem/1.4 var(--font-mono);
}

.genui__fn {
  color: var(--text-3);
  font: inherit;
}

.genui__fn span {
  padding: 1px 2px;
  border-radius: 4px;
  color: var(--text);
  transition: background-color 0.35s var(--ease-out), color 0.35s var(--ease-out);
}

.genui__fn span.is-lit {
  background: var(--primary);
  color: var(--canvas);
  transition-duration: 0.08s;
}

.genui__rec {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-3);
  font-size: 0.7rem;
}

.genui__rec::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.genui__body {
  display: grid;
  grid-template-columns: minmax(15rem, 0.85fr) minmax(0, 1.15fr);
  height: 450px;
}

.genui__log {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1rem;
  border-right: 1px solid var(--line);
}

.genui__ask {
  align-self: flex-end;
  max-width: 92%;
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.8rem;
  border-radius: 14px 14px 4px 14px;
  background: var(--text);
  color: var(--canvas);
  font-size: 0.88rem;
  line-height: 1.4;
}

.genui__ask:empty {
  display: none;
}

.genui__stream {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  font: 0.72rem/1.65 var(--font-mono);
  list-style: none;
  scrollbar-width: none;
}

.genui__stream li {
  display: grid;
  grid-template-columns: 5.9rem 4.4rem minmax(0, 1fr);
  gap: 0.5rem;
  color: var(--text-2);
  white-space: nowrap;
  animation: op-in 0.25s var(--ease-out);
}

.genui__stream li > * {
  overflow: hidden;
  text-overflow: ellipsis;
}

.genui__stream b {
  font-weight: 500;
}

.genui__stream [data-kind="create"] b { color: var(--primary); }
.genui__stream [data-kind="update"] b { color: var(--info); }
.genui__stream [data-kind="remove"] b { color: #e5484d; }
.genui__stream [data-kind="tool"] b { color: var(--secondary); }
.genui__stream [data-kind="result"] { color: var(--text-3); }

html[data-theme="contrast"] .genui__stream [data-kind="remove"] b {
  color: #ff6b6b;
}

@keyframes op-in {
  from {
    opacity: 0;
    translate: -6px 0;
  }
}

.genui__screen {
  position: relative;
  min-width: 0;
  overflow: auto;
  padding: 1.1rem 1.5rem 1.5rem;
  background: var(--mer-app);
}

/* A nameless app header: the engine isn't tied to one product. */
.genui__chrome {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
}

.genui__chrome i {
  width: 18px;
  height: 18px;
  margin-right: 0.25rem;
  border-radius: 5px;
  background: var(--mer-secondary);
}

.genui__chrome b {
  width: 3.5rem;
  height: 6px;
  border-radius: 999px;
  background: var(--mer-base);
}

.genui__chrome b + b {
  width: 2.5rem;
}

.genui__root {
  display: grid;
  gap: 0.75rem;
  transition: opacity 0.25s var(--ease-out);
}

.genui__root.is-clearing {
  opacity: 0;
}

.genui__prompts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
}

.genui__prompts span {
  margin-right: 0.25rem;
  color: var(--text-3);
  font: 0.72rem var(--font-mono);
}

.genui__prompts button {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 0.86rem/1.3 var(--font-sans);
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out), scale 0.2s var(--ease-spring);
}

.genui__prompts button:hover {
  background: color-mix(in srgb, var(--text) 7%, transparent);
}

.genui__prompts button[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--canvas);
}

.genui__prompts button.is-pressed,
.gn-btn.is-pressed {
  scale: 0.95;
}

/* Generated nodes, styled by the design system they were built from. */
[data-node] {
  position: relative;
  animation: node-in 0.3s var(--ease-out);
}

@keyframes node-in {
  from {
    opacity: 0;
    translate: 0 4px;
  }
}

[data-node].is-new {
  outline: 1.5px solid var(--info);
  outline-offset: 3px;
}

[data-node].is-new::after {
  content: attr(data-type);
  position: absolute;
  bottom: calc(100% + 4px);
  left: -4px;
  z-index: 1;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--info);
  color: #fff;
  font: 500 10px/1.4 var(--font-mono);
  white-space: nowrap;
  pointer-events: none;
}

html[data-theme="contrast"] [data-node].is-new::after {
  color: #000;
}

[data-node].is-leaving {
  opacity: 0;
  scale: 0.98;
  transition: opacity 0.3s var(--ease-out), scale 0.3s var(--ease-out);
}

.gn-card {
  display: grid;
  gap: 0.6rem;
  padding: 1rem 1.25rem 1.25rem;
  border: 1px solid var(--mer-border);
  border-radius: 0.5rem;
  background: var(--mer-surface-alt);
  box-shadow: var(--mer-elevation-1);
}

.gn-heading {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.gn-text {
  margin: 0;
  color: var(--mer-subtle);
  font-size: 0.875rem;
  line-height: 1.4286;
}

.gn-meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--mer-base);
}

.gn-meter i {
  display: block;
  width: var(--v, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--mer-secondary);
  transition: width 0.7s var(--ease-out);
}

.gn-form {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.gn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-self: stretch;
}

.gn-field {
  display: grid;
  flex: 1 1 9rem;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.gn-field :is(input, select) {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 0.75rem;
  border: 1px solid var(--mer-border-alt);
  border-radius: 0.375rem;
  background: var(--mer-app);
  color: var(--mer-on);
  font: 400 1rem "Inter", sans-serif;
}

.gn-field input[type="number"] {
  width: 7rem;
}

.gn-field :is(input, select):focus-visible,
.gn-btn:focus-visible,
.gn-check input:focus-visible {
  outline: 2px solid var(--mer-secondary);
  outline-offset: 1px;
  border-radius: 0.375rem;
}

.gn-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.gn-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--mer-secondary);
}

.gn-btn {
  height: 38px;
  padding: 0 1rem;
  border: 1px solid var(--mer-primary);
  border-radius: 0.375rem;
  background: var(--mer-primary);
  color: var(--mer-on-primary);
  font: 500 1rem "Inter", sans-serif;
  cursor: pointer;
  transition: background-color 0.15s, scale 0.2s var(--ease-spring);
}

.gn-btn:hover {
  background: var(--mer-primary-hover);
}

.gn-alert {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  background: var(--mer-success-subtle);
  color: var(--mer-success-on-subtle);
  font-size: 0.875rem;
  line-height: 1.4286;
}

html[data-theme="contrast"] .gn-alert {
  border: 1px solid #fff;
}

.gn-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gn-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--mer-border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.gn-list small {
  color: var(--mer-subtle);
  font-size: 0.8rem;
  font-weight: 400;
}

.gn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.gn-table :is(th, td) {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--mer-border);
  text-align: left;
}

.gn-table th {
  color: var(--mer-subtle);
  font-weight: 500;
}

.gn-table :is(th, td):last-child {
  text-align: right;
}

.ai__cursor {
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.ai__cursor.is-visible {
  opacity: 1;
}

.ai__cta {
  grid-area: cta;
}

@media (max-width: 1099px) {
  .ai {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "photo"
      "demo"
      "features"
      "cta";
  }

  .feature {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature:nth-child(even) .feature__visual {
    order: 0;
  }

  .snapshot {
    max-width: 22rem;
  }

  .genui__body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 170px minmax(0, 1fr);
    height: 600px;
  }

  .genui__log {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 759px) {
  .genui__rec {
    display: none;
  }

  .mini--tokens,
  .mini--intent {
    grid-template-columns: minmax(0, 1fr);
  }

  .mini__thread {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

/* ---------- Product Engineer: one product, and everything that branched off it ---------- */

.product {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  grid-template-areas:
    "copy growth"
    "branches growth"
    "cta cta";
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 2.5rem clamp(2rem, 4vw, 4rem);
  padding: 8rem clamp(1.25rem, 6vw, 6rem) 6rem calc(var(--rail) + clamp(1.5rem, 4vw, 4rem));
}

.product__copy {
  grid-area: copy;
  max-width: 40rem;
}

.product__copy > p {
  max-width: 46ch;
  margin: 0 0 1rem;
  color: var(--text-2);
  font-size: 1.1rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.product [data-branch="main"] { --branch: var(--primary); }
.product [data-branch="themes"] { --branch: var(--secondary); }
.product [data-branch="docs"] { --branch: var(--info); }
.product [data-branch="themebuilder"] { --branch: var(--tertiary); }
.product [data-branch="ai"] { --branch: var(--warning); }
.product [data-branch="explore"] { --branch: var(--text-2); }

/* The sticky graph needs its own containing block, or it slides over the CTA. */
.product__aside {
  grid-area: growth;
  align-self: stretch;
  min-width: 0;
}

.growth {
  position: sticky;
  top: calc(var(--bar-h) + 2rem);
  min-width: 0;
  margin: 0;
}

.growth__frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--panel) 70%, transparent), transparent 62%),
    color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: 0 30px 60px -36px rgb(0 0 0 / 0.4);
}

html[data-theme="contrast"] .growth__frame {
  border: 2px solid var(--text);
}

.growth__svg {
  display: block;
  width: 100%;
  height: auto;
  padding: 0.5rem;
  overflow: visible;
}

.growth__ring {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
  transform-box: view-box;
  transform-origin: 280px 220px;
  transition: stroke 0.3s var(--ease-out), stroke-width 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

.growth__ring:not([data-branch]) {
  stroke-width: 2;
}

.growth__branch {
  cursor: default;
  transition: opacity 0.3s var(--ease-out);
}

.growth__hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  pointer-events: stroke;
}

.growth__spiral,
.growth__path {
  fill: none;
  stroke: var(--branch);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  pointer-events: none;
}

.growth__release {
  fill: var(--branch);
}

.growth__explore {
  fill: none;
  stroke: url(#growth-explore);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0.5 7;
  pointer-events: none;
}

.growth__stop-a { stop-color: var(--primary); }
.growth__stop-b { stop-color: var(--text-2); }

.growth__node.growth__node--open {
  fill: var(--paper);
  stroke: var(--branch);
  stroke-width: 2;
  stroke-dasharray: 2.5 2;
}

.growth__node,
.growth__fork {
  fill: var(--branch);
  stroke: var(--paper);
  stroke-width: 2;
}

.growth__release,
.growth__node,
.growth__fork,
.growth__head,
.growth__label {
  transform-box: fill-box;
  transform-origin: center;
}

.growth__pulse {
  fill: var(--branch);
  opacity: 0;
  animation: growth-pulse 2.4s var(--ease-out) infinite;
}

@keyframes growth-pulse {
  from { opacity: 0.5; scale: 1; }
  to { opacity: 0; scale: 3.2; }
}

.growth__label {
  fill: var(--text-2);
  font: 500 12px var(--font-mono);
  pointer-events: none;
}

/* Hovering a branch in the log or the rings lights up the pair. */
.product.has-active .growth__branch:not(.is-on) {
  opacity: 0.2;
}

.product.has-active .growth__ring:not(.is-on) {
  opacity: 0.5;
}

.growth__ring.is-on {
  stroke: var(--branch);
  stroke-width: 2;
}

.growth__branch.is-on .growth__label {
  fill: var(--text);
}

/* The tree grows once, when it first scrolls into view. */
.product.is-armed:not(.is-grown) .growth__spiral,
.product.is-armed:not(.is-grown) .growth__path {
  stroke-dashoffset: 1;
}

.product.is-armed:not(.is-grown) .growth__explore {
  opacity: 0;
}

.product.is-grown .growth__explore {
  transition: opacity 0.8s var(--ease-out) var(--d, 0s);
}

.product.is-armed:not(.is-grown) :is(.growth__ring, .growth__release, .growth__node, .growth__fork, .growth__head, .growth__label) {
  opacity: 0;
  scale: 0.9;
}

.product.is-grown .growth__spiral {
  transition: stroke-dashoffset 2.4s linear;
}

.product.is-grown .growth__path {
  transition: stroke-dashoffset 0.7s var(--ease-out) var(--d, 0s);
}

.product.is-grown :is(.growth__ring, .growth__release, .growth__node, .growth__fork, .growth__head, .growth__label) {
  transition:
    opacity 0.5s var(--ease-out) var(--d, 0s),
    scale 0.6s var(--ease-spring) var(--d, 0s),
    stroke 0.3s var(--ease-out),
    stroke-width 0.3s var(--ease-out);
}

/* The branch log: the readable side of the rings. */
.branches {
  grid-area: branches;
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A git log --graph: a dot per branch on a shared rail. */
.branch {
  position: relative;
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: 0.15rem 0.9rem;
  padding: 0.85rem 1rem;
  margin: 0 -1rem;
  border-radius: 12px;
  transition: background-color 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

.branch::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--branch);
  box-shadow: 0 0 0 3px var(--canvas), 0 0 0 4px var(--branch);
}

.branch:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.9rem;
  bottom: -0.85rem;
  left: calc(1.5rem - 1px);
  width: 2px;
  background: var(--line);
}

.branch--sub::before {
  width: 8px;
  height: 8px;
  translate: 0.4rem 0;
}

.branch--explore::before {
  background: var(--canvas);
  box-shadow: 0 0 0 3px var(--canvas);
  outline: 2px dashed var(--branch);
  outline-offset: 0;
}

.branch:has(+ .branch--explore)::after {
  background: repeating-linear-gradient(var(--line-strong) 0 3px, transparent 3px 7px);
}

.branch__name {
  grid-column: 2;
  color: var(--text-3);
  font: 0.75rem/1.2 var(--font-mono);
}

.branch > div {
  grid-column: 2;
}

.branch h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 560;
  font-variation-settings: "SOFT" 100, "opsz" 72;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.branch p {
  max-width: 44ch;
  margin: 0 0 0.4rem;
  color: var(--text-2);
  line-height: 1.5;
  text-wrap: pretty;
}

.branch .ext-link {
  font-size: 0.92rem;
}

.branch.is-on {
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}

.product.has-active .branch:not(.is-on) {
  opacity: 0.45;
}

.product__cta {
  grid-area: cta;
  margin-top: 2.5rem;
}

@media (min-width: 1100px) {
  .product.is-armed:not(.is-grown) .branch {
    opacity: 0;
    translate: 0 8px;
  }

  .product.is-grown .branch {
    transition:
      opacity 0.5s var(--ease-out) var(--d, 0s),
      translate 0.6s var(--ease-out) var(--d, 0s),
      background-color 0.3s var(--ease-out);
  }
}

@media (max-width: 1099px) {
  .product {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas:
      "copy"
      "growth"
      "branches"
      "cta";
  }

  .growth {
    position: static;
    max-width: 40rem;
  }
}

.product.is-settled :is(.growth__ring, .growth__release, .growth__node, .growth__fork, .growth__head, .growth__label, .growth__path, .growth__explore, .branch) {
  transition-delay: 0s;
}

/* ---------- Curious Engineer: talks and writing ---------- */

.talks {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr);
  grid-template-areas:
    "copy shared"
    "cta cta";
  align-items: start;
  gap: 2.5rem clamp(2rem, 4vw, 4rem);
  padding: 8rem clamp(1.25rem, 6vw, 6rem) 6rem calc(var(--rail) + clamp(1.5rem, 4vw, 4rem));
}

.talks__copy {
  grid-area: copy;
  max-width: 34rem;
}

.talks__copy > p {
  max-width: 40ch;
  margin: 0;
  color: var(--text-2);
  font-size: 1.1rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.shared {
  grid-area: shared;
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shared__item {
  position: relative;
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
  column-gap: 1.25rem;
  padding: 0.85rem;
  margin: 0 -0.85rem;
  border-radius: 14px;
  transition: background-color 0.3s var(--ease-out);
}

.shared__item:has(.shared__link:hover, .shared__link:focus-visible) {
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}

.shared__item:has(.shared__link:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.shared__link {
  color: inherit;
  text-decoration: none;
  outline: none;
}

/* The title link covers the whole card; extra links sit above it. */
.shared__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.shared__extra {
  position: relative;
  z-index: 1;
  justify-self: start;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.shared__thumb {
  grid-row: 1 / -1;
  width: 100%;
  height: auto;
  aspect-ratio: 1.91;
  object-fit: cover;
  border-radius: 8px;
  outline: 1px solid var(--line);
  outline-offset: -1px;
  background: var(--panel);
  transition: scale 0.4s var(--ease-spring);
}

.shared__item:has(.shared__link:hover) .shared__thumb {
  scale: 1.02;
}

.shared__meta {
  margin-bottom: 0.35rem;
  color: var(--text-3);
  font: 0.72rem/1.4 var(--font-mono);
}

.shared__kind {
  color: var(--primary);
}

.shared__item[data-kind="post"] .shared__kind {
  color: var(--info);
}

.shared__item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

.shared__item p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.talks__cta {
  grid-area: cta;
  margin-top: 2.5rem;
}

@media (max-width: 1099px) {
  .talks {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "shared"
      "cta";
  }
}

@media (max-width: 599px) {
  .shared__item {
    grid-template-columns: minmax(0, 1fr);
  }

  .shared__thumb {
    grid-row: auto;
    margin-bottom: 0.75rem;
  }
}

/* Background artifacts. */
.artifact {
  font: 0.7rem/1 var(--font-mono);
  white-space: nowrap;
}

.artifact svg rect,
.artifact svg circle:not([fill]) {
  fill: var(--canvas);
  stroke: currentColor;
}

.artifact svg text {
  font: 0.7rem var(--font-mono);
}

.a-sel {
  position: relative;
  border: 1px solid currentColor;
}

.a-sel i {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--canvas);
  border: 1px solid currentColor;
}

.a-sel i:nth-child(1) { top: -4px; left: -4px; }
.a-sel i:nth-child(2) { top: -4px; right: -4px; }
.a-sel i:nth-child(3) { bottom: -4px; left: -4px; }
.a-sel i:nth-child(4) { bottom: -4px; right: -4px; }

.a-sel span {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  translate: -50% 0;
}

.a-redline {
  position: relative;
  height: 1px;
  margin-top: 12px;
  background: var(--secondary);
  opacity: 0.55;
}

.a-redline.is-vertical {
  width: 1px;
  margin: 0 0 0 12px;
}

.a-redline::before,
.a-redline::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 1px;
  height: 11px;
  background: inherit;
}

.a-redline::before { left: 0; }
.a-redline::after { right: 0; }

.a-redline.is-vertical::before,
.a-redline.is-vertical::after {
  top: auto;
  left: -5px;
  width: 11px;
  height: 1px;
}

.a-redline.is-vertical::before { top: 0; }
.a-redline.is-vertical::after { bottom: 0; }

.a-redline span {
  position: absolute;
  bottom: 6px;
  left: 50%;
  translate: -50% 0;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--secondary);
  color: #fff;
}

.a-redline.is-vertical span {
  bottom: auto;
  top: 50%;
  left: 8px;
  translate: 0 -50%;
}

.a-padding {
  position: relative;
  background: repeating-linear-gradient(-45deg, var(--secondary) 0 1px, transparent 1px 6px);
  border: 1px solid color-mix(in srgb, var(--secondary) 60%, transparent);
  opacity: 0.45;
}

.a-padding span {
  position: absolute;
  top: 50%;
  left: calc(100% + 6px);
  translate: 0 -50%;
  color: var(--secondary);
}

.a-frame {
  position: relative;
}

.a-frame span {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
}

.a-frame i {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid currentColor;
}

.a-frame i:nth-of-type(1) { top: 0; left: 0; border-width: 1px 0 0 1px; }
.a-frame i:nth-of-type(2) { top: 0; right: 0; border-width: 1px 1px 0 0; }
.a-frame i:nth-of-type(3) { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.a-frame i:nth-of-type(4) { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

.a-noodle {
  color: color-mix(in srgb, var(--info) 55%, transparent);
}

.a-auto {
  position: relative;
  height: 30px;
}

.a-auto b,
.a-auto u {
  position: absolute;
  top: 0;
  height: 30px;
}

.a-auto b {
  border: 1px solid currentColor;
  border-radius: 4px;
}

.a-auto u {
  background: repeating-linear-gradient(-45deg, var(--secondary) 0 1px, transparent 1px 5px);
  opacity: 0.4;
}

.a-auto span {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
}

/* Narrow desktops can't fit the inspector beside the photo, so it floats lower, over the shoulder. */
@media (min-width: 900px) and (max-width: 1099px) {
  .inspector {
    top: 60%;
  }
}

@media (max-width: 899px) {
  :root {
    --title-size: clamp(2rem, 8.6vw, 3.4rem);
  }

  .bar__file,
  .bar__nav,
  .facepile {
    display: none;
  }

  .bar {
    justify-content: flex-end;
  }

  .rail-ruler,
  .top-ruler,
  .inspector,
  .hero__frame-label {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    min-height: auto;
    padding-top: calc(var(--bar-h) + 2.5rem);
  }

  .portrait {
    order: -1;
    width: min(240px, 62vw);
  }

  .locale__zone {
    display: none;
  }

  .locale__time {
    display: grid;
    justify-items: center;
  }

  .placeholder,
  .design,
  .ai,
  .product,
  .talks {
    padding-left: clamp(1.25rem, 6vw, 6rem);
  }

  .design,
  .ai,
  .product,
  .talks {
    padding-top: 5rem;
  }

  .section__label {
    display: none;
  }

  .libraries-wrap {
    width: min(100%, 22rem);
  }

  .design__stage {
    margin: 0 calc(-1 * clamp(1.25rem, 6vw, 6rem));
  }
}
