/* Neutral cool chrome; colour comes from each app's own palette.
   Dark mode follows the system: the chrome goes near-black and every app section
   switches to that app's own dark palette. */
:root {
  --paper: #F2F3F5;
  --paper-2: #E7E9ED;
  --ink: #15171B;
  --ink-2: #4A4F58;
  --rule: #D5D8DE;
  --live: #1E8E4F;
  --ph-line: #B9BEC8;
  --close-bg: #15171B;
  --close-fg: #F2F3F5;
  --close-2: #B7BCC6;
  --close-3: #8D93A0;
  --close-line: #2E323A;
  --tile-ring: transparent;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Hanken Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1114;
    --paper-2: #1A1D22;
    --ink: #ECEEF1;
    --ink-2: #A1A7B2;
    --rule: #2A2E36;
    --live: #3FBF78;
    --ph-line: #3A3F48;
    --close-bg: #171A1F;
    --close-fg: #ECEEF1;
    --close-2: #A1A7B2;
    --close-3: #7D838F;
    --close-line: #2A2E36;
    --tile-ring: rgba(255, 255, 255, .07);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--live);
  outline-offset: 3px;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}

/* ------ Light / dark artwork ------ */

/* An app that ships a dark icon or screenshot gets both; the system setting picks. */
.when-dark { display: none; }

@media (prefers-color-scheme: dark) {
  .when-light { display: none; }
  .when-dark { display: block; }
}

/* iOS draws a dark-mode icon on its own dark plate; transparent dark variants need one here */
.icon-plate { background: #0E1110; }

/* ------ Nav ------ */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
}

.mark {
  font: 700 19px/1 var(--display);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
}

.nav nav a {
  color: var(--ink-2);
  text-decoration: none;
}

.nav nav a:hover {
  color: var(--ink);
}

.nav nav a.pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

@media (max-width: 640px) {
  .nav nav a:not(.pill) { display: none; }
}

/* ------ Hero ------ */

.hero {
  display: grid;
  gap: 28px;
  padding-block: clamp(48px, 9vw, 112px) clamp(40px, 6vw, 72px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 14px/1.3 var(--body);
  color: var(--ink-2);
  letter-spacing: 0.01em;
}

.eyebrow .dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--live) 18%, transparent);
}

h1 {
  max-width: 13ch;
  font: 700 clamp(44px, 8.4vw, 108px)/0.95 var(--display);
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h1 em {
  font-style: normal;
  font-weight: 500;
  color: var(--ink-2);
}

.lead {
  max-width: 36em;
  font-size: clamp(18px, 1.6vw, 21px);
  color: var(--ink-2);
}

.lead b {
  color: var(--ink);
  font-weight: 600;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 22px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font: 600 16px/1 var(--body);
  text-decoration: none;
  transition: transform .2s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.addr {
  font: 500 16px/1 var(--body);
  color: var(--ink-2);
  user-select: all;
}

/* ------ Shelf ------ */

/* Every app, newest first. auto-fill so a new icon just takes the next slot. */
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 22px clamp(12px, 2vw, 24px);
  margin-top: clamp(28px, 5vw, 56px);
  padding-top: clamp(24px, 4vw, 40px);
  border-top: 1px solid var(--rule);
}

@media (max-width: 520px) {
  .shelf {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 12px;
  }
}

.shelf a {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
}

.shelf .ic {
  width: 100%;
  max-width: 96px;
  aspect-ratio: 1;
  border-radius: 22.4%;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 10px 24px -12px rgba(20, 24, 32, .45), 0 0 0 1px var(--tile-ring);
  animation: rise .6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}

.shelf .ic img {
  width: 100%;
  height: 100%;
}

.shelf .soon .ic {
  opacity: .55;
  box-shadow: none;
}

.shelf b {
  font: 600 clamp(13px, 1.4vw, 16px)/1.1 var(--display);
  letter-spacing: -0.01em;
}

.shelf small {
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink-2);
}

@media (max-width: 520px) {
  .shelf small { display: none; }
}

/* Transform only, so a frame caught mid-animation still shows every icon */
@keyframes rise {
  from { transform: translateY(14px); }
  to { transform: none; }
}

.ph {
  display: grid;
  place-items: center;
  background: var(--paper-2);
  border: 1.5px dashed var(--ph-line);
}

.ph svg {
  width: 46%;
  height: 46%;
}

/* ------ Groups ------ */

.group {
  display: grid;
  gap: 12px;
  padding-block: clamp(56px, 8vw, 96px) clamp(28px, 4vw, 40px);
}

.kicker {
  font: 600 13px/1 var(--body);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

h2 {
  max-width: 18ch;
  font: 700 clamp(34px, 4.6vw, 60px)/1 var(--display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.group p {
  max-width: 38em;
  font-size: 18px;
  color: var(--ink-2);
}

/* ------ Featured band (iPhone + Android apps) ------ */

.band {
  background: var(--bg);
  color: var(--fg);
  box-shadow: inset 0 1px 0 var(--tile-ring), inset 0 -1px 0 var(--tile-ring);
}

.band .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
  padding-block: clamp(56px, 8vw, 104px);
}

@media (max-width: 820px) {
  .band .wrap { grid-template-columns: 1fr; }
}

.copy {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.app-id {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-id .ic {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 22.4%;
  overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg) 10%, transparent);
}

.app-id .ic img {
  width: 100%;
  height: 100%;
}

.app-id h3 {
  font: 700 26px/1 var(--display);
  letter-spacing: -0.02em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font: 500 13px/1.2 var(--body);
  color: var(--muted);
}

.status::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.band h4 {
  max-width: 16ch;
  font: 600 clamp(28px, 3.4vw, 44px)/1.05 var(--display);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.band p {
  max-width: 34em;
  color: var(--muted);
}

.built {
  list-style: none;
  display: grid;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
}

.built li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  font-size: 16px;
}

.built li::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: 8px;
  border-radius: 3px;
  background: var(--accent);
}

.built b {
  font-weight: 600;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding-top: 4px;
  font-size: 15px;
  font-weight: 600;
}

.links a {
  padding-bottom: 2px;
  border-bottom: 1.5px solid color-mix(in srgb, var(--accent) 70%, transparent);
  text-decoration: none;
}

.stage {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-width: 0;
}

.phone {
  flex: none;
  width: min(300px, 70vw);
  padding: 9px;
  border-radius: 46px;
  background: #0B0C0E;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1) inset, 0 40px 80px -30px rgba(0, 0, 0, .55);
}

.phone img {
  width: 100%;
  border-radius: 38px;
}

.phone.android { border-radius: 40px; }
.phone.android img { border-radius: 32px; }

.stage.pair .phone { width: min(250px, 42vw); }

.stage.pair .phone + .phone {
  margin-left: -46px;
  transform: translateY(34px);
}

.b-tare { --bg: #F7FAF7; --fg: #12211A; --muted: #42564B; --accent: #2E7D4F; }

/* ------ Coming soon ------ */

.next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  padding-block: 20px clamp(8px, 2vw, 16px);
}

.soon-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 22px;
  border-radius: 22px;
  background: var(--c-bg);
  color: var(--c-fg);
  border: 1px dashed color-mix(in srgb, var(--c-fg) 30%, transparent);
}

.soon-card .ic,
.soon-card .ph {
  width: 64px;
  height: 64px;
  border-radius: 22.4%;
  overflow: hidden;
}

.soon-card .ic img {
  width: 100%;
  height: 100%;
}

.soon-card h3 {
  font: 700 22px/1.1 var(--display);
  letter-spacing: -0.015em;
}

.soon-card .when {
  margin-top: 6px;
  font: 600 12px/1 var(--body);
  letter-spacing: .07em;
  text-transform: uppercase;
  opacity: .7;
}

.soon-card p {
  margin-top: 10px;
  font-size: 16px;
  opacity: .85;
}

.c-load { --c-bg: #E8ECF4; --c-fg: #0B1B2E; }
.c-fast { --c-bg: var(--paper-2); --c-fg: var(--ink); }

/* ------ iPhone apps grid ------ */

/* auto-fill, so a new release is one more tile and nothing else changes */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 18px;
  padding-bottom: clamp(56px, 8vw, 96px);
}

.tile {
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 26px;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--tile-ring);
}

.tile .top {
  display: grid;
  gap: 12px;
  padding: 24px 24px 0;
}

.tile .app-id .ic {
  width: 48px;
  height: 48px;
}

.tile .app-id h3 {
  font-size: 22px;
}

.tile p {
  font-size: 16px;
  color: var(--muted);
}

.tile .links {
  font-size: 14px;
}

.tile .peek {
  align-self: end;
  height: 230px;
  margin: 22px 24px 0;
  padding: 8px 8px 0;
  border-radius: 30px 30px 0 0;
  background: #0B0C0E;
  overflow: hidden;
}

.tile .peek img {
  width: 100%;
  border-radius: 24px 24px 0 0;
}

.t-oncenter { --bg: #F7C600; --fg: #121212; --muted: #3A3420; --accent: #D7261E; }
.t-nitrify  { --bg: #E4EFEE; --fg: #0F2224; --muted: #3C5658; --accent: #0E7C86; }
.t-puddle   { --bg: #D4E0CF; --fg: #1E2A31; --muted: #3E4F57; --accent: #5B7B98; }
.t-radia    { --bg: #07090C; --fg: #EEF0F3; --muted: #9AA2AE; --accent: #FF3B14; }
.t-autolyse { --bg: #16171A; --fg: #F1F2EC; --muted: #A3A69B; --accent: #B6CD2A; }

/* Phones rise into place as they scroll in. Transform only, so anything caught
   before its timeline starts is still fully visible. */
@supports (animation-timeline: view()) {
  .band .stage,
  .tile .peek {
    animation: slide-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 70%;
  }

  @keyframes slide-up {
    from { transform: translateY(32px); }
    to { transform: none; }
  }
}

/* ------ Services ------ */

.section {
  padding-block: 0 clamp(64px, 9vw, 120px);
}

.section-head {
  display: grid;
  gap: 14px;
  margin-bottom: clamp(32px, 4vw, 52px);
}

.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 22px;
  overflow: hidden;
}

@media (max-width: 900px) {
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .services { grid-template-columns: 1fr; }
}

.svc {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 26px;
  background: var(--paper);
}

.svc h3 {
  font: 600 21px/1.15 var(--display);
  letter-spacing: -0.015em;
}

.svc p {
  font-size: 16px;
  color: var(--ink-2);
}

.svc .proof {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.svc .proof img {
  width: 20px;
  height: 20px;
  border-radius: 5px;
}

/* ------ Process ------ */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  counter-reset: s;
}

@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; }
}

.steps li {
  counter-increment: s;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}

.steps li::before {
  content: "Step " counter(s);
  font: 600 12.5px/1 var(--body);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.steps h3 {
  font: 600 20px/1.15 var(--display);
}

.steps p {
  font-size: 15.5px;
  color: var(--ink-2);
}

/* ------ About / contact ------ */

.close {
  background: var(--close-bg);
  color: var(--close-fg);
}

.close .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(32px, 6vw, 80px);
  padding-block: clamp(64px, 10vw, 128px);
}

@media (max-width: 820px) {
  .close .wrap { grid-template-columns: 1fr; }
}

.close .intro {
  display: grid;
  align-content: start;
  gap: 22px;
}

.close h2 {
  max-width: 14ch;
}

.close .kicker {
  color: var(--close-3);
}

.close p {
  max-width: 32em;
  color: var(--close-2);
}

.close .big {
  font: 600 clamp(26px, 3.6vw, 44px)/1.1 var(--display);
  letter-spacing: -0.02em;
  color: var(--close-fg);
  text-decoration: none;
  border-bottom: 2px solid var(--close-3);
  word-break: break-all;
}

.facts {
  list-style: none;
  display: grid;
  align-content: start;
}

.facts li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--close-line);
  font-size: 15.5px;
}

.facts li span:first-child {
  color: var(--close-3);
}

.facts li span:last-child {
  text-align: right;
}

/* ------ Footer ------ */

footer {
  background: var(--close-bg);
  color: var(--close-3);
  font-size: 13.5px;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-block: 24px 36px;
  border-top: 1px solid var(--close-line);
}

/* ------ Dark mode: app palettes ------ */

/* Each app in its own Dark Mode colours. Kept last: these have the same specificity
   as the light rules above, so they only win by coming after them. Radia and Autolyse
   are dark already. */
@media (prefers-color-scheme: dark) {
  .b-tare     { --bg: #0E1512; --fg: #E6EFE9; --muted: #9DB3A6; --accent: #5FBF87; }
  .c-load     { --c-bg: #0B1B2E; --c-fg: #E6ECF5; }
  .t-oncenter { --bg: #121212; --fg: #F5F2E6; --muted: #B8B29A; --accent: #F7C600; }
  .t-nitrify  { --bg: #0B1113; --fg: #E3EEEF; --muted: #8FA9AB; --accent: #35B5BE; }
  .t-puddle   { --bg: #161E1A; --fg: #E4ECE1; --muted: #A2B1A4; --accent: #7CA3C4; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .shelf .ic,
  .band .stage,
  .tile .peek { animation: none; }
  .btn { transition: none; }
}
