/* Merlin's site: the landing page and the API docs. The product's design language (docs/design/DESIGN_LANGUAGE.md):
   cream ground, white objects with no shadow, sand fills, charcoal words, Inter at 500, pills for places and
   categories, the green accent for the one primary action. Only the dropdown floats, so only it has a shadow. */
:root {
  --bg: #F4F2E6; --surface: #FFFFFF; --surface-alt: #E6E2D4; --surface-soft: #FAF9F3;
  --text: #2A2A27; --text-muted: #6F6F68; --text-faint: #A3A39B; --icon: #55554F;
  --border: rgba(42, 42, 39, 0.06); --border-strong: rgba(42, 42, 39, 0.12);
  --green: #95C466; --accent-text: #2A2A27; --ink: #2A2A27;
  --tint-green: color-mix(in srgb, #95C466 30%, #FFFFFF);
  --tint-yellow: color-mix(in srgb, #F2E24E 32%, #FFFFFF);
  --tint-blue: color-mix(in srgb, #3E8EE8 18%, #FFFFFF);
  --tint-pink: color-mix(in srgb, #CDB0F0 38%, #FFFFFF);
  --shadow-menu: 0 0 0 1px rgba(42, 42, 39, 0.06), 0 12px 32px rgba(42, 42, 39, 0.12);
  --r-sm: 12px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --font: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --pad: max(16px, env(safe-area-inset-left, 0px));
  --max: 1200px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--green); color: var(--accent-text); }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* the mark: twelve petals, drawn by site.js */
.mark { display: inline-grid; width: 26px; height: 26px; flex: none; }
.mark svg { width: 100%; height: 100%; overflow: visible; }
.mark path { fill: var(--text); }
.mark--lg { width: 72px; height: 72px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: 500 15px/1 var(--font); letter-spacing: -0.02em; text-decoration: none; white-space: nowrap;
  transition: background-color 160ms ease; }
.btn:hover { background: color-mix(in srgb, var(--surface-alt) 60%, var(--surface)); }
.btn--go { background: var(--green); color: var(--accent-text); }
.btn--go:hover { background: color-mix(in srgb, var(--green) 85%, var(--text)); }
.btn--lg { height: 52px; padding: 0 24px; font-size: 16px; }

/* the bar */
.nav { position: sticky; top: 0; z-index: 50; background: var(--bg); }
.nav__in { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; gap: 24px; height: 72px; padding: 0 var(--pad); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 500; letter-spacing: -0.03em; text-decoration: none; }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__link { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: none;
  color: var(--text); font: 500 15px/1 var(--font); letter-spacing: -0.02em; text-decoration: none; cursor: pointer; }
.nav__link:hover, .dd__btn[aria-expanded="true"] { background: var(--surface-alt); }
.dd__btn .ic { width: 16px; height: 16px; transition: transform 200ms ease; }
.dd__btn[aria-expanded="true"] .ic { transform: rotate(180deg); }
.nav__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.dd { position: relative; }
.dd__panel { position: absolute; left: 0; top: calc(100% + 8px); width: 340px; padding: 8px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-menu); }
.dd__panel a { display: block; padding: 12px 14px; border-radius: var(--r-sm); text-decoration: none; }
.dd__panel a:hover { background: var(--bg); }
.dd__panel b { display: block; font-weight: 500; font-size: 15px; letter-spacing: -0.02em; }
.dd__panel small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 13.5px; }
.nav__menu { display: none; width: 44px; height: 44px; border: 0; border-radius: var(--r-sm); background: var(--surface); color: var(--text); place-items: center; cursor: pointer; }
.mobile { padding: 8px var(--pad) 20px; display: flex; flex-direction: column; }
.mobile[hidden] { display: none; }
.mobile a { padding: 12px 4px; font-size: 17px; font-weight: 500; text-decoration: none; letter-spacing: -0.02em; }
.mobile__label { margin-top: 12px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
@media (max-width: 900px) { .nav__links, .nav__signin { display: none; } .nav__menu { display: grid; } }
@media (max-width: 420px) { .nav__end .btn--go { padding: 0 14px; font-size: 14px; } }

/* type */
.kicker { margin: 0 0 14px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
h1 { font-size: clamp(44px, 7vw, 92px); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.05; letter-spacing: -0.032em; }
h3, .h3 { font-size: 22px; line-height: 1.25; letter-spacing: -0.025em; }
.h3 { font-size: clamp(24px, 2.6vw, 32px); }
.lead { margin: 16px 0 0; max-width: 62ch; color: var(--text-muted); font-size: clamp(17px, 1.5vw, 19px); line-height: 1.5; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.actions--c { justify-content: center; }

/* the hero and its film */
.hero { max-width: var(--max); margin: 0 auto; padding: 56px var(--pad) 40px; text-align: center; }
.hero .lead { margin-left: auto; margin-right: auto; }
.hero .actions { justify-content: center; }
.film { position: relative; margin: 48px 0 0; border-radius: var(--r-xl); overflow: hidden; background: var(--surface-alt); aspect-ratio: 16 / 9; }
.film video { width: 100%; height: 100%; object-fit: cover; }
.film__sound { position: absolute; left: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px; border: 0;
  border-radius: var(--r-pill); background: var(--surface); color: var(--text); font: 500 14px/1 var(--font); cursor: pointer; }

/* sections */
.sec { max-width: var(--max); margin: 0 auto; padding: 96px var(--pad); }
.sec--sand { max-width: none; background: var(--surface-alt); }
.sec--sand > * { max-width: calc(var(--max) - 32px); margin-left: auto; margin-right: auto; }
.sec__head { margin-bottom: 48px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.feat { padding: 12px 12px 28px; border-radius: var(--r-xl); background: var(--surface); }
.feat img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-lg); }
.feat h3 { margin: 22px 16px 0; }
.feat p { margin: 8px 16px 0; color: var(--text-muted); }
.wide { width: 100%; height: auto; border-radius: var(--r-xl); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; margin-top: 72px; }
.looks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.looks img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-lg); background: var(--surface); }
.loops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.loops video { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-lg); background: var(--surface); }
.split--dev { margin-top: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.inds { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.ind { grid-column: span 2; }
.ind:nth-child(n+4) { grid-column: span 3; }
.ind { padding: 28px; border-radius: var(--r-xl); background: var(--surface); scroll-margin-top: 96px; }
.ind__ic { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 20px; border-radius: 50%; }
.ind__ic .ic { width: 24px; height: 24px; }
.ind p { margin: 8px 0 0; color: var(--text-muted); }
.ind a { display: inline-block; margin-top: 14px; font-weight: 500; text-underline-offset: 3px; }
.ind:target { outline: 2px solid var(--green); outline-offset: 2px; }
.code { margin: 0; padding: 24px; overflow-x: auto; border-radius: var(--r-lg); background: var(--ink); color: #F4F2E6; font: 400 14px/1.65 var(--mono); }
.c-mute { color: #A3A39B; }
.end { padding: 112px var(--pad); text-align: center; display: grid; justify-items: center; gap: 24px; }
.foot { max-width: var(--max); margin: 0 auto; padding: 32px var(--pad) calc(40px + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px;
  border-top: 1px solid var(--border-strong); }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; }
.foot nav a { color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: 15px; }
.foot nav a:hover { color: var(--text); }
.foot small { margin-left: auto; color: var(--text-muted); }
@media (max-width: 900px) {
  .sec { padding: 64px var(--pad); }
  .grid, .split, .split--dev { grid-template-columns: minmax(0, 1fr); }
  .split { gap: 24px; margin-top: 48px; }
  .inds { grid-template-columns: minmax(0, 1fr); }
  .ind, .ind:nth-child(n+4) { grid-column: auto; }
  .film__sound { left: 10px; bottom: 10px; height: 34px; font-size: 13px; }
  .looks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .film { margin-top: 36px; border-radius: var(--r-lg); }
}
@media (min-width: 901px) and (max-width: 1100px) { .ind, .ind:nth-child(n+4) { grid-column: span 3; } .ind:last-child { grid-column: span 6; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* the API docs */
.docs { max-width: var(--max); margin: 0 auto; padding: 48px var(--pad) 96px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; }
.toc { position: sticky; top: 96px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.toc a { padding: 8px 12px; border-radius: var(--r-pill); color: var(--text-muted); font-size: 14.5px; font-weight: 500; text-decoration: none; }
.toc a:hover { background: var(--surface-alt); color: var(--text); }
.doc { min-width: 0; max-width: 820px; }
.doc section { padding-top: 24px; margin-bottom: 40px; }
.doc h1 { font-size: clamp(40px, 5vw, 64px); }
.doc h2 { font-size: 32px; margin-bottom: 12px; }
.doc h3 { font-size: 20px; margin: 28px 0 8px; }
.doc p, .doc li { color: #45453F; }
.doc p { margin: 12px 0; }
.doc ul { padding-left: 20px; }
.doc li { margin: 6px 0; }
.doc code { font-family: var(--mono); font-size: 0.9em; }
.doc :not(pre) > code { padding: 2px 6px; border-radius: 6px; background: var(--surface-alt); }
.doc .code { margin: 16px 0; }
.note { margin: 16px 0; padding: 16px 20px; border-radius: var(--r-lg); background: var(--surface); }
.tbl { width: 100%; margin: 16px 0; border-collapse: separate; border-spacing: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); font-size: 14.5px; }
.tbl th, .tbl td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-strong); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { font-weight: 500; background: var(--surface-soft); }
.tbl td:first-child { white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }
@media (max-width: 900px) { .docs { grid-template-columns: minmax(0, 1fr); gap: 24px; } .toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .tbl th, .tbl td { padding: 10px 12px; } .tbl td:first-child { white-space: normal; width: 42%; } .tbl code { word-break: break-word; } }

/* the film on scroll, full screen, under the menu */
.menu { position: fixed; left: 16px; top: calc(16px + env(safe-area-inset-top, 0px)); z-index: 60; width: 148px; border-radius: 24px; background: var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong); overflow: hidden;
  transition: width 320ms cubic-bezier(0.32, 0.72, 0, 1), border-radius 320ms cubic-bezier(0.32, 0.72, 0, 1), box-shadow 320ms ease; }
.menu.is-open { width: 264px; border-radius: 20px; box-shadow: 0 0 0 1px var(--border-strong), 0 16px 40px rgba(42, 42, 39, 0.12); }
.menu__head { display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 14px 0 14px; border: 0; background: none; color: var(--text); cursor: pointer; font: 500 17px/1 var(--font); letter-spacing: -0.02em; }
.menu__head .mark { width: 22px; height: 22px; }
.menu__name { flex: 1; text-align: left; }
.menu__ic { width: 20px; height: 20px; }
.menu__l1, .menu__l2 { transform-box: fill-box; transform-origin: center; transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1); }
.menu.is-open .menu__l1 { transform: translateY(3px) rotate(45deg); }
.menu.is-open .menu__l2 { transform: translateY(-3px) rotate(-45deg); }
.menu__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 360ms cubic-bezier(0.32, 0.72, 0, 1); }
.menu.is-open .menu__body { grid-template-rows: 1fr; }
.menu__in { min-height: 0; display: flex; flex-direction: column; gap: 1px; padding: 0 8px; opacity: 0; transition: opacity 200ms ease; }
.menu.is-open .menu__in { padding-bottom: 10px; opacity: 1; transition-delay: 80ms; }
.menu__label { padding: 14px 14px 6px; font-size: 13px; font-weight: 500; letter-spacing: 0.01em; color: var(--text-muted); }
.menu__a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 14px; border-radius: 999px; color: var(--text); font-size: 15px; font-weight: 400; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.menu__a .ic { width: 19px; height: 19px; fill: var(--text); stroke: none; }
.menu__a:hover { background: var(--bg); }
.menu__a[aria-current="page"] { background: var(--surface-alt); font-weight: 500; }
.menu__cta { margin: 14px 6px 4px; }
.menu__legal { align-self: center; margin-top: 8px; padding: 6px 10px; border-radius: 999px; color: var(--text-muted); font-size: 13px; font-weight: 500; text-decoration: none; }
.menu__legal:hover { color: var(--text); }
.menu__legal[aria-current="page"] { color: var(--text); }
.paged { padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { .menu, .menu__body, .menu__in, .menu__l1, .menu__l2 { transition: none; } }
.track { position: relative; height: 5400vh; }
.frame { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; background-color: transparent; }
/* the strips Safari 26 paints a phone's status bar and toolbar from (pinned, full width, at the very edge), in the scene's
   colour; they sit under the bars and over bands of their own colour, so they never show */
.edge { display: none; position: fixed; left: 0; right: 0; top: 0; height: 12px; z-index: 2147483000; pointer-events: none; background-color: #F4F2E6; }
.edge--bottom { top: auto; bottom: 0; }
@media (max-aspect-ratio: 4/5) { .edge { display: block; } }
.frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.hint { position: absolute; left: 0; right: 0; bottom: 28px; z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0; transition: opacity 400ms ease; }
.hint i { width: 2px; height: 28px; border-radius: 1px; background: var(--text); animation: hint 1.6s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes hint { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }

/* the intro: the mark builds itself petal by petal, turning into place, and the name rises beside it */
.intro { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: var(--bg); pointer-events: none; transform-origin: 50% 45%; }
.intro__in { display: grid; justify-items: center; gap: clamp(18px, 2.4vw, 32px); padding: 0 16px; }
.intro__lock { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.intro__mark { width: clamp(64px, 8.5vw, 128px); height: clamp(64px, 8.5vw, 128px); overflow: visible; }
.intro__rot { transform-box: view-box; transform-origin: 0 0; animation: introRot 1.15s cubic-bezier(0.32, 0.72, 0, 1) both; }
.intro__pt { fill: var(--text); transform-box: view-box; transform-origin: 0 0; animation: introPt 520ms cubic-bezier(0.23, 1, 0.32, 1) both; animation-delay: calc(var(--k) * 45ms); }
@keyframes introRot { from { transform: rotate(-60deg); } to { transform: rotate(0deg); } }
@keyframes introPt { from { opacity: 0; transform: rotate(var(--r)) translate(8px, -64px) scale(0.4); } to { opacity: 1; transform: rotate(var(--r)); } }
.intro__word { display: flex; align-items: baseline; font-size: clamp(56px, 8.5vw, 132px); font-weight: 500; letter-spacing: -0.035em; line-height: 1; }
.intro__m { display: inline-block; overflow: hidden; padding: 0.1em 0 0.16em; margin: -0.1em 0 -0.16em; }
.intro__m > span { display: inline-block; animation: introUp 620ms cubic-bezier(0.23, 1, 0.32, 1) both; animation-delay: calc(560ms + var(--k) * 40ms); }
.intro__for { margin: calc(-1 * clamp(6px, 1vw, 14px)) 0 0; color: var(--text); font-size: clamp(30px, 4vw, 60px); font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; text-align: center; animation: introFade 600ms ease both; animation-delay: 900ms; }
.intro__line { margin: 0; font-size: clamp(20px, 2.6vw, 40px); font-weight: 500; letter-spacing: -0.025em; color: var(--text-muted); text-align: center; animation: introFade 700ms cubic-bezier(0.23, 1, 0.32, 1) both; animation-delay: 1050ms; }
@keyframes introUp { from { transform: translateY(105%); } to { transform: translateY(0); } }
@keyframes introFade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.consult { max-width: 760px; margin: 0 auto; padding: 120px 16px 96px; }
.consult h1 { font-size: clamp(40px, 6vw, 72px); }
.form { margin-top: 36px; display: grid; gap: 18px; padding: 28px; border-radius: var(--r-xl); background: var(--surface); }
.form__two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { display: grid; gap: 8px; font-size: 14.5px; font-weight: 500; }
.form input, .form select, .form textarea { font: 400 16px/1.4 var(--font); color: var(--text); padding: 12px 14px; border: 0; border-radius: var(--r-sm); background: var(--bg); }
.form select { appearance: none; padding-right: 40px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232A2A27' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px; }
.form textarea { resize: vertical; }
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.form button { justify-self: start; border: 0; cursor: pointer; }
.form button:disabled { opacity: 0.6; cursor: default; }
.form__trap { position: absolute; left: -9999px; }
.form__msg { margin: 0; color: var(--text-muted); font-size: 14.5px; }
.form__done { margin: 0; font-size: 20px; font-weight: 500; }
@media (max-width: 640px) { .form__two { grid-template-columns: 1fr; } .consult { padding-top: 96px; } }
@media (prefers-reduced-motion: reduce) { .hint i, .intro__rot, .intro__pt, .intro__m > span, .intro__for, .intro__line { animation: none; } }
