/* Boston Angel Fund — two-ink organizing zine.
   Inks: riso Medium Blue and Sunflower on copier white. Overprint is what
   blue looks like printed over sunflower; it is used for small text on
   sunflower. No third colour. */

/* Self-hosted fonts, SIL Open Font License 1.1: see /fonts/LeagueGothic-OFL.txt and /fonts/AtkinsonHyperlegible-OFL.txt */
@font-face {
  font-family: "League Gothic";
  src: url("../fonts/league-gothic.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-017F, U+02C6, U+02DA, U+02DC, U+0300-0328, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-hyperlegible-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-017F, U+02C6, U+02DA, U+02DC, U+0300-0328, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-hyperlegible-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-017F, U+02C6, U+02DA, U+02DC, U+0300-0328, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  --blue: #3255A4;   /* 6.8:1 on paper */
  --sun: #FFB511;
  --over: #2E3A10;   /* 6.9:1 on sunflower */
  --paper: #FBFAF6;
  --gutter: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --rule: 3px;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 68px; /* lands a section's top rule on the header's rule */
  scrollbar-color: var(--blue) var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--paper);
  /* faint copier-paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .3 0 0 0 0 .6 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--blue);
  font: 400 1.125rem/1.55 "Atkinson Hyperlegible", system-ui, sans-serif;
  caret-color: var(--blue);
  text-rendering: optimizeLegibility;
}

::selection { background: var(--sun); color: var(--over); }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.on-blue :focus-visible { outline-color: var(--sun); }
#main:focus { outline: none; }
img, svg { display: block; }
p, li { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

.nowrap, a[href^="tel:"] { white-space: nowrap; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: var(--gutter); top: 0; z-index: 50; transform: translateY(-110%);
  background: var(--blue); color: var(--paper); padding: .7em 1em; font-weight: 700;
}
.skip:focus { transform: translateY(12px); }

.display {
  font-family: "League Gothic", "Arial Narrow", sans-serif; font-synthesis: none;
  font-weight: 400;
  text-transform: uppercase;
  line-height: .9;
  letter-spacing: .01em;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
svg.i {
  width: 1.1em; height: 1.1em; flex: none; display: inline-block;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: var(--rule) solid var(--blue);
}
.bar { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.home { display: flex; align-items: center; text-decoration: none; color: var(--blue); }
.home img { display: block; height: 56px; width: auto; }
.nav { position: relative; display: flex; flex-wrap: wrap; gap: 4px 26px; margin-left: auto; font-weight: 700; font-size: .95rem; }
.nav a { position: relative; z-index: 1; padding: 6px 0; text-decoration: none; }
.nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .35em; }
.nav-ink {
  position: absolute; left: 0; bottom: 2px; width: 100px; height: 8px;
  background: var(--sun); mix-blend-mode: multiply; transform-origin: 0 50%;
  transform: translateX(var(--x, 0)) scaleX(var(--s, 0));
  transition: transform .45s var(--ease);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  font: 700 1.05rem/1 "Atkinson Hyperlegible", system-ui, sans-serif;
  padding: .85em 1.2em; min-height: 48px;
  border: var(--rule) solid var(--blue); background: transparent; color: var(--blue);
  text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s;
}
.btn .arrow { transition: transform .2s var(--ease); }
.btn:active { transform: translateY(0); box-shadow: 0 2px 6px -2px rgba(50, 85, 164, .4); transition-duration: .08s; }
.btn.sun { background: var(--sun); border-color: var(--sun); color: var(--over); } /* small text on sunflower prints in overprint: 6.9:1 */
.btn.blue { background: var(--blue); color: var(--paper); }
.btn.paper { background: var(--paper); border-color: var(--paper); color: var(--blue); }
.btn.small { font-size: .95rem; padding: .6em .95em; min-height: 44px; }
.btn[data-done] { background: var(--sun); border-color: var(--sun); color: var(--over); }
.btn .done, .btn[data-done] .ready { display: none; }
.btn[data-done] .done { display: inline-flex; align-items: center; gap: .55em; }
.btn .ready { display: inline-flex; align-items: center; gap: .55em; }
html:not(.js) .needs-js { display: none !important; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(32px, 5vw, 72px);
  padding-block: clamp(36px, 6vw, 80px) clamp(48px, 7vw, 96px);
}
.hero h1 { font-size: clamp(3.2rem, 6.4vw, 5.25rem); margin-top: clamp(20px, 3vw, 36px); }
.hero h1 .line { display: block; }
/* The highlight is sunflower ink under blue letters: the ink is its own plate. */
.hl { position: relative; z-index: 0; display: inline-block; padding: 0 .12em; margin-left: -.12em; }
/* the band prints over the letters: where the plates cross, blue becomes overprint */
.hl::before { content: ""; position: absolute; inset: 8% 0 12%; z-index: 1; background: var(--sun); mix-blend-mode: multiply; pointer-events: none; }
.lede { font-size: clamp(1.15rem, 1.6vw, 1.35rem); max-width: 36ch; margin-top: 1.5rem; }

.doors { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 48px); align-self: center; }
.door { position: relative; display: block; padding: clamp(24px, 3vw, 36px); transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
.door h2 { font-size: clamp(2.6rem, 4.6vw, 3.9rem); }
.door p { margin-top: .6rem; max-width: 32ch; }
.door .acts { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 1.3rem; }
.door .address { margin-top: .8rem; }
/* Give door: sunflower plate under blue and overprint type. */
.door-give { color: var(--blue); isolation: isolate; }
.door-give::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--sun); }
.door-give p { color: var(--over); }
.door-give .go { color: var(--over); font-weight: 700; display: inline-flex; align-items: center; gap: .4em; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }
.door-give .go .arrow { transition: transform .2s var(--ease); }
.door-give .go::after { content: ""; position: absolute; inset: 0; } /* the whole card follows its one link */
.door-help { background: var(--blue); color: var(--paper); }
.door-help a:not(.btn) { color: var(--paper); font-weight: 700; }

/* ---------- sections ---------- */
.section { padding-block: clamp(56px, 8vw, 112px); border-top: var(--rule) solid var(--blue); }
.section h2 { font-size: clamp(2.8rem, 6vw, 4.6rem); max-width: 24ch; }
.intro { max-width: 62ch; margin-top: 1rem; font-size: 1.2rem; }
.small-print { font-size: .95rem; margin-top: 1.2rem; max-width: 70ch; }

/* help steps */
.steps {
  list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 48px); margin-top: clamp(32px, 4vw, 56px);
}
.steps li { position: relative; padding-top: 8px; border-top: var(--rule) solid var(--blue); }
.steps li:nth-child(2) { --i: 1; }
.steps li:nth-child(3) { --i: 2; }
.num {
  position: relative; isolation: isolate; display: inline-block; padding: 0 .12em; margin-left: -.12em;
  font-family: "League Gothic", "Arial Narrow", sans-serif; font-synthesis: none; font-size: 6rem; line-height: 1;
}
.num::before {
  content: ""; position: absolute; inset: 14% 0 8%; z-index: 1; pointer-events: none;
  background: var(--sun); mix-blend-mode: multiply; clip-path: inset(0);
}
.steps h3 { font: 400 2.3rem/1 "League Gothic", "Arial Narrow", sans-serif; text-transform: uppercase; }
.steps p { margin-top: .5rem; max-width: 36ch; }
.row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.1rem; }
.address { font-size: .95rem; margin-top: .9rem; word-break: break-word; }

.urgent {
  margin-top: clamp(36px, 5vw, 64px); padding: 20px 24px;
  border: var(--rule) dashed var(--blue);
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline;
}
.urgent h3 { font: 400 1.9rem/1 "League Gothic", "Arial Narrow", sans-serif; text-transform: uppercase; }
.urgent a { font-weight: 700; }
.urgent p { max-width: 50ch; }

.alongside {
  display: grid; grid-template-columns: minmax(12ch, 1fr) 3fr; gap: 12px 40px;
  margin-top: clamp(40px, 5vw, 72px); padding-top: 20px; border-top: var(--rule) solid var(--blue);
}
.alongside h3 { font: 400 2.3rem/1 "League Gothic", "Arial Narrow", sans-serif; text-transform: uppercase; }
.alongside p { max-width: 52ch; }
.alongside p + p { margin-top: .7rem; }

/* give */
.give-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: end; }
.facts { list-style: none; padding: 0; margin-top: 1.4rem; display: grid; gap: .6rem; max-width: 52ch; }
.facts li { display: flex; gap: .6em; align-items: baseline; }
.facts svg { transform: translateY(3px); }
.give-box { background: var(--sun); color: var(--over); padding: clamp(24px, 3vw, 40px); }
.give-box .goal { font: 400 clamp(4rem, 8vw, 6rem)/.9 "League Gothic", "Arial Narrow", sans-serif; color: var(--blue); }
.give-box .row { margin-top: 1.4rem; }
.give-box .btn:not(.blue) { border-color: var(--over); color: var(--over); }

/* footer */
.site-footer { border-top: var(--rule) solid var(--blue); padding-block: 40px 120px; }
.foot { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 24px 40px; align-items: start; }
.foot h2 { font: 400 1.6rem/1 "League Gothic", "Arial Narrow", sans-serif; text-transform: uppercase; margin-bottom: .5rem; }
.foot ul { list-style: none; padding: 0; display: grid; gap: .35rem; }
.foot .small-print { margin-top: .8rem; }

/* phone door bar */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: none; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--paper); border-top: var(--rule) solid var(--blue);
  transform: translateY(110%); transition: transform .28s var(--ease), visibility 0s .28s; visibility: hidden;
}
.dock.show { transform: none; visibility: visible; transition: transform .28s var(--ease); }
.dock .btn { flex: 1; justify-content: center; }

/* ---------- hover: only where a real pointer hovers (no sticky taps) ---------- */
@media (hover: hover) {
  a:hover { text-decoration-thickness: 3px; }
  .nav a:hover { text-decoration: underline; }
  .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -6px rgba(50, 85, 164, .45); text-decoration: none; }
  .btn:hover .arrow { transform: translateX(5px); }
  .door-give:hover { transform: translateY(-3px); box-shadow: 0 18px 32px -16px rgba(50, 85, 164, .5); }
  .door-give:hover .go .arrow { transform: translateX(6px); }
}

/* ---------- the print run: the one authored moment ----------
   Every word is readable at every instant. On load the two plates start
   slightly out of registration and settle into it.
   Only ink (overprint passes) is ever undrawn — never content.
   Fill-mode is backwards so the finished animation never pins transforms
   that hover states need. */
@media (prefers-reduced-motion: no-preference) {
  .print-b { animation: reg-b .75s var(--ease) backwards; animation-delay: var(--d, 0ms); }
  .hl::before, .door-give::before { animation: reg-s .9s var(--ease) backwards; animation-delay: calc(160ms + var(--d, 0ms)); }
  .hero h1 .line:nth-child(2) { --d: 70ms; }
  .hero h1 .line:nth-child(3) { --d: 140ms; }
  .hero h1 .line:nth-child(4) { --d: 210ms; }
  .lede { --d: 280ms; }
  .door-help { --d: 200ms; }
  @keyframes reg-b { from { transform: translate(-7px, 4px); } to { transform: none; } }
  @keyframes reg-s { from { transform: translate(16px, -10px); } to { transform: none; } }

  /* help steps: ink passes over each number in order */
  html.js .steps:not(.seen) .num::before { clip-path: inset(0 100% 0 0); }
  .num::before { transition: clip-path .5s var(--ease) calc(var(--i, 0) * 160ms + 100ms), transform .2s var(--ease); }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .steps li:hover .num::before { transform: translate(3px, -2px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .door-give:hover, .btn:hover .arrow, .door-give:hover .go .arrow { transform: none; }
  .nav-ink, .dock { transition-duration: .01s; }
}

/* ---------- Windows high contrast / forced colours ---------- */
@media (forced-colors: active) {
  .nav-ink { mix-blend-mode: normal; }
  .hl::before, .num::before { display: none; } /* forced colours paint them opaque, over the letters */
}

/* ---------- small screens (em, so larger default fonts get the phone layout) ---------- */
@media (max-width: 53.75em) {
  html { scroll-padding-bottom: 96px; } /* keep focused controls clear of the dock */
  .nav, .header-donate { display: none; }
  .hero, .give-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr; }
  .dock { display: flex; }
  .alongside { grid-template-columns: 1fr; }
}
/* phones in landscape: let the header scroll away so content keeps the screen */
@media (max-width: 53.75em) and (max-height: 500px) {
  .site-header { position: relative; }
  html { scroll-padding-top: 16px; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .dock, .needs-js { display: none !important; }
  body { background: #fff; }
  .section { break-inside: avoid; }
}

/* ---------- 404 page ---------- */
.notfound { border-top: 0; }
.notfound h1 { font-size: clamp(3rem, 8vw, 6rem); }
.notfound .row { margin-top: 2rem; }
