@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/manrope-latin.woff2") format("woff2");
}

@property --rainbow-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0turn;
}

:root {
  color-scheme: light;
  --canvas: oklch(1 0 0);
  --surface: oklch(0.965 0.012 150);
  --surface-strong: oklch(0.925 0.025 150);
  --ink: oklch(0.19 0.025 155);
  --muted: oklch(0.43 0.025 155);
  --primary: oklch(0.4 0.106 150);
  --primary-bright: oklch(0.52 0.13 150);
  --leaf: oklch(0.88 0.19 125);
  --sky: oklch(0.82 0.11 225);
  --coral: oklch(0.69 0.18 32);
  --focus: oklch(0.58 0.2 255);
  --white: oklch(1 0 0);
  --black: oklch(0.08 0 0);
  --error: oklch(0.52 0.19 25);
  --dock-height: 62px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --z-grid: 20;
  --z-selection: 25;
  --z-dock: 35;
  --z-popover: 40;
  --z-toast: 50;
  font-family: "Manrope", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  overflow-x: hidden;
}

body,
button,
input,
select {
  font: inherit;
}

button,
a,
input,
select,
[contenteditable="true"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

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

::selection {
  background: var(--sky);
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: var(--z-toast);
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  font-weight: 750;
  transform: translateY(-150%);
  transition: transform 180ms var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  min-height: 100vh;
  padding-bottom: 118px;
  transition: filter 220ms var(--ease-out);
}

.site-header {
  --section-py: 22px;
  --section-px: clamp(20px, 5vw, 72px);
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 78px;
  padding: var(--section-py) var(--section-px);
  background: var(--canvas);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 38px);
}

.site-header nav a,
.text-link {
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.site-header nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  color: var(--ink);
  font-weight: 820;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand-orbit {
  position: relative;
  display: block;
  width: 31px;
  height: 31px;
}

.brand-orbit i {
  position: absolute;
  display: block;
  border-radius: 50%;
}

.brand-orbit i:nth-child(1) {
  inset: 2px 9px 9px 2px;
  background: var(--primary);
}

.brand-orbit i:nth-child(2) {
  width: 15px;
  height: 15px;
  right: 0;
  bottom: 2px;
  background: var(--leaf);
}

.brand-orbit i:nth-child(3) {
  width: 8px;
  height: 8px;
  top: 1px;
  right: 2px;
  background: var(--coral);
}

.header-cta,
.primary-site-button,
.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--white);
  font-weight: 760;
  text-decoration: none;
  transition: transform 180ms var(--ease-out), background 180ms var(--ease-out);
}

.header-cta {
  justify-self: end;
}

.header-cta:hover,
.primary-site-button:hover,
.contact-button:hover {
  background: var(--primary-bright);
  transform: translateY(-2px);
}

.header-cta:active,
.primary-site-button:active,
.contact-button:active {
  transform: scale(0.97);
}

.hero {
  --section-py: clamp(52px, 7vw, 100px);
  --section-px: clamp(20px, 6vw, 92px);
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  align-items: center;
  gap: clamp(44px, 8vw, 128px);
  min-height: calc(100vh - 78px);
  padding: var(--section-py) var(--section-px);
  background: var(--canvas);
}

.hero-copy {
  max-width: 680px;
}

.hero-note {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0 0 28px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 750;
}

.hero h1 {
  max-width: 10ch;
  margin: 0;
  font-size: clamp(3.25rem, 7vw, 5.9rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.hero-intro {
  max-width: 58ch;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.65;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 38px;
}

.primary-site-button {
  min-height: 54px;
  padding-inline: 25px;
}

.text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 760;
}

.living-study {
  position: relative;
  isolation: isolate;
  min-height: min(630px, 67vw);
  overflow: hidden;
  border-radius: 16px;
  background: var(--primary);
}

.sun-disc {
  position: absolute;
  top: 8%;
  right: 8%;
  width: clamp(90px, 13vw, 180px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--leaf);
  animation: sun-pulse 5s var(--ease-out) infinite alternate;
}

.plant-orb {
  position: absolute;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
}

.plant-orb span {
  width: 44%;
  height: 62%;
  border-radius: 60% 12% 60% 12%;
  background: var(--primary);
  transform: rotate(35deg);
}

.plant-orb-one {
  left: -8%;
  bottom: 4%;
  width: 58%;
  background: var(--sky);
}

.plant-orb-two {
  right: 7%;
  bottom: 18%;
  width: 39%;
  background: var(--leaf);
}

.plant-orb-three {
  left: 31%;
  top: 19%;
  width: 27%;
  background: var(--coral);
}

.plant-orb-three span {
  background: var(--white);
}

.study-caption {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 210px;
  padding: 15px 17px;
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
}

.study-caption span {
  color: var(--muted);
  font-size: 0.8rem;
}

@keyframes sun-pulse {
  from { transform: scale(0.96); }
  to { transform: scale(1.04); }
}

.promise {
  --section-py: clamp(64px, 9vw, 132px);
  --section-px: clamp(20px, 8vw, 124px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(40px, 9vw, 150px);
  align-items: end;
  padding: var(--section-py) var(--section-px);
  background: var(--leaf);
}

.promise-heading {
  position: relative;
}

.promise h2,
.work h2,
.contact h2 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.promise-bubble {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 25px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--leaf);
  font-size: 1.7rem;
}

.promise-copy {
  max-width: 48ch;
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.work {
  --section-py: clamp(72px, 10vw, 148px);
  --section-px: clamp(20px, 7vw, 108px);
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(480px, 1.22fr);
  gap: clamp(50px, 10vw, 150px);
  padding: var(--section-py) var(--section-px);
  background: var(--canvas);
}

.work-intro {
  position: sticky;
  top: 42px;
  align-self: start;
}

.work h2 {
  font-size: clamp(2.4rem, 4.3vw, 4.5rem);
}

.work-intro p {
  max-width: 42ch;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.service-list article {
  display: grid;
  grid-template-columns: 18px minmax(150px, 0.65fr) minmax(220px, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 30px 0;
  border-bottom: 1px solid var(--surface-strong);
}

.service-list article:first-child {
  border-top: 1px solid var(--surface-strong);
}

.service-list h3,
.service-list p {
  margin: 0;
}

.service-list h3 {
  font-size: 1.2rem;
}

.service-list p {
  color: var(--muted);
  line-height: 1.55;
}

.service-list article > span:last-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.service-dot {
  display: block;
  width: 13px;
  height: 13px;
  margin-top: 5px;
  border-radius: 50%;
}

.dot-sky { background: var(--sky); }
.dot-leaf { background: var(--leaf); }
.dot-coral { background: var(--coral); }

.contact {
  --section-py: clamp(72px, 10vw, 144px);
  --section-px: clamp(20px, 8vw, 124px);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
  overflow: hidden;
  padding: var(--section-py) var(--section-px);
  background: var(--sky);
}

.contact-copy {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.contact h2 {
  max-width: 14ch;
}

.contact p {
  margin: 24px 0 0;
  font-size: 1.15rem;
}

.contact-button {
  position: relative;
  z-index: 2;
  min-height: 62px;
  padding-inline: 28px;
  gap: 12px;
  white-space: nowrap;
}

.contact-rings,
.contact-rings i {
  position: absolute;
  border-radius: 50%;
}

.contact-rings {
  top: -160px;
  right: 8%;
  width: 520px;
  height: 520px;
}

.contact-rings i {
  inset: 0;
  border: 56px solid color-mix(in oklch, var(--white) 38%, transparent);
}

.contact-rings i:nth-child(2) { inset: 105px; }
.contact-rings i:nth-child(3) { inset: 205px; background: var(--coral); border: 0; }

.site-footer {
  --section-py: 34px;
  --section-px: clamp(20px, 6vw, 92px);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: var(--section-py) var(--section-px);
  background: var(--ink);
  color: var(--white);
  font-size: 0.9rem;
}

/* Editor surface states */
[data-editable] {
  min-width: 1ch;
}

body[data-tool="edit"] [data-editable] {
  border-radius: 4px;
  outline: 2px dashed color-mix(in oklch, var(--focus) 70%, transparent);
  outline-offset: 5px;
  cursor: text;
}

body[data-tool="edit"] [data-editable]:hover,
body[data-tool="edit"] [data-editable]:focus {
  outline-style: solid;
  background: color-mix(in oklch, var(--sky) 36%, transparent);
}

[contenteditable="true"]:empty::before {
  content: "Type something";
  color: var(--muted);
}

.editor-node {
  position: relative;
  transform: translate(var(--move-x, 0px), var(--move-y, 0px));
}

.editable-block {
  transform: translate(var(--move-x, 0px), var(--move-y, 0px));
}

body[data-tool="spacing"] [data-section],
body[data-tool="move"] .move-candidate,
body[data-tool="style"] [data-section],
body[data-tool="style"] [data-editable],
body[data-tool="style"] [data-style-target] {
  cursor: pointer;
  transition: outline-color 180ms var(--ease-out), outline-width 180ms var(--ease-out), filter 180ms var(--ease-out);
}

body[data-tool="spacing"] [data-section]::after,
body[data-tool="move"] .move-candidate::after {
  content: attr(data-node-label);
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 8;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 760;
  pointer-events: none;
}

body[data-tool="spacing"] [data-section] {
  outline: 2px solid color-mix(in oklch, var(--coral) 70%, transparent);
  outline-offset: -2px;
}

body[data-tool="spacing"] [data-section]:hover {
  outline-width: 4px;
}

body[data-tool="move"] .move-candidate {
  outline: 2px dashed color-mix(in oklch, var(--focus) 78%, transparent);
  outline-offset: -3px;
  touch-action: none;
}

body[data-tool="move"] .move-candidate:hover {
  outline-style: solid;
  filter: saturate(1.04);
}

body.is-dragging .move-candidate.is-selected {
  cursor: grabbing;
}

.selection-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-selection);
  border: 3px solid var(--focus);
  border-radius: 10px;
  pointer-events: none;
  transform: translate3d(var(--ring-x, 0), var(--ring-y, 0), 0);
  transition: opacity 100ms linear, border-color 180ms var(--ease-out);
  will-change: transform, width, height;
}

.selection-ring[hidden] {
  display: none;
}

.selection-ring.is-offscreen {
  opacity: 0;
  visibility: hidden;
}

@keyframes selection-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes selection-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.selection-ring.is-opening {
  animation: selection-in 140ms linear both;
}

.selection-ring.is-closing {
  animation: selection-out 140ms linear both;
}

.selection-ring > span {
  position: absolute;
  left: 10px;
  bottom: calc(100% + 7px);
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--focus);
  color: var(--white);
  font-size: 0.74rem;
  font-weight: 780;
  white-space: nowrap;
  transform-origin: left bottom;
  animation: selection-label-in 300ms var(--ease-expo) both;
}

@keyframes selection-label-in {
  from { opacity: 0; transform: translateY(4px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ring-handle {
  position: absolute;
  display: block;
  width: 10px;
  height: 10px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--focus);
}

.handle-nw { top: -6px; left: -6px; }
.handle-ne { top: -6px; right: -6px; }
.handle-sw { bottom: -6px; left: -6px; }
.handle-se { right: -6px; bottom: -6px; }

.movement-grid {
  position: fixed;
  inset: 0;
  z-index: var(--z-grid);
  display: block;
  width: 100vw;
  height: 100dvh;
  contain: strict;
  pointer-events: none;
  opacity: 0;
  transform: translateZ(0);
  transition: opacity 180ms var(--ease-out);
  will-change: opacity;
}

body[data-tool="move"] .movement-grid {
  opacity: 0.68;
}

/* Floating editor controls */
.builder-dock {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: var(--z-dock);
  display: flex;
  align-items: center;
  gap: 4px;
  width: min(560px, calc(100vw - 24px));
  min-height: var(--dock-height);
  padding: 5px;
  border-radius: 999px;
  background: var(--black);
  box-shadow: 0 10px 28px color-mix(in oklch, var(--black) 25%, transparent);
  transform: translateX(-50%);
  transition: transform 240ms var(--ease-expo), opacity 180ms var(--ease-out);
}

.tool-button {
  --tool-accent: color-mix(in oklch, var(--white) 12%, transparent);
  --tool-accent-ink: var(--white);
  position: relative;
  display: flex;
  flex: 1 1 0;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 52px;
  padding: 5px 9px 5px 5px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: color-mix(in oklch, var(--white) 72%, var(--black));
  font-size: 0.74rem;
  font-weight: 720;
  cursor: pointer;
  transition: transform 180ms var(--ease-out), background 180ms var(--ease-out), color 180ms var(--ease-out);
}

.tool-button:hover {
  background: var(--tool-accent);
  color: var(--tool-accent-ink);
}

.tool-button:hover .tool-icon {
  transform: scale(1.05263158);
}

.tool-button:active {
  transform: none;
}

.tool-button[aria-expanded="true"],
.tool-button[aria-pressed="true"] {
  background: var(--tool-accent);
  color: var(--tool-accent-ink);
}

.tool-button[aria-expanded="true"] .tool-icon,
.tool-button[aria-pressed="true"] .tool-icon {
  background: color-mix(in oklch, var(--white) 42%, transparent);
  color: var(--tool-accent-ink);
  transform: scale(1.05263158);
}

.tool-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: color-mix(in oklch, var(--white) 12%, transparent);
  transform-origin: center;
  transition: transform 160ms var(--ease-out), background 180ms var(--ease-out);
}

.tool-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tool-button[data-tool="edit"] { --tool-accent: var(--sky); --tool-accent-ink: var(--ink); }
.tool-button[data-tool="spacing"] { --tool-accent: var(--coral); --tool-accent-ink: var(--ink); }
.tool-button[data-tool="move"] { --tool-accent: var(--leaf); --tool-accent-ink: var(--ink); }
.tool-button[data-tool="preview"] { --tool-accent: color-mix(in oklch, var(--white) 20%, transparent); --tool-accent-ink: var(--white); }

.tool-button[data-tool="style"]:hover,
.tool-button[data-tool="style"][aria-expanded="true"] {
  background: conic-gradient(from var(--rainbow-angle), var(--coral), var(--leaf), var(--sky), oklch(0.82 0.12 310), var(--coral));
  color: var(--ink);
  animation: rainbow-cycle 3.6s linear infinite;
}

.tool-button[data-tool="style"]:hover .tool-icon,
.tool-button[data-tool="style"][aria-expanded="true"] .tool-icon {
  background: color-mix(in oklch, var(--white) 48%, transparent);
  color: var(--ink);
}

@keyframes rainbow-cycle {
  to { --rainbow-angle: 1turn; }
}

.tool-popover {
  --panel-x: 0px;
  --panel-y: 0px;
  position: fixed;
  left: 50%;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--dock-height) + 12px);
  z-index: var(--z-popover);
  width: min(610px, calc(100vw - 24px));
  max-height: min(62vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  border: 0;
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 14px 38px color-mix(in oklch, var(--black) 22%, transparent);
  transform: translate3d(calc(-50% + var(--panel-x)), var(--panel-y), 0);
  animation: none;
  will-change: transform;
}

.tool-popover[hidden] {
  display: none;
}

@keyframes popover-in {
  from { opacity: 0; transform: translate3d(calc(-50% + var(--panel-x)), calc(var(--panel-y) + 12px), 0) scale(0.97); }
  to { opacity: 1; transform: translate3d(calc(-50% + var(--panel-x)), var(--panel-y), 0) scale(1); }
}

.tool-popover.is-opening {
  animation: popover-in 220ms var(--ease-out) both;
}

@keyframes popover-out {
  from { opacity: 1; transform: translate3d(calc(-50% + var(--panel-x)), var(--panel-y), 0) scale(1); }
  to { opacity: 0; transform: translate3d(calc(-50% + var(--panel-x)), calc(var(--panel-y) + 8px), 0) scale(0.985); }
}

.tool-popover.is-closing {
  pointer-events: none;
  animation: popover-out 180ms var(--ease-out) both;
}

.tool-popover.is-panel-dragging {
  animation: none;
  cursor: grabbing;
  user-select: none;
}

.tool-popover.is-returning {
  animation: none;
  transition: transform 300ms var(--ease-expo);
}

.tool-popover.is-adjusting {
  animation: none;
  transition: transform 220ms var(--ease-out);
}

.popover-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.popover-heading h2,
.popover-heading p {
  margin: 0;
}

.popover-heading h2 {
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.popover-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.popover-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--ink);
}

.icon-space { background: var(--coral); color: var(--ink); }
.icon-move { background: var(--leaf); }
.icon-style {
  background: conic-gradient(from var(--rainbow-angle), var(--coral), var(--leaf), var(--sky), oklch(0.82 0.12 310), var(--coral));
  animation: rainbow-cycle 3.6s linear infinite;
}

.popover-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.icon-style svg circle {
  fill: currentColor;
  stroke: none;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: background 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.icon-button:hover {
  background: var(--surface-strong);
  transform: rotate(5deg) scale(1.05);
}

.icon-button:active {
  transform: scale(0.9);
}

.icon-button svg,
.panel-drag-handle svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.panel-drag-handle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid color-mix(in oklch, var(--ink) 9%, transparent);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
  transition: color 180ms var(--ease-out), background 180ms var(--ease-out), border-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.panel-drag-handle:hover {
  border-color: color-mix(in oklch, var(--focus) 32%, transparent);
  background: color-mix(in oklch, var(--sky) 45%, transparent);
  color: var(--focus);
  transform: rotate(4deg) scale(1.05);
}

#spacing-panel .panel-drag-handle:hover {
  border-color: color-mix(in oklch, var(--coral) 72%, var(--ink));
  background: var(--coral);
  color: var(--ink);
}

#move-panel .panel-drag-handle:hover {
  border-color: color-mix(in oklch, var(--leaf) 66%, var(--ink));
  background: var(--leaf);
  color: var(--ink);
}

#style-panel .panel-drag-handle:hover {
  border-color: color-mix(in oklch, var(--sky) 72%, var(--ink));
  background: conic-gradient(from var(--rainbow-angle), var(--coral), var(--leaf), var(--sky), oklch(0.82 0.12 310), var(--coral));
  color: var(--ink);
  animation: rainbow-cycle 3.6s linear infinite;
}

.panel-drag-handle:active,
.is-panel-dragging .panel-drag-handle {
  cursor: grabbing;
  transform: scale(0.92);
}

.panel-drag-handle circle {
  fill: currentColor;
  stroke: none;
}

.panel-home-target {
  position: fixed;
  z-index: calc(var(--z-popover) - 1);
  border: 2px dashed color-mix(in oklch, var(--focus) 72%, transparent);
  border-radius: 16px;
  background: color-mix(in oklch, var(--sky) 11%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
  transition: opacity 140ms linear, transform 180ms var(--ease-out), background 180ms var(--ease-out);
}

.panel-home-target.is-visible {
  opacity: 1;
  transform: scale(1);
}

.panel-home-target.is-attracting {
  background: color-mix(in oklch, var(--leaf) 16%, transparent);
  transform: scale(1.008);
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin-top: 18px;
}

.control-grid label,
.size-control,
.font-control,
.color-control {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
}

.control-grid output,
.size-control output {
  float: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  height: 28px;
  margin: 4px 0 0;
  accent-color: var(--primary);
  cursor: pointer;
  transition: filter 180ms var(--ease-out), transform 180ms var(--ease-out);
}

input[type="range"]:not(:disabled):hover {
  filter: saturate(1.25);
}

input[type="range"]:not(:disabled):active {
  transform: scaleY(1.08);
}

#spacing-panel input[type="range"] {
  accent-color: var(--coral);
}

input:disabled,
select:disabled,
button:disabled,
fieldset:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.move-controls,
.style-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
}

.nudge-pad {
  display: grid;
  grid-template: repeat(3, 36px) / repeat(3, 36px);
  gap: 4px;
}

.nudge-pad button,
.format-buttons button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-strong);
  cursor: pointer;
  transition: background 180ms var(--ease-out), color 180ms var(--ease-out), transform 180ms var(--ease-expo), box-shadow 180ms var(--ease-out);
}

.nudge-pad button:hover,
.format-buttons button:hover {
  background: var(--sky);
  box-shadow: 0 5px 12px color-mix(in oklch, var(--focus) 12%, transparent);
}

.nudge-pad button:active,
.format-buttons button:active {
  transform: scale(0.88);
}

.nudge-pad svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 180ms var(--ease-out);
}

.nudge-up { grid-area: 1 / 2; }
.nudge-left { grid-area: 2 / 1; }
.nudge-right { grid-area: 2 / 3; }
.nudge-down { grid-area: 3 / 2; }

.nudge-centre {
  display: grid;
  grid-area: 2 / 2;
  place-items: center;
  width: 36px;
  height: 36px;
}

.nudge-centre i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 0 5px color-mix(in oklch, var(--leaf) 24%, transparent);
}

.nudge-up:hover svg { transform: translateY(-2px); }
.nudge-down:hover svg { transform: translateY(2px); }
.nudge-left:hover svg { transform: translateX(-2px); }
.nudge-right:hover svg { transform: translateX(2px); }

.nudge-pad button:hover {
  background: var(--sky);
  box-shadow: 0 5px 12px color-mix(in oklch, var(--focus) 12%, transparent);
}

.multiplier-button,
.secondary-button,
.history-dock button,
.exit-preview {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms var(--ease-out), color 180ms var(--ease-out), transform 180ms var(--ease-expo), box-shadow 180ms var(--ease-out);
}

.multiplier-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 14px;
  background: var(--ink);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 720;
}

.multiplier-button strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--leaf);
  color: var(--ink);
  transition: transform 240ms var(--ease-expo), background 180ms var(--ease-out);
}

.multiplier-button:hover,
.secondary-button:not(:disabled):hover,
.history-dock button:not(:disabled):hover,
.exit-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 14px color-mix(in oklch, var(--black) 12%, transparent);
}

.multiplier-button:hover strong {
  transform: rotate(7deg) scale(1.06);
}

.multiplier-button:active,
.secondary-button:not(:disabled):active,
.history-dock button:not(:disabled):active,
.exit-preview:active {
  transform: scale(0.94);
}

.secondary-button {
  padding: 9px 14px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 720;
}

#style-panel {
  width: min(720px, calc(100vw - 24px));
  max-height: min(76vh, 720px);
}

.style-controls {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(120px, 0.9fr) auto minmax(118px, 0.8fr);
  align-items: end;
}

.font-control,
.size-control,
.color-control {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
}

select {
  min-height: 42px;
  padding: 0 36px 0 11px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-strong);
  color: var(--ink);
  transition: background 180ms var(--ease-out), box-shadow 180ms var(--ease-out), transform 180ms var(--ease-out);
}

select:not(:disabled):hover {
  background: color-mix(in oklch, var(--sky) 32%, var(--surface-strong));
  transform: translateY(-1px);
}

.format-buttons {
  display: flex;
  gap: 5px;
}

.format-buttons button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--white);
}

.format-buttons svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.color-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 118px;
  min-height: 42px;
  padding: 5px 10px 5px 6px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 740;
  cursor: pointer;
  transition: background 180ms var(--ease-out), transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.color-trigger:hover,
.color-trigger[aria-expanded="true"] {
  background: color-mix(in oklch, var(--sky) 34%, var(--surface-strong));
  box-shadow: 0 4px 8px color-mix(in oklch, var(--focus) 12%, transparent);
  transform: translateY(-1px);
}

.color-trigger i {
  width: 31px;
  height: 31px;
  border: 2px solid var(--white);
  border-radius: 7px;
  background: var(--ink);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--ink) 18%, transparent);
}

.surface-swatches {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
}

.surface-swatches legend {
  float: left;
  margin-right: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
}

.surface-swatches button {
  width: 31px;
  height: 31px;
  padding: 0;
  border: 2px solid color-mix(in oklch, var(--ink) 18%, transparent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 180ms var(--ease-expo), box-shadow 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.surface-swatches button[aria-pressed="true"] {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--focus) 22%, transparent);
}

.surface-swatches button:not(:disabled):hover {
  border-color: var(--focus);
  box-shadow: 0 5px 12px color-mix(in oklch, var(--black) 14%, transparent);
  transform: translateY(-2px) scale(1.08);
}

.surface-swatches button:not(:disabled):active {
  transform: scale(0.92);
}

.surface-swatches button:nth-of-type(1) { background: var(--white); }
.surface-swatches button:nth-of-type(2) { background: var(--surface); }
.surface-swatches button:nth-of-type(3) { background: var(--leaf); }
.surface-swatches button:nth-of-type(4) { background: var(--sky); }
.surface-swatches button:nth-of-type(5) { background: var(--coral); }

.surface-swatches .section-color-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-width: 92px;
  padding: 3px 9px 3px 4px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 740;
}

.section-color-trigger i {
  width: 23px;
  height: 23px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--ink) 16%, transparent);
}

.color-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(230px, 1.15fr) minmax(190px, 0.85fr);
  gap: 12px 14px;
  width: 100%;
  margin-top: 2px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface);
  animation: none;
}

.color-picker[hidden] {
  display: none;
}

@keyframes picker-in {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes picker-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(5px) scale(0.99); }
}

.color-picker.is-opening {
  animation: picker-in 180ms var(--ease-out) both;
}

.color-picker.is-closing {
  pointer-events: none;
  animation: picker-out 160ms var(--ease-out) both;
}

.color-picker-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
}

.color-picker-heading strong {
  font-size: 0.82rem;
}

.close-color-picker {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-strong);
  cursor: pointer;
  transition: background 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.close-color-picker:hover {
  background: var(--sky);
  transform: rotate(5deg) scale(1.04);
}

.close-color-picker svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.color-field {
  --picker-hue: hsl(0 100% 50%);
  --picker-x: 100%;
  --picker-y: 0%;
  position: relative;
  grid-row: span 4;
  min-height: 190px;
  overflow: hidden;
  border-radius: 10px;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, transparent),
    var(--picker-hue);
  cursor: crosshair;
  touch-action: none;
}

.color-field i {
  position: absolute;
  left: var(--picker-x);
  top: var(--picker-y);
  width: 16px;
  height: 16px;
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--black) 48%, transparent);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hue-control,
.hex-control {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 720;
}

#color-hue {
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

#color-hue::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  appearance: none;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--black) 38%, transparent);
}

.hex-input {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}

.hex-input b {
  color: var(--muted);
}

.hex-input input {
  width: 100%;
  min-width: 0;
  padding: 0 0 0 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 740;
  text-transform: uppercase;
}

.picker-palette {
  display: grid;
  gap: 6px;
}

.picker-palette > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 720;
}

.palette-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.palette-colors button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid var(--white);
  border-radius: 7px;
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--ink) 18%, transparent);
  cursor: pointer;
  transition: transform 180ms var(--ease-expo), box-shadow 180ms var(--ease-out);
}

.palette-colors button:hover {
  box-shadow: 0 0 0 2px var(--focus);
  transform: translateY(-2px) scale(1.06);
}

.palette-empty {
  align-self: center;
  color: var(--muted);
  font-size: 0.68rem;
}

.history-dock {
  position: fixed;
  left: 50%;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--dock-height) + 14px);
  z-index: calc(var(--z-dock) - 1);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 10px 28px color-mix(in oklch, var(--black) 20%, transparent);
  transform: translateX(-50%);
  animation: none;
}

.history-dock[hidden] {
  display: none;
}

@keyframes history-in {
  from { opacity: 0; transform: translate(-50%, 10px) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes history-out {
  from { opacity: 1; transform: translate(-50%, 0) scale(1); }
  to { opacity: 0; transform: translate(-50%, 8px) scale(0.97); }
}

.history-dock.is-opening {
  animation: history-in 220ms var(--ease-out) both;
}

.history-dock.is-closing {
  pointer-events: none;
  animation: history-out 180ms var(--ease-out) both;
}

.history-dock button {
  padding: 8px 12px;
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 730;
}

.history-dock .save-button {
  padding-inline: 18px;
  background: var(--primary);
  color: var(--white);
}

.unsaved-dot {
  width: 10px;
  height: 10px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--coral);
}

.history-label {
  margin-right: 6px;
  font-size: 0.76rem;
  font-weight: 720;
}

body.has-open-panel .history-dock,
body.history-pinned-top .history-dock {
  bottom: auto;
  top: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--dock-height) + 22px);
  z-index: var(--z-toast);
  max-width: calc(100vw - 32px);
  padding: 11px 17px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 0.84rem;
  font-weight: 720;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px) scale(0.96);
  transition: opacity 180ms var(--ease-out), transform 220ms var(--ease-expo);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.exit-preview {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: var(--z-dock);
  padding: 10px 17px;
  background: var(--black);
  color: var(--white);
  font-weight: 760;
  box-shadow: 0 8px 20px color-mix(in oklch, var(--black) 20%, transparent);
}

@keyframes preview-control-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes preview-control-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(6px) scale(0.98); }
}

.exit-preview.is-opening {
  animation: preview-control-in 180ms var(--ease-out) both;
}

.exit-preview.is-closing {
  pointer-events: none;
  animation: preview-control-out 160ms var(--ease-out) both;
}

body.is-previewing .builder-dock,
body.is-previewing .history-dock {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 30px) scale(0.92);
}

body.is-previewing .tool-popover,
body.is-previewing .selection-ring,
body.is-previewing .movement-grid,
body.is-previewing .panel-home-target {
  opacity: 0;
  pointer-events: none;
}

body.is-previewing .site-shell {
  padding-bottom: 0;
}

.bubble-burst-layer {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-toast) + 1);
  pointer-events: none;
}

.burst-bubble {
  position: absolute;
  width: var(--bubble-size);
  height: var(--bubble-size);
  border-radius: 50%;
  background: var(--bubble-color);
  animation: bubble-burst 520ms var(--ease-expo) forwards;
}

@keyframes bubble-burst {
  from { opacity: 0.95; transform: translate(-50%, -50%) scale(0.3); }
  to { opacity: 0; transform: translate(calc(-50% + var(--bubble-x)), calc(-50% + var(--bubble-y))) scale(1); }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-header nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .living-study {
    min-height: 520px;
  }

  .promise,
  .work {
    grid-template-columns: 1fr;
  }

  .work-intro {
    position: static;
  }

  .contact {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .contact-button {
    justify-self: start;
  }

  .tool-button {
    min-width: 0;
    padding-right: 9px;
  }
}

@media (max-width: 620px) {
  :root {
    --dock-height: 60px;
  }

  .site-shell {
    padding-bottom: 104px;
  }

  .site-header {
    --section-py: 16px;
  }

  .header-cta {
    min-height: 44px;
    padding-inline: 15px;
    font-size: 0.82rem;
  }

  .hero h1 {
    font-size: clamp(3rem, 16vw, 4.65rem);
  }

  .living-study {
    min-height: 420px;
  }

  .promise {
    gap: 30px;
  }

  .service-list article {
    grid-template-columns: 16px 1fr auto;
    gap: 12px;
  }

  .service-list article p {
    grid-column: 2 / -1;
  }

  .contact-rings {
    right: -55%;
  }

  .site-footer {
    flex-direction: column;
    gap: 9px;
  }

  .builder-dock {
    justify-content: space-between;
    width: calc(100vw - 16px);
    padding: 6px;
  }

  .tool-button {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
    min-height: 50px;
    padding: 5px;
  }

  .tool-button > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .tool-icon {
    width: 40px;
    height: 40px;
  }

  .tool-popover {
    padding: 15px;
  }

  .control-grid,
  .style-controls {
    grid-template-columns: 1fr 1fr;
  }

  .format-buttons {
    grid-column: 1 / -1;
  }

  .format-buttons,
  .color-control {
    align-self: end;
  }

  .surface-swatches {
    flex-wrap: wrap;
  }

  .color-picker {
    grid-template-columns: 1fr;
  }

  .color-field {
    grid-row: auto;
    min-height: 160px;
  }

  .history-dock {
    width: calc(100vw - 24px);
    justify-content: center;
  }

  .history-dock .history-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .history-dock button span {
    display: none;
  }

  body.has-open-panel .history-dock,
  body.history-pinned-top .history-dock {
    width: auto;
    top: 8px;
    right: 8px;
    left: auto;
    transform: none;
  }
}

@media (max-width: 390px) {
  .brand-mark > span:last-child {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .popover-heading {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 7px;
  }

  .popover-heading p {
    font-size: 0.76rem;
  }

  .move-controls {
    align-items: center;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (forced-colors: active) {
  .tool-button[aria-expanded="true"],
  .tool-button[aria-pressed="true"],
  .selection-ring,
  [data-editable]:focus {
    outline: 3px solid Highlight;
  }

  .movement-grid {
    opacity: 0.22;
  }
}
