/*
 * talelight.app: the app's own colours, so a page opened inside the app
 * reads as part of it. Night is the app's own look; Dawn follows a light
 * system setting.
 */

:root {
  color-scheme: light dark;

  --background: #F7F5FD;
  --surface: #FFFFFF;
  --surface-raised: #EEEBF8;
  --separator: #DDD9EC;
  --content-primary: #1A1838;
  --content-secondary: #5B5880;
  --content-tertiary: #8E8BAE;
  --accent: #D98E1F;
  --accent-muted: #FFF1D9;
  --accent-content: #FFFFFF;
  --lavender: #6B55D6;
  --glow: rgba(217, 142, 31, 0.18);

  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0E1030;
    --surface: #171A42;
    --surface-raised: #22265A;
    --separator: #2E3270;
    --content-primary: #F6F2FF;
    --content-secondary: #B8B4D6;
    --content-tertiary: #7E7BA3;
    --accent: #FFC46B;
    --accent-muted: #3A2E52;
    --accent-content: #1A1030;
    --lavender: #B9A7FF;
    --glow: rgba(255, 196, 107, 0.22);
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--background);
  /* Lumi's glow, from the top. */
  background-image: radial-gradient(640px 360px at 50% -140px, var(--glow), transparent 72%);
  background-repeat: no-repeat;
  color: var(--content-primary);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--lavender);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
}

/* MARK: - Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(20px, env(safe-area-inset-top)) 0 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--content-primary);
  font-weight: 600;
  font-size: 17px;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--separator);
}

/* MARK: - Home */

.hero {
  padding: 44px 0 8px;
  text-align: center;
}

.hero .icon {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  box-shadow: 0 0 0 1px var(--separator), 0 18px 60px var(--glow);
}

.hero h1 {
  margin: 24px 0 0;
  font-family: var(--display);
  font-size: clamp(36px, 9vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  font-weight: 600;
  text-wrap: balance;
}

.hero p {
  max-width: 480px;
  margin: 12px auto 0;
  color: var(--content-secondary);
  font-size: 19px;
  text-wrap: pretty;
}

.hero .proof {
  margin-top: 6px;
  color: var(--content-primary);
  font-size: 17px;
  font-weight: 600;
}

/* Apple's badge, as Apple gives it: never redrawn, at least 40 px tall. */
.badge {
  display: inline-block;
  margin-top: 16px;
  padding: 13px;
}

.badge img {
  display: block;
  width: 150px;
  height: 50px;
}

.lumi {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
  margin: 40px 0 0;
  padding: 22px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--separator);
}

.lumi svg {
  width: 96px;
  height: 96px;
}

.lumi h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
}

.lumi p {
  margin: 6px 0 0;
  color: var(--content-secondary);
}

@media (max-width: 460px) {
  .lumi {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.features li {
  padding: 18px 20px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--separator);
}

.features svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
}

.features h2 {
  margin: 10px 0 0;
  font-size: 17px;
  font-weight: 600;
}

.features p {
  margin: 4px 0 0;
  color: var(--content-secondary);
  font-size: 15px;
  line-height: 1.45;
}

.privacy {
  margin: 44px 0 0;
  padding: 24px;
  border-radius: 24px;
  background: var(--accent-muted);
  text-align: center;
}

.privacy h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.2;
}

.privacy p {
  max-width: 520px;
  margin: 8px auto 0;
  color: var(--content-secondary);
  text-wrap: pretty;
}

.button {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-content);
  font-weight: 600;
}

.button:hover {
  text-decoration: none;
  filter: brightness(1.06);
}

/* MARK: - Documents */

.document {
  padding: 28px 0 8px;
}

.document h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(28px, 8vw, 36px);
  overflow-wrap: break-word;
  line-height: 1.15;
  font-weight: 600;
  text-wrap: balance;
}

.updated {
  margin: 8px 0 0;
  color: var(--content-tertiary);
  font-size: 15px;
}

.lead {
  margin: 24px 0 0;
  color: var(--content-secondary);
  font-size: 18px;
  text-wrap: pretty;
}

.summary {
  margin: 28px 0 8px;
  padding: 20px 22px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--separator);
}

.summary-title {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.document .summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.document .summary li {
  position: relative;
  margin: 8px 0 0;
  padding-left: 26px;
}

.document .summary li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.document h2 {
  margin: 40px 0 8px;
  font-family: var(--display);
  font-size: 23px;
  line-height: 1.3;
  font-weight: 600;
  scroll-margin-top: 16px;
}

.document h2 .number {
  display: inline-block;
  min-width: 1.5em;
  color: var(--content-tertiary);
  font-family: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.document p {
  margin: 10px 0 0;
  text-wrap: pretty;
}

.document ul {
  margin: 10px 0 0;
  padding-left: 1.3em;
}

.document li {
  margin: 6px 0 0;
}

.document li::marker {
  color: var(--accent);
}

.document strong {
  font-weight: 600;
}

.table {
  margin: 14px 0 0;
  overflow-x: auto;
  border: 1px solid var(--separator);
  border-radius: 14px;
}

.table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.4;
}

.table th,
.table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.table th {
  background: var(--surface-raised);
  color: var(--content-secondary);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.table tr + tr td {
  border-top: 1px solid var(--separator);
}

.contact-card {
  margin: 14px 0 0;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--separator);
}

.contact-card p {
  margin: 2px 0 0;
}

/* MARK: - Footer */

.site-footer {
  margin-top: 56px;
  padding: 20px 0 max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--separator);
  color: var(--content-tertiary);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 10px;
}

.site-footer nav a {
  color: var(--content-secondary);
}

@media (prefers-reduced-motion: no-preference) {
  .lumi svg .spark {
    animation: twinkle 2.6s ease-in-out infinite;
  }

  .lumi svg .spark:nth-child(2) { animation-delay: 0.8s; }
  .lumi svg .spark:nth-child(3) { animation-delay: 1.6s; }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
