/* iMail — the airmail page on the shared M3 contract (m3.css).
   Seed: airmail red, with blue as the tertiary. Signature: paper surfaces,
   serif headings, hard offset shadows and square corners — this page stays at
   the small end of the shape scale on purpose, which is how it keeps its
   printed look inside the same system as the other three. */

:root {
  color-scheme: light;

  --md-sys-color-primary: #b23025;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-tertiary: #1d4ed8;
  --md-sys-color-surface: #f4efe4;
  --md-sys-color-surface-container-low: #ece5d7;
  --md-sys-color-surface-container: #e6ddca;
  --md-sys-color-surface-container-high: #ded3bc;
  --md-sys-color-on-surface: #17150f;
  --md-sys-color-on-surface-variant: #5d5749;
  --md-sys-color-outline: #7a7264;
  --md-sys-color-outline-variant: #d3c9b7;

  /* Aliases: the rest of this file still speaks the old names. */
  --paper: var(--md-sys-color-surface);
  --paper-2: var(--md-sys-color-surface-container-low);
  --ink: var(--md-sys-color-on-surface);
  --muted: var(--md-sys-color-on-surface-variant);
  --rule: var(--md-sys-color-outline-variant);
  --red: var(--md-sys-color-primary);
  --blue: var(--md-sys-color-tertiary);
  --black: #12110d;
  --paper-ink: #f1eadb;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Noto Serif TC", "Songti TC", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "Noto Sans TC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --max: 1180px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --md-sys-color-primary: #e46a55;
  --md-sys-color-on-primary: #3a0d06;
  --md-sys-color-tertiary: #8aa8ff;
  --md-sys-color-surface: #12110e;
  --md-sys-color-surface-container-low: #1a1813;
  --md-sys-color-surface-container: #201d17;
  --md-sys-color-surface-container-high: #262218;
  --md-sys-color-on-surface: #efe8d8;
  --md-sys-color-on-surface-variant: #b3ab9c;
  --md-sys-color-outline: #8d8677;
  --md-sys-color-outline-variant: #3a352b;

  --black: #080806;
  --paper-ink: #f1eadb;
}
:root[data-theme="dark"] .browser {
  background: #17150f;
  border-color: var(--rule);
  box-shadow: 14px 14px 0 #221e17;
}
:root[data-theme="dark"] .browser-bar {
  background: linear-gradient(180deg, #242019, #17150f);
}
:root[data-theme="dark"] .browser img { border-color: var(--rule); }
:root[data-theme="dark"] #security {
  background: #221e17;
  border-color: var(--rule);
}
:root[data-theme="dark"] .site-footer { background-color: #080807; }
:root[data-theme="dark"] code {
  background: rgba(241, 234, 219, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--red); }
img { max-width: 100%; display: block; }
code, pre { font-family: var(--mono); }

.container {
  width: min(100% - 48px, var(--max));
  margin-inline: auto;
}

/* Masthead */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    135deg,
    var(--red) 0 10px,
    transparent 10px 20px,
    var(--blue) 20px 30px,
    transparent 30px 40px
  );
  background-repeat: no-repeat;
  background-size: 100% 3px;
  background-position: top;
  border-bottom: 1px solid var(--ink);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 74px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand img {
  width: 28px;
  height: 28px;
  border: 1px solid var(--ink);
  border-radius: 0;
}
.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}
.nav a {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}
.nav a:hover { color: var(--red); }
/* Both header controls are held to this page's small shape step. */
.theme-toggle,
.nav .lang {
  border-radius: var(--md-sys-shape-xs);
  font-family: var(--mono);
  font-size: var(--md-sys-type-label-sm-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 820px) {
  .nav .hide-sm { display: none; }
  .site-header .container { min-height: 62px; }
}

/* Hero */

.hero {
  padding: 80px 0 0;
  border-bottom: 1px solid var(--ink);
}
.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding-bottom: 64px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .dot {
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 50%;
}
h1 {
  margin: 22px 0 20px;
  font-family: var(--serif);
  font-size: clamp(3.1rem, 6.6vw, 5.6rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.04em;
}
h1 .grad {
  color: var(--red);
  font-style: italic;
  background: none;
  -webkit-text-fill-color: currentColor;
}
.lede {
  margin: 0 0 30px;
  max-width: 32rem;
  color: var(--muted);
  font-size: 1.06rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}
/* Structure and colours come from m3.css; the printed voice stays here. */
.btn {
  border-radius: var(--md-sys-shape-xs);
  font-family: var(--mono);
  font-size: var(--md-sys-type-label-md-size);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 11px 0;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pill { padding: 0; background: none; border: 0; }
.pill + .pill::before {
  content: "/";
  margin: 0 10px;
  color: var(--rule);
}

/* The screenshot as a postcard */

.browser {
  position: relative;
  border: 1px solid var(--ink);
  border-radius: var(--md-sys-shape-sm);
  background: var(--paper-2);
  padding: 9px 9px 0;
  box-shadow: 14px 14px 0 rgba(23, 21, 15, 0.08);
  transform: rotate(1.1deg);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px 10px;
  background: transparent;
  border: 0;
}
.browser-bar span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rule);
}
.browser-bar span:first-child { background: var(--red); }
.browser-bar span:nth-child(2) { background: #d9a441; }
.browser-bar span:nth-child(3) { background: var(--blue); }
.browser-url {
  margin-left: 10px;
  flex: 1;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser img {
  width: 100%;
  height: auto;
  border: 1px solid var(--ink);
}
.browser::after {
  content: "iMAIL\A POSTAGE\A 25";
  position: absolute;
  top: -22px;
  right: -20px;
  width: 74px;
  height: 88px;
  display: grid;
  place-items: center;
  text-align: center;
  white-space: pre;
  background: var(--paper);
  border: 2px dashed var(--red);
  color: var(--red);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: 0.12em;
  transform: rotate(4deg);
}

@media (max-width: 920px) {
  .hero { padding-top: 54px; }
  .hero .container { grid-template-columns: 1fr; gap: 46px; }
  .browser { transform: none; margin-right: 14px; }
  h1 { font-size: clamp(2.8rem, 11vw, 4.2rem); }
}

/* Sections */

main { counter-reset: sec; }
section { padding: 84px 0; border-top: 1px solid var(--ink); }
section:not(.hero) { counter-increment: sec; }
section.alt { background: var(--paper-2); }

.section-head {
  display: grid;
  grid-template-columns: 110px 1fr;
  column-gap: 32px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 26px;
  margin-bottom: 44px;
}
.section-head::before {
  content: counter(sec, decimal-leading-zero);
  grid-column: 1;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--red);
  padding-top: 11px;
}
.section-head h2 {
  grid-column: 2;
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.section-head p {
  grid-column: 2;
  margin: 0;
  max-width: 38rem;
  color: var(--muted);
}

/* Features as a ruled index */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 56px;
  counter-reset: item;
}
.card {
  counter-increment: item;
  display: grid;
  grid-template-columns: 46px 1fr;
  column-gap: 8px;
  align-content: start;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  background: none;
  padding: 20px 0 26px;
  transition: none;
}
.card:hover { border-color: var(--red); transform: none; }
.card::before {
  content: counter(item, decimal-leading-zero);
  grid-row: 1 / span 2;
  grid-column: 1;
  padding-top: 4px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.card h3 {
  grid-column: 2;
  margin: 0 0 7px;
  font-family: var(--serif);
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.card p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.icon { display: none; }

/* Split blocks */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.split > * { min-width: 0; }
.checks { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.checks li {
  min-width: 0;
  overflow-wrap: anywhere;
  border-left: 2px solid var(--red);
  padding-left: 16px;
  color: var(--muted);
  font-size: 0.93rem;
}
.checks strong { color: var(--ink); }

/* Deploy steps */

.steps { counter-reset: step; display: grid; }
.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  column-gap: 16px;
  border-top: 1px solid var(--rule);
  padding: 28px 0;
  min-width: 0;
}
.step:last-child { border-bottom: 1px solid var(--rule); }
.step::before {
  content: counter(step, decimal-leading-zero);
  grid-row: 1 / span 3;
  grid-column: 1;
  font-family: var(--serif);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--red);
}
.step h3 {
  grid-column: 2;
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
}
.step p { grid-column: 2; margin: 0 0 14px; color: var(--muted); }
.step .copy-wrap { grid-column: 2; }

/* Code */

pre {
  margin: 0;
  padding: 16px 18px;
  background: var(--black);
  color: #e9e0cf;
  border: 1px solid var(--black);
  border-radius: var(--md-sys-shape-xs);
  overflow-x: auto;
  max-width: 100%;
  font-size: 0.8rem;
  line-height: 1.6;
}
pre code {
  font-size: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}
.copy-wrap { position: relative; min-width: 0; padding-top: 34px; }
.copy-wrap pre { padding-right: 18px; max-width: 100%; }
.copy {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  border: 1px solid #3a362c;
  border-radius: var(--md-sys-shape-xs);
  background: var(--black);
  color: #cfc6b4;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.copy:hover { border-color: var(--red); color: #fff; }
.copy.ok { color: #9ed49a; border-color: #9ed49a; }

.note {
  margin: 22px 0 0;
  border-left: 2px solid var(--red);
  background: none;
  border-radius: 0;
  padding: 2px 0 2px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}
.note strong { color: var(--ink); }

/* Dark band: security */

#security {
  background: var(--black);
  color: var(--paper-ink);
  border-top: 1px solid var(--black);
}
#security .section-head { border-bottom-color: rgba(241, 234, 219, 0.22); }
#security .section-head::before { color: #ff8a7a; }
#security h2 { color: var(--paper-ink); }
#security .section-head p { color: #b5ac9b; }
#security .card { border-top-color: rgba(241, 234, 219, 0.22); }
#security .card:hover { border-top-color: #ff8a7a; }
#security .card::before { color: #ff8a7a; }
#security .card h3 { color: var(--paper-ink); }
#security .card p { color: #b5ac9b; }
#security code {
  background: rgba(241, 234, 219, 0.1);
  border-color: rgba(241, 234, 219, 0.2);
}

/* Technical details */

.specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 56px;
  margin: 0;
}
.specs div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.specs dt {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}
.specs dd { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.specs div.wide { grid-column: 1 / -1; }
.mono { font-family: var(--mono); font-size: 0.82rem; }

/* FAQ */

.faq { max-width: 880px; }
.faq details {
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: var(--md-sys-shape-none);
  background: none;
  padding: 18px 0;
}
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--red);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 400;
}
.faq details[open] summary::after { content: "−"; }
.faq details p {
  margin: 12px 0 2px;
  max-width: 720px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Inline code */

code {
  font-size: 0.86em;
  background: rgba(23, 21, 15, 0.06);
  border: 1px solid var(--rule);
  border-radius: var(--md-sys-shape-xs);
  padding: 1px 4px;
  overflow-wrap: anywhere;
}

/* Footer */

.site-footer {
  background-color: var(--black);
  background-image: repeating-linear-gradient(
    135deg,
    var(--red) 0 10px,
    transparent 10px 20px,
    var(--blue) 20px 30px,
    transparent 30px 40px
  );
  background-repeat: no-repeat;
  background-size: 100% 3px;
  background-position: top;
  color: #b5ac9b;
  padding: 3px 0 46px;
  font-size: 0.84rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 40px;
  padding-top: 40px;
}
.site-footer .fine { max-width: 620px; line-height: 1.55; }
.site-footer strong { color: var(--paper-ink); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a {
  color: #d8d0c0;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.site-footer a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 920px) {
  section { padding: 62px 0; }
  .section-head { grid-template-columns: 1fr; row-gap: 4px; margin-bottom: 34px; }
  .section-head::before { grid-column: 1; padding-top: 0; }
  .section-head h2, .section-head p { grid-column: 1; }
  .grid, .split, .specs { grid-template-columns: 1fr; gap: 0; }
  .split { row-gap: 32px; }
  .step { grid-template-columns: 64px minmax(0, 1fr); }
  .step::before { font-size: 1.9rem; }
  .specs div { grid-template-columns: 110px 1fr; }
  .specs div.wide { grid-column: auto; }
  .site-footer .container { display: block; }
  .site-footer nav { margin-top: 20px; }
}

