/* Marrow on cicadama.com. Cicadama's haze and ink, with Marrow's own blue,
   its highlighter yellow and its reading face (Literata). */
:root {
  --haze: #EEF1E8;
  --sheet: #F8FAF4;
  --ink: #22302A;
  --moss: #5C6F55;
  --rule: #CDD5C6;
  --blue: #0A7EA4;
  --blue-ink: #FFFFFF;
  --blue-soft: #D3ECF6;
  --mark: #FFD84D;
  --file-bg: #FFFFFF;
  --file-ink: #2B2B2B;
  --file-dim: #8A8F86;
  --shadow: 0 1px 2px rgb(34 48 42 / .08), 0 12px 40px -12px rgb(34 48 42 / .28);
  --wide: 1180px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --haze: #16201B;
    --sheet: #1C2722;
    --ink: #E6EDE4;
    --moss: #A3B59C;
    --rule: #2E3B34;
    --blue: #4FB6DC;
    --blue-ink: #0B1A20;
    --blue-soft: #123C4C;
    --mark: #E8B400;
    --file-bg: #1E1E1E;
    --file-ink: #DADADA;
    --file-dim: #7D8079;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 16px 48px -12px rgb(0 0 0 / .6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; overflow-x: clip;
  background: var(--haze); color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-optical-sizing: auto;
  font-size: 1.0625rem; line-height: 1.55;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
code, kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86em; }
code { background: color-mix(in srgb, var(--rule) 60%, transparent); padding: .1em .35em; border-radius: 5px; }
kbd {
  display: inline-block; min-width: 1.7em; text-align: center;
  padding: .12em .45em; border-radius: 6px;
  background: var(--sheet); border: 1px solid var(--rule); border-bottom-width: 2px;
  font-weight: 600; line-height: 1.35;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--haze); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 12px; }

main > section, .top-in, .foot { width: min(100% - 32px, var(--wide)); margin-inline: auto; }

/* ---------------------------------------------------------------- header */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--haze) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--rule); }
.top-in { display: flex; align-items: center; gap: 14px; padding-block: 14px; }
.studio { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 650; color: var(--moss); }
.studio:hover { color: var(--ink); }
.studio-mark { width: 22px; height: 22px; color: #B8661A; }
.product { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; padding-left: 14px; border-left: 1px solid var(--rule); }
.product img { width: 24px; height: 24px; border-radius: 6px; }
.nav { display: flex; align-items: center; gap: 4px 22px; margin: 0 0 0 auto; padding: 0; list-style: none; font-weight: 550; }
.nav a { text-decoration: none; color: var(--moss); }
.nav a:hover { color: var(--ink); }
.nav .nav-cta { color: var(--blue-ink); background: var(--blue); padding: 7px 14px; border-radius: 999px; }
.nav .nav-cta:hover { color: var(--blue-ink); filter: brightness(1.08); }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 0;
  background: var(--blue); color: var(--blue-ink);
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
  transition: filter .15s, background-color .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.quiet:hover { background: var(--ink); color: var(--haze); filter: none; }
.plain { color: var(--moss); font-weight: 550; text-underline-offset: 4px; }
.plain:hover { color: var(--ink); }

/* --------------------------------------------------------------- headings */
h1, h2, .step h3, .tour-caption h3, .yours dt, .dl h3 { font-family: Literata, Georgia, serif; font-optical-sizing: auto; }
h2 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 650; line-height: 1.08; letter-spacing: -.012em; }
.sec-head { max-width: 62ch; margin-bottom: 34px; }
.sec-head p { margin: 12px 0 0; color: var(--moss); font-size: 1.1rem; }
.sec-head.row { max-width: none; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.sec-head.row > div:first-child { max-width: 58ch; }
main > section { padding-block: clamp(64px, 9vw, 120px) 0; }

/* ------------------------------------------------------------------ hero */
.hero { display: grid; grid-template-columns: minmax(0, 9fr) minmax(0, 14fr); gap: 52px; align-items: center; padding-top: clamp(36px, 6vw, 80px) !important; }
.lockup { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; font-weight: 700; font-size: 1.25rem; }
.lockup img { width: 44px; height: 44px; border-radius: 11px; }
h1 { margin: 0; font-size: clamp(2.9rem, 6.4vw, 5.2rem); font-weight: 700; line-height: .98; letter-spacing: -.025em; text-wrap: balance; }
.lede { margin: 22px 0 0; font-size: clamp(1.12rem, 1.7vw, 1.3rem); line-height: 1.45; max-width: 36ch; }
.free { margin: 14px 0 0; color: var(--moss); font-weight: 550; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.hero-version { margin: 14px 0 0; color: var(--moss); font-size: .92rem; }

.reveal { margin: 0; }
.reveal-frame {
  position: relative; container-type: inline-size;
  aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden;
  background: var(--sheet); box-shadow: var(--shadow); outline: 1px solid var(--rule);
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
/* Just the note and its panel: the sidebar stays out, so the words are readable. */
.reveal-app { position: absolute; top: 0; left: -32.1%; width: 132.1%; max-width: none; height: auto; }
.reveal-file {
  position: absolute; inset: 0;
  background: var(--file-bg); color: var(--file-ink);
  clip-path: inset(0 calc(100% - var(--x)) 0 0);
}
.file-bar { display: flex; align-items: center; gap: 1.2cqw; height: 5.4cqw; padding: 0 1.6cqw; background: color-mix(in srgb, var(--file-bg) 88%, var(--rule)); border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent); font-size: 1.3cqw; white-space: nowrap; }
.file-dots { display: inline-flex; gap: .55em; }
.file-dots i { width: .8em; height: .8em; border-radius: 50%; background: color-mix(in srgb, var(--file-dim) 55%, transparent); }
.file-name { font-weight: 650; }
.file-where { color: var(--file-dim); }
.file-text {
  margin: 0; padding: 2.4cqw 3cqw;
  font: 1.42cqw/1.62 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: pre-wrap; overflow: hidden; height: calc(100% - 5.4cqw);
}
.file-text .fm, .file-text .ln { color: var(--file-dim); }
.file-text .ln { color: var(--blue); }
.file-text .h { font-weight: 700; }
.file-text .hl { background: color-mix(in srgb, var(--mark) 55%, transparent); }
.reveal-line { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: var(--blue); pointer-events: none; }
.reveal-handle {
  position: absolute; top: 50%; left: var(--x);
  width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  display: grid; place-items: center; cursor: ew-resize;
  background: var(--blue); color: var(--blue-ink); box-shadow: 0 4px 16px rgb(0 0 0 / .25);
}
.reveal-handle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.reveal-handle:focus-visible { outline-offset: 4px; }
.reveal.dragging .reveal-handle { transform: scale(1.08); }
.reveal figcaption { margin-top: 14px; color: var(--moss); font-size: .95rem; }
.reveal figcaption b { color: var(--ink); font-weight: 650; }
.reveal.intro .reveal-line, .reveal.intro .reveal-handle, .reveal.intro .reveal-file { transition: left 1.6s cubic-bezier(.6,.05,.2,1), clip-path 1.6s cubic-bezier(.6,.05,.2,1); }

/* ------------------------------------------------------------------ tour */
.tour-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 36px; align-items: start; }
.tour-list { display: flex; flex-direction: column; border-left: 1px solid var(--rule); position: sticky; top: 86px; }
.tour-list button {
  font: inherit; text-align: left; color: var(--moss); background: none; border: 0; cursor: pointer;
  padding: 9px 0 9px 18px; margin-left: -1px; border-left: 2px solid transparent; font-weight: 520;
}
.tour-list button:hover { color: var(--ink); }
.tour-list button[aria-selected="true"] { color: var(--ink); font-weight: 700; border-left-color: var(--blue); }
.window { border-radius: 12px; overflow: hidden; background: var(--sheet); box-shadow: var(--shadow); outline: 1px solid var(--rule); }
.window-bar { display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 14px; border-bottom: 1px solid var(--rule); font-size: .8rem; color: var(--moss); }
.window-bar .file-dots { font-size: 11px; }
.window-title { margin-inline: auto; transform: translateX(-24px); }
.window-shot { position: relative; aspect-ratio: 16 / 10; }
.window-shot img { width: 100%; height: 100%; transition: opacity .22s ease; }
.window-shot img.out { opacity: 0; }
.spot {
  position: absolute; left: var(--sx); top: var(--sy);
  width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  border: 3px solid var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent);
  transition: left .45s cubic-bezier(.4,0,.2,1), top .45s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.spot.ping::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--blue); animation: ping 1.1s ease-out 2; }
@keyframes ping { to { transform: scale(2); opacity: 0; } }
.tour-caption { margin-top: 22px; max-width: 62ch; min-height: 7.5em; }
.tour-caption h3 { margin: 0; font-size: 1.5rem; font-weight: 650; }
.tour-caption p { margin: 8px 0 0; font-size: 1.08rem; }

/* --------------------------------------------------------------- devices */
/* One row at one height, like devices standing side by side on a desk. */
.lineup { --h: calc((min(100vw - 32px, 1180px) - 78px) / 3.27); display: flex; align-items: flex-end; gap: clamp(14px, 2vw, 26px); }
.dev { margin: 0; flex: none; }
.dev img { height: var(--h); width: auto; border-radius: 10px; box-shadow: var(--shadow); outline: 1px solid var(--rule); }
.dev-pad img { border-radius: 16px; }
.dev-phone img { border-radius: 20px; }
.dev figcaption { margin-top: 12px; color: var(--moss); font-size: .9rem; font-weight: 550; }
.sync-line { max-width: 72ch; margin: 40px 0 0; font-size: 1.1rem; }

/* ----------------------------------------------------------------- guide */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step {
  counter-increment: step; position: relative;
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 20px 56px; align-items: start;
  padding: 44px 0 44px 76px; border-top: 1px solid var(--rule);
}
.step::before {
  content: counter(step); position: absolute; left: 0; top: 38px;
  font-family: Literata, Georgia, serif; font-size: 3rem; font-weight: 700; line-height: 1; color: var(--blue);
}
.step h3 { margin: 0 0 10px; font-size: clamp(1.35rem, 2.2vw, 1.7rem); font-weight: 650; line-height: 1.2; }
.step p { margin: 0 0 12px; max-width: 58ch; }
.step .try { color: var(--moss); }
.step-shot { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; background: var(--sheet); box-shadow: var(--shadow); outline: 1px solid var(--rule); }
.step-shot img {
  position: absolute; top: 0; left: 0; max-width: none;
  width: calc(var(--zoom, 1) * 100%);
  transform: translate(calc(var(--fx, 0%) * (1 - 1 / var(--zoom, 1)) * -1), calc(var(--fy, 0%) * (1 - 1.2 / var(--zoom, 1.2)) * -1));
}
.step-shot.phone-shot { background: color-mix(in srgb, var(--blue) 9%, var(--sheet)); }
.step-shot.phone-shot img { left: 50%; top: 9%; width: auto; height: 108%; transform: translateX(-50%); border-radius: 22px; box-shadow: var(--shadow); }

/* ------------------------------------------------------------------ keys */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--sheet); outline: 1px solid var(--rule); }
.seg button { font: inherit; font-weight: 600; font-size: .95rem; padding: 7px 16px; border: 0; border-radius: 999px; background: none; color: var(--moss); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--haze); }
.key-table { width: 100%; border-collapse: collapse; columns: 2; }
.key-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; }
.key-table tr { display: grid; grid-template-columns: 12em 1fr; gap: 16px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--rule); }
.key-table td { padding: 0; }
.key-table td:first-child { white-space: nowrap; }

/* ----------------------------------------------------------------- yours */
.yours-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 28px 36px; margin: 34px 0 0; }
.yours-list dt { font-size: 1.25rem; font-weight: 650; }
.yours-list dd { margin: 6px 0 0; color: var(--moss); }

/* -------------------------------------------------------------- download */
.dl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.dl { padding: 24px; border-radius: 14px; background: var(--sheet); outline: 1px solid var(--rule); display: flex; flex-direction: column; }
.dl h3 { margin: 0; font-size: 1.35rem; font-weight: 650; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dl p { margin: 8px 0 0; color: var(--moss); font-size: .98rem; }
.dl .dl-links { margin-top: auto; padding-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.dl.is-you { outline: 2px solid var(--blue); }
.dl.is-you h3::after { content: "This device"; font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: .8rem; font-weight: 650; color: var(--blue); }
.dl-more { margin-top: 22px; color: var(--moss); }

/* --------------------------------------------------------------- support */
.support { padding-bottom: 24px; }
.support > p { max-width: 58ch; margin: 12px 0 0; font-size: 1.1rem; }
.support .support-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 80px; padding-block: 32px 44px; border-top: 1px solid var(--rule); color: var(--moss); font-size: .95rem; }
.foot p { margin: 0; }
.foot p + p { display: flex; gap: 18px; }
.foot a { text-underline-offset: 4px; }

/* ---------------------------------------------------------------- narrow */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .tour-grid { grid-template-columns: 1fr; gap: 18px; }
  /* Phones and narrow windows: just the note, larger. */
  .reveal-frame { aspect-ratio: 4 / 3; }
  .reveal-app { left: -44.3%; width: 182.3%; }
  .file-text { font-size: 2.3cqw; }
  .file-bar { font-size: 2cqw; height: 7.5cqw; }
  .file-text { height: calc(100% - 7.5cqw); }
  .tour-list { position: static; flex-direction: row; overflow-x: auto; border-left: 0; border-bottom: 1px solid var(--rule); scrollbar-width: none; }
  .tour-list button { white-space: nowrap; padding: 10px 14px; margin: 0 0 -1px; border-left: 0; border-bottom: 2px solid transparent; }
  .tour-list button[aria-selected="true"] { border-bottom-color: var(--blue); }
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .key-table tbody { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav li:not(:last-child) { display: none; }
  .studio span { display: none; }
  .step { grid-template-columns: 1fr; padding: 36px 0 36px 52px; }
  .step::before { font-size: 2.3rem; top: 34px; }
  .lineup { --h: 300px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; margin-right: -16px; padding-right: 16px; }
  .dev { scroll-snap-align: start; }
  .sync-line { margin-top: 28px; }
  .spot { width: 40px; height: 40px; margin: -20px 0 0 -20px; border-width: 2px; }
  .key-table tr { grid-template-columns: 1fr; gap: 4px; }
  .dl-grid { grid-template-columns: 1fr; }
  .window-title { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal.intro .reveal-line, .reveal.intro .reveal-handle, .reveal.intro .reveal-file, .spot, .window-shot img { transition: none; }
  .spot.ping::after { animation: none; }
}
