/* Stop Ignoring Snoring: theme styles, ported from the approved version 2 design.
   Palette sampled from the supplied campaign artwork: lavender headline (#ccaccf) and
   teal pill (#3a9cb3). Button fills use a deeper teal so white text stays above 4.5:1.
   Page sections are core blocks carrying the class names below; the questionnaire is
   Gravity Forms markup with its own CSS turned off (see functions.php). */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-italic-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #1f1a24;
  --ink: #2a2530;
  --ink-soft: #57505e;
  --paper: #ffffff;
  --mist: #f5f2f7;
  --line: #e6e0ea;
  --line-strong: #cbc1d2;
  --field-border: #8b8094;
  --field-border-hover: #6e6378;
  --lavender: #ccaccf;
  --lavender-soft: #efe6f1;
  --plum: #6e4d78;
  --teal: #3a9cb3;
  --teal-light: #6cc6d6;
  --teal-strong: #17768a;
  --teal-deep: #0f6474;
  --error: #a3262f;
  --error-soft: #fbf1f2;

  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-sans: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --container: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --hero-inline: clamp(1.25rem, 6vw, 7rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* A column at least a screen tall, so a short page (the 404) still ends with its footer at
   the bottom of the screen. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.08;
  text-wrap: balance;
}

p,
figure {
  margin: 0;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--teal-strong);
}

:focus-visible {
  outline: 2px solid var(--teal-strong);
  outline-offset: 3px;
}

body > main {
  flex: 1 0 auto;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100000;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* It appears over the dark header, where the teal ring would be too faint. */
.skip-link:focus-visible {
  outline-color: #fff;
}

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

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

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

.cta {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.9rem 1.75rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #1a7d91 0%, var(--teal-strong) 55%, #136e81 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.2),
    0 12px 28px -14px rgb(9 60 70 / 0.7);
  color: #fff;
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.0625rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-wrap: balance;
  white-space: normal;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: box-shadow 0.25s var(--ease-out);
}

/* Hover deepens the teal through a layer that fades in (a gradient can't be transitioned).
   The button itself doesn't move: lifting it on hover let its edge slip out from under the
   pointer, so it flickered between states. */
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--teal-deep);
  opacity: 0;
  transition: opacity 0.25s var(--ease-out);
}

.cta:hover::before,
.cta:active::before {
  opacity: 1;
}

.cta:hover {
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.16),
    0 16px 32px -14px rgb(9 60 70 / 0.75);
}

.cta__arrow {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--ease-out);
}

.cta:hover .cta__arrow {
  transform: translateY(2px);
}

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

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  overflow: hidden;
  background: var(--night);
  color: #fff;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgb(31 26 36 / 0.7) 0%,
    rgb(31 26 36 / 0) 17%,
    rgb(31 26 36 / 0) 40%,
    rgb(31 26 36 / 0.72) 62%,
    rgb(31 26 36 / 0.94) 100%
  );
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2.4vw, 1.75rem) var(--hero-inline);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 0.3rem;
  color: #fff;
  text-decoration: none;
}

.brand__name {
  font-family: var(--font-serif);
  font-size: clamp(0.875rem, 0.8rem + 0.35vw, 1.0625rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-transform: uppercase;
}

.brand__by {
  font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.875rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: rgb(255 255 255 / 0.84);
}

.call {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgb(255 255 255 / 0.4);
  border-radius: 999px;
  background: rgb(31 26 36 / 0.32);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition:
    background-color 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out);
}

.call {
  -webkit-tap-highlight-color: transparent;
}

.call:hover {
  border-color: rgb(255 255 255 / 0.75);
  background: rgb(31 26 36 / 0.55);
}

.call__icon {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

/* Mike, October 22: the brand and phone number were too small on desktop. From 1024px wide
   they grow to 22px (name), 16px (byline) and about 18px (number); phones and tablets keep
   the design's sizes. */
@media (min-width: 64em) {
  .brand {
    gap: 0.35rem;
  }

  .brand__name {
    font-size: clamp(1.125rem, 0.55rem + 1.1vw, 1.375rem);
  }

  .brand__by {
    font-size: clamp(0.875rem, 0.6rem + 0.45vw, 1rem);
  }

  .call {
    gap: 0.6rem;
    font-size: clamp(1rem, 0.7rem + 0.5vw, 1.1875rem);
    min-height: 3.25rem;
    padding: 0.625rem 1.25rem;
  }

  .call__icon {
    width: 1.2rem;
    height: 1.2rem;
  }
}

/* Phones: the call link becomes an icon button so the brand stays on two lines.
   The number remains in its accessible name and in the footer. */
@media (max-width: 29.99em) {
  .call {
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
  }

  .call span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .call__icon {
    width: 1.15rem;
    height: 1.15rem;
  }
}

.hero__inner {
  position: relative;
  margin-top: auto;
  padding: 0 var(--hero-inline) clamp(2.25rem, 6svh, 5rem);
}

/* Short phone screens (375x667 and the like) put the headline higher, over the light bedding
   where the scrim is still thin, and narrow landscape views (phones, 200-400% zoom) run the
   text past the side scrim. There, a gradient tied to the text block keeps the lavender and
   teal words at 3:1 or better (WCAG 1.4.3). */
@media (orientation: portrait) and (min-aspect-ratio: 1/2) and (max-width: 47.99em),
  (orientation: landscape) and (max-width: 63.99em) {
  .hero__inner::before {
    content: "";
    position: absolute;
    inset: -3rem 0 0;
    z-index: -1;
    background: linear-gradient(
      180deg,
      rgb(31 26 36 / 0) 0,
      rgb(31 26 36 / 0.65) 3rem,
      rgb(31 26 36 / 0.78) 100%
    );
  }
}

.hero__title {
  width: fit-content;
  font-size: clamp(2.6rem, 11.4vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: 0.005em;
  text-wrap: initial;
  text-shadow: 0 2px 24px rgb(20 16 24 / 0.35);
}

.hero__title > span {
  display: block;
}

.hero__title::after {
  content: "";
  display: block;
  height: 3px;
  margin-top: 0.32em;
  border-radius: 2px;
  background: var(--lavender);
}

.hero__accent {
  color: var(--lavender);
}

.hero__sub {
  margin-top: 0.85rem;
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 5.4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 2px 18px rgb(20 16 24 / 0.4);
}

.hero__clue {
  color: var(--teal-light);
}

.hero__cta {
  margin-top: clamp(1.5rem, 4svh, 2.25rem);
}

@media (max-width: 29.99em) {
  .hero__cta {
    width: 100%;
    gap: 0.625rem;
    padding-inline: 1.25rem;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
  }
}

.hero :focus-visible {
  outline-color: #fff;
}

@media (orientation: landscape) {
  .hero__media img {
    object-position: 50% 35%;
  }

  .hero__scrim {
    background:
      linear-gradient(
        90deg,
        rgb(31 26 36 / 0.78) 0%,
        rgb(31 26 36 / 0.6) 26%,
        rgb(31 26 36 / 0.22) 46%,
        rgb(31 26 36 / 0) 60%
      ),
      linear-gradient(
        180deg,
        rgb(31 26 36 / 0.6) 0%,
        rgb(31 26 36 / 0) 18%,
        rgb(31 26 36 / 0) 68%,
        rgb(31 26 36 / 0.5) 100%
      );
  }

  .hero__title {
    font-size: clamp(2.25rem, 5vw, 5.5rem);
  }

  .hero__sub {
    font-size: clamp(1.25rem, 1.9vw, 2.25rem);
  }
}

/* Photography: licensed Depositphotos images in the Media Library ------------- */

.media-frame {
  overflow: hidden;
  border-radius: 20px;
  background: var(--mist);
  box-shadow: 0 28px 60px -34px rgb(31 26 36 / 0.5);
}

.media-frame img {
  width: 100%;
  /* !important beats the inline height: auto the block editor puts on images, so the
     editor shows the same crop as the page. */
  height: 100% !important;
  object-fit: cover;
}

/* Introduction ------------------------------------------------------------- */

.intro {
  padding-block: clamp(4.5rem, 3rem + 7vw, 9rem);
}

.intro__grid {
  display: grid;
  gap: 2.5rem;
  grid-template-areas:
    "lead"
    "media"
    "body";
}

.intro__lead {
  grid-area: lead;
}

.intro__lead p {
  font-family: var(--font-serif);
  font-size: clamp(1.875rem, 1.2rem + 2.6vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.12;
  text-wrap: balance;
}

.intro__lead p + p {
  margin-top: 0.55em;
  color: var(--plum);
}

.intro__media {
  grid-area: media;
  aspect-ratio: 4 / 3;
}

.intro__media img {
  object-position: 60% 50%;
}

.intro__body {
  grid-area: body;
}

.intro__body p {
  max-width: 34rem;
  font-family: var(--font-serif);
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.65;
  color: var(--ink-soft);
}

.intro__body p + p {
  margin-top: 1.25rem;
}

.intro__body .intro__close {
  margin-top: 2rem;
  color: var(--ink);
  font-weight: 600;
}

.intro__close::before {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin-bottom: 1.25rem;
  border-radius: 2px;
  background: var(--lavender);
}

@media (min-width: 56.25em) {
  .intro__grid {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    grid-template-areas:
      "lead media"
      "body media";
    align-items: start;
    gap: clamp(2.5rem, 4vw, 3.5rem) clamp(3rem, 7vw, 7rem);
  }

  .intro__body {
    align-self: end;
  }

  .intro__media {
    align-self: center;
    aspect-ratio: 4 / 5;
  }
}

/* How's your airway + questionnaire --------------------------------------- */

.airway {
  padding-block: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  background: var(--mist);
}

.airway__intro {
  display: grid;
  gap: 2rem;
}

.airway__media {
  aspect-ratio: 16 / 10;
}

.airway__media img {
  object-position: 25% 60%;
}

.airway__text h2 {
  font-size: clamp(2.125rem, 1.4rem + 2.8vw, 3.75rem);
  letter-spacing: 0.01em;
}

.airway__text p {
  margin-top: 1.25rem;
  font-family: var(--font-serif);
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.65;
  color: var(--ink-soft);
}

.airway__text p + p {
  margin-top: 1rem;
}

@media (min-width: 56.25em) {
  .airway__intro {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: center;
    gap: clamp(3rem, 7vw, 7rem);
  }

  .airway__media {
    aspect-ratio: 4 / 5;
  }
}

.airway__cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  color: var(--teal-strong);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-align: center;
}

.airway__cue::after {
  content: "";
  width: 1.25rem;
  height: 2.25rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 40' fill='none' stroke='%23ccaccf' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v34m0 0-7-7m7 7 7-7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.form-card {
  width: min(100%, 54rem);
  margin: clamp(2rem, 4vw, 3rem) auto 0;
  padding: clamp(1.5rem, 0.9rem + 3vw, 3.5rem);
  border-radius: 24px;
  background: var(--paper);
  box-shadow:
    0 1px 2px rgb(31 26 36 / 0.06),
    0 28px 64px -28px rgb(31 26 36 / 0.28);
  scroll-margin-top: 1.5rem;
}

.form-card h3 {
  font-size: clamp(1.625rem, 1.2rem + 1.5vw, 2.375rem);
  letter-spacing: 0.01em;
}

.form-card__head p {
  max-width: 40rem;
  margin-top: 0.85rem;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* Gravity Forms: questionnaire ------------------------------------------------ */

.gform_wrapper {
  margin-top: clamp(2rem, 4vw, 2.75rem);
}

.gform_wrapper form {
  margin: 0;
}

.gform_fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 1.5rem;
}

.gfield {
  grid-column: 1 / -1;
  min-width: 0;
}

.gform_wrapper .gform_validation_container,
.gform_wrapper .gfield_visibility_hidden,
.gform_wrapper .gform_hidden,
.gform_wrapper .gform-icon,
.gform_wrapper input[type="hidden"] {
  display: none !important;
}

/* The 12 questions sit in one fieldset (see functions.php). */
.questions {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Floated so its margin applies like any block; the next element clears it. */
.questions__legend {
  float: left;
  width: 100%;
  margin-bottom: 1rem;
  padding: 0;
  color: var(--teal-strong);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
}

.questions__legend + * {
  clear: both;
}

.gfield.q {
  display: grid;
  gap: 0.75rem;
  padding-block: 1.35rem;
  border-top: 1px solid var(--line);
}

.gfield.q .gfield_label {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: baseline;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
}

.q__num {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--plum);
}

@media (min-width: 45em) {
  .gfield.q .ginput_container {
    width: min(100% - 2.25rem, 34rem);
    margin-left: 2.25rem;
  }
}

.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper select {
  width: 100%;
  min-height: 3.25rem;
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background-color: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.3;
  transition:
    border-color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out);
}

.gform_wrapper select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236e4d78' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
  text-overflow: ellipsis;
  cursor: pointer;
}

.gform_wrapper select:has(option[value=""]:checked) {
  color: var(--ink-soft);
}

.gform_wrapper input:hover,
.gform_wrapper select:hover {
  border-color: var(--field-border-hover);
}

.gform_wrapper input:focus-visible,
.gform_wrapper select:focus-visible {
  border-color: var(--teal-strong);
  outline: 2px solid var(--teal-strong);
  outline-offset: 2px;
}

.gfield.score {
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line);
}

.score p {
  max-width: 40rem;
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.score .score__note {
  margin-top: 1.75rem;
  color: var(--plum);
  font-size: clamp(1.1875rem, 1.05rem + 0.4vw, 1.375rem);
  font-weight: 600;
  line-height: 1.45;
}

.score__note::before {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin-bottom: 1rem;
  border-radius: 2px;
  background: var(--lavender);
}

.byline {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.byline__photo,
.signature__photo img {
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 3px var(--paper),
    0 0 0 4px var(--lavender);
}

.byline__photo {
  width: 4rem;
  height: 4rem;
}

.byline__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.byline__name {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}

.byline__meta {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.4;
}

/* Contact fields: Today's Date, First name, Last name, Email. */

.gfield.contact-start {
  margin-top: clamp(2rem, 4vw, 2.75rem);
  padding-top: clamp(2rem, 4vw, 2.75rem);
  border-top: 1px solid var(--line);
}

.gfield.contact {
  margin-top: 1.25rem;
}

.gfield.contact-start .gfield_label,
.gfield.contact .gfield_label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.gfield_required_text {
  margin-left: 0.35em;
  color: var(--plum);
  font-size: 0.9375rem;
  font-weight: 500;
}

/* The date input carries Gravity Forms' calendar button inside its right edge. GF draws
   the icon with Dashicons, which the front end doesn't load, so the theme draws it. */
.ginput_container_date {
  position: relative;
  max-width: 16rem;
}

.gform_wrapper .ginput_container_date input {
  padding-right: 3.5rem;
}

.gform-datepicker-toggle {
  position: absolute;
  top: 0.25rem;
  right: 0.375rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--plum);
  cursor: pointer;
}

.gform-datepicker-toggle:hover {
  background: var(--lavender-soft);
}

.gform-datepicker-toggle:focus-visible {
  outline: 2px solid var(--teal-strong);
  outline-offset: 0;
}

.gform-datepicker-toggle .gform-datepicker-toggle-icon {
  width: 1.25rem;
  height: 1.25rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='2.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='2.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Gravity Forms' accessible calendar (opened by the button above). It is an ARIA
   application: day cells are role="button" and arrow keys move between them. */
.gform-datepicker-calendar {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 20;
  width: min(20rem, 100vw - var(--gutter) - 2rem);
  padding: 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 24px 48px -20px rgb(31 26 36 / 0.35);
  color: var(--ink);
  font-family: var(--font-sans);
}

.gform-datepicker-calendar table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  table-layout: fixed;
}

.gform-datepicker-calendar th,
.gform-datepicker-calendar td {
  padding: 0;
  text-align: center;
}

.gform-datepicker-calendar th {
  padding-block: 0.5rem 0.25rem;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 700;
}

.gform-datepicker-calendar .day,
.gform-datepicker-calendar .nav[role="button"] {
  height: 2.5rem;
  border-radius: 8px;
  cursor: pointer;
}

.gform-datepicker-calendar .day {
  font-size: 0.9375rem;
  font-weight: 500;
}

.gform-datepicker-calendar .nav[role="button"] {
  color: var(--plum);
  font-size: 1.125rem;
}

.gform-datepicker-calendar .day:hover,
.gform-datepicker-calendar .nav[role="button"]:hover {
  background: var(--lavender-soft);
}

.gform-datepicker-calendar .dayToday {
  box-shadow: inset 0 0 0 1px var(--teal-strong);
}

.gform-datepicker-calendar .day.selected {
  background: var(--teal-strong);
  color: #fff;
  font-weight: 700;
}

.gform-datepicker-calendar .dayDisabled {
  color: var(--line-strong);
  cursor: default;
}

.gform-datepicker-calendar [role="button"]:focus {
  outline: 2px solid var(--teal-strong);
  outline-offset: 1px;
}

.gform_wrapper .gform-datepicker-calendar select {
  min-height: 2.5rem;
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  background-position: right 0.625rem center;
}

.gform-datepicker-calendar .monthMessage {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 40em) {
  .gform_fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gfield--width-half {
    grid-column: auto;
  }

  .field--email input {
    max-width: calc(50% - 0.75rem);
  }
}

.consent {
  max-width: 40rem;
  margin-top: 1.75rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.gform_footer {
  margin-top: 1.5rem;
}

.cta--submit {
  width: 100%;
}

@media (min-width: 40em) {
  .cta--submit {
    width: auto;
    padding-inline: 2.25rem;
  }
}

/* Validation: Gravity Forms' own messages, shown after the server checks the entry. */

.gform_validation_errors {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--error);
  border-radius: 12px;
  background: var(--error-soft);
  color: var(--error);
}

.gform_validation_errors:focus {
  outline: 2px solid var(--error);
  outline-offset: 3px;
}

.gform_submission_error {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

.gform_validation_errors ol {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.gform_validation_errors a {
  color: var(--error);
  font-weight: 600;
}

.gfield_validation_message {
  margin-top: 0.5rem;
  color: var(--error);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.gform_wrapper .gfield_error input {
  border-color: var(--error);
  box-shadow: 0 0 0 1px var(--error);
}

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

.site-footer {
  padding-block: clamp(3rem, 6vw, 4.5rem);
  background: var(--night);
  color: rgb(255 255 255 / 0.84);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem 3rem;
}

.site-footer__address {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 1rem;
  font-style: normal;
  line-height: 1.55;
}

.site-footer__practice {
  margin-bottom: 0.2rem;
  color: #fff;
  font-weight: 700;
}

.site-footer a {
  color: #fff;
  text-underline-offset: 0.2em;
}

.site-footer a.brand {
  text-decoration: none;
}

.site-footer :focus-visible {
  outline-color: #fff;
}

/* Thank-you page (and any other page) -------------------------------------- */

.ty-hero {
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgb(204 172 207 / 0.16), transparent 70%),
    var(--night);
  color: #fff;
}

.ty-hero--photo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.ty-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 60%;
}

.ty-hero--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    90deg,
    rgb(31 26 36 / 0.9) 0%,
    rgb(31 26 36 / 0.76) 55%,
    rgb(31 26 36 / 0.68) 100%
  );
}

/* On narrow screens the lead line is under 24px, so it needs 4.5:1 over the sheets' highlights. */
@media (max-width: 47.99em) {
  .ty-hero--photo::before {
    background: rgb(31 26 36 / 0.84);
  }
}

.container--narrow {
  --container: 44rem;
}

.masthead--contained {
  padding-inline: 0;
}

.ty-hero__inner {
  padding-block: clamp(3rem, 2rem + 6vw, 7rem) clamp(3.5rem, 2rem + 6vw, 7rem);
}

.ty-hero h1 {
  font-size: clamp(2.4rem, 1.3rem + 3.6vw, 4.25rem);
  line-height: 1;
  letter-spacing: 0.005em;
}

.ty-hero h1::after {
  content: "";
  display: block;
  width: 5rem;
  height: 3px;
  margin-top: 0.4em;
  border-radius: 2px;
  background: var(--lavender);
}

.ty-hero__lead {
  margin-top: 1.1rem;
  color: var(--lavender);
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 1rem + 1.2vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
}

.ty-hero :focus-visible {
  outline-color: #fff;
}

.ty-body {
  padding-block: clamp(3.5rem, 2rem + 6vw, 7rem);
}

.ty-body p {
  font-family: var(--font-serif);
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.7;
  color: var(--ink-soft);
}

.ty-body p + p {
  margin-top: 1.25rem;
}

.ty-body .ty-first {
  color: var(--ink);
  font-weight: 600;
}

.notice {
  margin-top: clamp(2.75rem, 5vw, 3.75rem);
}

.notice h2 {
  font-size: clamp(1.625rem, 1.2rem + 1.5vw, 2.375rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--plum);
}

.notice ul {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.notice li {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  padding-block: 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(1.1875rem, 1rem + 0.7vw, 1.5rem);
  font-weight: 600;
  line-height: 1.35;
}

.notice li:last-child {
  border-bottom: 1px solid var(--line);
}

.notice li::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.55em;
  border-radius: 50%;
  background: var(--lavender);
}

.ty-body .notice + p {
  margin-top: clamp(2rem, 4vw, 2.75rem);
}

.ty-body .ty-close {
  color: var(--ink);
  font-weight: 600;
}

.signature {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.signature__photo {
  flex: none;
}

.signature__photo img {
  width: 5.5rem;
  height: 5.5rem;
}

.ty-body .signature__text p {
  margin: 0;
}

.ty-body .signature__name {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.5;
}

.ty-body .signature__meta {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
}

.ty-body .disclaimer {
  margin-top: clamp(3rem, 6vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Other pages (Privacy Policy, Accessibility, 404) ---------------------------
   The thank-you page's header and body, with room for longer text. */

.page-title {
  text-transform: uppercase;
}

.page-body h2 {
  margin-top: clamp(2.25rem, 4vw, 3rem);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  line-height: 1.15;
  color: var(--ink);
}

.page-body h2 + p {
  margin-top: 1rem;
}

.page-body ul,
.page-body ol {
  margin: 1.25rem 0 0;
  padding-left: 1.25rem;
  font-family: var(--font-serif);
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.7;
  color: var(--ink-soft);
}

.page-body li + li {
  margin-top: 0.5rem;
}

.page-body ul + p,
.page-body ol + p {
  margin-top: 1.25rem;
}

.page-body a:not(.cta) {
  text-underline-offset: 0.2em;
}

/* Footer links to the information pages. */
.site-footer__links {
  flex-basis: 100%;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.16);
}

.site-footer__links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.site-footer__links a {
  display: inline-block;
  padding-block: 0.25rem;
}

.page-body .page-updated {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
}


/* Motion ----------------------------------------------------------------------
   The campaign is about waking up and noticing the clues, so the motion does that:
   the hero photo comes into focus out of the dark, the headline surfaces line by line,
   and "clue" lights up. Further down, words surface, photos open like light coming into
   a room, and the questionnaire answers back as it's filled in. Everything is visible
   by default; assets/js/motion.js hides only what is below the first screen and reveals
   it on scroll. With reduced motion, only fades and color changes remain. */

:root {
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
}

::selection {
  background: var(--lavender);
  color: var(--night);
}

input,
select,
textarea {
  caret-color: var(--teal-strong);
}

.hero__title .hero__line > span,
.title-mask > span {
  display: block;
}

.title-mask {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  /* Hero: the room comes into focus while the headline arrives the way it reads aloud
     (Mike, October 26): "WHAT IF" … "SNORING" … "ISN'T THE PROBLEM?" … "What if it's
     the" … "clue?" … then the button. */
  .hero__media img {
    animation: wake-photo 3.6s var(--ease-soft) both;
  }

  .hero .masthead {
    animation: fade-down 0.9s var(--ease-expo) 0.5s both;
  }

  .hero__line {
    animation: mask-open 1s var(--ease-expo) 0.4s both;
  }

  .hero__line > span {
    animation: line-rise 1s var(--ease-expo) both;
    animation-delay: inherit;
    animation-duration: inherit;
  }

  .hero__line:nth-child(2) {
    animation-delay: 1.2s;
    animation-duration: 1.25s;
  }

  .hero__line:nth-child(3) {
    animation-delay: 2s;
  }

  .hero__line:nth-child(4) {
    animation-delay: 2.12s;
  }

  .hero__title::after {
    transform-origin: left center;
    animation: rule-draw 1s var(--ease-expo) 2.8s both;
  }

  .hero__sub {
    animation: soft-rise 0.9s var(--ease-expo) 3.2s both;
  }

  .hero__clue {
    display: inline-block;
    animation:
      clue-arrive 0.9s var(--ease-expo) 3.7s both,
      clue-glow 2.4s var(--ease-soft) 3.8s both;
  }

  .hero__q {
    animation: fade-in 0.6s var(--ease-soft) 3.95s both;
  }

  .hero__cta {
    animation: soft-rise 1s var(--ease-expo) 4.3s both;
  }

  .hero__cta .cta__arrow {
    animation: arrow-nudge 1.4s var(--ease-soft) 5.4s 2;
  }

  /* Thank-you, privacy and 404 headers: the same waking photo and surfacing headline. */
  .ty-hero__bg {
    animation: wake-photo 2.4s var(--ease-soft) both;
  }

  .ty-hero .title-mask {
    animation: mask-open 1.1s var(--ease-expo) 0.3s both;
  }

  .ty-hero .title-mask > span {
    animation: line-rise 1.1s var(--ease-expo) 0.3s both;
  }

  .ty-hero h1::after {
    transform-origin: left center;
    animation: rule-draw 1s var(--ease-expo) 0.75s both;
  }

  .ty-hero__lead {
    animation: soft-rise 1s var(--ease-expo) 0.85s both;
  }

  .ty-hero .masthead {
    animation: fade-down 0.9s var(--ease-expo) 0.15s both;
  }
}

@keyframes clue-arrive {
  from {
    opacity: 0;
    transform: translateY(0.35em);
    filter: blur(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__line,
  .hero__sub,
  .hero__cta,
  .ty-hero h1,
  .ty-hero__lead {
    animation: fade-in 0.6s ease-out both;
  }
}

@keyframes wake-photo {
  from {
    transform: scale(1.08);
    filter: blur(14px) brightness(0.45);
  }
  55% {
    filter: blur(0) brightness(0.95);
  }
  to {
    transform: scale(1);
    filter: none;
  }
}

/* The clip opens with the rising line and ends unclipped, so the text shadow isn't cut. */
@keyframes mask-open {
  from {
    clip-path: inset(0 -1em 0 -1em);
  }
  to {
    clip-path: inset(-1em -1em -1em -1em);
  }
}

@keyframes line-rise {
  from {
    transform: translateY(110%);
  }
}

@keyframes rule-draw {
  from {
    transform: scaleX(0);
  }
}

@keyframes soft-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes clue-glow {
  0% {
    text-shadow: 0 2px 18px rgb(20 16 24 / 0.4), 0 0 0 rgb(108 198 214 / 0);
  }
  45% {
    text-shadow: 0 2px 18px rgb(20 16 24 / 0.4), 0 0 26px rgb(108 198 214 / 0.85);
  }
  100% {
    text-shadow: 0 2px 18px rgb(20 16 24 / 0.4), 0 0 14px rgb(108 198 214 / 0.35);
  }
}

@keyframes arrow-nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}

/* Scroll reveals (motion.js adds .reveal and the kind, then .is-in when it's on screen).
   --d staggers siblings. */
.reveal {
  transition:
    opacity 0.9s var(--ease-expo),
    transform 1.1s var(--ease-expo),
    clip-path 1.2s var(--ease-expo),
    filter 1.2s var(--ease-expo),
    box-shadow 1.2s var(--ease-expo);
  transition-delay: var(--d, 0s);
}

/* Words surface from behind a line, as in the hero. */
.reveal--text:not(.is-in) {
  opacity: 0;
  transform: translateY(0.65em);
  clip-path: inset(0 -1em 100% -1em);
}

.reveal--text.is-in {
  clip-path: inset(-1em -1em -1em -1em);
}

/* Photos open like light coming into a room, and come into focus. */
/* The open state reaches past the frame so the clip never crops its drop shadow. */
.reveal--photo {
  clip-path: inset(-80px -80px -80px -80px round 20px);
}

.reveal--photo:not(.is-in) {
  clip-path: inset(0 0 0 100% round 20px);
}

.reveal--photo-left:not(.is-in) {
  clip-path: inset(0 100% 0 0 round 20px);
}

.reveal--photo img {
  transition:
    transform 1.8s var(--ease-expo),
    filter 1.6s var(--ease-expo);
  transition-delay: var(--d, 0s);
}

.reveal--photo:not(.is-in) img {
  transform: scale(1.14);
  filter: blur(10px) brightness(0.7);
}

.reveal--fade:not(.is-in) {
  opacity: 0;
  transform: translateY(18px);
}

/* The form card settles into place, its shadow arriving with it. */
.reveal--card:not(.is-in) {
  opacity: 0;
  transform: translateY(48px);
  box-shadow:
    0 1px 2px rgb(31 26 36 / 0),
    0 8px 20px -14px rgb(31 26 36 / 0.1);
}

/* Lavender accent rules draw in with their paragraph. */
.reveal--text.intro__close::before,
.reveal--text.score__note::before {
  transform-origin: left center;
  transition: transform 1s var(--ease-expo) calc(var(--d, 0s) + 0.35s);
}

.reveal--text.intro__close:not(.is-in)::before,
.reveal--text.score__note:not(.is-in)::before {
  transform: scaleX(0);
}

/* The cue arrow draws down, then breathes while it's on screen. */
.reveal--cue::after {
  transform-origin: top center;
  transition: transform 1s var(--ease-expo) 0.4s;
}

.reveal--cue:not(.is-in)::after {
  transform: scaleY(0);
}

.reveal--cue.is-in.is-onscreen::after {
  animation: cue-breathe 2.6s var(--ease-soft) 1.6s infinite;
}

@keyframes cue-breathe {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

/* "Keep noticing" questions on the thank-you page arrive one by one, dot first. */
.reveal--item:not(.is-in) {
  opacity: 0;
  transform: translateX(-12px);
}

.notice li::before {
  transition: transform 0.6s var(--ease-expo) calc(var(--d, 0s) + 0.15s);
}

.notice li.reveal--item:not(.is-in)::before {
  transform: scale(0);
}

/* Arriving at the questionnaire from the hero button: a soft lavender halo, once. */
.form-card.is-arrived {
  animation: card-arrive 1.6s var(--ease-soft);
}

@keyframes card-arrive {
  0% {
    box-shadow:
      0 0 0 0 rgb(204 172 207 / 0),
      0 1px 2px rgb(31 26 36 / 0.06),
      0 28px 64px -28px rgb(31 26 36 / 0.28);
  }
  35% {
    box-shadow:
      0 0 0 6px rgb(204 172 207 / 0.55),
      0 1px 2px rgb(31 26 36 / 0.06),
      0 28px 64px -28px rgb(31 26 36 / 0.28);
  }
  100% {
    box-shadow:
      0 0 0 14px rgb(204 172 207 / 0),
      0 1px 2px rgb(31 26 36 / 0.06),
      0 28px 64px -28px rgb(31 26 36 / 0.28);
  }
}

/* Answered questions: the number turns teal, so progress shows as you go. */
.q__num {
  display: inline-block;
  transition: color 0.35s var(--ease-soft);
}

.gfield.q.is-answered .q__num {
  color: var(--teal-strong);
}

.gfield.q.is-answered.just-answered .q__num {
  animation: answer-pop 0.5s var(--ease-expo);
}

@keyframes answer-pop {
  40% {
    transform: scale(1.22);
  }
}

.gform_wrapper select,
.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"] {
  transition:
    border-color 0.2s var(--ease-soft),
    box-shadow 0.2s var(--ease-soft),
    color 0.2s var(--ease-soft),
    outline-offset 0.2s var(--ease-soft);
}

/* Sending: a light passes across the button while the page submits. */
.cta.is-sending {
  cursor: progress;
}

.cta.is-sending::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(100deg, rgb(255 255 255 / 0) 30%, rgb(255 255 255 / 0.28) 50%, rgb(255 255 255 / 0) 70%) -150% 0 / 60% 100% no-repeat;
  animation: sending-sweep 1.3s var(--ease-soft) infinite;
}

@keyframes sending-sweep {
  to {
    background-position: 250% 0;
  }
}

/* Footer links: the underline warms to lavender. */
.site-footer a {
  text-decoration-color: rgb(255 255 255 / 0.45);
  transition: text-decoration-color 0.25s var(--ease-soft), color 0.25s var(--ease-soft);
}

.site-footer a:hover {
  text-decoration-color: var(--lavender);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition: opacity 0.6s ease-out;
    transition-delay: 0s;
  }

  .gfield.q.is-answered.just-answered .q__num,
  .reveal--cue.is-in.is-onscreen::after,
  .form-card.is-arrived,
  .cta.is-sending::after {
    animation: none;
  }
}

/* A printed page shows everything, whether or not it was scrolled to. */
@media print {
  .reveal,
  .reveal img,
  .reveal::before,
  .reveal::after {
    transform: none !important;
    clip-path: none !important;
    filter: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1 !important;
  }
}
