/*
 * kite-browser.app: the whole site's styles. No web fonts and no scripts;
 * colors follow the device's light or dark mode.
 */

:root {
  color-scheme: light dark;
  --bg: #fff;
  --surface: #f5f5f7;
  --text: #1d1d1f;
  /* 5.1:1 on the page, 4.7:1 on cards. */
  --text-2: #6e6e73;
  --separator: rgb(60 60 67 / 0.2);
  /* iOS blue, for accents and focus rings. */
  --blue: #007aff;
  /* iOS blue, a shade deeper: #007aff on white is 4.0:1, under WCAG AA for
     text; this is 5.3:1 on the page, 4.8:1 on cards and 4.6:1 on the
     tint. */
  --link: #0068db;
  --tint: #e8f1fe;
  --radius: 22px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --text-2: #98989d;
    --separator: rgb(84 84 88 / 0.65);
    --blue: #0a84ff;
    /* 5.8:1 on the page, 4.7:1 on cards, 4.7:1 on the tint. */
    --link: #0a84ff;
    --tint: #081b33;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p,
li,
dd {
  text-wrap: pretty;
}

.tagline,
.beta-line,
.lede {
  text-wrap: balance;
}

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* An email address never breaks at its hyphen ("support@kite-" /
   "browser.app" reads as a hyphenated word). */
a[href^="mailto:"],
.nowrap {
  white-space: nowrap;
}

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

strong {
  font-weight: 600;
}

code {
  font: 0.9em ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.18);
}

.skip-link:focus {
  top: 12px;
}

/* Layout */

.wrap {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: 20px;
}

.wrap.narrow {
  max-width: 760px;
}

@media (min-width: 600px) {
  .wrap {
    padding-inline: 32px;
  }
}

/* Header */

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  min-height: 64px;
  padding-block: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: -4px;
  padding: 4px 8px 4px 4px;
  border-radius: 12px;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
}

.site-nav ul {
  display: flex;
  gap: 2px;
  margin: 0 -12px 0 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--surface);
}

.site-nav a[aria-current="page"] {
  color: var(--link);
}

/* Home */

.hero {
  padding-block: 8px 16px;
  text-align: center;
}

.hero-kite {
  display: block;
  width: 240px;
  max-width: 72%;
  /* KiteMark leaves room round the kite; take some of it back. */
  margin: -24px auto -12px;
}

/* One short rise as the page opens, then the kite stays still and
   untransformed, so its grain lands 1:1 on the screen's pixels (the
   images are drawn for 2x and 3x). No rotation, and no loop. */
@media (prefers-reduced-motion: no-preference) {
  .hero-kite img {
    animation: settle 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  @keyframes settle {
    from {
      transform: translateY(8px);
    }

    to {
      transform: none;
    }
  }
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 13vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
}

.tagline {
  max-width: 19em;
  margin: 14px auto 0;
  color: var(--text-2);
  font-size: clamp(1.25rem, 5vw, 1.625rem);
  line-height: 1.3;
  letter-spacing: -0.012em;
}

/* A status, not a button: neutral, so it doesn't look tappable. */
.badge {
  display: inline-block;
  margin: 24px 0 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 600;
}

.beta-line {
  max-width: 30em;
  margin: 14px auto 0;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.section {
  padding-block: 40px;
}

.section > h2 {
  margin: 0 0 20px;
  font-size: clamp(1.625rem, 6vw, 2.125rem);
  letter-spacing: -0.025em;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .cards .wide {
    grid-column: 1 / -1;
  }
}

.card {
  padding: 22px 22px 24px;
  border-radius: var(--radius);
  background: var(--surface);
}

@media (min-width: 600px) {
  .card {
    padding: 28px 28px 30px;
  }
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1.1875rem;
  font-weight: 700;
}

.card p {
  /* A comfortable line on the full-width card too: about 75 characters. */
  max-width: 56ch;
  margin: 0;
  color: var(--text-2);
}

.card p + p {
  margin-top: 10px;
}

/* Sentence case, like every other label on the site. */
.card .kicker {
  margin: 0 0 4px;
  color: var(--link);
  font-size: 0.875rem;
  font-weight: 600;
}

/* The home page's closing links, after the cards. */
.closing {
  padding-block: 0 8px;
}

.closing .links {
  margin-top: 0;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: var(--tint);
}

/* Policy and support pages */

.page-head {
  padding-block: 24px 8px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(2.25rem, 9vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.page-head .meta {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.page-head .lede {
  margin: 20px 0 0;
  font-size: 1.1875rem;
  line-height: 1.5;
}

.doc h2 {
  margin: 48px 0 10px;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  scroll-margin-top: 20px;
}

.doc h3 {
  margin: 28px 0 6px;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  scroll-margin-top: 20px;
}

.doc h2 + h3 {
  margin-top: 16px;
}

.doc p {
  margin: 0 0 12px;
}

.doc ul,
.doc ol {
  margin: 0 0 12px;
  padding-left: 1.3em;
}

.doc li {
  margin: 6px 0;
}

.doc li::marker {
  color: var(--text-2);
}

.panel {
  margin: 28px 0 0;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--surface);
}

@media (min-width: 600px) {
  .panel {
    padding: 24px 28px;
  }
}

.panel > h2 {
  margin: 0 0 10px;
  font-size: 1.1875rem;
}

.panel > :last-child {
  margin-bottom: 0;
}

.toc ol {
  margin: 0;
  padding-left: 1.4em;
}

@media (min-width: 600px) {
  .toc ol {
    columns: 2;
    column-gap: 40px;
  }
}

.toc li {
  margin: 0 0 6px;
  break-inside: avoid;
}

.facts {
  margin: 0 0 12px;
}

.facts dt {
  margin-top: 16px;
  font-weight: 600;
}

.facts dd {
  margin: 2px 0 0;
}

.note {
  color: var(--text-2);
  font-size: 0.9375rem;
}

.contact-card {
  margin: 28px 0 0;
}

.contact-card h2 {
  margin-top: 0;
}

/* Smaller on the narrowest screens, so the address never breaks at its
   hyphen (it needs about 323 px at full size). */
.address {
  font-size: clamp(1.0625rem, 5.6vw, 1.1875rem);
  font-weight: 600;
}

.not-found {
  padding-block: 48px 24px;
  text-align: center;
}

.not-found img {
  width: 160px;
  height: 160px;
  margin: -16px auto -8px;
}

.not-found h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 2.75rem);
  letter-spacing: -0.03em;
}

.not-found p {
  margin: 12px auto 0;
  max-width: 26em;
  color: var(--text-2);
}

.not-found .links {
  justify-content: center;
}

/* Footer */

.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--separator);
  color: var(--text-2);
  font-size: 0.875rem;
}

/* Each link is about 44 px tall to tap; the line and the rows carry the
   same padding, so the spacing looks as it did. */
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  padding-block: 13px 29px;
}

.site-footer p {
  margin: 0;
  padding-block: 11px;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-block;
  padding-block: 11px;
  color: var(--text-2);
}

.site-footer a:hover {
  color: var(--text);
}

@media print {
  .site-header nav,
  .skip-link,
  .hero-kite {
    display: none;
  }

  a {
    color: inherit;
  }
}
