/* ==========================================================================
   allyhart.com
   Palette sampled from the cover art; contrast measured against WCAG 2.1.
   See docs/03-colour-palette.md and docs/04-typography.md.
   Filename is versioned because /assets/css/* is cached immutable for a year.
   ========================================================================== */

/* ---------- Fonts: self-hosted, latin subset ------------------------------ */

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/assets/fonts/cormorant-garamond-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/assets/fonts/cormorant-garamond-600-italic.woff2') format('woff2');
  font-weight: 600; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('/assets/fonts/lora-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('/assets/fonts/lora-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Allura';
  src: url('/assets/fonts/allura-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- Tokens -------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Sampled from the cover */
  --paper:       #FADCD7;
  --paper-light: #FDE3DD;
  --paper-deep:  #F6C9C4;
  --surface:     #FFF6F3;
  --petal:       #EFAFAB;
  --rose:        #B4636A;
  --rose-deep:   #A34E55;
  --wine:        #8A3C40;
  --ink:         #4A2E2B;
  --ink-muted:   #6B4A45;
  --sage:        #8E7C62;
  --sage-deep:   #5F5140;

  /* Semantic — components reference these, never a raw colour */
  --bg:           var(--paper);
  --bg-alt:       var(--paper-deep);
  --card-bg:      var(--surface);
  --text:         var(--ink);
  --text-muted:   var(--ink-muted);
  --heading:      var(--rose-deep);
  --link:         var(--wine);
  --link-hover:   var(--rose-deep);
  --rule:         var(--petal);
  --btn-bg:       var(--wine);
  --btn-text:     var(--surface);
  --btn-hover-bg: var(--rose-deep);
  --focus:        var(--wine);

  --font-display: 'Cormorant Garamond', 'Iowan Old Style', Palatino,
                  'Palatino Linotype', Georgia, serif;
  --font-body:    'Lora', Charter, 'Bitstream Charter', Georgia, serif;
  --font-script:  'Allura', 'Snell Roundhand', 'Brush Script MT', cursive;

  --shadow-soft: 0 1px 3px rgb(74 46 43 / 0.08);
  --shadow-card: 0 2px 10px rgb(74 46 43 / 0.07);
  --radius:      6px;
  --radius-lg:   10px;

  --measure:     34rem;   /* ~66 characters */
  --wide:        68rem;
  --gutter:      clamp(1.25rem, 5vw, 3rem);
  --section-y:   clamp(3rem, 9vw, 6rem);
}

/* ---------- Reset --------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 0.99rem + 0.34vw, 1.1875rem);  /* 17 → 19px */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; height: auto; }

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

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

/* ---------- Typography ---------------------------------------------------- */

h1, h2, h3, h4, h5, h6 { margin: 0; text-wrap: balance; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; }

h1 { font-size: clamp(2.25rem, 6vw, 3.5rem);    line-height: 1.1;  color: var(--heading); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem);    line-height: 1.2;  color: var(--heading); }
h3 { font-size: clamp(1.375rem, 3vw, 1.75rem);  line-height: 1.3;  color: var(--text); }
h4 { font-size: 1.125rem; font-family: var(--font-body); font-weight: 600; color: var(--text); }

p { margin: 0; text-wrap: pretty; }
p + p { margin-block-start: 1.25em; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }

strong { font-weight: 600; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--sage-deep);
  margin: 0;
}
.eyebrow--centred { text-indent: 0.18em; }   /* compensate trailing tracking */

.lead {
  font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.375rem);
  line-height: 1.6;
  color: var(--text-muted);
}

.script {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.5rem, 8vw, 3.75rem);
  line-height: 1;
  color: var(--rose);
  margin: 0;
}

.small { font-size: 0.9375rem; }
.muted { color: var(--text-muted); }

/* ---------- Layout -------------------------------------------------------- */

.wrap  { width: 100%; max-width: var(--wide);    margin-inline: auto; padding-inline: var(--gutter); }
.prose { width: 100%; max-width: var(--measure); margin-inline: auto; }

.section { padding-block: var(--section-y); }
.section--tint { background: var(--bg-alt); }

.stack       { display: flex; flex-direction: column; gap: 1.25rem; }
.stack--tight{ gap: 0.75rem; }
.stack--loose{ gap: 2rem; }
.centred     { text-align: center; align-items: center; }

.skip-link {
  position: absolute; inset-inline-start: -9999px;
  background: var(--wine); color: var(--surface);
  padding: 0.75rem 1.25rem; border-radius: 0 0 var(--radius) 0; z-index: 10;
}
.skip-link:focus { inset-inline-start: 0; }

/* ---------- Header -------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  padding-block: 1.5rem;
}
.site-header__inner {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 0.75rem 2rem;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.375rem, 4vw, 1.75rem);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--rose-deep);
  text-decoration: none;
  line-height: 1;
}
.wordmark:hover { color: var(--wine); }

.nav ul {
  display: flex; flex-wrap: wrap; gap: 1rem 1.75rem;
  list-style: none; margin: 0; padding: 0;
}
.nav a {
  font-size: 1rem; text-decoration: none; color: var(--link);
  display: inline-block; padding-block: 0.35rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--link-hover); text-decoration: underline; }
.nav a[aria-current="page"] { font-weight: 600; }

/* Touch devices get the full 44px tap target on nav links. */
@media (pointer: coarse) {
  .nav a { min-height: 44px; display: inline-flex; align-items: center; }
}

@media (max-width: 39.99em) {
  .site-header { padding-block: 1.125rem; }
  .site-header__inner { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .nav ul { gap: 0 1.25rem; }
  .nav a { font-size: 0.9375rem; padding-block: 0.25rem; }
}

/* ---------- Hero ---------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(var(--paper-light), var(--paper));
  padding-block: clamp(3rem, 10vw, 6.5rem);
}
.hero__inner { position: relative; z-index: 1; }
.hero h1 { max-width: 18ch; }

.botanical {
  position: absolute;
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}
.botanical--tl { inset-block-start: -1rem; inset-inline-start: -2rem; width: clamp(110px, 22vw, 190px); }
.botanical--br { inset-block-end: -1.5rem; inset-inline-end: -2rem; width: clamp(96px, 18vw, 160px); transform: rotate(180deg); }

@media (max-width: 39.99em) {
  .botanical--br { display: none; }
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.7rem 1.6rem;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  letter-spacing: 0.02em; line-height: 1.3;
  border: 1px solid transparent; border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn--primary { background: var(--btn-bg); color: var(--btn-text); }
.btn--primary:hover { background: var(--btn-hover-bg); color: var(--btn-text); }
.btn--secondary { background: transparent; color: var(--link); border-color: var(--rose-deep); }
.btn--secondary:hover { background: var(--paper-deep); color: var(--link-hover); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Heart divider ------------------------------------------------- */

.divider {
  display: flex; align-items: center; justify-content: center; gap: 0.9rem;
  color: var(--rose);
  margin-block: 0.5rem;
}
.divider::before, .divider::after {
  content: ""; height: 1px; width: min(80px, 16vw); background: var(--rule);
}

/* ---------- Trope line ---------------------------------------------------- */

.tropes {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.35rem 0.85rem;
  list-style: none; margin: 0; padding: 0;
  font-size: 0.9375rem; color: var(--text-muted);
}
.tropes li + li::before {
  content: "·"; margin-inline-end: 0.85rem; color: var(--petal);
}

/* ---------- Cards --------------------------------------------------------- */

.card-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  box-shadow: var(--shadow-card);
}
.card h3 { color: var(--heading); font-size: 1.375rem; }
.card p { font-size: 1rem; color: var(--text-muted); }
.card--muted { background: transparent; box-shadow: none; border-style: dashed; }

/* ---------- Newsletter ---------------------------------------------------- */

.newsletter {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 5vw, 2.75rem);
  box-shadow: var(--shadow-card);
  max-width: 40rem; margin-inline: auto;
}
.newsletter h2 { font-size: clamp(1.625rem, 3.5vw, 2.125rem); }

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label {
  font-family: var(--font-body); font-weight: 600;
  font-size: 0.8125rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--sage-deep);
}
.field input {
  font-family: var(--font-body); font-size: 1.0625rem;
  padding: 0.75rem 0.9rem; min-height: 44px; width: 100%;
  border: 1px solid var(--petal); border-radius: var(--radius);
  background: var(--paper-light); color: var(--text);
}
.field input::placeholder { color: var(--text-muted); opacity: 0.7; }
.field input:focus-visible { border-color: var(--wine); }

.form-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.form-row .field { flex: 1 1 15rem; }

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

.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(2.5rem, 6vw, 3.5rem);
  margin-block-start: var(--section-y);
}
.site-footer a { color: var(--petal); }
.site-footer a:hover { color: var(--paper); }
.site-footer p { color: var(--paper); }
.site-footer .nav a { color: var(--petal); }
.site-footer .nav a:hover { color: var(--paper); }
.site-footer .fine { font-size: 0.9375rem; color: var(--petal); }
.site-footer .divider { color: var(--petal); margin-block-end: 2rem; }
.site-footer .divider::before,
.site-footer .divider::after { background: rgb(239 175 171 / 0.35); }

/* ---------- About block --------------------------------------------------- */

.about {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: start;
  max-width: 52rem;
  margin-inline: auto;
}
@media (min-width: 48em) {
  .about { grid-template-columns: 18rem 1fr; justify-items: start; }
}
.about__photo {
  width: 200px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-card);
  display: block;
}
@media (min-width: 48em) { .about__photo { width: 288px; } }
.about__text { max-width: var(--measure); }

.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  line-height: 1.4;
  color: var(--rose-deep);
  margin: 0.5rem 0 0;
  padding-inline-start: 1rem;
  border-inline-start: 2px solid var(--petal);
}

/* Sits below the about grid, centred, so the column beside the photo
   doesn't read as a void on wide screens. */
.pull-quote--feature {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 0 0 1.25rem;
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  text-wrap: balance;
}

/* ---------- Utilities (continued) ----------------------------------------- */

.text-centre { text-align: center; }

/* ---------- Utilities ----------------------------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
