/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */

/* IBM Plex Sans, IBM's own Latin-1 web subset (SIL OFL 1.1, see OFL.txt). */
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/IBMPlexSans-Bold-Latin1.woff2") format("woff2");
}

/* The app's palette (CitusPalette in app/lib/src/ui/citusmail_theme.dart). */
:root {
  --lagoon: #0F7A69;
  --lagoon-light: #5DCAB4;
  --citrus: #F4B740;
  --spruce: #15332E;

  --bg: #F3F6F5;
  --surface: #FFFFFF;
  --band: #E6EFEC;
  --ink: #17201E;
  --muted: #4A5B57;
  --line: #D3DEDA;
  --link: #0B6B5C;
  --button-ink: #FFFFFF;
  --button-bg: var(--lagoon);
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 8px 24px rgb(0 0 0 / 8%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1A18;
    --surface: #15332E;
    --band: #12251F;
    --ink: #E4ECEA;
    --muted: #A7B8B4;
    --line: #2A4540;
    --link: #5DCAB4;
    --button-ink: #0E1A18;
    --button-bg: #5DCAB4;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 35%);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; margin: 0 0 0.5em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 700; margin: 0 0 0.75em; }
h3 { font-size: 1.2rem; font-weight: 600; margin: 0 0 0.4em; }

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

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--surface); padding: 8px 12px; z-index: 10;
}
.skip:focus { left: 8px; }

/* Header and footer */
.top { border-bottom: 1px solid var(--line); background: var(--bg); }
.top-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.2rem;
}
.top nav { display: flex; gap: 20px; flex-wrap: wrap; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
.top nav a:hover { color: var(--link); }

.bottom { border-top: 1px solid var(--line); margin-top: 64px; padding: 28px 0; }
.footer-row {
  display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap;
  color: var(--muted); font-size: 0.95rem;
}
.footer-row p { margin: 0; max-width: 420px; }
.footer-row nav { display: flex; gap: 8px 20px; flex-wrap: wrap; }

/* Shared pieces */
section { padding: 56px 0; }
.band { background: var(--band); }
.small { color: var(--muted); font-size: 0.95rem; }
.caption { color: var(--muted); text-align: center; margin-top: 16px; }

.button {
  display: inline-block; padding: 12px 22px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-weight: 600; text-decoration: none;
}
.button.primary { background: var(--button-bg); color: var(--button-ink); border-color: transparent; }
.button:hover { filter: brightness(1.05); text-decoration: none; }

.shot {
  border-radius: 14px; box-shadow: var(--shadow);
  border: 1px solid var(--line); background: var(--surface);
}

/* Hero */
.hero { padding: 64px 0 56px; }
.hero-grid {
  display: grid; gap: 40px; align-items: center;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}
.eyebrow { color: var(--link); font-weight: 600; margin: 0 0 8px; }
.lead { font-size: 1.2rem; color: var(--muted); margin: 0 0 24px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.hero-shots { position: relative; margin: 0; padding-bottom: 40px; }
.hero-shots .desktop { width: 100%; }
.hero-shots .phone {
  position: absolute; right: -8px; bottom: 0; width: 26%;
  border-radius: 18px;
}

/* What sets it apart */
.feature-split {
  display: grid; gap: 40px; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.ticks { padding-left: 1.2em; }
.ticks li { margin: 6px 0; }
.ticks li::marker { color: var(--lagoon-light); }
.shots-pair { display: flex; gap: 16px; justify-content: center; }
.shots-pair .shot { width: 46%; max-width: 260px; }

.cards {
  display: grid; gap: 20px; margin-top: 48px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px;
}
.card p { margin: 0; color: var(--muted); }

.phishing { padding-top: 48px; padding-bottom: 8px; }
.phishing .shot { display: block; margin: 0 auto; width: 100%; max-width: 980px; }

/* Features */
.feature-list {
  list-style: none; padding: 0; margin: 0 0 40px;
  display: grid; gap: 14px 32px; grid-template-columns: repeat(2, minmax(0, 1fr));
}
.feature-list li { border-left: 3px solid var(--lagoon-light); padding: 4px 0 4px 14px; }
.phones { display: flex; gap: 20px; justify-content: center; }
.phones .shot { width: 30%; max-width: 280px; }

/* Download */
.downloads {
  display: grid; gap: 16px; margin: 20px 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.download {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; color: var(--ink); text-decoration: none;
}
.download:hover { border-color: var(--lagoon-light); }
.download span { color: var(--muted); font-size: 0.95rem; }

.privacy p { max-width: 760px; }

/* Policy pages */
.doc { max-width: 780px; margin: 0 auto; padding: 48px 20px 0; }
.doc h2 { font-size: 1.45rem; margin-top: 1.8em; }
.doc h3 { margin-top: 1.4em; }
.doc table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  font-size: 0.95rem; display: block; overflow-x: auto;
}
.doc th, .doc td {
  border: 1px solid var(--line); padding: 8px 10px;
  text-align: left; vertical-align: top;
}
.doc th { background: var(--band); }
.narrow { max-width: 680px; margin: 0 auto; padding: 64px 20px; }

/* Smaller screens */
@media (max-width: 860px) {
  .hero-grid, .feature-split { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .feature-list { grid-template-columns: minmax(0, 1fr); }
  .downloads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  section { padding: 40px 0; }
  .hero { padding-top: 40px; }
  .top nav { gap: 14px; }
  .downloads { grid-template-columns: minmax(0, 1fr); }
  .phones .shot { width: 31%; }
  .hero-shots .phone { width: 30%; right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
