/* ==========================================================================
   raisingadollar.com
   Design direction: the page as a financial instrument. Cotton-rag paper,
   intaglio green ink, one Treasury-seal red accent per page, and serial
   numbers as the organizing device. The thesis is arithmetic, so the site
   is built to look like a ledger rather than a brochure.
   ========================================================================== */

:root {
  --ink:        #12241a;   /* intaglio engraving ink */
  --ink-soft:   #3d4f43;
  --paper:      #dedcce;   /* cotton rag */
  --paper-lit:  #edebe0;
  --treasury:   #1f6b45;   /* engraving green */
  --seal:       #9e2b25;   /* Treasury seal red — used once per page */
  --rule:       #a9a995;

  --display: "Bodoni Moda", "Didot", Georgia, serif;
  --body:    "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ledger:  "Courier Prime", "Courier New", monospace;

  --measure: 62ch;
  --gutter:  clamp(1.25rem, 5vw, 4rem);
  --frame:   clamp(0.75rem, 2.5vw, 1.75rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.97rem + 0.18vw, 1.0625rem);
  line-height: 1.65;
  font-weight: 400;
  /* Faint engraved guilloche wash. Two offset gradients, nothing heavier. */
  background-image:
    repeating-linear-gradient(66deg,  rgba(31,107,69,.045) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-66deg, rgba(31,107,69,.035) 0 1px, transparent 1px 9px);
}

/* --- the outer frame, like the border printed on a note --------------- */
.frame {
  min-height: 100vh;
  padding: var(--frame);
}
.frame__inner {
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 3px;
  background:
    linear-gradient(var(--paper-lit), var(--paper-lit));
  background-blend-mode: normal;
}

/* --- typography ------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.5rem, 1.6rem + 4.2vw, 5.25rem); }
h2 { font-size: clamp(1.9rem, 1.35rem + 2.4vw, 3.25rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.6rem); }

p { margin: 0 0 1.15em; max-width: var(--measure); }
a { color: var(--treasury); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

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

.lede {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

/* Small caps label. Used for section headers and data captions. */
.label {
  font-family: var(--ledger);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
  display: block;
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}
.rule--double {
  border: 0;
  border-top: 3px double var(--ink);
  margin: 0;
}

/* --- layout ----------------------------------------------------------- */
.wrap { padding-inline: var(--gutter); }
.section { padding-block: clamp(3rem, 7vw, 6rem); }
.section--tight { padding-block: clamp(2rem, 4vw, 3.25rem); }
.center { text-align: center; }
.center p { margin-inline: auto; }

.cols {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
}
@media (min-width: 800px) {
  .cols--2 { grid-template-columns: repeat(2, 1fr); }
  .cols--3 { grid-template-columns: repeat(3, 1fr); }
}

/* --- masthead --------------------------------------------------------- */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}
.wordmark span {
  font-family: var(--ledger);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--treasury);
}
.nav { display: flex; flex-wrap: wrap; gap: clamp(0.85rem, 2vw, 1.75rem); align-items: center; }
.nav a {
  font-family: var(--ledger);
  font-size: 0.75rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] {
  border-bottom-color: var(--seal);
  color: var(--ink);
}

@media (max-width: 560px) {
  .masthead { padding-block: 0.85rem; gap: 0.6rem; }
  .nav { gap: 0.75rem 1.1rem; width: 100%; }
  .nav a { font-size: 0.68rem; }
}

/* --- the signature: serial number plate -------------------------------- */
.serial {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--ledger);
  font-size: clamp(0.78rem, 0.72rem + 0.3vw, 0.95rem);
  letter-spacing: 0.16em;
  color: var(--seal);
  border: 1px solid currentColor;
  padding: 0.45rem 0.8rem;
  background: rgba(158, 43, 37, 0.04);
  white-space: nowrap;
}
.serial::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.serial--lg { font-size: clamp(0.95rem, 0.8rem + 0.8vw, 1.35rem); padding: 0.7rem 1.1rem; }

/* --- hero ------------------------------------------------------------- */
.hero { padding-block: clamp(3rem, 8vw, 6.5rem); text-align: center; }
.hero h1 { margin-block: 1.25rem 1rem; }
.hero h1 em {
  font-style: italic;
  color: var(--treasury);
}
.hero .lede { margin-inline: auto; max-width: 46ch; }

/* The numeral. One giant engraved 1, the way it sits on the note. */
.numeral {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(9rem, 4rem + 26vw, 22rem);
  line-height: 0.78;
  color: var(--treasury);
  display: block;
  margin: 0;
  letter-spacing: -0.04em;
  position: relative;
}
.numeral::after {
  content: "ONE DOLLAR";
  position: absolute;
  left: 50%;
  bottom: -0.4em;
  transform: translateX(-50%);
  font-family: var(--ledger);
  font-size: 0.055em;
  letter-spacing: 0.55em;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* --- tally counter ---------------------------------------------------- */
.tally {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 4.5rem);
  padding-block: 2rem;
}
.tally__item { text-align: center; }
.tally__num {
  font-family: var(--ledger);
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  display: block;
  font-variant-numeric: tabular-nums;
}
.tally__cap {
  font-family: var(--ledger);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* --- buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.95rem 1.9rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--treasury);
  color: var(--paper-lit);
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.btn:hover { background: var(--ink); color: var(--paper-lit); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper-lit); }
.btn--block { width: 100%; }
.btn--lg { padding: 1.15rem 2.4rem; font-size: 1.075rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin-top: 1.75rem;
}

/* --- ledger table ----------------------------------------------------- */
.ledger {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ledger);
  font-size: 0.85rem;
}
.ledger caption {
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 0.75rem;
}
.ledger th {
  text-align: left;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--ink);
  padding: 0.5rem 0.75rem 0.5rem 0;
}
.ledger td {
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px dotted var(--rule);
  font-variant-numeric: tabular-nums;
}
.ledger td:last-child, .ledger th:last-child { text-align: right; padding-right: 0; }
.ledger tbody tr:hover { background: rgba(31, 107, 69, 0.045); }
.ledger .empty {
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  padding-block: 2rem;
  border-bottom: 0;
}
.table-scroll { overflow-x: auto; }

/* --- cards / panels --------------------------------------------------- */
.panel {
  border: 1px solid var(--ink);
  padding: clamp(1.35rem, 3vw, 2.25rem);
  background: rgba(255, 255, 255, 0.34);
}
.panel--seal { border-color: var(--seal); }
.panel h3 { margin-bottom: 0.5rem; }
.panel p:last-child { margin-bottom: 0; }

.stat {
  font-family: var(--ledger);
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
  font-weight: 700;
  color: var(--treasury);
  display: block;
  line-height: 1;
  margin-bottom: 0.6rem;
  font-variant-numeric: tabular-nums;
}

/* --- the arithmetic block --------------------------------------------- */
.math {
  font-family: var(--ledger);
  font-size: clamp(0.95rem, 0.85rem + 0.7vw, 1.35rem);
  line-height: 2.1;
  border-top: 3px double var(--ink);
  border-bottom: 3px double var(--ink);
  padding-block: 1.5rem;
  max-width: 34rem;
  margin-inline: auto;
}
.math__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-variant-numeric: tabular-nums;
}
.math__row--total {
  border-top: 1px solid var(--ink);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  font-weight: 700;
  color: var(--treasury);
}

/* --- give form -------------------------------------------------------- */
.give-grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
@media (min-width: 900px) { .give-grid { grid-template-columns: 1.15fr 0.85fr; align-items: start; } }

.field { margin-bottom: 1.15rem; }
.field label {
  display: block;
  font-family: var(--ledger);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="number"] {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper-lit);
  color: var(--ink);
}
.field input:focus { outline: 2px solid var(--seal); outline-offset: 1px; }
.hint { font-size: 0.82rem; color: var(--ink-soft); margin: 0.4rem 0 0; }

/* padding-top leaves room for the flag that sits above the first chip */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-top: 0.75rem; }
.chip {
  position: relative;
  font-family: var(--ledger);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.chip:hover { background: rgba(31,107,69,.1); }
.chip[aria-pressed="true"] {
  background: var(--treasury);
  color: var(--paper-lit);
  border-color: var(--treasury);
}
.chip--flag::after {
  content: "MOST GIVE THIS";
  position: absolute;
  top: -0.65rem; left: 50%;
  transform: translateX(-50%);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  background: var(--seal);
  color: var(--paper-lit);
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
}

.summary {
  font-family: var(--ledger);
  border: 1px solid var(--ink);
  padding: 1.35rem;
  background: rgba(255,255,255,.4);
}
.summary__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.45rem;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.summary__row--total {
  border-top: 1px solid var(--ink);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.notice {
  border-left: 3px solid var(--seal);
  background: rgba(158,43,37,.05);
  padding: 1rem 1.15rem;
  font-size: 0.92rem;
  margin-block: 1.5rem;
}
.notice strong { font-weight: 700; }
.notice p:last-child { margin-bottom: 0; }

.notice--ok { border-left-color: var(--treasury); background: rgba(31,107,69,.06); }

/* --- footer ----------------------------------------------------------- */
.foot {
  border-top: 3px double var(--ink);
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) 2rem;
  font-size: 0.9rem;
}
.foot__grid { display: grid; gap: 2rem; margin-bottom: 2.5rem; }
@media (min-width: 760px) { .foot__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h4 {
  font-family: var(--ledger);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
  font-weight: 700;
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 0.5rem; }
.foot a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot a:hover { border-bottom-color: var(--seal); }
.colophon {
  font-family: var(--ledger);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem;
  z-index: 10;
  background: var(--ink);
  color: var(--paper-lit);
  padding: 0.7rem 1.1rem;
}

/* --- print: the receipt actually prints ------------------------------- */
@media print {
  body { background: #fff; }
  .masthead, .foot, .btn-row, .nav { display: none; }
  .frame__inner { border: 0; outline: 0; }
}
