/* ============================================================
   styles.css — peggyfitzsimmons.com redesign
   One coherent system, inherited from style-tile.html.
   Palette and letterforms are drawn from the homepage painting:
   indigo tree ink, watercolor blue, pale luminous sky.
   ============================================================ */

/* ---------- Fonts ---------- */

/* Poppins 500 (labels, buttons, nav) — self-hosted */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/poppins-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/poppins-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113;
}

/* ---------- Design tokens (the style tile, verbatim) ---------- */

:root {
  /* Color — every color has one job */
  --paper:    #FCFBF8;  /* the page: warm luminous white, the painting's sky */
  --ink:      #303C4B;  /* all reading text, and button labels */
  --ink-soft: #5A6879;  /* captions and attributions only */
  --heron:    #3A87AE;  /* hover states of sky-blue elements */
  --pool:     #266E93;  /* links inside reading text */
  --sky:      #53B5DF;  /* the site's blue: headings, name, menu, buttons */
  --sky-soft: #79C4E4;  /* button hover fill */
  --sky-bright: #3FC1F5; /* the name on the homepage: a brighter sky */
  --wash:     #EAF3F8;  /* tinted panels and image mats */
  --mist:     #DCE7EE;  /* hairline borders */
  --frame:    #78C0E8;  /* the frame around the book cover — sampled from the RELEASE title on the cover */

  /* Type — two voices */
  --font-display: "HelveticaNeue-Thin", "Helvetica Neue", Helvetica, "Nunito Sans", Arial, sans-serif;
  --font-body: "Charter", "Iowan Old Style", Palatino, Georgia, serif;
  --font-label: "Poppins", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --fs-display: clamp(2.4rem, 5vw, 3.9rem);
  --fs-h2:      clamp(1.8rem, 3vw, 2.5rem);
  --fs-h3:      1.3rem;
  --fs-lead:    1.3rem;
  --fs-body:    1.125rem;
  --fs-caption: 0.95rem;
  --fs-label:   0.8rem;

  /* Space — one rhythm everywhere */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2.5rem;
  --s-5: 4rem;
  --s-6: clamp(4.5rem, 9vw, 7.5rem);

  --measure: 62ch;
  --content-max: 1200px;
  --pad-x: clamp(1.25rem, 4vw, 3rem);
  --radius: 4px;
  --shadow: 0 10px 30px rgba(48, 60, 75, 0.07);
}

/* ---------- Base ---------- */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  /* faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.19 0 0 0 0 0.24 0 0 0 0 0.29 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23g)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 100;
  text-transform: uppercase;
  color: var(--sky);
  line-height: 1.2;
}

h1 strong, h2 strong, h3 strong {
  font-weight: 100;
}

p {
  margin-block: var(--s-2);
  max-width: var(--measure);
}

em { font-style: italic; }

a {
  color: var(--pool);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease;
}
a:hover { color: var(--heron); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--pool);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--sky); color: #fff; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--pool);
  padding: 0.5em 1em;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header — a quiet sticky nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: transparent;
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

.site-header.is-scrolled {
  background: rgba(252, 251, 248, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--mist);
}

.header-inner {
  position: relative;
  z-index: 11;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: var(--s-3) var(--pad-x);
}

.site-title {
  font-family: var(--font-display);
  font-weight: 100;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--sky);
  text-decoration: none;
  white-space: nowrap;
}
.site-title:hover { color: var(--heron); }

/* on the home page the name sits large and bright over the painting */
.page-home .site-title {
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
  color: var(--sky-bright);
}

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  column-gap: 1.8em;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--sky);
  text-decoration: none;
  padding-bottom: 0.4em;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  border-bottom-color: var(--sky);
}

.site-nav a[aria-current="page"] {
  border-bottom-color: currentColor;
}

/* burger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle .burger-bar {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--sky);
  margin: 7px 0;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* mobile overlay menu */
.mobile-nav { display: none; }

body.nav-open .mobile-nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.6rem;
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 9;
  padding: 22vh 10vw 10vh;
  overflow-y: auto;
}

.mobile-nav a {
  font-family: var(--font-display);
  font-weight: 100;
  font-size: clamp(1.7rem, 7vw, 2.4rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sky);
  text-decoration: none;
}

.mobile-nav a[aria-current="page"] {
  border-bottom: 2px solid currentColor;
  align-self: flex-start;
}

body.nav-open { overflow: hidden; }

body.nav-open .nav-toggle .burger-bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
body.nav-open .nav-toggle .burger-bar:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle .burger-bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------- Shared section shell ---------- */

.section-inner {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: var(--s-6) var(--pad-x);
}

/* consecutive sections share one breath, not two */
main section + section .section-inner {
  padding-top: 0;
}

/* Section header treatment: eyebrow + heading */

.eyebrow {
  display: block;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--pool);
  margin-bottom: var(--s-1);
}

.section-heading {
  font-size: var(--fs-h2);
  letter-spacing: 0.11em;
}


.section-head { margin-bottom: var(--s-4); }
.section-head--center { text-align: center; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.2;
  padding: 1.05em 2.2em;
  border-radius: var(--radius);
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.btn--primary {
  background: var(--sky);
  color: var(--ink);
  border: 1px solid var(--sky);
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--sky-soft);
  border-color: var(--sky-soft);
  color: var(--ink);
  transform: translateY(-1px);
}

.btn--quiet {
  background: transparent;
  color: var(--pool);
  border: 1px solid currentColor;
}
.btn--quiet:hover,
.btn--quiet:focus-visible {
  background: var(--wash);
  color: var(--pool);
  transform: translateY(-1px);
}

/* ---------- Reveal on scroll (added by JS; page is whole without it) ----------
   The safety animation guarantees nothing can ever stay hidden: if the
   scroll-reveal fails to fire for any reason, every element fades in on
   its own within two seconds of page load. ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s ease, transform 0.9s ease;
  animation: reveal-safety 0.9s ease 1.8s forwards;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
  animation: none;
}

@keyframes reveal-safety {
  to { opacity: 1; transform: none; }
}

/* ---------- Home: the breathing hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 26%;
  background: linear-gradient(to bottom, rgba(252, 251, 248, 0.5), rgba(252, 251, 248, 0));
  pointer-events: none;
}

.hero img {
  width: 100%;
  height: auto;
}

/* on the home page the header floats over the full-bleed painting,
   so the image bleeds to the very top of the page (as on the live site) */
.site-header--overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.hero__birds {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__birds .drift { position: absolute; }
.drift { animation: drift 26s ease-in-out infinite alternate; }
.drift--2 { animation-duration: 34s; animation-delay: -8s; }
.drift--3 { animation-duration: 42s; animation-delay: -17s; }

@keyframes drift {
  from { transform: translate(0, 0) rotate(0deg); }
  to   { transform: translate(28px, -20px) rotate(-3deg); }
}

/* ---------- Meet Peggy ---------- */

.about-grid {
  display: grid;
  grid-template-areas:
    ".     heading"
    "photo body";
  grid-template-columns: 38% 1fr;
  grid-template-rows: auto 1fr;
  column-gap: clamp(2rem, 5%, 4rem);
  align-items: start;
}

.about-photo {
  grid-area: photo;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.about-head {
  grid-area: heading;
  margin-bottom: var(--s-3);
}

.about-heading {
  font-size: var(--fs-h2);
  letter-spacing: 0.11em;
}

.about-body { grid-area: body; }

/* the photo's top edge sits flush with the first line of the story */
.about-body > p:first-child { margin-top: 0; }
.about-photo { margin-top: 0.45rem; }

/* ---------- The Book / Connect: image + text split ---------- */

.card-split {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  column-gap: clamp(2.5rem, 8%, 6rem);
  align-items: start;
}

.card-split__heading {
  font-size: var(--fs-h2);
  letter-spacing: 0.11em;
  margin-bottom: 0.4em;
}

.card-split .btn { margin-top: var(--s-3); }

/* the book cover floats on the page, lifted by a soft halo on all sides so
   its edges stay defined against the warm-white paper (no frame, no mat) */
.book-cover {
  margin: 0;
}
.book-cover img {
  box-shadow: 0 0 30px rgba(48, 60, 75, 0.28),
              0 16px 34px rgba(48, 60, 75, 0.28);
}

/* The Book page carries two offerings — the book and the course — built as a
   matching pair. The workbook sits a touch smaller than the book cover, but its
   column keeps the book's width so both text columns start on the same line. */
.course .book-cover { max-width: 300px; }
.course .book-cover img { width: 100%; height: auto; }

/* the first line of the course copy sits level with the top of its cover */
.course .card-split__body > p:first-child { margin-top: 0; }

/* both section headings sit over the text column, not over the cover, so they
   line up with each other and with the paragraphs beneath them */
.book .section-head,
.course .section-head {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  column-gap: clamp(2.5rem, 8%, 6rem);
}

.book .section-head > *,
.course .section-head > * { grid-column: 2; }

/* the connect photo needs only a quiet frame */
.photo-frame {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 0;
}

/* ---------- Praise / testimonials ---------- */

.pull-quote {
  font-style: italic;
  font-size: var(--fs-lead);
  line-height: 1.6;
  max-width: 34em;
  margin-inline: auto;
  padding-left: var(--s-3);
  border-left: 2px solid var(--sky);
  text-align: left;
}

.pull-quote p { margin-top: 0; max-width: none; }

.pull-quote footer,
.testimonial footer {
  margin-top: var(--s-2);
  font-style: normal;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.8;
}

.quote-stack {
  display: grid;
  gap: var(--s-5);
}

.testimonial {
  border-left: 2px solid var(--sky);
  padding: var(--s-4);
}
.testimonial blockquote { font-style: italic; }
.testimonial blockquote p { margin-top: 0; }

.testimonial-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  align-items: start;
  margin-top: var(--s-5);
}

/* on The Book the heading above already carries the spacing */
.page-thebook .testimonial-cols {
  margin-top: 0;
}

.testimonial--lead {
  max-width: 46em;
  margin-inline: auto;
}

/* ---------- Media: one unified set of tiles ---------- */

.media-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
  padding: 0;
  margin: 0;
}

.media-tile {
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.media-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(48, 60, 75, 0.12);
}

.media-tile a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  height: 100%;
}

.media-tile .tile__mat {
  background: #fff;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: var(--s-3);
}

.media-tile .tile__mat img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0;
}

.tile__label {
  padding: var(--s-2) var(--s-3);
  font-family: var(--font-label);
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink);
}

/* one card holding several articles (the Sunday Paper pieces):
   the banner appears once, the articles list beneath it */
.media-tile--group:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.media-tile--group .tile__mat {
  aspect-ratio: auto;
}

.tile__links {
  list-style: none;
  padding: var(--s-2) var(--s-3) var(--s-3);
  margin: 0;
  display: grid;
  gap: 0.7em;
  text-align: center;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tile__links a {
  color: var(--pool);
  text-decoration: none;
}

.tile__links a:hover,
.tile__links a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* ---------- Connect ---------- */

.page-connect .testimonial-cols {
  margin-top: var(--s-4);
  gap: var(--s-3);
}

.contact-link {
  color: var(--pool);
  font-weight: bold;
  text-decoration: underline;
}

/* ---------- Inspiration ---------- */

.writings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  align-items: stretch;
}

.writing-item {
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.writing-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.writing-item__body {
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.writing-item h2,
.writing-item h3 {
  font-size: clamp(0.95rem, 1.55vw, 1.15rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin-bottom: var(--s-2);
  white-space: nowrap;
}

.writing-item p {
  margin-inline: auto;
  text-align: left;
}

.writing-item .btn {
  margin-top: var(--s-3);
  align-self: center;
}

.visuals-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 15 cards: three clean rows of five */
  gap: var(--s-3);
  padding: 0;
  margin: 0;
}

.visuals-grid img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: var(--s-5) var(--pad-x) var(--s-6);
  border-top: 1px solid var(--mist);
}

.footer-wordmark {
  max-width: none;
  font-family: var(--font-display);
  font-weight: 100;
  font-size: 1.15rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--s-3);
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  column-gap: 2em;
  row-gap: 0.5em;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* ---------- Reduced motion: a perfectly still site ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; animation: none; }
  .drift { animation: none; }
  .btn, .media-tile { transition: none; }
}
