/* Shared by index.html and apps.html. Every value comes from these tokens. */
:root {
  --espresso: #1e1712; --bark: #2e241c; --bark-2: #3d3026;
  --clay: #a44a25; --ochre: #d39b45; --olive: #4f5a30;
  --sand: #ede3d1; --linen: #f6f0e4;
  --mute-d: #b3a48e;   /* on espresso: 7.4:1 */
  --mute-l: #6b5d4d;   /* on sand: 5.3:1 */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px; --s8: 144px;
  --t-sm: 14px; --t-md: 17px; --t-lg: 21px;
  --t-xl: clamp(28px, 3.4vw, 40px);
  --t-2xl: clamp(44px, 7vw, 96px);
  --t-3xl: clamp(52px, 9vw, 136px);
  --r: 32px; --pill: 999px;
  --ease: cubic-bezier(.2, .7, .2, 1); --dur: .6s;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --wheel: min(128svh, 210vw, 1500px);
}
@media (max-width: 720px) { :root { --s7: 64px; --s8: 88px; --r: 24px } }
*, *::before, *::after { box-sizing: border-box; margin: 0 }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100% }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto } }
body { background: var(--espresso); color: var(--sand); font: var(--t-md)/1.6 system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden }
img { display: block; max-width: 100% }
a { color: inherit; text-decoration: none }
button { font: inherit; color: inherit }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 4px; border-radius: 8px }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--s2) }
@media (min-width: 720px) { .wrap { padding: 0 var(--s5) } }
.display { font-family: var(--display); font-weight: 800; letter-spacing: -.045em; line-height: .9 }

/* film grain over everything, matching the logo's texture */
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .07;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: var(--s1); min-height: 52px; padding: 0 var(--s3);
  border-radius: var(--pill); font-weight: 600;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), translate .3s var(--ease) }
.btn-solid { background: var(--sand); color: var(--espresso) }
.btn-solid:hover { background: var(--ochre) }
.btn-line { border: 1.5px solid currentColor }
.btn-line:hover { background: var(--sand); color: var(--espresso) }
.btn .arrow { transition: translate var(--dur) var(--ease) }
.btn:hover .arrow { translate: 4px 0 }

/* ---------- nav: floating pills, no bar ---------- */
.nav { position: fixed; inset: var(--s2) 0 auto; z-index: 50; pointer-events: none }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s1) }
.nav a { pointer-events: auto; background: var(--espresso); border: 1px solid var(--bark-2); border-radius: var(--pill);
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / .45); transition: background var(--dur) var(--ease), color var(--dur) var(--ease) }
.brand { display: flex; align-items: center; gap: var(--s1); padding: 6px var(--s2) 6px 6px;
  font: 800 var(--t-lg)/1 var(--display); letter-spacing: -.03em; white-space: nowrap }
.brand img { width: 40px; height: 40px }
.nav ul { display: flex; gap: var(--s1); list-style: none; padding: 0; font-weight: 600 }
.nav ul a { display: block; padding: 14px var(--s3) }
.nav a:hover, .nav a[aria-current="page"] { background: var(--sand); color: var(--espresso) }
@media (max-width: 480px) {
  .brand { font-size: var(--t-md); padding-right: 14px } .brand img { width: 34px; height: 34px }
  .nav ul a { padding: 12px var(--s2) }
}

/* ---------- section heads ---------- */
.section-head { margin-bottom: var(--s6) }
.section-head h2 { font-size: var(--t-2xl) }
.section-head p { margin-top: var(--s3); font-size: var(--t-lg); color: var(--mute-l) }
.on-dark .section-head p { color: var(--mute-d) }

/* ---------- badges and chips ---------- */
.badge { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: var(--pill); background: var(--espresso);
  color: var(--ochre); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap }
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--ochre); margin-right: 8px; animation: pulse 1.8s ease-in-out infinite }
@keyframes pulse { 50% { opacity: .25 } }
.chips { display: flex; flex-wrap: wrap; gap: var(--s1); list-style: none; padding: 0 }
.chips li { padding: 6px 14px; border-radius: var(--pill); border: 1px solid rgb(237 227 209 / .4); font-size: var(--t-sm); font-weight: 600 }

/* ---------- app cards (home grid) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s3) }
@media (max-width: 360px) { .cards { grid-template-columns: 1fr } }
.card { position: relative; display: flex; flex-direction: column; gap: var(--s2); min-height: 600px; padding: var(--s4);
  border-radius: var(--r); background: var(--c); color: var(--sand); overflow: hidden; isolation: isolate }
.card .top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2) }
.card .icon { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 8px 24px rgb(0 0 0 / .25);
  transition: rotate .6s var(--ease), scale .6s var(--ease) }
.card h3 { font-size: clamp(36px, 4vw, 48px); margin-top: var(--s1) }
.card p { opacity: .92; max-width: 30ch }
.card .go { margin-top: var(--s1); display: flex; align-items: center; gap: var(--s1); font-weight: 700; position: relative; z-index: 2 }
.card .go span { transition: translate var(--dur) var(--ease) }
/* the app's screen rises out of the bottom of the card */
.card .peek { position: absolute; z-index: -1; left: 50%; bottom: 0; width: 62%; translate: -50% 58%;
  transition: translate .8s var(--ease), rotate .8s var(--ease) }
.card:hover .peek, .card:focus-visible .peek { translate: -50% 40%; rotate: -3deg }
.card:hover .icon { rotate: -8deg; scale: 1.08 }
.card:hover .go span { translate: 6px 0 }
.card .peek .phone { width: 100%; cursor: inherit }
.card .peek:has(.mac) { width: 100%; translate: -50% 0 }
.card .peek:has(.mac) .mac { border-width: 6px; border-radius: 14px 14px 0 0; box-shadow: none }
.card:hover .peek:has(.mac) { translate: -50% 0; rotate: 0deg }
.card::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, var(--c) 45%, transparent 75%) }

/* ---------- full panel (apps page) ---------- */
.panel { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: var(--s5);
  padding: var(--s6); border-radius: var(--r); color: var(--sand); min-height: 640px; overflow: hidden;
  background: var(--c); transition: background .7s var(--ease) }
.panel .tag { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s4) }
.panel .tag img { width: 72px; height: 72px; border-radius: 17px; box-shadow: 0 8px 24px rgb(0 0 0 / .25);
  transition: rotate .6s var(--ease), scale .6s var(--ease) }
.panel:hover .tag img { rotate: -8deg; scale: 1.08 }
.panel h2 { font-size: var(--t-2xl); margin-bottom: var(--s3) }
.panel h2 span { display: inline-block; white-space: pre; transition: translate .5s var(--ease); transition-delay: calc(var(--i) * 30ms) }
.panel:hover h2 span { translate: 0 -.1em }
.panel p { font-size: var(--t-lg); max-width: 32ch; opacity: .92; margin-bottom: var(--s4) }
.panel .chips { margin-bottom: var(--s5) }
.panel .copy > * { animation: enter .7s var(--ease) both }
.panel .copy > :nth-child(2) { animation-delay: .05s } .panel .copy > :nth-child(3) { animation-delay: .1s }
.panel .copy > :nth-child(4) { animation-delay: .15s } .panel .copy > :nth-child(5) { animation-delay: .2s }
.panel .stage { animation: enter-r .8s var(--ease) both }
@keyframes enter { from { opacity: 0; translate: 0 24px } }
@keyframes enter-r { from { opacity: 0; translate: 40px 0 } }
@media (max-width: 860px) {
  .panel { grid-template-columns: 1fr; padding: var(--s4) var(--s3) var(--s5); min-height: 0; gap: var(--s4) }
  .panel p { font-size: var(--t-md) }
  .panel .chips { margin-bottom: var(--s4) }
}

/* ---------- phone ---------- */
.stage { perspective: 1200px; display: grid; place-items: center; min-width: 0 }
.stage > .mac { justify-self: stretch }
.phone { position: relative; width: min(300px, 68vw); aspect-ratio: 9 / 19.5; border-radius: 48px; overflow: hidden;
  background: #0b0806; border: 10px solid #0b0806; box-shadow: 0 40px 80px -20px rgb(0 0 0 / .55), inset 0 0 0 1px #3a2e24;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .4s var(--ease); cursor: pointer }
.phone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 38px;
  opacity: 0; scale: 1.06; transition: opacity .9s var(--ease), scale 2.6s var(--ease) }
.phone img.on { opacity: 1; scale: 1 }
.phone::before { content: ""; position: absolute; z-index: 3; top: 10px; left: 50%; translate: -50% 0; width: 32%; height: 26px;
  border-radius: var(--pill); background: #0b0806 }
.lock { position: absolute; z-index: 2; inset: 52px 0 auto; text-align: center; color: #fff; pointer-events: none;
  text-shadow: 0 1px 12px rgb(0 0 0 / .35) }
.lock small { font-size: 13px; font-weight: 600 }
.lock b { display: block; font: 600 68px/1 var(--display); letter-spacing: -.02em }
@media (max-width: 480px) { .phone { border-radius: 40px; border-width: 8px } .phone img { border-radius: 32px } .lock b { font-size: 54px } }
/* fan of neighbouring screens behind the phone; spreads when the panel is hovered */
.deck { position: relative }
.deck .phone { z-index: 1; touch-action: pan-y }
.ghost { position: absolute; top: 7%; left: 10%; width: 80%; height: 86%; padding: 0; border: 8px solid #0b0806; border-radius: 40px;
  background: #0b0806 center / cover; cursor: pointer; filter: brightness(.6) saturate(.8);
  transition: transform .7s var(--ease), filter var(--dur) var(--ease) }
.ghost.prev { transform: translateX(-26%) rotate(-7deg) }
.ghost.next { transform: translateX(26%) rotate(7deg) }
.panel:hover .ghost.prev { transform: translateX(-58%) rotate(-12deg) }
.panel:hover .ghost.next { transform: translateX(58%) rotate(12deg) }
.ghost:hover { filter: none }
@media (hover: none) { .ghost.prev { transform: translateX(-40%) rotate(-9deg) } .ghost.next { transform: translateX(40%) rotate(9deg) } }
/* thumbnails */
.thumbs { display: flex; gap: var(--s1); justify-content: center; margin-top: var(--s3); flex-wrap: wrap }
.thumbs button { width: 34px; height: 72px; padding: 0; border: 0; border-radius: 8px; background: center / cover; opacity: .5;
  cursor: pointer; transition: opacity var(--dur) var(--ease), translate var(--dur) var(--ease) }
.thumbs button:hover { opacity: .85; translate: 0 -4px }
.thumbs button[aria-current="true"] { opacity: 1; outline: 2px solid var(--sand); outline-offset: 3px }

/* ---------- Mac screen strip: a looping screen recording under the menu bar ---------- */
.mac { position: relative; width: 100%; max-width: 1040px; margin-inline: auto; overflow: hidden; background: #0b0806;
  border: 10px solid #0b0806; border-bottom: 0; border-radius: 22px 22px 0 0;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / .55), inset 0 0 0 1px #3a2e24;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .4s var(--ease) }
.mac video { display: block; width: 100%; aspect-ratio: 1280 / 482; object-fit: cover; border-radius: 12px 12px 0 0 }
/* an app shown on a Mac gets the full panel width: copy on top, the screen rising from the bottom edge */
.panel.wide { grid-template-columns: 1fr; padding-bottom: 0; min-height: 0 }
.panel.wide .stage { align-self: end }
@media (min-width: 861px) {   /* name on the left, description and platforms beside it */
  .panel.wide .copy { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--s5); align-items: start }
  .panel.wide .copy > .tag { grid-column: 1 / -1 }
  .panel.wide .copy > h2 { grid-row: 2 / span 3; margin: 0 }
  .panel.wide .copy > :not(.tag):not(h2) { grid-column: 2 }
  .panel.wide .chips { margin-bottom: var(--s3) }
}
@media (max-width: 860px) { .mac { border-width: 6px; border-radius: 14px 14px 0 0 } }

/* ---------- footer ---------- */
footer { position: relative; overflow: hidden; padding-top: var(--s7) }
.foot-top { display: grid; grid-template-columns: auto 1fr; gap: var(--s6); align-items: start }
.foot-mark { display: grid; justify-items: center; gap: var(--s2) }
.foot-logo { width: 180px; aspect-ratio: 1; position: relative; touch-action: pan-y; cursor: grab }
.foot-logo .sun { position: absolute; inset: 29.5%; border-radius: 50%; background: var(--clay) }
.foot-logo img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none }
.est { font-size: var(--t-sm); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--mute-d) }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s4) }
.foot-cols h4 { font-size: var(--t-sm); letter-spacing: .14em; text-transform: uppercase; color: var(--mute-d); margin-bottom: var(--s2); font-weight: 600 }
.foot-cols ul { list-style: none; padding: 0; display: grid; gap: var(--s1) }
.foot-cols a { font: 600 var(--t-lg)/1.3 var(--display) } .foot-cols a:hover { color: var(--ochre) }
@media (max-width: 720px) {
  .foot-top { grid-template-columns: 1fr; gap: var(--s5) }
  .foot-mark { justify-items: start } .foot-logo { width: 140px }
}
.wordmark { font: 800 clamp(96px, 27vw, 420px)/.78 var(--display); letter-spacing: -.06em; color: var(--bark);
  white-space: nowrap; text-align: center; margin-top: var(--s6); translate: 0 18%; transition: color 1s var(--ease) }
footer:hover .wordmark { color: var(--bark-2) }
.legal { padding: var(--s3) 0; border-top: 1px solid var(--bark-2); color: var(--mute-d); font-size: var(--t-sm);
  position: relative; z-index: 1; background: var(--espresso) }
.legal .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s2) }
.legal a:hover { color: var(--sand) }

/* ---------- scroll reveal ---------- */
.js [data-reveal] { opacity: 0; translate: 0 48px; transition: opacity 1s var(--ease), translate 1s var(--ease) }
.js [data-reveal].in { opacity: 1; translate: 0 0 }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; translate: none; transition: none }
  .badge i, .panel .copy > *, .panel .stage { animation: none }
}
