/*
  Layout: a quiet, plain frame around loud little launch films.
  Each film has its own colour and type. Red pen is the one mark they share.
  Films are sized in cqw, so the same markup works small and enlarged.
*/
@font-face { font-family: Familjen; src: url(assets/fonts/familjen.woff2) format("woff2"); font-weight: 400 700; font-display: swap }
@font-face { font-family: Newsreader; src: url(assets/fonts/newsreader-italic.woff2) format("woff2"); font-weight: 400 600; font-style: italic; font-display: swap }
@font-face { font-family: Shantell; src: url(assets/fonts/shantell.woff2) format("woff2"); font-weight: 400 700; font-display: swap }

:root {
  --bg: #f8f9fb;
  --surface: #fff;
  --text: #171a24;
  --muted: #5b6070;
  --line: #d7dae2;
  --blue: #3478f6;
  --pen: #e8382f;
  --nav: rgb(255 255 255 / .88);
  --ui: Familjen, system-ui, sans-serif;
  --serif: Newsreader, Georgia, serif;
  --hand: Shantell, "Comic Sans MS", cursive;
  --ease: cubic-bezier(.23, 1, .32, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101218; --surface: #181b23; --text: #edf0f7; --muted: #9ea5b5;
    --line: #2c313d; --pen: #ff625a; --nav: rgb(24 27 35 / .88); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101218; --surface: #181b23; --text: #edf0f7; --muted: #9ea5b5;
  --line: #2c313d; --pen: #ff625a; --nav: rgb(24 27 35 / .88); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box }
[hidden] { display: none !important }
html { scroll-behavior: smooth; scroll-padding-top: 72px }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 var(--ui); -webkit-font-smoothing: antialiased }
main, footer { width: 100%; max-width: 1312px; margin: 0 auto; padding-inline: 24px }
img { display: block; max-width: 100% }
h1, h2, h3, p { margin: 0 }
h1, h2 { text-wrap: balance }
h2 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; font-weight: 600 }
a { color: inherit }
button { font: inherit; color: inherit; cursor: pointer }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px }
kbd { font: inherit }

/* Floating nav */
.nav {
  position: fixed; top: 16px; right: 24px; z-index: 10;
  display: flex; align-items: center; gap: 2px; padding: 5px;
  background: var(--nav); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 10px; font-size: 15px;
}
.nav a, .nav button {
  display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px;
  border: 0; border-radius: 6px; background: none; text-decoration: none; white-space: nowrap;
}
.nav a:hover, .nav button:hover { background: var(--bg) }
.nav .home { padding: 0 5px }

/* Hero */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px 64px; align-items: end; padding: 122px 0 36px }
.hero h1 { font-size: clamp(46px, 6.5vw, 88px); line-height: 1.04; font-weight: 600; letter-spacing: -.015em }
.typo { position: relative; display: inline-block }
.typo svg { position: absolute; inset: 8% -5% auto; width: 110%; height: 88%; overflow: visible }
.typo path { fill: none; stroke: var(--pen); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 130; animation: strike .5s .5s var(--ease) backwards }
.typo i {
  position: absolute; left: 34%; bottom: 82%; color: var(--pen);
  font: 600 .46em/1 var(--hand); transform: rotate(-8deg);
  animation: scribble .6s 1s var(--ease) backwards;
}
.pitch { display: grid; gap: 20px; padding-bottom: 6px }
.pitch > p:first-child { font-size: 21px; line-height: 1.4; max-width: 34ch }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px }
.download {
  display: inline-flex; align-items: center; min-height: 50px; padding: 0 24px;
  background: var(--blue); color: #fff; border-radius: 9px; font-weight: 600; text-decoration: none;
  transition: transform .15s var(--ease), filter .15s;
}
.download:hover { filter: brightness(1.08) }
.download:active { transform: scale(.97) }
.source { text-underline-offset: 5px }
.needs { color: var(--muted); font-size: 15px }

/* The big demo */
.stage { position: relative; height: 548px; overflow: hidden; border-radius: 14px; background: #4b55ee; color: #fff }
.field {
  position: absolute; top: 48px; left: 48px; right: 48px;
  padding: 28px 64px 28px 32px; border-radius: 12px; background: #fff; color: #171a24;
}
.draft { display: grid; font-size: clamp(21px, 2.7vw, 36px); line-height: 1.3 }
.draft > span { grid-area: 1 / 1 }
.ghost { visibility: hidden }
.stage[data-phase="typing"] #draft::after { content: ""; display: inline-block; width: 2px; height: 1em; vertical-align: -.12em; background: var(--blue) }
#draft mark { padding: 0 .04em; background: #d8f55f; color: inherit; animation: ink .5s var(--ease) both }
.dot {
  position: absolute; right: 14px; bottom: 14px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 15px; line-height: 1;
}
.dot::before { content: "✦" }
.stage[data-phase="working"] .dot::before { content: ""; width: 13px; height: 13px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .6s linear infinite }
.stage[data-phase="done"] .dot { background: #28b95f }
.stage[data-phase="done"] .dot::before { content: "✓" }
.menu {
  position: absolute; right: 62px; top: 236px; width: 286px; height: auto; border-radius: 12px;
  filter: drop-shadow(0 14px 22px rgb(14 16 70 / .3)); transform-origin: top right;
  transition: opacity .16s var(--ease), transform .16s var(--ease);
}
.stage:not([data-phase="menu"]) .menu { opacity: 0; transform: scale(.95) }
.trigger { position: absolute; left: 48px; bottom: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; max-width: calc(100% - 430px) }
#tap { display: flex; gap: 10px; padding: 0; border: 0; background: none }
#tap kbd {
  width: 92px; height: 82px; padding: 8px 10px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end;
  border-radius: 12px; background: #20245f; color: #fff; box-shadow: 0 5px 0 #15183f; font-size: 15px;
  transition: transform .1s, box-shadow .1s;
}
#tap kbd span { font: 23px/1 system-ui }
#tap kbd.down { transform: translateY(5px); box-shadow: 0 0 0 #15183f }
.trigger p { font: 500 18px/1.35 var(--hand) }
.stage-controls { position: absolute; left: 48px; bottom: 154px; display: flex; gap: 12px }
.stage .stage-controls button { border: 1px solid rgb(255 255 255 / .45); background: transparent; color: #fff }
.stage .stage-controls .takes [aria-pressed="true"] { background: #fff; color: #20245f }
#pause { min-height: 36px; padding: 0 12px; border-radius: 6px; font-size: 14px }

/* Film gallery */
.section { padding-top: 104px }
.section-head { display: grid; gap: 12px; margin-bottom: 32px }
.section-head p, .screen-copy > p { color: var(--muted); max-width: 62ch }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px }
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
}
.meta { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 18px }
.meta h3 { display: flex; justify-content: space-between; gap: 8px; font-size: 19px; line-height: 1.3; font-weight: 600 }
.meta h3 kbd { color: var(--muted); font-size: 15px; font-weight: 400 }
.meta p { color: var(--muted); font-size: 15px; line-height: 1.4 }
.takes { display: flex; gap: 6px }
.meta .takes { margin-top: auto; padding-top: 14px }
.takes button { width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font-size: 14px }
.takes button[aria-pressed="true"] { background: var(--text); color: var(--bg) }

.film {
  container-type: inline-size; position: relative; display: block; flex: none;
  width: 100%; aspect-ratio: 16 / 10; overflow: hidden; padding: 0; border: 0; text-align: left;
}
.film .take { position: absolute; inset: 0; display: block }
.film .take > * { position: absolute; display: block }
.film img { max-width: none; height: auto }

.f-fix { background: #d8f55f; color: #1b2108 }
.f-fix .proof { inset: 10cqw 7cqw auto; font: 400 5.3cqw/1.35 var(--hand) }
.f-fix .proof b { font-weight: 400; color: #d92c24; text-decoration: underline wavy #d92c24; text-underline-offset: 1cqw }
.f-fix .answer { inset: auto 7cqw 6cqw; font: 700 7.4cqw/1.06 var(--ui) }

.f-short { background: #173d2f; color: #f1f3df }
.f-short .long { inset: 7cqw 7cqw auto; font: 400 4cqw/1.3 var(--ui); color: #8fb3a2; text-decoration: line-through #ff8a70 .4cqw }
.f-short .short { inset: 25cqw 7cqw auto; font: italic 500 8cqw/1.04 var(--serif) }
.f-short .count { right: 5cqw; bottom: 3cqw; font: 500 3.6cqw/1 var(--ui); color: #d8f55f }

.f-tone { background: #f5a3c7; color: #3b1027 }
.f-tone .label { left: 7cqw; top: 5cqw; font: 700 13cqw/1 var(--ui) }
.f-tone .note { left: 9cqw; right: 8cqw; top: 23cqw; padding: 3.6cqw 4cqw; font: 500 5cqw/1.2 var(--ui); background: #fff0f6; transform: rotate(-2deg) }
.f-tone .formal .label { font: italic 600 14cqw/1 var(--serif) }
.f-tone .formal .note { font: italic 500 5.6cqw/1.16 var(--serif) }
.f-tone .casual .label { font: 700 12cqw/1 var(--hand) }
.f-tone .casual .note { font: 500 4.4cqw/1.2 var(--hand); background: #ffe66b; transform: rotate(2deg) }
.f-tone .direct .note { background: #3b1027; color: #fff; transform: none }

.f-keys { background: #151936; color: #fff }
.f-keys .line { left: 6cqw; top: 14cqw; font: 700 8cqw/1 var(--ui); color: #aebaff }
.f-keys img { right: 3cqw; top: 7cqw; width: 47cqw }
.f-keys img.custom { top: 21cqw }

.f-voice { background: #c9bdf7; color: #281c52 }
.f-voice .line { left: 5cqw; top: 8cqw; font: italic 600 10.4cqw/.98 var(--serif) }
.f-voice img { left: 46cqw; top: 8cqw; width: 62cqw; border-radius: 1.6cqw }
.f-voice img.voices { left: 48cqw; top: -66cqw; width: 64cqw }

.f-learn { background: #f47b3e; color: #331305 }
.f-learn .line { left: 6cqw; top: 5cqw; font: 600 8.6cqw/1.04 var(--hand) }
.f-learn img { left: 20cqw; top: 25cqw; width: 76cqw; border-radius: 2cqw }

.f-off { background: #30333b; color: #f7f7f7 }
.f-off .line { left: 5cqw; top: 8cqw; font: 700 12cqw/.96 var(--ui) }
.f-off img { left: 46cqw; top: 6cqw; width: 59cqw; border-radius: 2cqw }

.f-start { background: #91d5ee; color: #0b3444 }
.f-start .line { left: 6cqw; right: 6cqw; top: 5cqw; font: 700 6cqw/1.05 var(--ui) }
.f-start img { left: 10cqw; top: 16cqw; width: 80cqw; border-radius: 2cqw }

/* A film rests on its last frame. .play runs it from the start. */
.play .take > :nth-child(1) { animation: rise .8s var(--ease) backwards }
.play .take > :nth-child(2) { animation: land 1s .55s var(--ease) backwards }
.play .take > :nth-child(3) { animation: rise .7s 1.2s var(--ease) backwards }
.f-fix.play .answer, .f-short.play .short { animation: wipe 1.1s .9s var(--ease) backwards }
.f-tone.play .note { animation: slap .8s .4s var(--ease) backwards }
.f-learn.play img { animation: scroll-up 2.4s .4s var(--ease) backwards }
.f-voice.play .voices { animation: pan 2.2s .2s var(--ease) backwards }

dialog { width: min(1100px, calc(100vw - 32px), calc((100dvh - 110px) * 1.6)); max-width: none; padding: 0; border: 0; background: transparent; overflow: visible }
dialog::backdrop { background: rgb(8 10 16 / .82) }
dialog .film { border-radius: 12px; cursor: default }
dialog .close { display: block; margin: 0 0 10px auto; min-height: 40px; padding: 0 14px; border: 0; border-radius: 7px; background: #fff; color: #171a24 }

/* Screenshots */
.screens { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px 64px; align-items: center }
.screen-copy { display: grid; gap: 16px }
.tabs { display: grid; margin-top: 16px }
.tabs button { display: grid; gap: 2px; padding: 14px; text-align: left; border: 0; border-radius: 8px; background: none; color: var(--muted) }
.tabs b { color: var(--text); font-weight: 600; font-size: 19px }
.tabs span { font-size: 15px }
.tabs [aria-pressed="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line) }
.screen { height: 730px; min-width: 0; display: grid; place-items: center; padding: 28px; border-radius: 14px; background: #91d5ee; overflow: hidden }
.screen img { width: auto; height: auto; max-height: 674px; object-fit: contain; border-radius: 14px }

/* Privacy */
.privacy h2 { font-size: clamp(30px, 4.3vw, 58px) }
.privacy em { font: italic 500 1.08em/1.05 var(--serif); color: var(--muted) }
.privacy dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 48px; margin: 40px 0 0 }
.privacy dt { font-weight: 600; margin-bottom: 4px }
.privacy dd { margin: 0; color: var(--muted); font-size: 16px }

/* Install */
.install { margin-top: 104px; padding: 64px 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 64px; align-items: center; border-radius: 14px; background: #d8f55f; color: #1b2108 }
.install h2 { grid-row: span 3; font-size: clamp(44px, 6vw, 84px); line-height: .98 }
.install ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 19px }
.install .download { justify-self: start; background: #1b2108; color: #fff }
.install .needs { color: #414d16 }
footer { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-block: 32px 40px; color: var(--muted); font-size: 15px }
footer span { margin-right: auto }

@media (max-width: 1080px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .hero { grid-template-columns: minmax(0, 1fr) }
}
@media (max-width: 940px) {
  .stage { height: auto; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 14px }
  .field, .menu, .trigger, .stage-controls { position: relative; inset: auto }
  .field { align-self: stretch; padding: 18px 20px 42px }
  .menu { width: 250px }
  .trigger { max-width: none; justify-content: center; text-align: center }
}
@media (max-width: 720px) {
  main, footer { padding-inline: 16px }
  .nav { top: 10px; right: 12px }
  .nav .wide { display: none }
  .hero { padding-top: 104px }
  .hero h1 { font-size: clamp(38px, 12vw, 64px); line-height: 1.12 }
  .pitch > p:first-child { font-size: 19px }
  .draft { font-size: 19px }
  #tap kbd { width: 78px; height: 64px }
  .section { padding-top: 72px }
  .gallery, .screens, .privacy dl, .install { grid-template-columns: minmax(0, 1fr) }
  .screen { height: 420px; padding: 14px }
  .screen img { max-height: 392px }
  .install { margin-top: 72px; padding: 36px 22px }
  .install h2 { grid-row: auto }
}

@keyframes strike { from { stroke-dashoffset: 130 } }
@keyframes scribble { from { opacity: 0; clip-path: inset(0 100% 0 0) } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes ink { from { background: transparent } }
@keyframes rise { from { opacity: 0; translate: 0 3cqw } }
@keyframes land { from { opacity: 0; translate: 7cqw 0; scale: .95 } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0) } }
@keyframes slap { from { opacity: 0; scale: 1.3; rotate: 7deg } }
@keyframes scroll-up { from { translate: 0 28cqw } }
@keyframes pan { from { translate: 0 62cqw } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  *, *::before, *::after { animation: none !important; transition: none !important }
}
@media (min-width: 721px) and (max-width: 940px) {
  .screen { height: auto; padding: 20px }
}
