/* Fonts (self-hosted, no third-party requests) */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 84px;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
a { color: var(--color-link); }
::selection { background: var(--color-mark); }
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 8px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
main { flex: 1; overflow-x: hidden; overflow-x: clip; } /* keeps the hero glow from widening the page */
.section { padding: clamp(22px, 5vw, 44px) 0; }
.section > .container > h2,
.section-title { font-size: clamp(1.5rem, 4.6vw, 2.1rem); margin-bottom: 20px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: var(--color-header);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
  border-bottom: 1px solid var(--color-border);
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 750;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.logo { width: 30px; height: 30px; flex: none; }
.site-header nav { display: flex; align-items: center; gap: 2px; }
.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--color-muted);
  font-weight: 500;
  text-decoration: none;
}
.site-header nav a[aria-current="page"] { color: var(--color-text); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease;
}
.theme-toggle:active { transform: scale(0.92); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 26px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: 600 1.02rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--color-text); color: var(--color-bg); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.arrow { width: 20px; height: 20px; flex: none; transition: transform 0.18s ease; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Entrance animation */
.rise { opacity: 0; transform: translateY(14px); animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 28px;
  padding-top: clamp(36px, 9vw, 88px);
  padding-bottom: clamp(24px, 6vw, 56px);
}
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.hero::before {
  inset: -30% -25% auto -25%;
  height: 130%;
  background: radial-gradient(55% 55% at 78% 8%, var(--color-glow), transparent 70%);
}
.hero::after {
  inset: 0 0 0 0;
  background-image: radial-gradient(var(--color-border) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%);
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
  opacity: 0.9;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.88rem;
  font-weight: 500;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); box-shadow: 0 0 0 0 var(--color-glow); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 {
  margin: 20px 0 18px;
  font-size: clamp(2.6rem, 10.5vw, 5.2rem);
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.04em;
}
.hl { background: linear-gradient(transparent 62%, var(--color-mark) 62% 92%, transparent 92%); padding: 0 0.06em; }
.lead { max-width: 34rem; color: var(--color-muted); font-size: clamp(1.06rem, 3.8vw, 1.28rem); line-height: 1.55; }

/* Decorative app tiles */
.tiles { position: relative; width: 100%; max-width: 440px; aspect-ratio: 1 / 0.82; margin: 8px auto 0; }
.tile {
  position: absolute;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 22.4%;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: bob 7s ease-in-out infinite;
}
.tile svg { width: 44%; height: 44%; }
.t1 { width: 40%; left: 3%; top: 26%; --r: -9deg; color: #1b1815; background: linear-gradient(145deg, var(--color-accent), #ffa83d); }
.t2 { width: 47%; left: 42%; top: 0; --r: 7deg; color: var(--color-bg); background: var(--color-text); animation-delay: -2.2s; }
.t3 { width: 36%; left: 34%; top: 52%; --r: -4deg; color: var(--color-link); background: var(--color-surface); border: 1px solid var(--color-border); animation-delay: -4.4s; }
@keyframes bob {
  0%, 100% { transform: rotate(var(--r)) translateY(0); }
  50% { transform: rotate(var(--r)) translateY(-9px); }
}

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 16px; }
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 1.2rem; margin-bottom: 6px; }
.card p { color: var(--color-muted); }
.card-link {
  display: flex;
  align-items: center;
  gap: 18px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card-link:active { transform: scale(0.985); }
.card-link .grow { flex: 1; min-width: 0; }
.card-link .arrow { color: var(--color-muted); }
.card-dashed { background: transparent; border-style: dashed; box-shadow: none; }
.icon-tile {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--color-accent-soft);
  color: var(--color-link);
}
.icon-tile svg { width: 22px; height: 22px; }

/* App tile (icon placeholder) */
.app-tile {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--s, 72px);
  height: var(--s, 72px);
  border-radius: 22.4%;
  background: linear-gradient(145deg, var(--color-accent), #ffa83d);
  color: #1b1815;
  font: 800 calc(var(--s, 72px) * 0.34) / 1 var(--font-heading);
  letter-spacing: -0.03em;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.feature { padding: 20px; }

/* App page */
.app-hero { display: grid; gap: 22px; padding-top: clamp(32px, 7vw, 72px); padding-bottom: 8px; }
.app-hero h1 { margin: 14px 0 12px; font-size: clamp(2.4rem, 9vw, 4.2rem); letter-spacing: -0.04em; }
.shelf {
  display: flex;
  gap: 16px;
  padding: 8px max(20px, env(safe-area-inset-left)) 28px;
  scroll-padding-left: max(20px, env(safe-area-inset-left));
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.shelf::-webkit-scrollbar { display: none; }
.phone {
  position: relative;
  flex: none;
  width: min(66vw, 250px);
  aspect-ratio: 9 / 19.3;
  border: 7px solid var(--phone-bezel);
  border-radius: 40px;
  background: linear-gradient(160deg, var(--color-surface-2), var(--color-surface));
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: var(--shadow-lg);
}
.phone::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 34%;
  height: 20px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: var(--phone-bezel);
}
.phone span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--color-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Support and prose pages */
.page-head { padding-top: clamp(32px, 7vw, 72px); padding-bottom: 12px; }
.page-head h1 { margin: 14px 0 12px; font-size: clamp(2.2rem, 8vw, 3.6rem); letter-spacing: -0.04em; }
.narrow { max-width: 44rem; margin: 0 auto; }
.contact { display: grid; gap: 14px; justify-items: start; }
.contact h2 { font-size: 1.4rem; }
.contact p { color: var(--color-muted); }
.checklist { margin: 4px 0 0; padding-left: 20px; color: var(--color-muted); }
.checklist li { margin: 4px 0; }
details { border-bottom: 1px solid var(--color-border); }
details:first-of-type { border-top: 1px solid var(--color-border); }
summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 10px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; flex: none; font: 400 1.6rem/1 var(--font-heading); color: var(--color-link); }
details[open] summary::after { content: "\2013"; }
details p { padding: 0 0 18px; color: var(--color-muted); }
.prose h2 { font-size: 1.35rem; margin: 2.2em 0 0.5em; }
.prose p, .prose ul { margin-bottom: 1em; }
.prose ul { padding-left: 22px; }
.prose { line-height: 1.7; }
.meta {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 0.88rem;
}

/* Footer */
.site-footer {
  margin-top: 32px;
  border-top: 1px solid var(--color-border);
  padding: 24px 0 calc(24px + env(safe-area-inset-bottom));
  color: var(--color-muted);
  font-size: 0.95rem;
}
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 6px; }
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  color: var(--color-muted);
  text-decoration: none;
}

/* Hover only on devices that really hover (avoids "stuck" hover on iPhone) */
@media (hover: hover) {
  .site-header nav a:hover { color: var(--color-text); background: var(--color-surface-2); }
  .theme-toggle:hover { background: var(--color-surface-2); }
  .btn:hover { transform: translateY(-2px); }
  .btn-primary:hover { box-shadow: var(--shadow-lg); }
  .btn-ghost:hover { border-color: var(--color-text); }
  .btn:hover .arrow, .card-link:hover .arrow { transform: translateX(4px); }
  .card-link:hover { transform: translateY(-3px); border-color: var(--color-accent); }
  .site-footer nav a:hover { color: var(--color-text); }
}

/* Small phones */
@media (max-width: 560px) {
  .actions .btn { flex: 1 1 100%; }
}
@media (max-width: 340px) {
  .brand-name { display: none; }
}

/* Tablets and up */
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 48px; }
  .tiles { margin: 0; }
  .app-hero { grid-template-columns: auto 1fr; align-items: center; gap: 36px; }
  .shelf { justify-content: center; overflow: visible; }
  .phone { scroll-snap-align: none; width: 250px; }
  .phone:nth-child(2) { transform: translateY(-22px); }
}

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; opacity: 1; transform: none; }
  .tile, .dot { animation: none; }
  .tile { transform: rotate(var(--r)); }
  html { scroll-behavior: auto; }
}
