/* Cardholder Vanilla — site stylesheet
   Editorial layout, system fonts only (no external requests). */

:root {
  --paper: #fbf8f2;
  --paper-2: #f3eee4;
  --ink: #1d231f;
  --ink-2: #4a524c;
  --ink-3: #6f766f;
  --rule: #e2dccf;
  --green: #1f4a36;
  --green-2: #2d6a4f;
  --maple: #b3261e;
  --note-bg: #fff4d6;
  --note-rule: #e2c36b;
  --warn-bg: #fdecea;
  --warn-rule: #e3a39e;
  --link: #1f5c43;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
  --measure: 70ch;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--maple); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--maple);
  outline-offset: 2px;
}

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 10;
}
.skip:focus { left: 1rem; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1rem; }

/* ---------- Notice strip ---------- */
.notice-strip {
  background: var(--ink);
  color: #e9e6de;
  font-size: .82rem;
  line-height: 1.45;
}
.notice-strip p { margin: 0; padding: .45rem 0; }
.notice-strip a { color: #fff; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 68px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { width: 38px; height: 38px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--serif); font-size: 1.28rem; font-weight: 700; letter-spacing: -.01em; }
.brand-tag { font-size: .72rem; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--rule); border-radius: 4px;
  font: inherit; font-size: .9rem; padding: .35rem .7rem; color: var(--ink); cursor: pointer;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .15rem 1.1rem; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: var(--ink-2); font-size: .95rem; padding: .3rem 0; display: inline-block; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--green); box-shadow: inset 0 -2px 0 var(--green); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .site-nav { width: 100%; display: none; padding-bottom: .8rem; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { padding: .55rem 0; display: block; border-top: 1px solid var(--rule); }
  .site-nav a:hover, .site-nav a[aria-current="page"] { box-shadow: none; }
}

/* ---------- Breadcrumb ---------- */
.crumbs { font-size: .85rem; color: var(--ink-3); margin: 1.2rem 0 0; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.crumbs li + li::before { content: "/"; margin: 0 .45rem; color: var(--rule); }
.crumbs a { color: var(--ink-3); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 3rem;
  padding: 1.5rem 0 3.5rem;
}
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}

article { max-width: var(--measure); min-width: 0; }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); line-height: 1.22; letter-spacing: -.005em; }
h1 { font-size: clamp(1.85rem, 1.3rem + 2.2vw, 2.6rem); margin: .4rem 0 .6rem; font-weight: 700; }
h2 { font-size: 1.6rem; margin: 2.6rem 0 .7rem; padding-top: .3rem; font-weight: 700; }
h3 { font-size: 1.22rem; margin: 1.8rem 0 .5rem; font-weight: 700; }
h4 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; }
p { margin: 0 0 1.05rem; }
ul, ol { padding-left: 1.35rem; margin: 0 0 1.1rem; }
li { margin-bottom: .35rem; }
strong { font-weight: 650; }

.dek { font-size: 1.18rem; color: var(--ink-2); line-height: 1.55; margin-bottom: 1rem; font-family: var(--serif); }

.byline {
  font-size: .85rem; color: var(--ink-3);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: .55rem 0; margin: 1.1rem 0 1.6rem;
  display: flex; flex-wrap: wrap; gap: .2rem 1.2rem;
}

/* ---------- Callouts ---------- */
.callout {
  border-left: 4px solid var(--note-rule);
  background: var(--note-bg);
  padding: .9rem 1.1rem;
  margin: 1.4rem 0;
  font-size: .98rem;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout.warn { border-color: var(--maple); background: var(--warn-bg); }
.callout.tip { border-color: var(--green-2); background: #e9f2ec; }
.callout-title { font-weight: 700; display: block; margin-bottom: .25rem; }

.disclaimer-box {
  border: 1px solid var(--warn-rule);
  background: var(--warn-bg);
  padding: 1rem 1.15rem;
  margin: 0 0 1.6rem;
  font-size: .95rem;
}
.disclaimer-box p { margin: 0; }

/* ---------- TOC ---------- */
.toc {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: .9rem 1.1rem .5rem;
  margin: 0 0 1.8rem;
  font-size: .95rem;
}
.toc summary { font-weight: 700; cursor: pointer; font-family: var(--serif); font-size: 1.05rem; }
.toc ol { margin: .6rem 0 .4rem; padding-left: 1.2rem; }
.toc li { margin-bottom: .2rem; }

/* ---------- Steps ---------- */
ol.steps { list-style: none; counter-reset: step; padding-left: 0; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1rem;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: .05rem;
  width: 1.8rem; height: 1.8rem;
  border: 1.5px solid var(--green);
  color: var(--green);
  border-radius: 50%;
  font-family: var(--serif); font-weight: 700; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; margin: 1.2rem 0 1.5rem; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; min-width: 480px; }
caption { text-align: left; font-size: .85rem; color: var(--ink-3); padding-bottom: .4rem; }
th, td { text-align: left; vertical-align: top; padding: .6rem .7rem; border-bottom: 1px solid var(--rule); }
thead th { border-bottom: 2px solid var(--ink); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
tbody tr:nth-child(even) { background: rgba(0,0,0,.018); }

code, kbd { font-family: var(--mono); font-size: .9em; background: var(--paper-2); padding: .05rem .3rem; border-radius: 3px; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--rule); padding: .2rem 0; }
.faq details:first-of-type { border-top: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none;
  font-family: var(--serif); font-weight: 700; font-size: 1.08rem;
  padding: .8rem 2rem .8rem 0; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .2rem; top: .7rem;
  font-family: var(--sans); font-weight: 400; font-size: 1.4rem; color: var(--green);
}
.faq details[open] summary::after { content: "\2212"; }
.faq .answer { padding: 0 0 .8rem; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- Home ---------- */
.home-intro {
  border-bottom: 1px solid var(--rule);
  padding: 2.2rem 0 2rem;
}
.home-intro .kicker { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--maple); font-weight: 700; margin: 0 0 .5rem; }
.home-intro h1 { max-width: 22ch; margin-top: 0; }
.home-intro .dek { max-width: 60ch; }

.quick {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule);
  margin: 1.8rem 0 0;
}
.quick > div { padding: 1rem 1.2rem 1.1rem 0; }
.quick > div + div { padding-left: 1.2rem; border-left: 1px solid var(--rule); }
.quick h2 { font-size: 1.1rem; margin: 0 0 .35rem; padding: 0; }
.quick p { font-size: .95rem; color: var(--ink-2); margin: 0 0 .4rem; }
.quick a { font-size: .92rem; font-weight: 600; }
@media (max-width: 720px) {
  .quick { grid-template-columns: 1fr; }
  .quick > div, .quick > div + div { padding: .9rem 0; border-left: 0; }
  .quick > div + div { border-top: 1px solid var(--rule); }
}

.guide-list { list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.guide-list li { border-bottom: 1px solid var(--rule); padding: .85rem 0; margin: 0; }
.guide-list a { font-family: var(--serif); font-weight: 700; font-size: 1.12rem; text-decoration: none; }
.guide-list a:hover { text-decoration: underline; }
.guide-list p { margin: .2rem 0 0; color: var(--ink-2); font-size: .95rem; }

/* ---------- Card anatomy figure ---------- */
figure.anatomy { margin: 1.6rem 0; }
figure.anatomy svg { display: block; width: 100%; max-width: 560px; }
figure.anatomy figcaption { font-size: .85rem; color: var(--ink-3); margin-top: .5rem; }

/* ---------- Sidebar ---------- */
aside.sidebar { font-size: .95rem; }
.side-block { border-top: 2px solid var(--ink); padding-top: .7rem; margin-bottom: 2rem; }
.side-block h2 { font-size: 1.02rem; margin: 0 0 .6rem; padding: 0; text-transform: uppercase; letter-spacing: .06em; font-family: var(--sans); }
.side-block ul { list-style: none; padding: 0; margin: 0; }
.side-block li { border-bottom: 1px solid var(--rule); margin: 0; }
.side-block li a { display: block; padding: .5rem 0; text-decoration: none; color: var(--ink); }
.side-block li a:hover { color: var(--maple); }
.side-block li a[aria-current="page"] { color: var(--green); font-weight: 650; }
.side-note { background: var(--paper-2); border: 1px solid var(--rule); padding: .9rem 1rem; font-size: .88rem; color: var(--ink-2); }
.side-note p { margin: 0 0 .5rem; }
.side-note p:last-child { margin: 0; }
@media (min-width: 961px) {
  .sidebar-sticky { position: sticky; top: 1.2rem; }
}

/* ---------- Related / next ---------- */
.related { border-top: 1px solid var(--rule); margin-top: 2.8rem; padding-top: 1.2rem; }
.related h2 { margin-top: 0; font-size: 1.25rem; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 1rem; }
label { display: block; font-weight: 600; font-size: .93rem; margin-bottom: .3rem; }
input[type=text], input[type=email], select, textarea {
  width: 100%; font: inherit; font-size: 1rem;
  padding: .6rem .7rem; border: 1px solid #c9c2b3; border-radius: 3px; background: #fff; color: var(--ink);
}
textarea { min-height: 150px; resize: vertical; }
.hint { font-size: .85rem; color: var(--ink-3); margin-top: .25rem; }
.btn {
  display: inline-block; font: inherit; font-weight: 650; font-size: .98rem;
  background: var(--green); color: #fff; border: 0; border-radius: 3px;
  padding: .7rem 1.3rem; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--ink); color: #fff; }
.form-status { margin-top: 1rem; font-size: .95rem; }

/* ---------- Footer ---------- */
.site-footer { background: #17201b; color: #c9cdc7; font-size: .9rem; padding: 2.6rem 0 1.6rem; }
.site-footer a { color: #e8ebe6; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 1.4rem; } }
.site-footer h2 { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: #fff; margin: 0 0 .7rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; }
.footer-brand { display: flex; align-items: center; gap: .55rem; margin-bottom: .8rem; color: #fff; font-family: var(--serif); font-size: 1.15rem; font-weight: 700; }
.footer-brand img { width: 32px; height: 32px; }
.footer-legal { border-top: 1px solid #334038; margin-top: 2rem; padding-top: 1.2rem; font-size: .82rem; color: #a3aaa3; }
.footer-legal p { margin: 0 0 .6rem; }

/* ---------- 404 ---------- */
.notfound { padding: 3rem 0 4rem; max-width: 640px; }
.notfound .code { font-family: var(--serif); font-size: 4.5rem; color: var(--maple); line-height: 1; margin: 0; }

@media print {
  .notice-strip, .site-header, .site-footer, aside.sidebar, .toc, .nav-toggle { display: none !important; }
  body { background: #fff; }
  .layout { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
