/* Colours from the Kitedrake logo sketches: cream paper, a kite-red dragon, gold and indigo ribbons. */
:root {
  --bg: #f6f0e4;
  --surface: #fcf8f0;
  --surface-2: #ece4d3;
  --ink: #22201d;
  --muted: #5f5a52;
  --line: #e0d6c3;
  --line-strong: #cbbfa8;
  --kite: #c8432b;
  --panel: #f3e2c3;
  --spar: #5a3b1c;
  --ribbon: #353f7a;
  --gold: #d1a03a;
  --string: #8a8172;
  --accent: #b23a24;
  --accent-bg: #b8402a;
  --accent-bg-hover: #9e3522;
  --link: #2f3f86;
  --shadow: rgba(40, 30, 20, 0.22);
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141519;
    --surface: #1c1e24;
    --surface-2: #262932;
    --ink: #efe9dd;
    --muted: #aaa59b;
    --line: #2d3039;
    --line-strong: #3d414c;
    --kite: #e0573c;
    --panel: #f0d9b5;
    --spar: #f0d9b5;
    --ribbon: #9aa6e8;
    --gold: #e2b552;
    --string: #8d8a84;
    --accent: #f08a70;
    --accent-bg: #c2452d;
    --accent-bg-hover: #d3523a;
    --link: #a9b6ff;
    --shadow: rgba(0, 0, 0, 0.55);
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 5.2vw, 3.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1em; }

a { color: var(--link); text-underline-offset: 3px; }

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

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

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

/* Header and footer */

.site-header { border-bottom: 1px solid var(--line); }

.header-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 72px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand svg { width: auto; height: 42px; }

.site-nav { display: flex; gap: 22px; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { text-decoration: underline; }

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  padding-top: 28px;
  padding-bottom: 40px;
}
.footer-row p { margin: 0; }
.footer-row a { color: var(--muted); }

/* Shared pieces */

.lede {
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1.5;
  max-width: 38ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.button:hover { border-color: var(--ink); }
.button.primary {
  border-color: transparent;
  background: var(--accent-bg);
  color: #fff;
}
.button.primary:hover { background: var(--accent-bg-hover); }
.button.quiet { border-color: transparent; background: transparent; color: var(--link); }
.button.quiet:hover { text-decoration: underline; }
.button.is-disabled,
.button.is-disabled:hover {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
  cursor: default;
}

.section { margin-top: 80px; }

/* Home */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 32px;
  padding-top: 48px;
}

.hero-art { position: relative; }
.hero-art svg { width: 100%; max-height: 420px; margin: 0 auto; }
.hero-art::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -6px;
  height: 18px;
  background: radial-gradient(closest-side, var(--shadow), transparent);
  opacity: 0.45;
}

.kite { fill: var(--kite); }
.panel { fill: var(--panel); }
.spar { stroke: var(--spar); }
.tail { stroke: var(--ribbon); }
.bow { fill: var(--gold); }
.string { stroke: var(--string); }

/* The kite drifts a little, unless motion is reduced. */
@media (prefers-reduced-motion: no-preference) {
  .hero-art svg { animation: drift 7s ease-in-out infinite; transform-origin: 60% 20%; }
}
@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(-1.5deg); }
}

.app-grid,
.promise-grid,
.other-apps,
.notes ul,
.points {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Two by two on wide screens, so four apps never leave one card alone on a row. */
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 700px) {
  .app-grid { grid-template-columns: minmax(0, 1fr); }
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.app-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 18px 40px -22px var(--shadow);
  transform: translateY(-2px);
}
.app-card:focus-within { outline: 3px solid var(--link); outline-offset: 3px; }
.app-card .app-icon { width: 88px; margin: -4px 0 12px -6px; }
.app-card h3 { font-size: 1.6rem; margin-bottom: 0.3em; }
.app-card p { color: var(--muted); }

.card-link { color: var(--ink); text-decoration: none; }
.card-link:focus-visible { outline: none; }
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.points li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 4px;
  font-size: 0.97rem;
}
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--kite);
}

.more {
  margin-top: auto;
  padding-top: 18px;
  color: var(--link);
  font-weight: 600;
}

.promise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px 32px;
}
.promise-grid li { padding-top: 18px; border-top: 2px solid var(--kite); }
.promise-grid h3,
.feature h3 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0;
  margin-bottom: 6px;
}
.promise-grid p,
.feature p { color: var(--muted); margin: 0; }

/* App pages */

.back { margin: 28px 0 0; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--ink); text-decoration: underline; }

.app-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 32px;
  margin-top: 28px;
}
.app-hero .app-icon { width: 148px; }
.app-hero h1 { margin-bottom: 0.2em; }
.app-hero .lede { max-width: 46ch; }
.meta { margin: 16px 0 0; color: var(--muted); font-size: 0.95rem; }

.summary {
  max-width: 62ch;
  margin: 48px 0 36px;
  font-size: 1.18rem;
}

.shot img {
  width: 100%;
  filter: drop-shadow(0 20px 28px var(--shadow)) drop-shadow(0 1px 2px var(--shadow));
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 30px 40px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.gallery.single { grid-template-columns: minmax(0, 760px); }

.notes li {
  margin-bottom: 10px;
  padding: 14px 18px;
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  background: var(--surface);
  max-width: 78ch;
}

.other-apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.other-apps a {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
}
.other-apps a:hover { border-color: var(--line-strong); }
.other-apps strong { display: block; color: var(--ink); }
.mini-icon { flex: none; width: 48px; }

/* About and other text pages */

.prose { max-width: 68ch; padding-top: 40px; }
.prose h2 { margin-top: 48px; }
.prose h3 {
  margin-top: 24px;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0;
}
.prose .lede { max-width: none; }

/* Small screens */

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .hero-art { max-width: 340px; width: 100%; margin: 8px auto 0; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .site-nav { gap: 16px; }
  .brand span { font-size: 1.15rem; }
  .app-hero { grid-template-columns: 1fr; gap: 16px; }
  .app-hero .app-icon { width: 104px; margin-left: -8px; }
  .section { margin-top: 60px; }
  .lede { font-size: 1.12rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .app-card:hover { transform: none; }
}

/* What's new */

.release { max-width: 78ch; margin-bottom: 24px; }
.release h3 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0;
  margin-bottom: 6px;
}
.release h3 span { margin-left: 8px; color: var(--muted); font-weight: 400; }
.release ul { margin: 0; padding-left: 1.2em; color: var(--muted); }
