/* =========================================================================
   Loving Hospitality — Andy Pearce
   Tokens from design_handoff_andy_pearce_site/README.md lines 75-96.

   One deliberate deviation: --muted-caption darkens the handoff's #8a8a91 /
   #97979e / #8f8f97 to reach WCAG AA at 11px. It is applied to captions AND
   to form field labels, which are the same size and colour in the handoff and
   fail contrast for the same reason. See spec Decision 3.
   ========================================================================= */
:root {
  --paper: #f8f6f3;
  --paper-band: #efece7;
  --field-bg: #fcfbfa;
  --ink: #17181c;
  --body: #4a4b52;
  --secondary: #5e6068;
  --muted-caption: #6a6a72;   /* was #8a8a91 / #97979e — failed AA at 11px */
  --rule: #e2ddd6;
  --rule-soft: #d8d7d2;
  --rule-strong: #cbc7c1;
  --accent: #c81230;
  --cover-red: #e51636;
  --on-dark: #f4f2ef;
  --on-dark-muted: #b6b6bd;
  /* Dark-band form labels. Kept at the handoff's value: 11px #8f8f97 on
     #17181c measures 5.55:1, so unlike the light-background captions it
     already clears AA and needed no correction. */
  --on-dark-label: #8f8f97;
  --on-dark-rule: #3c3d44;
  --serif: 'EB Garamond', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --content-max: 1120px;
  --gutter: 32px;
}

/* ============================ base ====================================== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: #ecdfe1; }
input::placeholder { color: var(--muted-caption); }

img, picture { max-width: 100%; }

/* Shared inner-width wrapper. The handoff repeats these three values on every
   section; they live here once instead. */
.hero,
.book-grid,
.andy-grid,
.action-inner,
.stories-grid,
.site-footer {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ======================= type scale =====================================
   Display sizes are fluid so the responsive pass changes layout only and
   never font-size. Body copy stays fixed — the max-width measures below
   control line length, which is what actually matters for reading. */
h1 {
  font-size: clamp(38px, 8vw, 66px);
  line-height: 1.04;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 28px;
  text-wrap: pretty;
}

h2 {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
  text-wrap: pretty;
}

.lede {
  font-size: clamp(19px, 2.4vw, 22px);
  line-height: 1.6;
  color: var(--body);
  margin: 0 0 36px;
  text-wrap: pretty;
}

.pull {
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.5;
  margin: 0 0 30px;
  text-wrap: pretty;
}

.body-copy {
  font-size: 19px;
  line-height: 1.75;
  color: var(--body);
  margin: 0 0 22px;
}
.body-copy.on-dark { color: var(--on-dark-muted); line-height: 1.7; margin: 0; }
.body-copy.last { margin: 0; }

.measure-30 { max-width: 30em; }
.measure-36 { max-width: 36em; margin-bottom: 20px; }
.measure-38 { max-width: 38em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 26px;
}
.eyebrow-dark { color: var(--cover-red); margin: 0 0 20px; }

/* The handoff uses a different eyebrow bottom-margin per section: 26px in the
   hero, 14px in the book band, 20px in About Andy. Scoped rather than
   generalised -- using the hero value everywhere pushed the book title 12px
   low against the reference. */
.book-grid .eyebrow { margin-bottom: 14px; }
.andy-grid .eyebrow { margin-bottom: 20px; }

.caption {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-caption);
  letter-spacing: 0.06em;
  margin: 12px 0 0;
}

.note-mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-caption);
}

/* ========================= buttons & links ============================== */
.btn-primary {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 16px 30px;
  border-radius: 2px;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.btn-primary:hover { background: var(--accent); color: var(--paper); }

.btn-outline {
  display: inline-block;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 14px 28px;
  border-radius: 2px;
  font-size: 17px;
}
.btn-outline:hover { background: var(--ink); color: var(--paper); }

.text-link {
  font-size: 17px;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 2px;
}

.btn-submit-red,
.btn-submit-dark {
  justify-self: start;
  border: 0;
  padding: 15px 32px;
  font-family: var(--serif);
  font-size: 18px;
  border-radius: 2px;
  cursor: pointer;
}
.btn-submit-red {
  margin-top: 12px;
  background: var(--cover-red);
  color: var(--ink);
}
.btn-submit-red:hover { background: var(--on-dark); }
.btn-submit-dark { background: var(--ink); color: var(--paper); }
.btn-submit-dark:hover { background: var(--accent); }

/* ============================ header ==================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 239, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-nav {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.wordmark {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.nav-links {
  display: flex;
  align-items: baseline;
  gap: 30px;
  font-size: 17px;
}

/* ============================= hero ===================================== */
.hero {
  padding: 90px var(--gutter) 100px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 72px;
  align-items: center;
}
.hero .lede { max-width: 30em; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.hero-cover { display: flex; justify-content: center; }
.cover-img {
  width: 300px;
  height: auto;
  display: block;
  box-shadow: 26px 26px 0 -1px rgba(23, 24, 28, 0.07);
}

/* ======================= alternate band sections ======================== */
.band {
  border-top: 1px solid var(--rule);
  background: var(--paper-band);
}

/* ============================ the book ================================== */
.book-grid {
  padding: 96px var(--gutter);
  display: grid;
  grid-template-columns: 0.4fr 1fr;
  gap: 64px;
}
.book-title {
  /* An h2 for document outline -- the section had no heading, so screen
     readers navigating by heading skipped it. Visually unchanged: these
     override every h2 default, including its letter-spacing. */
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: normal;
  margin: 0;
}
.book-subtitle {
  font-size: 19px;
  line-height: 1.5;
  color: var(--secondary);
  font-style: italic;
  margin: 12px 0 0;
}
.book-grid .body-copy:last-of-type { margin-bottom: 34px; }
.book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
}

/* =========================== about andy ================================= */
.andy-grid {
  padding: 100px var(--gutter);
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 72px;
  align-items: start;
}
.portrait {
  width: 100%;
  height: 560px;
  object-fit: cover;
  object-position: 50% 22%;   /* andy-chickfila — tuned crop, do not change */
  display: block;
  border: 1px solid var(--rule);
}

/* ====================== hospitality in action =========================== */
.action-inner { padding: 90px var(--gutter); }
.action-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 44px;
}
.action-head h2 {
  font-size: clamp(28px, 4.5vw, 40px);
  margin: 0;
}
.photo-grid {
  display: grid;
  /* auto-fit gives 3 / 2 / 1 columns with no media query at all. Empty
     tracks collapse, so three items always share the full width evenly.
     240px rather than 200px so the tablet step lands on 2 columns instead
     of three ~207px slivers. */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.photo-grid figure { margin: 0; }
.photo {
  width: 100%;
  /* height:auto is load-bearing. The img width/height attributes act as
     presentational hints on the CSS width/height properties; without this,
     height="820" won and aspect-ratio was ignored, so the three photos
     rendered at their own natural ratios instead of a shared 3:4. */
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}
/* 34%, not the handoff's 46%: at 46% the 1116px-wide 3:4 window starts at
   x=399 of a 1984px source and clips the youngest child, who begins at x=290,
   while wasting the tree trunk on the right. 34% centres the window on the
   family group (x=290-1430). Changed at the client's request. */
.photo-family  { object-position: 34% 45%; }
.photo-airport { object-position: 55% 40%; }  /* tuned crop — do not change */
/* New photos, all shown in the shared 3:4 box. Portraits keep the faces: the
   tops are weighted because heads sit in the upper third of each frame. */
.photo-tutoring { object-position: 50% 30%; }
.photo-work     { object-position: 50% 8%; }
.photo-quince   { object-position: 50% 8%; }
/* Landscape in a portrait box, like the family photo: 50% keeps all seven
   faces; the right-hand child's feet are trimmed. */
.photo-skater   { object-position: 50% 50%; }

/* ============================ e-stories ================================= */
.stories {
  background: var(--ink);
  color: var(--on-dark);
}
.stories-grid {
  padding: 96px var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.stories-grid h2 { margin: 0 0 22px; }

.stories-form { display: grid; gap: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; }
.field-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-caption);
}
.stories-form .field-label { color: var(--on-dark-label); }

.stories-form input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--on-dark-rule);
  color: var(--on-dark);
  font-family: var(--serif);
  font-size: 20px;
  padding: 10px 2px;
}

/* ========================= contact / footer ============================= */
.site-footer {
  padding: 80px var(--gutter) 90px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: end;
}
.footer-main { max-width: 34em; }
.say-hello {
  /* Also an h2, for the same reason. Visually unchanged. */
  font-size: 30px;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: normal;
  margin: 0 0 8px;
}
.footer-lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--secondary);
  margin: 0 0 28px;
}
.footer-lede a { text-decoration: underline; text-underline-offset: 3px; }
.contact-form { display: grid; gap: 18px; }
.contact-form input,
.contact-form textarea {
  background: var(--field-bg);
  border: 1px solid var(--rule-soft);
  padding: 13px;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
}
.contact-form textarea { resize: vertical; }

.footer-social {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}
.social-links { display: flex; gap: 24px; font-size: 17px; }
.copyright {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-caption);
  margin: 0;
}

/* =========================================================================
   Responsive. Not covered by the handoff; direction from its README.md:70-72.
   Mobile is the primary view here -- the entry point is a QR code scanned
   from an audience -- so these are not fallbacks.

   Display type is already fluid via clamp(), so nothing below changes
   font-size. Layout only.

   Deliberately no `overflow-x: hidden` guard: setting it on html makes html a
   scroll container, which can break the sticky header. Nothing should overflow
   in the first place, and the console check in the plan verifies that.
   ========================================================================= */

/* --- Tablet: collapse the multi-column sections --- */
@media (max-width: 900px) {
  .hero,
  .book-grid,
  .andy-grid,
  .stories-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero { padding-top: 56px; padding-bottom: 64px; }

  /* Cover above the headline on narrow screens (handoff README.md:71), and
     left-aligned with the copy rather than centred. */
  .hero-cover { order: -1; justify-content: flex-start; }
  .cover-img {
    width: min(240px, 58vw);
    box-shadow: 14px 14px 0 -1px rgba(23, 24, 28, 0.07);
  }

  /* A fixed 560px would swallow a phone viewport. */
  .portrait { height: auto; aspect-ratio: 4 / 5; }

  .book-grid   { padding: 64px var(--gutter); }
  .andy-grid   { padding: 64px var(--gutter); }
  .action-inner { padding: 64px var(--gutter); }
  .stories-grid { padding: 64px var(--gutter); }

  .site-footer {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 40px;
    padding: 64px var(--gutter) 72px;
  }
  .footer-social { align-items: flex-start; }
  .footer-main { max-width: none; }
}

/* --- Phone --- */
@media (max-width: 760px) {
  /* One line instead of overriding padding on six selectors: every section
     already consumes this token. */
  :root { --gutter: 20px; }

  /* Five anchor links cannot fit beside the wordmark. On a single scrolling
     page the nav is a convenience, not a necessity, so it goes -- no
     hamburger, no JS. Spec Decision 2. */
  .nav-links { display: none; }

  .field-row { grid-template-columns: 1fr; }

  .action-head { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* 44px minimum tap targets. */
  .stories-form input,
  .contact-form input,
  .contact-form textarea,
  .btn-primary,
  .btn-outline,
  .btn-submit-red,
  .btn-submit-dark { min-height: 44px; }

  .hero { padding-top: 40px; padding-bottom: 56px; }

  /* --- Centred masthead on phones ---
     The wordmark, cover, and eyebrow only. The headline, lede and buttons stay
     left-aligned: centring a four-line H1 and a button row reads as a poster
     rather than a page. Scoped to this breakpoint because centring the
     wordmark only works once .nav-links is hidden -- above 760px it would
     collide with the links sitting on the right. */
  .site-nav { justify-content: center; }

  .hero-cover { justify-content: center; }
  .cover-img {
    /* Optical, not geometric. The offset shadow spills 14px to the right and
       contributes no layout width, so a mathematically centred image looks
       ~7px right of centre. Shift back by half the offset. */
    transform: translateX(-7px);
  }

  .hero-copy .eyebrow { text-align: center; }
}

/* =========================================================================
   Accessibility. Three defects in the supplied design, corrected.
   ========================================================================= */

/* 1. The handoff sets outline:none on every input (reference lines 122-156),
      which removes the keyboard focus indicator outright. Restored in the
      design's own language instead of deleted: :focus carries the intended
      border colour change for every user, and :focus-visible adds a second
      ring so keyboard users get a clearly stronger signal than mouse users. */
.stories-form input:focus {
  outline: none;
  border-bottom-color: var(--cover-red);
}
.stories-form input:focus-visible {
  outline: none;
  border-bottom-color: var(--cover-red);
  box-shadow: 0 2px 0 0 var(--cover-red);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
/* The accent red is nearly invisible against the #17181c band. */
.stories a:focus-visible,
.stories button:focus-visible { outline-color: var(--cover-red); }

/* 2. scroll-behavior: smooth was unguarded in the handoff. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* 3. Deferred-integration notice. Occupies exactly the slot the real
      confirmation will use, so wiring the forms later shifts no layout.
      min-height reserves the line while it is empty. */
.form-note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 4px 0 0;
  min-height: 16px;
}
.stories-form .form-note { color: var(--on-dark-label); }
.contact-form .form-note { color: var(--muted-caption); }
