/* All Canadian eBooks — site styles
   Palette: cream #FBF6EC, ink #1E1A17, logo red #C8192A, gold #F4A933 (decoration only)
   Type: Poppins (headings/labels/wordmark), Source Serif 4 (body) */

:root {
  --cream: #FBF6EC;
  --ink: #1E1A17;
  --red: #C8192A;
  --red-mid: #B0161F;
  --red-dark: #7E0F16;
  --line: #E8DFCC;
  --body-muted: #4A433C;
  --foot-muted: #6B6259;
  --pill-bg: #FDF0CF;
  --pill-ink: #8A5A00;
  --input-border: #CFC4AE;
  --input-bg: #FFFDF8;
  --error: #B0161F;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Source Serif 4', Georgia, serif;
}

a { color: var(--red-mid); }
a:hover { color: var(--red-dark); }

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: clamp(44px, 6vw, 56px); height: auto; flex: 0 0 auto; }
.brand-word {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(13px, 1.4vw, 16px);
  line-height: 1.05;
  color: var(--red);
  letter-spacing: 0.01em;
  text-align: center;
}
.pill {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: clamp(11px, 1vw, 13px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pill-ink);
  background: var(--pill-bg);
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Hero — Design 2: daytime view through an arched window, logo + sign-up on the sill */
main#top {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.hero {
  --rise: clamp(110px, 15vw, 200px);   /* how far the logo + card stand up into the view */
  --jamb: clamp(8px, 1.7vw, 24px);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
}

/* The view: scene, scrim, window casing, headline */
.hero-view {
  position: relative;
  overflow: hidden;
  min-height: clamp(440px, 46vw, 560px);
  padding: clamp(84px, 8vw, 104px) clamp(28px, 6vw, 64px) calc(var(--rise) + clamp(56px, 5vw, 72px));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-scene,
.hero-window {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.hero-scene { z-index: 0; }
.hero-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 58%;
  display: block;
  background: #5A7A8C;
}
.hero-scrim {
  position: absolute;
  inset: 0 0 auto 0;
  height: 52%;
  z-index: 1;
  background: linear-gradient(180deg, rgba(20, 24, 18, 0.42) 0%, rgba(20, 24, 18, 0) 100%);
  pointer-events: none;
}
.hero-window { z-index: 2; }
/* side jambs, with a thin shadow on the inside edge */
.hero-view::before,
.hero-view::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--jamb);
  z-index: 2;
  background: #F7F1E3;
  pointer-events: none;
}
.hero-view::before { left: 0; box-shadow: 4px 0 0 rgba(0, 0, 0, 0.12); }
.hero-view::after { right: 0; box-shadow: -4px 0 0 rgba(0, 0, 0, 0.12); }

.hero-head {
  position: relative;
  width: min(760px, 100%);
}
.hero-head .headline,
.hero-head .subline-in-hero { position: relative; z-index: 3; }
/* soft dark glow behind the text so it stays readable over pale snow and cloud in the photo.
   .hero-head makes no stacking context, so the glow sits between the scrim and the window casing
   (the cream mullions stay cream) while the text itself stays above the casing. */
.hero-head::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: -36px -14% -28px;
  background: radial-gradient(ellipse 72% 68% at 50% 52%, rgba(10, 14, 12, 0.66) 0%, rgba(10, 14, 12, 0.6) 55%, rgba(10, 14, 12, 0) 100%);
  pointer-events: none;
}
.headline {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 5.4vw, 70px);
  line-height: 1.07;
  letter-spacing: -0.01em;
}
.headline .line { display: block; }
.headline .accent { color: var(--red); }
.hero .headline {
  font-size: clamp(30px, 4.6vw, 58px);
  line-height: 1.08;
  color: #FFFFFF;
  text-shadow: 0 0 2px rgba(10, 12, 8, 0.6), 0 2px 12px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
}
.hero .headline .accent { color: #FFE1A8; }

.subline {
  margin: 0;
  max-width: 34em;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.6;
  color: var(--body-muted);
}
.subline-in-hero {
  margin: 16px auto 0;
  font-size: clamp(16px, 1.4vw, 19px);
  color: #FFFFFF;
  /* tight dark edge keeps letters readable where they cross the cream mullions */
  text-shadow: 0 0 2px rgba(10, 12, 8, 0.85), 0 1px 3px rgba(10, 12, 8, 0.6), 0 2px 10px rgba(10, 12, 8, 0.45);
}
.subline-below-hero { display: none; }

/* The windowsill desk */
.hero-desk {
  position: relative;
  z-index: 4;
  background: linear-gradient(180deg, #C98A4B 0%, #A86B36 55%, #8B5A2B 100%);
  border-top: 3px solid #E8C68A;
  box-shadow: inset 0 14px 20px rgba(0, 0, 0, 0.25);
  padding: 0 clamp(16px, 5vw, 64px) clamp(14px, 2.4vw, 26px);
}
.hero-desk-inner {
  width: min(560px, 100%);
  margin: calc(-1 * var(--rise)) auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.2vw, 14px);
}
.hero-mark {
  width: clamp(46px, 6.4vw, 82px);
  height: auto;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.4));
}
.sunray { transition: opacity 0.6s ease; }

/* Sign-up card restyled to sit on the wood */
.signup-card.on-desk,
.signup-success.on-desk {
  background: #FFFDF8;
  border-color: transparent;
  border-radius: 16px;
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.32);
}
.on-desk .field input { background: #FFFFFF; }

/* Below the hero: phone subline + the three points */
.below-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(18px, 3vw, 28px);
  padding: clamp(28px, 5vw, 56px) clamp(20px, 5vw, 64px) 56px;
}

/* Sign-up form */
.signup-card, .signup-success {
  width: 100%;
  max-width: 560px;
  box-sizing: border-box;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
  box-shadow: 0 10px 30px rgba(120, 80, 20, 0.08);
}
.signup-success { text-align: center; align-items: center; }
.signup-card[hidden],
.signup-success[hidden] { display: none; }

.signup-title {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 19px;
}
.success-title {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 3vw, 28px);
  line-height: 1.15;
}
.success-text { margin: 0; font-size: 17px; line-height: 1.55; color: var(--body-muted); }

.signup-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--body-muted);
}
.field input {
  height: 52px;
  box-sizing: border-box;
  padding: 0 16px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  font-size: 17px;
  font-family: 'Source Serif 4', Georgia, serif;
  background: var(--input-bg);
  color: var(--ink);
}
.field input:focus-visible,
.btn:focus-visible,
.consent input:focus-visible,
a:focus-visible,
.success-link:focus-visible {
  outline: 3px solid #0B5FFF;
  outline-offset: 2px;
}
.field input[aria-invalid="true"] { border-color: var(--error); }

.btn {
  height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 12px;
  background: var(--red);
  color: #FFFFFF;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  flex: 0 0 auto;
}
.btn:hover { background: var(--red-dark); }
.btn:disabled { opacity: 0.6; cursor: wait; }

.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.5;
  color: var(--body-muted);
}
.consent input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--red);
}

.form-note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--foot-muted); }

.field-error {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--error);
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
}

/* Honeypot: hidden from sighted users and screen reader users, but present for bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Points */
.points {
  width: 100%;
  max-width: 1040px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  margin-top: 0;
  text-align: left;
}
.point {
  flex: 1 1 260px;
  border-top: 3px solid var(--red);
  padding-top: 16px;
}
.point h2 {
  margin: 0 0 6px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 18px;
}
.point p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--body-muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px clamp(20px, 5vw, 64px);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--foot-muted);
}
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { color: var(--foot-muted); }

@media (max-width: 599px) {
  .signup-row { flex-direction: column; align-items: stretch; }
  .signup-row .field { flex: 0 0 auto; }
  .btn { width: 100%; flex: 0 0 auto; }
  /* phone: the subline moves out of the view, under the hero */
  .subline-in-hero { display: none; }
  .subline-below-hero { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Privacy page */
.legal-main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) clamp(20px, 5vw, 32px) 72px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.legal-main h1 {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1.1;
}
.legal-updated { margin: 0; font-family: 'Poppins', sans-serif; font-size: 14px; color: var(--foot-muted); }
.legal-lead { margin: 0; font-size: 19px; line-height: 1.65; color: #2E2823; }
.legal-main section { display: flex; flex-direction: column; gap: 8px; }
.legal-main h2 { margin: 0; font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 21px; }
.legal-main p { margin: 0; font-size: 17px; line-height: 1.65; color: var(--body-muted); }
.back-home { font-family: 'Poppins', sans-serif; font-weight: 500; font-size: 15px; }

/* 404 page */
.notfound-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  padding: clamp(40px, 8vw, 96px) clamp(20px, 5vw, 64px);
}
.notfound-main h1 { margin: 0; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: clamp(32px, 4vw, 44px); }
.notfound-main p { margin: 0; max-width: 32em; font-size: 18px; line-height: 1.6; color: var(--body-muted); }
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 24px;
  border-radius: 12px;
  border: 2px solid var(--red);
  color: var(--red-mid);
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 16px;
}
.btn-outline:hover { background: var(--red); color: #fff; }
