/* ==========================================================================
   Patsy's Grace — patsysgrace.org
   Single stylesheet. Design tokens first, then layout, then components.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------
   Only the latin and latin-ext subsets are shipped; the browser downloads a
   file only if the page actually contains characters in its unicode-range.
   ------------------------------------------------------------------------ */
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('assets/fonts/karla-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('assets/fonts/karla-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('assets/fonts/newsreader-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('assets/fonts/newsreader-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokens --------------------------------------------------------------- */
:root {
  --bg:          #f8f6fc;
  --ink:         #242231;  /* headings */
  --body:        #3d3b48;  /* body copy */
  --muted:       #585663;  /* secondary copy, footer */
  --accent:      #595384;
  --accent-dark: #3e3866;
  --rule:        #d9d6e4;
  --rule-strong: #827d92;
  --card-lilac:  rgb(250 250 255 / 0.94);
  --card-lilac-edge: #d7d7eb;
  --card-rose:   rgb(255 248 254 / 0.94);
  --card-rose-edge:  #e5d3e0;

  --serif: Newsreader, Georgia, 'Times New Roman', serif;
  --sans:  Karla, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --measure: 1080px;   /* content max width */
  --gutter:  28px;
  --section-gap: 84px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul { margin: 0; }
img { display: block; max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}

/* Visible only to screen readers. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Keyboard-only shortcut past the header. */
.skip-link {
  position: fixed;
  left: 12px; top: 12px;
  z-index: 100;
  transform: translateY(-200%);
  padding: 10px 14px;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.18);
}
.skip-link:focus { transform: translateY(0); text-decoration: none; }

/* --- Decorative background ------------------------------------------------
   Floral artwork bleeds off the top and bottom of the viewport, softened by a
   radial veil so text stays legible over it. Purely decorative: hidden from
   assistive technology.
   ------------------------------------------------------------------------ */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.backdrop__flowers {
  position: absolute;
  left: 0; right: 0;
  width: 100%;
  height: min(340px, 42vh);
  object-fit: cover;
}
.backdrop__flowers--top    { top: 0;    object-position: top center; }
.backdrop__flowers--bottom { bottom: 0; object-position: bottom center; }
.backdrop__veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(max(72vw, 620px) max(62vh, 520px) at 50% 42%,
    rgb(251 249 254 / 0.93),
    rgb(251 249 254 / 0.55) 62%,
    transparent 82%);
}

/* Everything above the backdrop. */
.page { position: relative; z-index: 1; }

/* --- Layout --------------------------------------------------------------- */
.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 28px 22px;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 25px;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.wordmark:hover { color: var(--accent-dark); text-decoration: none; }

.site-nav a { padding-block: 10px; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 26px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Each section: a small label column beside a wider content column. */
.section { padding-top: var(--section-gap); scroll-margin-top: 24px; }

.section__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px 56px;
  border-top: 1px solid var(--rule);
  padding-top: 34px;
}
@media (min-width: 880px) {
  .section__grid { grid-template-columns: minmax(160px, 1fr) 2fr; }
}

.section__label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* --- Hero ----------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
  align-items: center;
  border-top: 1px solid var(--rule);
  padding-top: 56px;
  margin-top: 18px;
}
@media (min-width: 880px) {
  .hero { grid-template-columns: 1fr 1fr; }
}

.hero__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}
.hero__lede {
  margin-top: 22px;
  max-width: 46ch;
  font-size: 19px;
  color: var(--muted);
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-block;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--accent);
  color: #fbf9ff;
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--accent-dark);
  color: #fbf9ff;
}

.btn--ghost {
  border-color: var(--rule);
  color: var(--body);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--rule-strong);
  color: var(--ink);
}

/* --- Photos --------------------------------------------------------------- */
.photo {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo--hero  { aspect-ratio: 4 / 3; min-height: 240px; }
.photo--patsy { aspect-ratio: 3 / 4; min-height: 220px; margin-top: 24px; }

/* Credit is hidden at rest and revealed on hover. The reveal is wrapped in a
   hover-capable media query rather than left bare, so it never matches on a
   device whose primary input cannot hover: every phone, and any tablet with no
   pointing device attached. That is also what stops iOS Safari from applying a
   sticky :hover after a tap and pinning the badge open. hover: hover reports on
   the primary input only, so a machine that has a touchscreen AND a mouse still
   reveals it; that is fine, since a visitor with a pointer can hover on
   purpose. Sighted visitors on touch-only devices see no credit; the .sr-only
   span in the markup keeps the attribution in the accessibility tree
   everywhere. */
.photo__credit {
  position: absolute;
  right: 10px; bottom: 10px;
  padding: 5px 10px;
  border-radius: 3px;
  background: rgb(22 20 30 / 0.62);
  color: #fcfbfe;
  font-size: 12px;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
@media (hover: hover) {
  .photo:hover .photo__credit { opacity: 1; }
}

/* Outside the hover gate on purpose, so it still works if a focusable element
   is ever added inside .photo. Nothing in there is focusable today. */
.photo:focus-within .photo__credit { opacity: 1; }

/* --- Prose ---------------------------------------------------------------- */
.statement {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.5;
  color: var(--ink);
  max-width: 60ch;
  text-wrap: pretty;
}
.statement--sm { font-size: clamp(19px, 2.2vw, 24px); }

.prose {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 62ch;
  text-wrap: pretty;
}

.narrow { max-width: 56ch; }

/* The email is the only action on the site, so it carries the section's
   emphasis rather than the sentence introducing it. */
.contact-email { margin-top: 14px; }
.contact-email a { text-underline-offset: 4px; }
.contact-email a:hover { text-decoration-thickness: 2px; }

/* --- Cards ---------------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.card {
  padding: 26px;
  border: 1px solid var(--card-lilac-edge);
  border-radius: 4px;
  background: var(--card-lilac);
  backdrop-filter: blur(2px);
}
.card--rose {
  border-color: var(--card-rose-edge);
  background: var(--card-rose);
}
.card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.25;
  color: var(--ink);
}
.card p { margin-top: 10px; color: var(--muted); }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  margin-top: 96px;
  padding-block: 30px 56px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  justify-content: space-between;
  font-size: 14.5px;
  color: var(--muted);
}
.site-footer__org { display: flex; flex-wrap: wrap; gap: 4px 18px; }

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

/* --- 404 page -------------------------------------------------------------
   Lives here rather than in a <style> block on 404.html so styles.css stays
   the single answer to "where do I change how it looks".
   ------------------------------------------------------------------------ */
.notfound {
  min-height: 68vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 80px;
}
.notfound .hero__title { margin-top: 18px; }
