@font-face {
  font-family: "Glacial Indifference";
  src: url("fonts/glacial-indifference.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Caprasimo";
  src: url("fonts/caprasimo-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --orange: #DD4A1E;
  --pink: #FFCBC0;
  --pink-shade: #FEBAAD;
  --blush: #FFE7E3;
  --paper: #FFF4E8;
  --ink: #5a2a14;
  --tear: 22px;
  --body-font: "Montserrat", system-ui, sans-serif;
  --display-font: "Glacial Indifference", "Montserrat", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--orange); }
body {
  margin: 0;
  background: var(--orange);
  color: var(--ink);
  font-family: var(--body-font);
  line-height: 1.5;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
p { margin: 0; }

/* Paper strips: flat cut paper. Each strip overlaps the one above by more than its deepest
   torn-edge dip (15px), so the orange page background never shows through a dip. */
.layer {
  position: relative;
  margin-top: calc(var(--tear) * -0.8);
}
.layer--top { margin-top: 0; }
.paper {
  padding: calc(var(--tear) + 14px) 20px 28px;
  clip-path: polygon(0 12px, 7% 4px, 15% 13px, 24% 6px, 33% 15px, 43% 5px, 52% 12px, 62% 3px, 72% 14px, 82% 6px, 91% 13px, 100% 5px, 100% 100%, 0 100%);
}
.layer--when .paper { clip-path: polygon(0 6px, 9% 14px, 18% 5px, 29% 13px, 38% 4px, 49% 14px, 58% 6px, 69% 12px, 78% 3px, 88% 13px, 100% 7px, 100% 100%, 0 100%); }
.layer--evening .paper { clip-path: polygon(0 10px, 8% 3px, 17% 12px, 27% 5px, 36% 14px, 46% 4px, 55% 13px, 65% 6px, 75% 14px, 85% 4px, 93% 12px, 100% 6px, 100% 100%, 0 100%); }
.layer--form .paper { clip-path: polygon(0 5px, 10% 13px, 20% 4px, 30% 12px, 41% 6px, 50% 14px, 60% 5px, 70% 13px, 80% 4px, 90% 12px, 100% 6px, 100% 100%, 0 100%); }
.layer--footer .paper { clip-path: polygon(0 8px, 11% 14px, 21% 5px, 32% 12px, 42% 4px, 53% 13px, 63% 6px, 73% 14px, 83% 5px, 92% 12px, 100% 4px, 100% 100%, 0 100%); }

.paper--pink { background: var(--pink); }
.paper--blush { background: var(--blush); }
.paper--shade { background: var(--pink-shade); }
.paper--paper { background: var(--paper); }
.paper--orange { background: var(--orange); }

/* Strip 1 */
.layer--top .paper { padding-top: 14px; padding-bottom: calc(var(--tear) + 18px); clip-path: none; }
.bsd { text-align: right; font-size: .8rem; color: #fff; }
.headline { margin: 8px 0 0; display: grid; gap: 10px; justify-items: center; }
.headline img { width: 100%; max-width: 640px; }
.headline img + img { max-width: 600px; }
/* The traced one-line headline is too small on a phone, so phones get live text split over
   two lines; the font size is fitted so "Pregnancy Loss" fills the width without wrapping. */
.headline-text {
  font-family: "Caprasimo", Georgia, serif;
  font-weight: 400;
  font-size: min(11.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -.01em;
  color: var(--orange);
  text-align: center;
}
.headline-line { display: block; white-space: nowrap; }
.headline-image { display: none; }
.layer--top .paper { padding-bottom: calc(var(--tear) + 26px); }
.headline { gap: 14px; margin-top: 10px; }

/* Strip 2 */
.layer--when .paper { text-align: center; font-family: var(--display-font); color: var(--orange); }
.night { font-size: 1.5rem; line-height: 1.25; }
.when { font-size: 1.6rem; line-height: 1.3; }
.where { margin-top: 6px; font-family: var(--body-font); font-size: 1rem; color: var(--ink); text-wrap: balance; }
.map-link { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--orange); }

/* Strip 3 */
.eyebrow {
  display: none;
  margin: 0 0 14px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.evening { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 18px; align-items: center; }
.illustration { width: 100%; max-height: 300px; object-fit: cover; object-position: left top; border-radius: 6px; }
.program { display: grid; gap: 12px; font-size: 1rem; line-height: 1.45; }
.program strong { color: var(--orange); font-weight: 700; }

/* Strip 4: the form */
.card-heading { display: none; margin: 0 0 8px; font-size: 1.1rem; font-weight: 700; color: var(--orange); }
.layer--form .paper { padding-bottom: 32px; }
label { display: block; margin-top: 14px; font-weight: 600; font-size: 1rem; }
input[type="text"], input[type="tel"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 14px 16px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--pink-shade);
  border-radius: 14px;
}
input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}
input[aria-invalid="true"] { border-color: var(--orange); }
.field-error { min-height: 0; margin-top: 4px; font-size: .875rem; color: #b3340f; }
.field-error:empty { display: none; }
.field-help { margin-top: 6px; font-size: .875rem; line-height: 1.4; color: var(--ink); }
.field-help[data-state="hint"] { opacity: .85; }
.field-help[data-state="readback"] { font-weight: 600; }
.field-help[data-state="error"] { color: #b3340f; }
.field-help .tick { color: #2f7d4f; }
.field-help bdi, #done-phone { white-space: nowrap; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.privacy { margin-top: 16px; font-size: .875rem; line-height: 1.4; }
#submit {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 16px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: var(--orange);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
#submit:disabled { opacity: .7; cursor: progress; }
.form-message { margin-top: 10px; min-height: 1.2em; font-size: .9rem; font-weight: 600; color: #b3340f; }
.cost { margin-top: 10px; display: flex; align-items: center; gap: 12px; font-size: 1rem; }
.cost::before, .cost::after { content: ""; flex: 1; height: 1px; background: var(--pink-shade); }
.cost strong { font-size: 1.15rem; color: var(--orange); }
.friend { margin-top: 14px; font-size: .9rem; text-align: center; }
.share-link {
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--orange);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}
.share-feedback { font-size: .875rem; }

#done { text-align: center; }
/* Focus moves here only so screen readers announce success; no ring needed. */
#done h2:focus { outline: none; }
#done h2 { margin: 0 0 8px; font-size: 1.4rem; color: var(--orange); }
.calendar-links { margin-top: 14px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 18px; }
.calendar-links a { color: var(--orange); font-weight: 600; }
#closed p { font-weight: 600; line-height: 1.5; }

/* Strip 5 */
.layer--footer .paper { padding-top: calc(var(--tear) + 22px); padding-bottom: 36px; }
.layer--footer img { width: 220px; margin: 0 auto; }

/* Laptop: the form becomes a raised card beside the evening program. */
@media (min-width: 900px) {
  .paper { padding-left: 48px; padding-right: 48px; }
  .layer--top .paper { padding-top: 20px; padding-bottom: calc(var(--tear) + 18px); }
  .headline { gap: 10px; margin-top: 8px; }
  .headline-image { display: block; }
  /* Kept for screen readers; the traced image shows the same words on a laptop. */
  .headline-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .when { font-size: 1.5rem; }
  .night, .when { display: inline; font-size: 1.5rem; }
  .night::after { content: " · "; }

  .main-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    max-width: none;
  }
  .layer--evening { grid-column: 1 / -1; grid-row: 1; }
  .layer--evening .paper {
    padding-right: calc(380px + 96px);
    padding-bottom: 72px;
    min-height: 100%;
  }
  .eyebrow { display: block; }
  .evening { grid-template-columns: 170px minmax(0, 420px); align-items: start; }
  .illustration { max-height: 230px; }
  .program { font-size: 1.0625rem; }

  .layer--form {
    grid-column: 2;
    grid-row: 1;
    z-index: 1;
    margin: 20px 48px 30px 0;
    align-self: start;
  }
  .layer--form .paper {
    padding: 26px 24px 28px;
    clip-path: polygon(1% 2%, 30% 0, 62% 1.5%, 99% 0, 100% 32%, 98.5% 66%, 100% 99%, 70% 100%, 38% 98.5%, 0 100%, 1.5% 64%, 0 30%);
  }
  .card-heading { display: block; }
  .layer--footer .paper { padding-top: 56px; }
}

@media (max-width: 380px) {
  .night { font-size: 1.35rem; }
  .when { font-size: 1.4rem; }
  .evening { grid-template-columns: 38% 1fr; gap: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  #submit { transition: opacity .15s; }
}
