/* AloSave — shared stylesheet
   Palette: paper #FBFAF7 · ink #10233B · tile blue #2E86AB
   Type: Spectral (display), Inter (body), IBM Plex Mono (data) */

:root {
  --paper: #FBFAF7;
  --ink: #10233B;
  --blue: #2E86AB;
  --blue-deep: #1F6A8A;
  --glaze: #DDE9EF;
  --glaze-soft: #EEF4F7;
  --muted: #53637A;
  --rule: #E6E1D6;
  --focus: #10233B;

  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --col: 42rem;
  --gutter: 1.25rem;

  --step--1: 0.9rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 2rem;
  --step-4: 2.625rem;
}

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 100%;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: var(--step-0);
}

main { flex: 1 0 auto; }

/* Skip link */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 3px;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* Focus */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* Column */
.col {
  width: min(var(--col), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* Type */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, var(--step-4)); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, var(--step-3)); }
h3 { font-size: var(--step-1); font-weight: 600; }

p, ul, ol, dl { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: 0.35em; }

a {
  color: var(--blue-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--ink); }

strong { font-weight: 600; }

.lede {
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink);
}

.aside {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--muted);
  border-left: 3px solid var(--blue);
  padding-left: 1rem;
  margin: 1.5rem 0;
}

.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }

address { font-style: normal; }

/* Rules between sections */
hr.rule {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 0;
}

/* Header */
.site-header {
  padding: 1.4rem 0 1.2rem;
  border-bottom: 1px solid var(--rule);
}
.site-header .col {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.wordmark svg { width: 1.5rem; height: 1.5rem; flex: none; }
.site-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step--1);
  padding-block: 0.2rem;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { border-bottom-color: var(--blue); }

/* Sections */
.section { padding: 3.5rem 0; }
.section-tight { padding: 2.5rem 0; }
.section h2 { margin-bottom: 1rem; }

/* Hero */
.hero { padding: 4.5rem 0 3rem; }
.hero h1 { margin-bottom: 1.1rem; }
.hero .lede { max-width: 36rem; }
.hero-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  font-size: var(--step--1);
  color: var(--muted);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero-meta svg { width: 1rem; height: 1rem; }

/* Tile frieze */
.frieze-wrap {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--glaze-soft);
  overflow: hidden;
  line-height: 0;
}
.frieze {
  display: block;
  width: 100%;
  height: 52px;
  color: var(--blue);
}

/* Subscribe form */
.subscribe {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--glaze-soft);
  border: 1px solid var(--glaze);
  border-radius: 6px;
}
.subscribe h2 { font-size: var(--step-1); margin-bottom: 0.4rem; }
.subscribe p { margin-bottom: 1rem; }
.form-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.input {
  flex: 1 1 14rem;
  min-width: 0;
  font: inherit;
  padding: 0.7rem 0.9rem;
  border: 1px solid #A9BAC6;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
.input::placeholder { color: #5F6D7A; }
.input:focus { border-color: var(--blue); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  padding: 0.7rem 1.25rem;
  border-radius: 4px;
  border: 1px solid var(--blue-deep);
  background: var(--blue-deep);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.button:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.button-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.button-secondary:hover { background: var(--ink); color: var(--paper); }
.button-large { padding: 0.95rem 1.6rem; font-size: var(--step-1); }

.form-note { margin: 0.75rem 0 0; font-size: var(--step--1); color: var(--muted); }
.form-status { margin: 0.75rem 0 0; font-size: var(--step--1); min-height: 1.4em; }
.form-status[data-state="error"] { color: #9A2B2B; }
.form-status[data-state="ok"] { color: var(--blue-deep); }

/* Process steps (a real sequence) */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li {
  position: relative;
  padding-left: 3rem;
  margin: 0;
  padding-bottom: 1.6rem;
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--blue-deep);
  background: var(--glaze);
  border-radius: 50%;
}
.steps h3 { margin-bottom: 0.3em; }
.steps p { margin: 0; }

/* Anatomy list */
.anatomy { margin: 0; }
.anatomy > div {
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
}
.anatomy > div:last-child { border-bottom: 1px solid var(--rule); }
.anatomy dt { font-weight: 600; }
.anatomy dd { margin: 0; }
@media (max-width: 36rem) {
  .anatomy > div { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* Editors */
.editors { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.editors article { border-top: 2px solid var(--blue); padding-top: 0.9rem; }
.editors h3 { margin-bottom: 0.2em; }
.editors p { margin: 0; }
@media (max-width: 36rem) { .editors { grid-template-columns: 1fr; } }

/* Callout */
.callout {
  border: 1px solid var(--glaze);
  border-left: 4px solid var(--blue);
  background: #fff;
  padding: 1.4rem 1.5rem;
  border-radius: 4px;
}
.callout h2, .callout h3 { margin-bottom: 0.4em; }
.callout p:last-child { margin-bottom: 0; }

/* Email practices */
.practices { list-style: none; padding: 0; margin: 0; }
.practices li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.8rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}
.practices li:last-child { border-bottom: 1px solid var(--rule); }
.practices svg { width: 1.3rem; height: 1.3rem; color: var(--blue); margin-top: 0.15rem; }
.practices p { margin: 0; }

/* Accordion FAQ */
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0.25rem;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid var(--blue);
  border-bottom: 2px solid var(--blue);
  transform: rotate(45deg);
  transition: transform 160ms ease;
  margin-right: 0.35rem;
}
.faq details[open] summary::after { transform: rotate(225deg); }
.faq .answer { padding: 0 0.25rem 1.25rem; }
.faq .answer p:last-child { margin-bottom: 0; }

/* Issue page */
.issue-head { padding: 3.5rem 0 2rem; }
.issue-meta {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: 1rem;
}
.issue-meta span + span::before { content: " / "; }

.pick {
  background: #fff;
  border: 1px solid var(--glaze);
  border-radius: 6px;
  padding: 1.75rem;
  margin: 2rem 0;
}
.pick h2 { margin-bottom: 0.3em; }
.pick .merchant { color: var(--muted); margin-bottom: 1.2rem; }

.code-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--glaze-soft);
  border: 1px dashed var(--blue);
  border-radius: 4px;
  margin: 1.2rem 0;
}
.code-box .label { font-size: var(--step--1); color: var(--muted); flex: 1 1 100%; margin: 0; }
.code-box code {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  flex: 1 1 auto;
  word-break: break-all;
}
.copy-button {
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  border-radius: 4px;
  cursor: pointer;
}
.copy-button:hover { background: var(--ink); color: var(--paper); }
.copy-button[data-copied="true"] { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }

.pick-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-top: 1.2rem; }
.pick-actions .small { flex: 1 1 100%; margin: 0; }

.checks { list-style: none; padding: 0; margin: 0; }
.checks li {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.7rem;
  padding: 0.6rem 0;
  margin: 0;
}
.checks svg { width: 1.15rem; height: 1.15rem; color: var(--blue); margin-top: 0.2rem; }
.checks p { margin: 0; }

.terms-list dt { font-weight: 600; margin-top: 0.8rem; }
.terms-list dd { margin: 0.15rem 0 0; }

/* Legal pages */
.legal h2 { font-size: var(--step-2); margin-top: 2.4rem; }
.legal h3 { margin-top: 1.6rem; }
.legal .updated { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); }
.toc { padding: 1rem 1.25rem; background: var(--glaze-soft); border-radius: 4px; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li + li { margin-top: 0.25em; }

/* Closing rule on legal pages */
.legal hr.rule-closing { margin: 2.5rem 0 1.5rem; }

/* 404 */
.notfound { padding: 5rem 0; }
.notfound .code {
  font-family: var(--font-mono);
  color: var(--blue-deep);
  font-size: var(--step--1);
  margin-bottom: 0.6rem;
}
.notfound svg { width: 4.5rem; height: 4.5rem; color: var(--blue); margin-bottom: 1.5rem; }
.notfound .actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.notfound .notfound-help { margin-top: 1.5rem; }

/* Footer — two columns */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--glaze-soft);
  padding: 2.75rem 0 2rem;
  font-size: var(--step--1);
  color: var(--ink);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2.5rem;
}
.site-footer h2 {
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.site-footer p { margin-bottom: 0.7em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li + li { margin-top: 0.4em; }
.site-footer a { color: var(--ink); }
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
@media (max-width: 40rem) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
}

/* Visually hidden helper */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Print */
@media print {
  .site-header, .site-footer, .subscribe, .copy-button, .skip-link { display: none; }
  body { font-size: 11pt; }
}
