/* ============================================================
   MailLogic — utilitarian email-utility system
   IBM Plex Sans / Mono · cool grays · functional teal
   ============================================================ */

:root {
  --bg:        #ffffff;
  --bg-alt:    #f6f7f9;   /* section bands */
  --bg-inset:  #eef1f4;   /* inset rows / fields */
  --ink:       #14171c;
  --ink-2:     #2b313b;
  --muted:     #586172;
  --muted-2:   #828b99;
  --line:      #e3e7ec;
  --line-2:    #d4dae1;

  --primary:   #0d7a6f;
  --primary-d: #0a5f57;
  --primary-wash: #e6f4f1;
  --primary-line: #bfe3dd;

  --blue:      #1f6fe0;
  --blue-wash: #eaf1fd;

  --ok:        #1f9254;
  --ok-wash:   #e7f6ed;
  --ok-line:   #b9e3c8;
  --warn:      #a96a12;
  --warn-wash: #fbf1de;
  --warn-line: #f0d9a8;
  --danger:    #c23934;
  --danger-wash:#fbeceb;

  /* surfaces (distinct from page --bg so cards elevate in dark mode) */
  --surface:        #ffffff;   /* cards, panels, table */
  --surface-raised: #ffffff;   /* elevated cards (hero card) */
  --accent-text:    #ffffff;   /* text/icon on accent fills */

  /* CTA band (flips: near-black in light, elevated slate in dark) */
  --cta-bg:    #14171c;
  --cta-text:  #e7ebf0;
  --cta-muted: #9aa5b3;

  /* semantic aliases — mirror the tokens above, auto-flip in dark */
  --bg-soft:       var(--bg-alt);
  --text:          var(--ink);
  --border:        var(--line);
  --accent:        var(--primary);
  --accent-soft:   var(--primary-wash);
  --success-bg:    var(--ok-wash);
  --success-text:  var(--ok);
  --warning-bg:    var(--warn-wash);
  --warning-text:  var(--warn);

  --code-bg:   #0e1622;
  --code-bg-2: #16202e;
  --code-line: #243244;
  --code-text: #c7d2e0;
  --code-green:#5fd0a8;
  --code-blue: #6bb3f0;
  --code-amber:#e7c06b;
  --code-dim:  #6b7a8d;

  --radius:    10px;
  --radius-sm: 7px;
  --radius-lg: 14px;

  --shadow-xs: 0 1px 2px rgb(20 23 28 / 6%);
  --shadow-sm: 0 1px 3px rgb(20 23 28 / 8%), 0 1px 2px rgb(20 23 28 / 5%);
  --shadow-md: 0 6px 16px -6px rgb(20 23 28 / 14%);
  --shadow-lg: 0 18px 40px -18px rgb(20 23 28 / 22%);

  --maxw: 1200px;

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.018em; color: var(--ink); line-height: 1.12; }
p { margin: 0; }
::selection { background: var(--primary-wash); }
svg { display: block; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 28px; }
.section { padding-block: clamp(48px, 6vw, 80px); }
.band { background: var(--bg-alt); border-block: 1px solid var(--line); }

.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary);
}
.sec-head { max-width: 680px; }
.sec-head.center { margin-inline: auto; text-align: center; }
.sec-head h2 { font-size: clamp(26px, 3vw, 34px); margin-top: 12px; }
.sec-head p { color: var(--muted); font-size: 16.5px; margin-top: 12px; line-height: 1.55; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 14.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn-lg { height: 48px; padding: 0 22px; font-size: 15.5px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-primary { background: var(--primary); color: var(--accent-text); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--primary-d); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--muted-2); background: var(--bg-alt); }
.btn-dark { background: var(--ink); color: var(--accent-text); }
.btn-dark:hover { background: #000; }
.btn-link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; font-size: 14.5px; }
.btn-link:hover { color: var(--primary-d); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand img { width: 28px; height: 28px; }
.brand .lo { color: var(--primary); }
.brand .io { color: var(--muted-2); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { font-size: 14.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-cta .signin { font-size: 14.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.nav-cta .signin:hover { color: var(--ink); }

/* ---------- status chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 999px;
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
  border: 1px solid var(--line-2); background: var(--surface);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.chip.ok { background: var(--ok-wash); border-color: var(--ok-line); color: var(--ok); }
.chip.ok .dot { background: var(--ok); }
.chip.warn { background: var(--warn-wash); border-color: var(--warn-line); color: var(--warn); }
.chip.warn .dot { background: var(--warn); animation: blink 1.5s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ---------- generic card ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }

/* ============================================================
   Window mock (browser/app frame) for diagrams
   ============================================================ */
.win { border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-md); }
.win-bar { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.win-bar .dots { display: flex; gap: 6px; }
.win-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.win-bar .title { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.win-bar .right { margin-left: auto; }

/* dark code/terminal window */
.term { border: 1px solid var(--code-line); border-radius: var(--radius); overflow: hidden; background: var(--code-bg); box-shadow: var(--shadow-md); }
.term-bar { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--code-line); background: var(--code-bg-2); }
.term-bar .dots { display: flex; gap: 6px; }
.term-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: #2f3e52; }
.term-bar .title { font-family: var(--mono); font-size: 12px; color: var(--code-dim); }
.term pre { margin: 0; padding: 16px 18px; font-family: var(--mono); font-size: 13px; line-height: 1.75; color: var(--code-text); overflow-x: auto; }
.term .g { color: var(--code-green); }
.term .b { color: var(--code-blue); }
.term .a { color: var(--code-amber); }
.term .d { color: var(--code-dim); }

/* ---------- inbox mini (kept minimal, neutral) ---------- */
.inbox-mini { font-family: var(--sans); }
.inbox-mini .row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.inbox-mini .row:last-child { border-bottom: 0; }
.inbox-mini .from { font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.inbox-mini .subj { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-mini .subj b { color: var(--ink); font-weight: 600; }
.inbox-mini .time { font-size: 12px; color: var(--muted-2); font-family: var(--mono); }
.inbox-mini .row.hot { background: var(--primary-wash); box-shadow: inset 2px 0 0 var(--primary); }
.inbox-mini .badge { display:inline-flex; align-items:center; height: 18px; padding: 0 7px; border-radius: 5px; font-family: var(--mono); font-size: 10.5px; font-weight: 500; background: var(--primary); color: var(--accent-text); margin-left: 6px; }

/* ============================================================
   Flow diagram (nodes + connectors)
   ============================================================ */
.flow { display: flex; align-items: stretch; gap: 0; flex-wrap: nowrap; }
.flow-node {
  flex: 1; min-width: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); padding: 16px 16px; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 6px;
}
.flow-node.accent { border-color: var(--primary-line); background: var(--primary-wash); }
.flow-node .nh { display: flex; align-items: center; gap: 8px; font-size: 12px; font-family: var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.flow-node .nh svg { color: var(--primary); }
.flow-node .nv { font-family: var(--mono); font-size: 13.5px; font-weight: 500; color: var(--ink); word-break: break-all; }
.flow-node .nn { font-size: 12.5px; color: var(--muted); }
.flow-conn { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 10px; color: var(--primary); position: relative; }
.flow-conn .lbl { position: absolute; top: -16px; font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }

/* DNS records table */
.dns { width: 100%; }
.dns-row { display: grid; grid-template-columns: 70px 150px 1fr auto; gap: 14px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.dns-row:last-child { border-bottom: 0; }
.dns-row .type { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--primary); background: var(--primary-wash); border: 1px solid var(--primary-line); border-radius: 5px; height: 24px; display: grid; place-items: center; }
.dns-row .host { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.dns-row .val { font-family: var(--mono); font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dns-head { display: grid; grid-template-columns: 70px 150px 1fr auto; gap: 14px; padding: 11px 16px; background: var(--bg-alt); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); }

/* feature/spec list */
.spec { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); }
.spec svg { flex: none; margin-top: 2px; color: var(--primary); }
.spec.muted { color: var(--muted-2); }
.spec.muted svg { color: var(--muted-2); }

/* ---------- footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding-block: 48px 28px; }
.footer-top { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.footer-brand { max-width: 300px; }
.footer-brand p { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; margin-bottom: 13px; }
.footer-col a { display: block; font-size: 14px; color: var(--muted); margin-bottom: 11px; line-height: 1.35; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; font-size: 13px; color: var(--muted-2); }
.footer-bottom .mono { font-family: var(--mono); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .wrap { padding-inline: 20px; }
}

/* ============================================================
   Dark theme — auto, follows OS/browser (no toggle).
   Overrides the base tokens; semantic aliases inherit. Dashboard-
   like deep-slate palette, brightened teal, off-white text.
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg:        #0f1722;   /* page — deep slate/near-navy */
    --bg-alt:    #141e2b;   /* section bands */
    --bg-inset:  #1b2735;   /* inset fields */
    --surface:   #18222f;   /* cards — slightly lighter slate */
    --surface-raised: #1e2a39; /* elevated cards */

    --ink:       #e8eef4;   /* soft off-white text */
    --ink-2:     #c4d0dc;
    --muted:     #a1b3c4;   /* readable gray-blue */
    --muted-2:   #8195a8;
    --line:      #283645;   /* subtle blue-gray borders */
    --line-2:    #37485b;

    --primary:   #34c0aa;   /* brand teal, brightened for dark */
    --primary-d: #4ad0ba;   /* hover → lighter in dark */
    --primary-wash: #14322d;/* dark teal tint */
    --primary-line: #245049;
    --accent-text: #06231f; /* dark text reads on the bright teal */

    --blue:      #5ea0f2;
    --blue-wash: #16273d;

    --ok:        #45ca8b;
    --ok-wash:   #123026;
    --ok-line:   #20493a;
    --warn:      #e3b561;
    --warn-wash: #332a17;
    --warn-line: #4d4020;
    --danger:    #e9756f;
    --danger-wash:#3a1d1d;

    /* CTA band: clearly lighter than the page so it never disappears */
    --cta-bg:    #1d2e3f;
    --cta-text:  #eaf1f7;
    --cta-muted: #aab8c8;

    --shadow-xs: 0 1px 2px rgb(0 0 0 / 32%);
    --shadow-sm: 0 1px 3px rgb(0 0 0 / 40%), 0 1px 2px rgb(0 0 0 / 32%);
    --shadow-md: 0 8px 20px -8px rgb(0 0 0 / 55%);
    --shadow-lg: 0 22px 46px -20px rgb(0 0 0 / 65%);
  }

  /* Logo mark: the SVG ships with a dark-teal stroke; brighten via filter
     so it stays legible on the dark header. */
  .brand img { filter: brightness(1.5) saturate(1.1); }
}

/* ============================================================
   Pricing page
   ============================================================ */

.phero { padding-top: clamp(40px, 5vw, 60px); padding-bottom: 8px; }
.phero .sec-head h1 { font-size: clamp(30px, 3.6vw, 42px); margin-top: 12px; letter-spacing: -0.025em; }
.phero .sec-head h1 .t { color: var(--primary); }
.phero .sec-head p { font-size: 16.5px; }
.bill-note { display:inline-flex; align-items:center; gap:14px; margin-top:18px; flex-wrap:wrap; }
.bill-note .chip { height: 28px; }

/* receive vs send summary */
.pricing-model { padding-top: clamp(28px, 3vw, 40px); }
.pricing-model-head { margin-bottom: 4px; }
.rs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.rs { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 22px; background: var(--surface); box-shadow: var(--shadow-xs); display:flex; flex-direction:column; }
.rs.send { border-color: var(--primary-line); }
.rs .rh { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.rs .rh .nm { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.rs .rh .pr { font-size: 26px; font-weight: 700; letter-spacing:-0.02em; white-space: nowrap; flex: none; }
.rs .rh .pr small { font-size: 13px; font-weight: 500; color: var(--muted); }
.rs h2 { font-size: 19px; margin-top: 4px; }
.rs > p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.rs .specs { display:grid; gap:9px; margin: 16px 0 18px; }
.rs .mfoot { margin-top:auto; }

/* plans table */
.ptbl-wrap { margin-top: 38px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.ptbl { width: 100%; border-collapse: collapse; min-width: 720px; background: var(--surface); }
.ptbl th, .ptbl td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.ptbl thead th { background: var(--bg-alt); border-bottom: 1px solid var(--line-2); }
.ptbl thead .plan-cell { text-align: center; }
.ptbl thead .plan-cell.hl { background: var(--primary-wash); }
.ptbl .plan-name { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.ptbl .plan-price { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.ptbl .plan-price small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.ptbl .plan-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ptbl .plan-cta { margin-top: 12px; }
.ptbl tbody th { font-weight: 500; font-size: 14.5px; color: var(--ink-2); }
.ptbl tbody td { text-align: center; font-size: 14.5px; font-family: var(--mono); color: var(--ink); }
.ptbl tbody td.hl { background: color-mix(in srgb, var(--primary-wash) 50%, transparent); }
.ptbl tbody tr.group th { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted-2); background: var(--bg-alt); }
.ptbl tbody tr:last-child th, .ptbl tbody tr:last-child td { border-bottom: 0; }
.tick { display:inline-grid; place-items:center; width:22px; height:22px; border-radius:50%; background:var(--ok-wash); color:var(--ok); }
.dash { color: var(--muted-2); }
.ptbl .feat-head { font-size: 13px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); }
.ptbl button.btn, .rs button.btn, .cta-acts button.btn { appearance: none; }
.btn:disabled { cursor: not-allowed; opacity: 0.58; }
.pricing-message { min-height: 22px; margin: 16px 2px 0; color: var(--muted); font-size: 14px; }
.pricing-message[data-type="error"] { color: var(--danger); }

/* included strip */
.incl-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 30px; }
.incl { border:1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); }
.incl .ic { width: 34px; height: 34px; border-radius: 8px; background: var(--primary-wash); color: var(--primary); display:grid; place-items:center; margin-bottom: 12px; }
.incl h4 { font-size: 14.5px; }
.incl-tag { display:inline-flex; align-items:center; height:20px; padding:0 8px; border-radius:5px; font-family: var(--mono); font-size:10.5px; font-weight:500; letter-spacing:0.02em; text-transform:uppercase; margin-bottom:9px; border:1px solid transparent; }
.incl-tag.free { background: var(--ok-wash); color: var(--ok); border-color: var(--ok-line); }
.incl-tag.paid { background: var(--primary-wash); color: var(--primary); border-color: var(--primary-line); }
.incl p { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

/* faq */
.faq-grid { display:grid; grid-template-columns: minmax(0,0.6fr) minmax(0,1fr); gap: 36px; align-items:start; }
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q { width:100%; text-align:left; background:none; border:0; cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:20px; padding: 18px 2px; font-family: var(--sans); font-size: 16px; font-weight: 600; color: var(--ink); }
.faq-q .pm { flex:none; width:22px; height:22px; position:relative; color:var(--primary); }
.faq-q .pm::before, .faq-q .pm::after { content:""; position:absolute; background:currentColor; border-radius:2px; }
.faq-q .pm::before { top:10px; left:3px; right:3px; height:2px; }
.faq-q .pm::after { left:10px; top:3px; bottom:3px; width:2px; transition: opacity .2s ease; }
.faq-item.open .faq-q .pm::after { opacity:0; }
.faq-a { max-height:0; overflow:hidden; transition: max-height .3s ease; }
.faq-item.open .faq-a { max-height: 260px; }
.faq-a p { color: var(--muted); font-size: 14.5px; line-height: 1.6; padding: 0 2px 18px; }

/* CTA */
.cta-band { background: var(--cta-bg); color: var(--cta-text); }
.cta-band .wrap { display:flex; align-items:center; justify-content:space-between; gap:28px; flex-wrap:wrap; padding-block: clamp(40px,5vw,56px); }
.cta-band h2 { color: var(--cta-text); font-size: clamp(22px,2.6vw,30px); }
.cta-band p { color: var(--cta-muted); margin-top:8px; font-size:15px; }
.cta-band .btn-ghost { background:transparent; color: var(--cta-text); border-color: color-mix(in srgb, var(--cta-text) 28%, transparent); }
.cta-band .btn-ghost:hover { background: color-mix(in srgb, var(--cta-text) 10%, transparent); border-color: color-mix(in srgb, var(--cta-text) 55%, transparent); }
.cta-acts { display:flex; gap:12px; flex-wrap:wrap; }

@media (max-width: 920px) {
  .rs-grid { grid-template-columns: 1fr; }
  .incl-grid { grid-template-columns: 1fr 1fr; }
  .faq-grid { grid-template-columns: 1fr; gap: 20px; }
}
