/* Kracha. Paper and ink, like the studio's croquis drawings; the apps' own colors do the rest. */
:root {
  --bg: #f6f1e7; --paper: #fffaf1; --ink: #1d1a16; --muted: #6b6257; --line: #e4dccd;
  --accent: #b4532a; --accent-ink: #fffaf1; --shadow: 0 30px 60px -30px rgba(60, 40, 20, .35);
  --phone: #1d1a16;
  /* Motion, from the studio kit (StudioMotion / StudioSprings): the site moves like the apps. */
  --short: 150ms; --medium: 300ms; --long: 450ms;
  --ease-enter: cubic-bezier(.05, .7, .1, 1);   /* emphasized decelerate: fast start, long settle */
  --ease-leave: cubic-bezier(.3, 0, .8, .15);   /* emphasized accelerate */
  --ease-std: cubic-bezier(.2, 0, 0, 1);
  --ease-spring: cubic-bezier(.34, 1.36, .64, 1); /* a small overshoot, like the kit's press release */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #16130f; --paper: #201c17; --ink: #f3ece0; --muted: #a99f91; --line: #332d25;
    --accent: #e38b5f; --accent-ink: #16130f; --shadow: 0 30px 60px -30px rgba(0, 0, 0, .7); --phone: #000; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #16130f; --paper: #201c17; --ink: #f3ece0; --muted: #a99f91; --line: #332d25;
  --accent: #e38b5f; --accent-ink: #16130f; --shadow: 0 30px 60px -30px rgba(0, 0, 0, .7); --phone: #000; color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 "Instrument Sans", -apple-system, system-ui, sans-serif; }
img, video { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; line-height: 1.1; text-wrap: balance; margin: 0; }
.eyebrow { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.muted { color: var(--muted); }

/* Top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { font-family: "Fraunces", Georgia, serif; font-size: 24px; font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.top nav { display: flex; gap: 22px; flex-wrap: wrap; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }

/* Hero */
.hero { padding-block: 72px 40px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(42px, 6vw, 76px); letter-spacing: -.02em; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p.lede { font-size: 20px; color: var(--muted); max-width: 32em; margin: 22px 0 28px; }
.cta { display: inline-flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 13px 22px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 16px; }
.btn { transition: transform var(--medium) var(--ease-spring), background-color var(--medium) var(--ease-std), border-color var(--medium) var(--ease-std); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.97); transition-duration: var(--short); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { border: 1.5px solid var(--line); }
.icons-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; max-width: 420px; justify-self: center; }
.icons-row { grid-template-columns: repeat(6, 1fr); max-width: 470px; }
.icons-row img { width: 100%; border-radius: 22%; box-shadow: var(--shadow); transition: transform var(--medium) var(--ease-spring); }
.icons-row img:nth-child(odd) { transform: translateY(14px); }
.icons-row img:hover { transform: translateY(-4px) rotate(-3deg); }

/* Promises */
.promises { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; margin-block: 32px 80px; }
.promises div { background: var(--paper); padding: 22px; }
.promises b { display: block; font-family: "Fraunces", Georgia, serif; font-size: 20px; margin-bottom: 6px; }
.promises p { margin: 0; font-size: 15px; color: var(--muted); }

/* Apps */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(32px, 4vw, 48px); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters a { font-size: 14px; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); text-decoration: none; }
.filters a { transition: background-color var(--medium) var(--ease-std), color var(--medium) var(--ease-std), border-color var(--medium) var(--ease-std), transform var(--medium) var(--ease-spring); }
.filters a:active { transform: scale(.96); }
.filters a:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filters button { font: inherit; font-size: 14px; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.apps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.cat { margin-bottom: 72px; scroll-margin-top: 90px; }
.cat-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 22px; margin-bottom: 22px; }
.cat-name { font-size: 30px; }
.cat-head p { margin: 0; }
.app { background: var(--paper); border: 1px solid var(--line); border-radius: 28px; padding: 26px; display: grid; grid-template-columns: 1fr 210px;
  gap: 24px; align-items: center; min-width: 0; }
.app[hidden] { display: none; }
.app { transition: transform var(--long) var(--ease-enter), box-shadow var(--long) var(--ease-enter), border-color var(--medium) var(--ease-std); }
.app:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.app .meta { min-width: 0; }
.app .id { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.app .id img { width: 56px; height: 56px; border-radius: 14px; }
.app h3 { font-size: 28px; }
.app .tag { font-size: 13px; color: var(--muted); }
.app p { margin: 0 0 14px; }
.app ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 15px; color: var(--muted); }
.app li::before { content: "—"; color: var(--accent); margin-right: 8px; }
.app .pill { display: inline-block; margin-top: 16px; font-size: 13px; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 600; }

/* Phone frame */
.phone { position: relative; width: 210px; aspect-ratio: 720 / 1602; max-width: 100%; border-radius: 30px; background: var(--phone); padding: 7px; box-shadow: var(--shadow); justify-self: center; }
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 24px; background: #000; }
.phone { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform var(--long) var(--ease-enter); }
.phone.tilting { transition-duration: 80ms; }
/* The kit's tilt-and-shine: a soft highlight that follows the pointer, clipped to the screen (no blur, no blending). */
.phone::before { content: ""; position: absolute; inset: 7px; border-radius: 24px; pointer-events: none; z-index: 1; opacity: 0;
  background: radial-gradient(circle at var(--sx, 50%) var(--sy, 30%), rgba(255, 255, 255, .22), transparent 55%); transition: opacity var(--medium) var(--ease-std); }
.phone.tilting::before { opacity: 1; }
.phone::after { content: ""; position: absolute; top: 14px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #000; opacity: .8; }

/* Story band */
.band { background: var(--ink); color: var(--bg); border-radius: 32px; padding: 56px 40px; margin-bottom: 96px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.band h2 { font-size: clamp(30px, 3.6vw, 44px); }
.band p { color: color-mix(in srgb, var(--bg) 75%, transparent); margin: 0 0 14px; }
.band .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-content: center; }
.band .stats b { font-family: "Fraunces", Georgia, serif; font-size: 44px; display: block; line-height: 1; color: var(--accent); }
.band .stats span { font-size: 15px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding-block: 40px 56px; font-size: 15px; }
footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
footer h4 { margin: 0 0 10px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; }
.copy { user-select: all; font-weight: 600; }

/* Prose pages */
.prose { max-width: 720px; padding-block: 56px 80px; }
.prose h1 { font-size: clamp(36px, 5vw, 52px); margin-bottom: 8px; }
.prose h2 { font-size: 24px; margin: 36px 0 8px; }
.prose p, .prose li { color: color-mix(in srgb, var(--ink) 85%, transparent); }
.prose ul { padding-left: 1.2em; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px; margin: 24px 0; }
details { border-bottom: 1px solid var(--line); padding-block: 14px; }
summary { cursor: pointer; font-weight: 600; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; }
  .promises { grid-template-columns: 1fr 1fr; }
  .apps { grid-template-columns: 1fr; }
  .band { grid-template-columns: 1fr; padding: 40px 24px; }
  footer .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .app { grid-template-columns: 1fr; }
  .phone { width: 200px; }
  .promises { grid-template-columns: 1fr; }
  .top nav { gap: 14px; font-size: 14px; }
  footer .wrap { grid-template-columns: 1fr; }
}
/* Arrivals: nothing appears from nowhere. Cards rise in as they reach the screen; the headline arrives word by word
   from behind masks; icons cascade 40 ms apart. Only when the script ran, so the page is complete without it. */
.js .reveal { opacity: 0; translate: 0 28px; transition: opacity var(--long) var(--ease-std), translate var(--long) var(--ease-enter), transform var(--long) var(--ease-enter), box-shadow var(--long) var(--ease-enter), border-color var(--medium) var(--ease-std); }
.js .reveal.in { opacity: 1; translate: none; }
.js .icons-row img { animation: appear var(--long) var(--ease-enter) both; animation-delay: calc(var(--i, 0) * 40ms + 200ms); }
@keyframes appear { from { opacity: 0; translate: 0 12px; } }
.word { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.word > span { display: inline-block; animation: rise .7s var(--ease-enter) both; animation-delay: calc(var(--i, 0) * 70ms + 80ms); }
@keyframes rise { from { transform: translateY(105%); } }

/* Between pages: the top bar stays put while the page underneath fades through (the kit's fadeThrough). */
@view-transition { navigation: auto; }
.top { view-transition-name: topbar; }
::view-transition-old(root) { animation: vt-out 90ms var(--ease-leave) both; }
::view-transition-new(root) { animation: vt-in var(--medium) var(--ease-enter) 90ms both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: scale(.97); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; }
  .js .reveal { opacity: 1; translate: none; }
  .phone { transform: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
