/* Margin Ant: vintage paper and ink, with a little brick red. Centred, generous, light on bold. */
:root {
  --paper: #f3ebda;
  --paper-deep: #e9dec6;
  --white: #fbf7ee;
  --ink: #231c18;
  --ink-2: #4a4039;
  --ink-3: #655848;
  --line: #dacdb2;
  --wash: #ece2cc;
  --red: #8f3228;
  --red-deep: #74261e;
  --red-tint: #efdfce;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .25 0 0 0 0 .13 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --font: "Schibsted Grotesk", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --header: 72px;
  --wrap: 1200px;
  --pad: clamp(20px, 5vw, 56px);
  --section: clamp(80px, 10vw, 144px);
  --radius: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header); scrollbar-color: #c3b494 var(--paper); }
body {
  margin: 0;
  background: var(--paper) var(--grain);
  color: var(--ink-2);
  font: 400 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--red); color: var(--white); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.6vw, 5.5rem); line-height: 1.04; letter-spacing: -0.032em; }
h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); line-height: 1.12; letter-spacing: -0.024em; }
h3 { font-size: 1.25rem; line-height: 1.35; letter-spacing: -0.008em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
strong { font-weight: 600; color: var(--ink); }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
code { background: var(--wash); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font: 400 0.875rem/1.5 ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--ink); white-space: nowrap; }

.wrap { width: min(100%, calc(var(--wrap) + var(--pad) * 2)); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: var(--section); }
.center { text-align: center; }
.center p { margin-inline: auto; }
.lede { margin-top: 18px; max-width: 40em; font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.55; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 60; background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 8px; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.header { position: sticky; top: 0; z-index: 30; background: var(--paper) var(--grain); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 12px; height: var(--header); }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; color: var(--ink); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.018em; text-decoration: none; white-space: nowrap; }
.brand img { width: 32px; height: 32px; }
.nav { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); margin-right: clamp(8px, 2vw, 24px); }
.nav a { padding: 8px 0; font-size: 0.975rem; font-weight: 500; text-decoration: none; }
.nav a:hover { color: var(--ink); text-decoration: underline; }
.nav a[aria-current="page"] { color: var(--red-deep); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.5em; }
.menu-btn { display: none; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); font-size: 0.9375rem; font-weight: 500; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; padding: 0 28px; border: 1.5px solid transparent; border-radius: var(--radius); font: 500 1.0625rem/1 var(--font); text-decoration: none; white-space: nowrap; transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn-small { height: 42px; padding: 0 18px; border-radius: 10px; font-size: 0.975rem; }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-deep); }
.btn-line { border-color: var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--white); }
.btn:disabled { background: var(--wash); border-color: var(--line); color: var(--ink-3); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* ---------- old paper, darker at the edges ---------- */
.aged { background: var(--grain), radial-gradient(130% 105% at 50% 38%, rgba(243, 235, 218, 0) 52%, rgba(139, 105, 60, 0.2) 100%), var(--paper); }

/* ---------- home: first screen ---------- */
.hero { position: relative; display: flex; flex-direction: column; min-height: calc(100vh - var(--header)); min-height: calc(100svh - var(--header)); overflow: hidden; }
.hero-main { display: flex; flex-direction: column; align-items: center; padding-top: clamp(28px, 4.5vh, 56px); text-align: center; }
.hero-mark { width: clamp(60px, 8vh, 84px); height: auto; margin-bottom: clamp(14px, 2.2vh, 22px); }
.hero h1 { max-width: 14em; font-size: clamp(2.6rem, min(6.2vw, 9.4vh), 5.25rem); }
.hero .lede { max-width: 32em; margin-inline: auto; }
.hero .actions { margin-top: clamp(22px, 3.4vh, 34px); }
.hero-note { margin-top: 14px; font-size: 0.9375rem; color: var(--ink-3); }
/* The ants take whatever height is left on the first screen. */
.swarm { position: relative; flex: 1 0 auto; min-height: clamp(180px, 30vh, 420px); margin-top: clamp(8px, 1.6vh, 24px); }
.swarm canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.swarm-toggle { position: absolute; right: 18px; bottom: 16px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--ink); transition: background-color 0.2s, transform 0.16s var(--ease); }
.swarm-toggle:hover { border-color: var(--ink); }
.swarm-toggle:active { transform: scale(0.95); }
.swarm-toggle svg { width: 16px; height: 16px; }
.swarm-toggle .i-play, .swarm-toggle[aria-pressed="true"] .i-pause { display: none; }
.swarm-toggle[aria-pressed="true"] .i-play { display: block; }

/* Short windows: drop the extras so the ants are on the first screen. */
@media (min-width: 721px) and (max-height: 720px) {
  .hero-mark, .hero-note { display: none; }
  .hero-main { padding-top: 22px; }
  .hero h1 { font-size: clamp(2.2rem, min(6.2vw, 9vh), 5.25rem); }
  .hero .lede { margin-top: 10px; font-size: 1.0625rem; }
  .hero .actions { margin-top: 16px; }
  .hero .btn { height: 44px; }
  .swarm { min-height: 150px; margin-top: 0; }
}

/* ---------- home: slider ---------- */
.gallery { background: var(--grain), var(--paper-deep); padding-block: clamp(48px, 5vw, 72px) clamp(64px, 8vw, 96px); overflow: hidden; }
/* A picture is never taller than the screen that shows it. */
.slider { --slide: max(320px, min(78vw, 1040px, calc((100vh - 340px) * 1.6))); margin-top: clamp(24px, 3vw, 40px); }
.slides { display: flex; gap: clamp(14px, 2.4vw, 32px); margin: 0; padding: 8px calc((100% - var(--slide)) / 2) 28px; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; }
.slides::-webkit-scrollbar { display: none; }
.slides.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.slide { flex: 0 0 var(--slide); scroll-snap-align: center; }
.slide img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; border: 1px solid #cbbb98; border-radius: 16px; background: var(--white); box-shadow: 0 22px 34px -26px rgba(60, 40, 15, 0.45); user-select: none; -webkit-user-drag: none; }
.slide figure { margin: 0; }
.slide figcaption { margin-top: 20px; text-align: center; }
.slide figcaption span { display: block; color: var(--ink); font-size: 1.1875rem; font-weight: 600; }
.slider-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 4px; }
.arrow { display: grid; place-items: center; width: 50px; height: 50px; padding: 0; border: 1px solid #c8b795; border-radius: 50%; background: var(--white); color: var(--ink); transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
.arrow:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: var(--white); }
.arrow:disabled { opacity: 0.38; }
.arrow svg { width: 20px; height: 20px; }
.dots { display: flex; gap: 4px; }
.dots button { display: grid; place-items: center; width: 24px; height: 32px; padding: 0; border: 0; background: none; }
.dots button::before { content: ""; width: 9px; height: 9px; border-radius: 9px; background: #bfad88; transition: width 0.35s var(--ease), background-color 0.2s; }
.dots button[aria-current="true"] { width: 36px; }
.dots button[aria-current="true"]::before { width: 28px; background: var(--red); }
.fine { margin-top: 18px; font-size: 0.875rem; color: var(--ink-3); }

/* ---------- columns ---------- */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 32px); margin-top: clamp(40px, 5vw, 64px); }
.tile { padding: clamp(28px, 3.2vw, 44px); border: 1px solid var(--line); border-radius: 18px; background: var(--white); text-align: center; }
.tile > svg { width: 56px; height: 56px; margin: 0 auto 22px; padding: 13px; border-radius: 16px; background: var(--red-tint); color: var(--red-deep); }
.tile p { margin-top: 10px; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 32px; margin-top: 40px; }
.links a { color: var(--red-deep); font-weight: 500; }

.cta { text-align: center; background: var(--grain), var(--paper-deep); }
.cta .lede { margin-inline: auto; }
.cta .actions { margin-top: 34px; }

/* ---------- inner page banner ---------- */
.banner { text-align: center; padding-block: clamp(56px, 8vw, 104px); }
.banner { border-bottom: 1px solid var(--line); }
.banner h1 { font-size: clamp(2.4rem, 5.4vw, 4.25rem); }
.banner .lede { margin-inline: auto; }

/* ---------- download ---------- */
.banner + .section { padding-top: clamp(48px, 6vw, 80px); }
.banner-deep { padding-bottom: clamp(128px, 14vw, 184px); border-bottom: 0; }
.banner-deep + .section { margin-top: clamp(-120px, -9vw, -80px); padding-top: 0; position: relative; }
.platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 32px); }
.platform { position: relative; display: flex; flex-direction: column; align-items: center; padding: clamp(36px, 4vw, 56px) 28px 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: 0 26px 40px -30px rgba(60, 40, 15, 0.45); text-align: center; }
.platform > svg { width: 68px; height: 68px; margin-bottom: 24px; padding: 15px; border-radius: 18px; background: var(--red-tint); color: var(--red-deep); }
.platform p { margin-top: 4px; color: var(--ink-3); font-size: 0.975rem; }
.platform .btn { width: 100%; margin-top: 32px; }
.platform.is-yours { border: 2px solid var(--red); }
.platform .yours { position: absolute; top: -14px; padding: 3px 14px; border-radius: 20px; background: var(--red); color: var(--white); font-size: 0.8125rem; font-weight: 500; }
.after { margin-top: 36px; text-align: center; }

/* ---------- help ---------- */
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px clamp(32px, 5vw, 72px); align-items: start; }
.faq h2 { margin: 24px 0 14px; font-size: 1.5rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 19px 0; color: var(--ink); font-weight: 500; list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 14px; height: 14px; background: linear-gradient(var(--red), var(--red)) center / 100% 2px no-repeat, linear-gradient(var(--red), var(--red)) center / 2px 100% no-repeat; transition: transform 0.35s var(--ease); }
.faq details[open] summary::after { transform: rotate(135deg); }
.faq details > p { padding-bottom: 20px; }

/* ---------- changelog ---------- */
.releases { max-width: 1000px; }
.release { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 20px 48px; padding: clamp(28px, 4vw, 48px); border: 1px solid var(--line); border-radius: 18px; }
.release + .release { margin-top: 28px; }
.release h2 { font-size: 1.75rem; }
.release time { display: block; margin-top: 6px; color: var(--ink-3); font-size: 0.9375rem; }
.release h3 { font-size: 1.0625rem; margin-top: 28px; }
.release h3:first-child { margin-top: 2px; }
.release ul { margin: 10px 0 0; padding-left: 1.2em; }
li::marker { color: var(--red); }
li + li { margin-top: 6px; }

/* ---------- legal documents ---------- */
.doc { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.toc { position: sticky; top: calc(var(--header) + 28px); padding: 24px; border-radius: 16px; background: var(--wash); }
.toc h2 { margin-bottom: 10px; font-size: 1rem; letter-spacing: 0; }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc li + li { margin-top: 0; }
.toc a { display: block; padding: 5px 0; font-size: 0.9375rem; line-height: 1.4; text-decoration: none; }
.toc a:hover { color: var(--red-deep); text-decoration: underline; }
.prose { max-width: 760px; }
.prose section + section { margin-top: 44px; padding-top: 40px; border-top: 1px solid var(--line); }
.prose section { scroll-margin-top: 24px; }
.prose h2 { font-size: 1.5rem; letter-spacing: -0.012em; }
.prose h3 { margin-top: 24px; font-size: 1.0625rem; }
.prose p { margin-top: 14px; }
.prose ul { margin: 12px 0 0; padding-left: 1.25em; }

/* ---------- not found ---------- */
.lost { display: grid; place-content: center; justify-items: center; gap: 26px; min-height: calc(100svh - var(--header)); padding-block: 72px; text-align: center; }

/* ---------- footer ---------- */
.footer { background: #201915; color: #d5c8ae; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--white); text-decoration: underline; }
.footer :focus-visible { outline-color: var(--white); }
.foot-grid { display: grid; grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); gap: 40px 32px; padding-block: clamp(56px, 7vw, 88px) 48px; }
.footer .brand { margin: 0 0 14px; color: var(--white); }
.footer h2 { margin-bottom: 12px; color: var(--white); font-size: 1rem; letter-spacing: 0; }
.footer ul { margin: 0; padding: 0; list-style: none; }
.footer li + li { margin-top: 0; }
.footer li a { display: inline-block; padding: 5px 0; font-size: 0.975rem; }
.footer p { max-width: 24em; font-size: 0.975rem; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 24px 32px; border-top: 1px solid #43362d; font-size: 0.875rem; color: #b0a188; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .trio, .platforms, .columns { grid-template-columns: minmax(0, 1fr); }
  .platforms, .trio { max-width: 560px; margin-inline: auto; }
  .doc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .menu-btn { display: inline-flex; align-items: center; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 8px var(--pad) 16px; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: 0 22px 30px -24px rgba(60, 40, 15, 0.4); }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; font-size: 1.0625rem; }
  .slider { --slide: 86vw; }
  .slide img { border-radius: 10px; aspect-ratio: 4 / 3.4; object-position: top left; }
  .slider-controls { gap: 8px; }
  .arrow { width: 42px; height: 42px; }
  .dots { gap: 0; }
  .dots button { width: 18px; }
  .dots button[aria-current="true"] { width: 28px; }
  .dots button[aria-current="true"]::before { width: 20px; }
  .release { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .brand { font-size: 1.0625rem; gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  .header .btn-small { padding: 0 13px; font-size: 0.9375rem; }
  .header .btn-small svg { display: none; }
  .hero .actions { width: 100%; }
  .actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
