/* darefly.app. Colour values mirror darefly-app/src/config/tokens.ts. */

:root {
  color-scheme: light dark;
  --bg: #faf7f2; /* pageCream */
  --panel: #f6f0e0; /* cream */
  --text: #18213d; /* navy */
  --heading: #1b2a4e; /* navyTitle */
  --muted: #5b6780; /* navyMuted */
  --link: #1a33a8; /* icon tile, top */
  --line: #e4dcc8;
  --field-bg: #ffffff;
  --field-border: #5b6780;
  --focus: #0a72b8; /* icon tile, bottom */
  --accent-from: #1a33a8;
  --accent-to: #0a72b8;
  --on-accent: #ffffff;
  --danger: #a4231b;
  --on-danger: #ffffff;
  --radius: 12px;
  --radius-lg: 20px;
  --font: -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18213d;
    --panel: #222c4f;
    --text: #f6f0e0;
    --heading: #faf7f2;
    --muted: #b7bfd3;
    --link: #a9c2ff;
    --line: #34406a;
    --field-bg: #1d2747;
    --field-border: #7d88a6;
    --focus: #a9c2ff;
    --danger: #ffb4ab;
    --on-danger: #18213d;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
  padding-block: 1.5rem 4rem;
}

main:focus {
  outline: none;
}

.wrap {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 40rem) {
  .wrap {
    padding-inline: 1.5rem;
  }
}

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

/* ---- Type ---- */

h1,
h2,
h3 {
  color: var(--heading);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.75rem;
  scroll-margin-top: 1.5rem;
}

h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem);
  letter-spacing: -0.02em;
  margin-top: 1rem;
}

h2 {
  font-size: 1.375rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.5rem;
}

li + li {
  margin-top: 0.5rem;
}

strong {
  font-weight: 650;
}

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

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

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

.muted {
  color: var(--muted);
}

/* ---- Skip link ---- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--heading);
  color: var(--bg);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ---- Header ---- */

.site-header {
  padding-block: 1.25rem 0.5rem;
}

.brand {
  display: inline-block;
  line-height: 0;
  border-radius: 6px;
}

.brand img {
  display: block;
  width: auto;
  height: 2.125rem;
}

@media (min-width: 40rem) {
  .brand img {
    height: 2.5rem;
  }
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 1.5rem 2rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Phones: a two-column list, © beneath. Wider: one dotted line. */
.footer-links {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 0 1.75rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.footer-links li {
  margin: 0;
}

@media (min-width: 48rem) {
  .footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
  }

  .footer-inner nav {
    display: flex;
    align-items: baseline;
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
  }

  .footer-links li + li::before,
  .footer-inner nav::after {
    content: "·";
    content: "·" / "";
    padding-inline: 0.5rem;
    color: var(--muted);
  }
}

.site-footer a {
  color: var(--muted);
  display: inline-block;
  padding-block: 0.375rem;
}

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

.copyright {
  margin: 0;
  padding-block: 0.375rem;
}

/* ---- Landing ---- */

.hero {
  display: flex;
  align-items: center;
  padding-block: 2rem 4rem;
}

.hero-inner {
  text-align: center;
}

.hero-icon {
  width: 6rem;
  height: 6rem;
  border-radius: 22%;
  display: block;
  margin: 0 auto 1.75rem;
  box-shadow: 0 10px 30px rgb(10 30 90 / 0.18);
}

.hero h1 {
  font-size: clamp(2.5rem, 1.25rem + 5.5vw, 4.75rem);
  text-wrap: balance;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0 0 1rem;
}

.lede {
  font-size: clamp(1.1875rem, 1rem + 0.8vw, 1.5rem);
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.launch {
  display: inline-block;
  margin: 0;
  padding: 0.5rem 1.125rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  color: var(--on-accent);
  font-weight: 600;
}

.badges {
  margin-top: 2.25rem;
}

.badges[hidden] {
  display: none;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem 1.25rem;
}

.badge-row a {
  display: inline-block;
  line-height: 0;
  border-radius: 8px;
}

.badge-row a[hidden] {
  display: none;
}

.badge-apple {
  height: 48px;
  width: auto;
}

/* Google's file carries its own clear space (41 of 250 px each side);
   at 72px tall the visible badge is 48px, matching Apple's. */
.badge-google {
  height: 72px;
  width: auto;
  margin: -12px;
}

.trademarks {
  margin: 1.25rem auto 0;
  max-width: 34rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.trademarks span[hidden] {
  display: none;
}

/* ---- Legal pages ---- */

.effective {
  color: var(--muted);
}

.toc {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 1rem;
  margin: 1.75rem 0 0.5rem;
}

.toc h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
  columns: 2 15rem;
  column-gap: 2rem;
}

.toc li {
  margin: 0 0 0.375rem;
  break-inside: avoid;
}

.legal ol > li::marker {
  font-weight: 650;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 40rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--line);
}

tr:last-child > th,
tr:last-child > td {
  border-bottom: 0;
}

thead th {
  background: var(--panel);
  color: var(--heading);
  font-weight: 650;
}

tbody th {
  font-weight: 650;
  color: var(--heading);
  width: 22%;
}

/* ---- Support ---- */

.faq {
  margin: 1.75rem 0 2rem;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0.25rem;
  font-weight: 650;
  color: var(--heading);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  content: "+" / "";
  flex: none;
  font-size: 1.375rem;
  line-height: 1;
  color: var(--muted);
}

.faq details[open] > summary::after {
  content: "–";
  content: "–" / "";
}

.faq details > p {
  margin: 0 0.25rem 1.25rem;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

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

/* ---- Forms and buttons ---- */

.form {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.75rem 0;
}

/* Shown from the first paint (no layout shift); without JavaScript the
   page shows the email fallback in its place. */
@media (scripting: none) {
  .js-only {
    display: none;
  }
}

label {
  display: block;
  font-weight: 650;
  color: var(--heading);
  margin-bottom: 0.5rem;
}

input[type="email"] {
  display: block;
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--field-bg);
  border: 1.5px solid var(--field-border);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  margin-bottom: 1rem;
}

input[type="email"]:focus-visible {
  outline-offset: 1px;
}

.button {
  display: inline-block;
  font: inherit;
  font-weight: 650;
  border: 0;
  border-radius: 999px;
  padding: 0.8125rem 1.5rem;
  min-height: 3rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  color: var(--on-accent);
}

.button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.button-danger {
  background: var(--danger);
  color: var(--on-danger);
}

.status p {
  margin: 1rem 0 0;
  font-weight: 600;
}

.status p[hidden] {
  display: none;
}

.notice {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}

[data-state][hidden] {
  display: none;
}

/* ---- 404 ---- */

.notfound {
  display: flex;
  align-items: center;
}

/* ---- Motion: only when the reader hasn't asked for less ---- */

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

  a,
  .button {
    transition: color 150ms ease, text-decoration-thickness 150ms ease, filter 150ms ease;
  }

  .button:hover:not(:disabled) {
    filter: brightness(1.08);
  }
}
