/* vessey.org holding site. Palette, type and the iris bloom come from the grants project's
   brand (iris-vessey-grants/static/css/site.css). No inline styles, fonts self-hosted. */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --iris: #5b3fa0;
  --iris-dark: #45307e;
  --iris-edge: #2f2157;
  --iris-pale: #cdbff0;
  --iris-mist: #a792de;
  --iris-soft: #8c73cf;
  --night: #1f1a33;
  --stem: #4f6f57;
  --stem-pale: #8dac91;
  --beard: #e8b63c;
  --white: #ffffff;
  --band: #f2f0f5;
  --muted: #4f4866;
  --danger: #a12c2c;
  --success: #2f6b3a;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --mark-top: var(--iris);
  --mark-fall: var(--iris-soft);
  --mark-stem: var(--stem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--night);
  background: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--iris); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--iris-dark); text-decoration-thickness: 3px; }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: 0.6rem 1rem; background: var(--beard); color: var(--night); font-weight: 700; }
.skip-link:focus { top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Mark colours */
.mark .m-ink { fill: var(--mark-top); }
.mark .m-fold { fill: var(--mark-fall); }
.mark .m-leaf { fill: var(--mark-stem); }
.on-night { --mark-top: var(--iris-mist); --mark-fall: var(--iris-pale); --mark-stem: var(--stem-pale); }
.on-night a:not(.button) { color: var(--white); }

/* Header and footer */
.site-header { background: var(--night); color: var(--white); }
.site-header-inner, .site-footer-inner { max-width: 72rem; margin: 0 auto; padding: 0.75rem 1rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1.5rem; }
.brand { display: flex; align-items: center; gap: 0.65rem; color: var(--white); text-decoration: none; min-height: 48px; }
.brand:hover { color: var(--white); }
.brand-name { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name strong { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; }
.brand-name span { font-size: 1rem; line-height: 1.25; color: var(--iris-pale); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; font-weight: 700; }
.site-nav a { min-height: 48px; display: inline-flex; align-items: center; color: var(--white); text-decoration: none; border-bottom: 4px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--iris-pale); }

main { flex: 1 0 auto; width: 100%; }

.site-footer { background: var(--night); color: var(--iris-pale); font-size: 1rem; border-top: 6px solid var(--iris); }
.site-footer-inner { padding: 2rem 1rem; justify-content: flex-start; gap: 0.75rem 1.25rem; }
.site-footer p { margin: 0; }
.site-footer-text { display: flex; flex-direction: column; gap: 0.15rem; }

/* Cover: the iris grows and blooms in the night band */
.cover { background: var(--night); color: var(--white); position: relative; overflow: hidden; border-bottom: 6px solid var(--iris); min-height: 32rem; }
.cover-inner { position: relative; z-index: 1; max-width: 72rem; margin: 0 auto; padding: 4.5rem 1rem 5.5rem; }
.cover-text { max-width: min(36rem, 56%); }
.cover h1 { font-size: clamp(2.5rem, 1.6rem + 4vw, 4.5rem); line-height: 1.02; color: var(--white); }
.cover .lead { color: var(--iris-pale); font-size: 1.25rem; }
.cover-art { position: absolute; z-index: 0; right: max(1.5rem, calc((100vw - 72rem) / 2)); bottom: -9rem; width: min(26rem, 38vw); height: auto; pointer-events: none; }
.iris-wind-root, .iris-wind-leaf, .iris-wind-head, .iris-wind-fall { transform-box: view-box; }
.iris-wind-root { transform-origin: 480px 1470px; }
.iris-wind-leaf { transform-origin: 510px 1360px; }
.iris-wind-head, .iris-wind-fall { transform-origin: 522px 535px; }
@media (max-width: 47.99rem) {
  .cover { display: flex; flex-direction: column; min-height: auto; }
  .cover-inner { width: 100%; padding: 2rem 1rem 1.25rem; }
  .cover-text { max-width: 34rem; }
  .cover-art { position: relative; right: auto; bottom: auto; flex: none; align-self: flex-end; width: min(16rem, 70vw); height: auto; margin: 0 0.5rem -2rem 0; }
}

/* Bands */
.band { padding: 3.5rem 0; }
.band-grey { background: var(--band); }
.band-inner { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 44rem; }
.areas-grid { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); border-top: 6px solid var(--iris); }
.areas-grid li { padding: 1.25rem 0; border-bottom: 1px solid #cfcad9; }
.areas-grid h3 { color: var(--iris); margin-bottom: 0.4rem; }
.areas-grid p { margin: 0; }
.exploring-h { color: var(--stem); margin-top: 2.5rem; }
@media (min-width: 48rem) {
  .areas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3rem; }
}

/* Buttons */
.button, button[type="submit"] {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 1.5rem; margin-top: 0.5rem;
  font: 700 1.1rem var(--font-body); text-decoration: none; cursor: pointer;
  background: var(--iris); color: var(--white); border: 0; border-radius: 0; box-shadow: 0 3px 0 var(--iris-edge);
}
.button:hover, button[type="submit"]:hover { background: var(--iris-dark); color: var(--white); }
.button.accent { background: var(--beard); color: var(--night); box-shadow: 0 3px 0 #9c7313; }
.button.accent:hover { background: #f0c453; color: var(--night); }
button[type="submit"][disabled] { opacity: 0.7; cursor: progress; }

/* Form */
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.field .hint { display: block; color: var(--muted); font-size: 1rem; margin-bottom: 0.35rem; }
input[type="text"], input[type="email"], textarea {
  width: 100%; min-height: 48px; padding: 0.6rem 0.75rem;
  font: inherit; color: var(--night); background: var(--white);
  border: 2px solid var(--night); border-radius: 0;
}
textarea { min-height: 10rem; resize: vertical; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 1rem; padding: 1rem 1.25rem; font-weight: 700; }
.form-status:empty { display: none; }
.form-status.ok { background: var(--success); color: var(--white); }
.form-status.error { background: var(--danger); color: var(--white); }
.cf-turnstile { margin: 0.5rem 0 1rem; }

/* Bloom: only when motion is fine */
@media (prefers-reduced-motion: no-preference) {
  .cover-art .iris-plant { transform-origin: 480px 1470px; animation: iris-grow 1.15s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; }
  .cover-art .iris-leaf-left, .cover-art .iris-leaf-right { transform-origin: 510px 1360px; animation: iris-leaf-open 1.12s cubic-bezier(0.22, 0.61, 0.36, 1) 0.22s both; }
  .cover-art .iris-leaf-left { --leaf-turn: 24deg; }
  .cover-art .iris-leaf-right { --leaf-turn: -24deg; animation-delay: 0.34s; }
  .cover-art .iris-petal { transform-origin: 522px 535px; animation-duration: 1.95s; animation-timing-function: cubic-bezier(0.35, 0, 0.3, 1); animation-fill-mode: both; }
  .cover-art .iris-standard-center { --petal-turn: 0deg; animation-name: iris-standard-open; animation-delay: 0.78s; }
  .cover-art .iris-standard-left { --petal-turn: 40deg; animation-name: iris-standard-open; animation-delay: 0.8s; }
  .cover-art .iris-standard-right { --petal-turn: -40deg; animation-name: iris-standard-open; animation-delay: 0.82s; }
  .cover-art .iris-fall-left { --petal-turn: 132deg; animation-name: iris-fall-open; animation-delay: 0.5s; }
  .cover-art .iris-fall-right { --petal-turn: -132deg; animation-name: iris-fall-open; animation-delay: 0.52s; }
  .cover-art .iris-fall-center { animation-name: iris-front-open; animation-delay: 0.54s; }
  @keyframes iris-grow { from { transform: scale(0.42, 0.015); } to { transform: none; } }
  @keyframes iris-leaf-open { from { transform: rotate(var(--leaf-turn)) scale(0.12, 0.32); } to { transform: none; } }
  @keyframes iris-standard-open { from { transform: scale(0.16, 0.52) rotate(var(--petal-turn)); } to { transform: scale(1, 1) rotate(0deg); } }
  @keyframes iris-fall-open { from { transform: scale(0.17, 0.6) rotate(var(--petal-turn)); } to { transform: scale(1, 1) rotate(0deg); } }
  @keyframes iris-front-open { from { transform: scale(0.2, 0.62) rotateX(170deg); } to { transform: scale(1, 1) rotateX(0deg); } }
}

/* Focus: gold with night, as in the brand */
:focus-visible { outline: 3px solid var(--night); outline-offset: 3px; box-shadow: 0 0 0 3px var(--beard); }
.on-night :focus-visible { outline-color: var(--white); }
main:focus { outline: none; box-shadow: none; }
.button:focus-visible, button[type="submit"]:focus-visible { outline: 3px solid transparent; background: var(--beard); color: var(--night); box-shadow: 0 3px 0 var(--night); }
.on-night .button:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
