/*
 * Cloudlarm website. System fonts, inline SVG icons and no scripts, so pages load in
 * one round trip and the Content-Security-Policy in _headers can stay strict.
 */

:root {
  color-scheme: light dark;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-alt: #eef3f9;
  --text: #15202b;
  --muted: #4d5b6a;
  --border: #dde3ea;
  --brand: #1e5aa8;
  --brand-hover: #174a8c;
  --brand-soft: #e3ecf8;
  --on-brand: #ffffff;
  --tag-text: #7a4f00;
  --tag-bg: #fdf0d2;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 10px 30px rgb(16 24 40 / 8%);
  --radius: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d141c;
    --surface: #15202b;
    --surface-alt: #111b25;
    --text: #e7edf4;
    --muted: #a3b1bf;
    --border: #253444;
    --brand: #8ab8f2;
    --brand-hover: #b0d0f7;
    --brand-soft: #1b2d44;
    --on-brand: #0d141c;
    --tag-text: #f5cf75;
    --tag-bg: #3b2f12;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 30px rgb(0 0 0 / 35%);
  }
}

*,
*::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-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Noto Sans",
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  text-wrap: balance;
}

/*
 * Korean breaks lines at the spaces between words and Japanese headings between phrases,
 * where browsers support it, rather than inside a word.
 */
:lang(ko) {
  word-break: keep-all;
}

:lang(ja) :is(h1, h2, h3, h4) {
  word-break: auto-phrase;
}

p {
  margin: 0;
}

a {
  color: var(--brand);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--brand-hover);
}

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

svg {
  display: block;
  flex: none;
}

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

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

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

/* Header */

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

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

/* The app's icon, from the favicon, in both themes. */
.brand-mark {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
}

.lang-menu {
  position: relative;
}

.lang-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.95rem;
  list-style: none;
  cursor: pointer;
}

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

.lang-menu summary svg {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--muted);
}

/*
 * The app's 19 languages in two columns, read down the first one, no wider than a phone's
 * screen less the page's margins.
 */
.lang-list {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 5;
  width: max-content;
  min-width: 10rem;
  max-width: calc(100vw - 2rem);
  margin: 0;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  list-style: none;
  columns: 2;
  column-gap: 0.25rem;
}

.lang-list li {
  break-inside: avoid;
}

.lang-list a {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--text);
  text-decoration: none;
}

.lang-list a:hover {
  background: var(--brand-soft);
}

.lang-list a[aria-current="page"] {
  color: var(--brand);
  font-weight: 600;
}

/* Home page */

.hero {
  padding-block: 3rem 3.5rem;
  background:
    radial-gradient(
      60rem 30rem at 85% -10%,
      var(--brand-soft),
      transparent 70%
    ),
    var(--bg);
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 56rem) {
  .hero {
    padding-block: 5rem 5.5rem;
  }

  .hero-grid {
    grid-template-columns: 1.15fr 1fr;
    gap: 3.5rem;
  }
}

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.3rem, 1.6rem + 3.4vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.lead {
  max-width: 36em;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 1.2rem;
}

/*
 * The link to Cloudlarm's page in Google Play, a button in the site's own style. Google's
 * badge would need its artwork, which the site does not use.
 */
.store {
  margin-top: 2rem;
}

.notifications {
  display: grid;
  gap: 0.85rem;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.notification {
  padding: 0.9rem 1.1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

@media (min-width: 56rem) {
  .notification:nth-child(2) {
    margin-left: 1.5rem;
  }

  .notification:nth-child(3) {
    margin-left: 0.75rem;
  }
}

.notification-app {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.notification-app svg {
  width: 1rem;
  height: 1rem;
  color: var(--brand);
}

.notification-title {
  margin-top: 0.35rem;
  font-weight: 650;
}

.notification-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.section {
  padding-block: 3.5rem;
}

@media (min-width: 56rem) {
  .section {
    padding-block: 4.5rem;
  }
}

.section-alt {
  background: var(--surface-alt);
}

.section h2 {
  font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.3rem);
  letter-spacing: -0.02em;
}

.section-intro {
  max-width: 40em;
  margin-top: 0.75rem;
  color: var(--muted);
}

.group-heading {
  margin: 2.5rem 0 1rem;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.alarm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.alarm-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  hyphens: auto;
}

.alarm-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.8rem;
  background: var(--brand-soft);
  color: var(--brand);
}

.alarm-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.alarm-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.5rem;
  font-size: 1.05rem;
}

.alarm-card p {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.tag {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.steps {
  display: grid;
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 48rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  counter-increment: step;
}

.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
}

.step h3 {
  font-size: 1.15rem;
}

.step p {
  margin-top: 0.5rem;
  color: var(--muted);
}

.section-note {
  max-width: 40em;
  margin-top: 1.5rem;
  color: var(--muted);
}

.privacy-panel {
  padding: 2rem 1.5rem;
  border-radius: 1.5rem;
  background: var(--brand-soft);
}

@media (min-width: 48rem) {
  .privacy-panel {
    padding: 2.5rem 3rem;
  }
}

.checks {
  display: grid;
  gap: 0.7rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.checks svg {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.15rem;
  color: var(--brand);
}

.arrow-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-weight: 600;
}

.arrow-link::after {
  content: " →";
}

.plans {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 48rem) {
  .plans {
    grid-template-columns: 1fr 1fr;
  }
}

.plan {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.plan-premium {
  border: 2px solid var(--brand);
}

.plan h3 {
  font-size: 1.35rem;
}

.plan-note {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Privacy policy, security page and 404 page */

.page {
  padding-block: 2.5rem 4rem;
}

.policy {
  max-width: 46rem;
  hyphens: auto;
}

.policy h1,
.not-found h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  letter-spacing: -0.02em;
}

.policy-updated {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Atop the policy's translations: the English policy is binding. */
.policy-translation {
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  font-size: 0.95rem;
}

.policy section,
.toc {
  margin-top: 2.5rem;
  scroll-margin-top: 1rem;
}

.policy h2 {
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.policy section p,
.policy section ul {
  margin: 0.8rem 0 0;
}

.policy ul,
.toc ol {
  padding-left: 1.25rem;
}

.policy li + li {
  margin-top: 0.4rem;
}

.policy .summary {
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius);
  background: var(--brand-soft);
}

/* Set apart from the sections around it, as the GDPR wants for the right to object. */
.policy .notice {
  padding: 1.25rem 1.5rem 1.5rem;
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface);
}

.policy address {
  margin-top: 0.8rem;
  font-style: normal;
}

/* The security page: one block of text without sections. */
.security > p,
.security > ul {
  margin: 0.8rem 0 0;
}

.security > h1 + p {
  margin-top: 1.25rem;
}

.toc {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.policy .toc h2 {
  font-size: 1.05rem;
}

.toc ol {
  margin: 0.75rem 0 0;
  columns: 2 14rem;
  column-gap: 2.5rem;
}

.toc li {
  margin-block: 0.15rem;
  break-inside: avoid;
}

.not-found {
  max-width: 40rem;
  padding-block: 2rem;
}

.not-found p {
  margin-top: 1rem;
  color: var(--muted);
}

.button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
}

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

/* Footer */

.site-footer {
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  gap: 0.75rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: inherit;
}

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

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

@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .toc {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  a {
    color: inherit;
  }
}
