:root {
  --bg: #16150e;
  --surface: #1f1e15;
  --surface-hi: #2a281b;
  --line: #3b3927;
  --text: #f4f1de;
  --muted: #aaa68c;
  --accent: #ffe566;
  --accent-ink: #1b1900;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 10;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  border-radius: 8px;
}

/* Top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.mark-tile {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.125rem;
  line-height: 1;
}

.nav {
  display: flex;
  gap: clamp(14px, 3vw, 28px);
  font-size: 1rem;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Hero: the one loud thing on the home page */

.hero {
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: clamp(20px, 3vw, 32px);
  padding: clamp(24px, 5vw, 56px);
  padding-top: clamp(40px, 9vw, 120px);
}
.hero :focus-visible { outline-color: var(--accent-ink); }

.hero-word {
  margin: 0;
  margin-left: -0.04em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(5rem, 22vw, 15rem);
  line-height: 0.8;
  letter-spacing: -0.06em;
}

.hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: clamp(28px, 5vw, 56px);
}

.hero-text {
  margin: 0;
  max-width: 30ch;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.hero-links { display: flex; flex-wrap: wrap; gap: 10px; }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-small { padding: 8px 14px; font-size: 0.9375rem; }
.btn-note { font-weight: 400; color: var(--muted); }

.btn-ink { background: var(--accent-ink); color: var(--accent); }
.btn-ink:hover { background: #33300a; }

.btn-ink-line { border-color: var(--accent-ink); color: var(--accent-ink); }
.btn-ink-line:hover { background: var(--accent-ink); color: var(--accent); }

.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: #fff0a3; }

.btn-line { border-color: var(--line); color: var(--text); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); }
.btn-line:hover .btn-note { color: inherit; }

/* Sections */

.section { padding-top: clamp(56px, 9vw, 104px); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-bottom: 24px;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

/* Platform filter */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--accent); }
.chip-count { color: var(--muted); font-weight: 400; }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.chip[aria-pressed="true"] .chip-count { color: var(--accent-ink); }

/* App cards */

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 16px;
}

.app {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  min-width: 0;
}

.app-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(20px, 2.6vw, 26px);
}

/* Screenshot, or a placeholder until there is one */
.app-thumb {
  aspect-ratio: 16 / 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.thumb-shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.app-thumb.is-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background-color: var(--bg);
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 18px 18px;
}
.thumb-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.thumb-letters {
  display: grid;
  place-items: center;
  border-radius: 20px;
  border: 1.5px dashed var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}
.thumb-note {
  color: var(--muted);
  font-size: 0.875rem;
  background: var(--bg);
  padding: 0 8px;
}

.app-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 15px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.03em;
  object-fit: cover;
}
.app-titles { min-width: 0; }
.app-name {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.app-tags {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.app-tags li {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}
.app-tags li.is-soon { color: var(--accent); border-color: rgba(255, 229, 102, 0.4); }

.app-desc { margin: 0; color: var(--muted); }

.app-actions {
  display: grid;
  gap: 14px;
  margin-top: auto;
  justify-items: start;
}
.app-downloads { display: grid; gap: 14px; width: 100%; }
.app-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.app-meta { margin: 0; color: var(--muted); font-size: 0.9375rem; }

.app-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.app-more-label {
  width: 100%;
  color: var(--muted);
  font-size: 0.875rem;
}

.app-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}
.app-link {
  color: var(--muted);
  text-underline-offset: 3px;
}
.app-link:hover { color: var(--accent); }

/* Kite suite */

.kite-mark { width: 64px; height: 64px; color: var(--accent); flex: none; }

.suite {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(18px, 3vw, 32px);
  background: var(--bg);
}
.suite-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  margin-bottom: 24px;
}
.suite-head > div { flex: 1 1 260px; }
.suite-line { margin: 6px 0 0; color: var(--muted); }
.apps-suite .app { background: var(--surface); }
img.app-icon,
.apps-suite img.app-icon {
  background: none;
  border: 0;
  border-radius: 0;
  object-fit: contain;
}
.apps-suite .app-icon {
  background: var(--accent-ink);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.kite-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
  padding: clamp(32px, 7vw, 88px) 0 0;
}
.kite-hero .kite-mark { width: clamp(88px, 14vw, 150px); height: auto; }
.kite-hero > div { flex: 1 1 320px; }
.kite-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.5rem, 12vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
}
.kite-intro {
  margin: 18px 0 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
}

.notfound { padding: clamp(48px, 10vw, 120px) 0 0; }
.notfound .kite-title { font-size: clamp(2.75rem, 8vw, 5rem); }
.notfound .btn { margin-top: 28px; }

/* Install help */

.help {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}
.help-item {
  border-top: 2px solid var(--accent);
  padding-top: 16px;
}
.help-name {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.help-item p { margin: 0; color: var(--muted); }

/* Footer */

.footer {
  margin-top: clamp(64px, 10vw, 120px);
  border-top: 1px solid var(--line);
  padding-top: 28px;
  padding-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  color: var(--muted);
  font-size: 1rem;
}
.footer p { margin: 0; }
.footer a { color: var(--text); text-underline-offset: 3px; }
.footer a:hover { color: var(--accent); }

.noscript {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  color: var(--muted);
}

@media (max-width: 520px) {
  .hero-links .btn { flex: 1 1 auto; }
  .suite-more { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
