/* MailCraft's site. The app's own colours (crates/ui-egui/src/look/theme.rs), system fonts,
   no frameworks: one stylesheet, light and dark. */

:root {
  --accent: #0e7c86;
  --accent-strong: #0b6670;
  --accent-soft: #d2ebee;
  --on-accent: #ffffff;
  --bg: #ffffff;
  --bg-alt: #f3f4f6;
  --surface: #ffffff;
  --border: #e1e4e8;
  --text: #1f2328;
  --dim: #5b636e;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 12px 40px rgb(16 24 40 / 12%);
  --radius: 14px;
  --wrap: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #3fb6c1;
    --accent-strong: #66c9d2;
    --accent-soft: #123b40;
    --on-accent: #0b1416;
    --bg: #17181b;
    --bg-alt: #1c1e21;
    --surface: #222428;
    --border: #34373c;
    --text: #e8eaed;
    --dim: #a3aab3;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 40px rgb(0 0 0 / 45%);
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
code {
  font: 0.88em ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.05em 0.35em;
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

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

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.top-row { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.top nav { display: flex; align-items: center; gap: 22px; }
.top nav a { color: var(--dim); text-decoration: none; font-size: 0.95rem; }
.top nav a:hover { color: var(--text); }
.top nav a.btn { color: var(--on-accent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-small { min-height: 38px; padding: 0 16px; background: var(--accent); }
.btn-small:hover { background: var(--accent-strong); }

/* Hero */
.hero { padding: 72px 0 24px; background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 70%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 760px); justify-content: center; text-align: center; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.82rem; }
h1 { margin: 0; font-size: clamp(2.3rem, 5.6vw, 3.9rem); line-height: 1.08; letter-spacing: -0.025em; }
.lead { margin: 20px auto 0; max-width: 640px; color: var(--dim); font-size: 1.15rem; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.fine { color: var(--dim); font-size: 0.9rem; margin: 14px 0 0; }
h1 .accent { color: var(--accent); }
.trust {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  color: var(--dim);
  font: 600 0.74rem/1.4 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.trust a { color: inherit; text-decoration: none; }
.trust a:hover { color: var(--accent); }
.shot-wrap { margin-top: 48px; }
.shot { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface); }
.shot-main { width: 100%; }

/* Providers */
.providers { padding: 36px 0 8px; text-align: center; }
.providers .kicker { margin: 0 0 14px; color: var(--dim); font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.providers ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.providers li { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 0.95rem; }

/* Sections */
.section { padding: 80px 0; }
section[id], details[id] { scroll-margin-top: 80px; }
h2 { margin: 0; font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.15; letter-spacing: -0.02em; }
.section-lead { margin: 12px 0 0; color: var(--dim); font-size: 1.1rem; max-width: 680px; }
h3 { margin: 0 0 8px; font-size: 1.1rem; }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 36px; }
.features article { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.features p { margin: 0; color: var(--dim); }

.gallery { padding-top: 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
figure { margin: 0; }
figcaption { margin-top: 12px; color: var(--dim); font-size: 0.95rem; }
figcaption strong { color: var(--text); }

.privacy { background: var(--bg-alt); border-block: 1px solid var(--border); }
.checks { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
.checks li { position: relative; padding-left: 34px; color: var(--dim); }
.checks li strong { color: var(--text); }
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* Download */
.platforms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.platform { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.platform.is-yours { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.platform .req { margin: 0 0 12px; color: var(--dim); font-size: 0.9rem; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.links li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.links a { font-size: 0.95rem; overflow-wrap: anywhere; }
.links .size { color: var(--dim); font-size: 0.82rem; white-space: nowrap; }

.first-run { margin-top: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 4px 22px; }
.first-run ul { padding-left: 20px; }

details summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style-position: outside; }
details p, details li { color: var(--dim); }

/* Feedback */
.feedback { padding-top: 0; }
.feedback-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 36px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.feedback-box > div:first-child { max-width: 620px; padding-left: 16px; }
.feedback-box p { color: var(--dim); margin: 10px 0 0; }
.feedback-box .cta { margin-top: 0; padding-right: 16px; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--border); max-width: 820px; }
.faq details:first-of-type { margin-top: 24px; border-top: 1px solid var(--border); }
.faq details p { margin: 0 0 16px; }

/* Closing call to action */
.closing { padding-top: 24px; }
.closing-box {
  text-align: center;
  padding: 56px 28px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #169aa6 0%, #0b6670 100%);
  color: #ffffff;
}
.closing-box h2 { color: #ffffff; }
.closing-box p { margin: 12px 0 0; color: #d2ebee; font-size: 1.1rem; }
.closing-box .btn-primary { background: #ffffff; color: #0b6670; }
.closing-box .btn-primary:hover { background: #e8f5f6; color: #0b6670; }
.closing-box .btn-ghost { background: transparent; border-color: rgb(255 255 255 / 55%); color: #ffffff; }
.closing-box .btn-ghost:hover { border-color: #ffffff; color: #ffffff; }

/* Footer */
.foot { border-top: 1px solid var(--border); padding: 36px 0 28px; background: var(--bg-alt); }
.foot-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot p { color: var(--dim); font-size: 0.92rem; margin: 10px 0 0; max-width: 520px; }
.foot nav { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.foot nav a { color: var(--dim); text-decoration: none; }
.foot nav a:hover { color: var(--text); }
.legal { font-size: 0.8rem !important; max-width: none !important; margin-top: 24px !important; }

/* Plain pages (privacy, 404) */
.page { padding: 64px 0 80px; }
.page .wrap { max-width: 760px; }
.page p, .page li { color: var(--dim); }
.page h2 { margin-top: 40px; font-size: 1.4rem; }
.cta-left { justify-content: flex-start; }

/* Narrower screens */
@media (max-width: 960px) {
  .features, .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feedback-box { flex-direction: column; align-items: flex-start; }
  .feedback-box .cta { justify-content: flex-start; padding-left: 16px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .top nav a:not(.btn) { display: none; }
  .hero { padding-top: 48px; }
  .section { padding: 56px 0; }
  .features, .gallery-grid, .platforms, .checks { grid-template-columns: minmax(0, 1fr); }
  .cta .btn { flex: 1 1 100%; }
  .shot-wrap { margin-top: 32px; }
  .closing-box { padding: 40px 20px; }
}

/* Guides on the home page */
.guide-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.guide { display: block; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
.guide:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.guide h3 { color: var(--accent); }
.guide p { margin: 0; color: var(--dim); font-size: 0.95rem; }
@media (prefers-reduced-motion: reduce) { .guide, .btn { transition: none; } .guide:hover { transform: none; } }

/* Guide pages */
.article .wrap { max-width: 760px; }
.article h1 { font-size: clamp(2rem, 4.6vw, 2.8rem); text-align: left; }
.article h2 { margin-top: 48px; font-size: 1.55rem; }
.article p, .article li { color: var(--dim); }
.article strong { color: var(--text); }
.article ol, .article ul { padding-left: 22px; }
.article li { margin: 6px 0; }
.article figure { margin: 24px 0; }
.crumbs { font-size: 0.88rem; color: var(--dim); margin-bottom: 18px; }
.crumbs a { color: var(--dim); }
.toc { margin-top: 24px; padding: 18px 18px 18px 40px !important; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-alt); }
.note { padding: 14px 18px; border-left: 4px solid var(--accent); border-radius: 8px; background: var(--accent-soft); }
.keys { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.95rem; }
.keys th, .keys td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.keys th { color: var(--text); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.keys td { color: var(--dim); }
kbd { font: 0.85em ui-monospace, SFMono-Regular, Consolas, monospace; padding: 2px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); color: var(--text); }
.next { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 48px; }
.release { border-top: 1px solid var(--border); margin-top: 32px; }
.release h2 { display: flex; align-items: baseline; gap: 12px; }
.release .date { font-size: 0.95rem; font-weight: 400; color: var(--dim); }
@media (max-width: 960px) { .guide-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .guide-cards { grid-template-columns: minmax(0, 1fr); } .next .btn { flex: 1 1 100%; } }
