@charset "UTF-8";

/*
 * Bedtime Box
 * Mobile first: base rules are the phone layout; wider layouts are added at 51.25em (820px).
 * Layout is flexbox and grid only. No positioned elements.
 */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #14213D;
  --text: #33415C;
  --muted: #55627A;
  --blue: #1D3A8A;
  --tint: #EEF4FB;
  --line: #D5DFEE;
  --stitch: #9FB4D6;
  --sun: #F6C445;
  --star: #C32B3D;
  --night-text: #D5DFF5;
  --white: #FFFFFF;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  font-weight: 600;
  font-size: clamp(2.5rem, 5vw + 1rem, 4rem);
  line-height: 1.08;
}

h2 {
  font-weight: 600;
  font-size: clamp(2rem, 3vw + 1rem, 2.75rem);
  line-height: 1.15;
}

h3 {
  font-weight: 500;
  font-size: 1.625rem;
  line-height: 1.2;
}

p {
  margin: 0;
}

a {
  color: var(--blue);
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

address {
  font-style: normal;
}

/* ---------- Helpers ---------- */

.wrap {
  width: 100%;
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.section--short {
  padding-block: clamp(3.5rem, 7vw, 5rem);
}

.band--tint {
  background: var(--tint);
}

.band--night {
  background: var(--ink);
  color: var(--white);
}

.band--night h2,
.band--night h3 {
  color: var(--white);
}

.band--night .lead {
  color: var(--night-text);
}

.eyebrow {
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

.lead {
  font-size: 1.25rem;
  max-width: 32em;
}

.rounded {
  border-radius: 1.75rem;
}

.round {
  border-radius: 999px;
  aspect-ratio: 1;
  object-fit: cover;
}

/* The dashed "stitched" edge borrowed from the felt logo */
.stitched {
  border-radius: 1.5rem;
  outline: 2px dashed var(--stitch);
  outline-offset: 6px;
}

.stitched.round {
  border-radius: 999px;
}

/* Skip link: collapsed until it receives keyboard focus */
.skip {
  display: block;
  height: 0;
  overflow: hidden;
  text-align: center;
  font-weight: 700;
}

.skip:focus {
  height: auto;
  padding: 0.75rem;
  background: var(--sun);
  color: var(--ink);
}

/* Honeypot field: takes no space and is skipped by keyboard and screen readers */
.hp {
  height: 0;
  overflow: hidden;
}

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.5rem 2rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn--sun {
  background: var(--sun);
  color: var(--ink);
}

.btn--sun:hover {
  background: #FFD564;
  color: var(--ink);
}

.btn--ink {
  background: var(--ink);
  color: var(--white);
}

.btn--ink:hover {
  background: var(--blue);
  color: var(--white);
}

.btn--ghost {
  border-color: var(--white);
  color: var(--white);
}

.btn--ghost:hover {
  background: var(--white);
  color: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.link-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 3.5rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.1875rem;
}

.link-strong {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 700;
}

/* ---------- Header and navigation ---------- */

.site-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding-block: 0.75rem;
}

.site-bar__logo {
  display: inline-flex;
}

.site-bar__logo img {
  height: 3.25rem;
  width: auto;
}

/* Without JavaScript the menu is simply always open and the button stays hidden */
.burger {
  display: none;
  align-items: center;
  gap: 0.625rem;
  min-height: 3rem;
  padding: 0 1.125rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.js .burger {
  display: inline-flex;
}

.site-nav {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0 1rem;
  border-top: 1px solid var(--line);
}

.js .site-nav {
  display: none;
}

.js .site-nav.is-open {
  display: flex;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 3.5rem;
  border-bottom: 1px solid #E3EBF6;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--sun);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}

.site-nav a.site-nav__buy {
  justify-content: center;
  margin-top: 1rem;
  border-bottom: 0;
  border-radius: 999px;
  background: var(--sun);
  font-weight: 700;
}

/* ---------- Two-part layouts ---------- */

.split {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.split__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  min-width: 0;
}

.split__media {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.split__media--narrow img {
  width: 100%;
  max-width: 22rem;
}

.split__media--small img {
  width: 20rem;
}

.hero {
  padding-top: clamp(1rem, 4vw, 2rem);
  padding-bottom: clamp(3.5rem, 8vw, 5.5rem);
}

.hero__mat {
  width: 100%;
  max-width: 37.5rem;
}

/* ---------- Home: benefit cards ---------- */

.cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem 2.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card h3 {
  margin-top: 0.5rem;
}

/* ---------- Star lists ---------- */

.starlist,
.values,
.contents,
.steps,
.facts,
.gallery__thumbs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.star {
  flex: none;
}

.starlist {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.starlist li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.starlist div {
  display: flex;
  flex-direction: column;
}

.starlist strong,
.contents strong {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.3125rem;
}

.starlist span,
.contents span {
  color: var(--night-text);
}

.contents {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem 2.5rem;
}

.contents li {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* ---------- Home: film ---------- */

.film {
  align-items: center;
}

.film__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.film__frame {
  width: 100%;
  max-width: 60rem;
  overflow: hidden;
  border-radius: 1.75rem;
  background: var(--ink);
}

.film__frame video {
  width: 100%;
  aspect-ratio: 16 / 9;
}

/* ---------- Credentials ---------- */

.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.badges img {
  height: 4.5rem;
  width: auto;
  border-radius: 0.75rem;
}

.credentials {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.credential {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem 0.75rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.credential img {
  height: 4rem;
  width: auto;
}

/* ---------- About: values ---------- */

.values {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

.values li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.75rem;
  background: var(--white);
  border-radius: 1.5rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.3125rem;
  line-height: 1.3;
  color: var(--ink);
}

/* ---------- Buy ---------- */

.gallery {
  flex-direction: column;
  justify-content: flex-start;
  gap: 1.75rem;
}

.gallery > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.gallery__thumbs img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 1rem;
}

.gallery__thumb--outlined {
  border: 1px solid var(--line);
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--star);
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form__note {
  font-size: 1rem;
  color: var(--muted);
}

.price {
  font-family: var(--display);
  font-weight: 500;
  font-size: 2rem;
  color: var(--ink);
}

.facts {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}

.facts strong {
  color: var(--ink);
}

.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}

.steps li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.steps__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  background: var(--tint);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.625rem;
  color: var(--blue);
}

.order {
  align-items: center;
}

.order > * {
  width: 100%;
  max-width: 44rem;
}

.order__intro {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ---------- Forms ---------- */

.form {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(1.5rem, 6vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 1.75rem;
  background: var(--white);
}

.stitched-inset {
  outline: 2px dashed var(--stitch);
  outline-offset: -10px;
}

.form .btn {
  align-self: flex-start;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.field--short {
  max-width: 12rem;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

.fieldset {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.fieldset legend {
  padding: 0;
  margin-bottom: 1rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.3125rem;
  color: var(--ink);
}

label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 1rem;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--star);
}

.field__error,
.form__error {
  font-size: 1rem;
  font-weight: 700;
  color: #A3202F;
}

.form__error {
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  background: #FCEBEC;
}

.notice {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.5rem, 6vw, 2.5rem);
  border-radius: 1.75rem;
  background: var(--white);
  border: 1px solid var(--line);
}

.notice h2 {
  font-size: 1.75rem;
}

/* ---------- Contact ---------- */

.address-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.75rem;
  border-radius: 1.5rem;
  background: var(--tint);
}

.address-card strong {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.3125rem;
  color: var(--ink);
}

.address-card a,
.social-row a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 700;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

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

.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-block: clamp(2.5rem, 6vw, 3.5rem) 2.5rem;
}

.site-footer__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem 3.5rem;
  font-size: 1rem;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.site-footer__brand img {
  height: 4rem;
  width: auto;
}

.site-footer__brand p {
  max-width: 24em;
}

.site-footer__links,
.site-footer__address {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.site-footer__links a,
.site-footer__address a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.site-footer__address {
  gap: 0.25rem;
}

.site-footer__address strong {
  color: var(--ink);
}

.site-footer__legal {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- Error page ---------- */

.missing {
  align-items: flex-start;
}

/* ---------- Small tablets: two-up grids ---------- */

@media (min-width: 37.5em) {
  .field-row,
  .values,
  .contents,
  .site-footer__cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Desktop ---------- */

@media (min-width: 51.25em) {
  body {
    font-size: 1.125rem;
  }

  .site-bar {
    gap: 0.75rem 2rem;
    padding-block: 1.25rem;
  }

  .site-bar__logo img {
    height: 4.75rem;
  }

  .burger,
  .js .burger {
    display: none;
  }

  .site-nav,
  .js .site-nav,
  .js .site-nav.is-open {
    flex: 0 1 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.75rem;
    padding: 0;
    border-top: 0;
  }

  .site-nav a {
    min-height: 2.75rem;
    border-bottom: 0;
    font-size: inherit;
  }

  .site-nav a.site-nav__buy {
    margin-top: 0;
    min-height: 3rem;
    padding: 0 1.5rem;
  }

  .split {
    flex-direction: row;
    align-items: center;
    gap: 3rem 4rem;
  }

  .split--top {
    align-items: flex-start;
  }

  .split--center {
    justify-content: center;
  }

  .split__body,
  .split__media {
    flex: 1 1 0;
  }

  .split__media--narrow {
    flex: 0 1 24rem;
  }

  .split__media--small {
    flex: 0 0 auto;
  }

  .split--center .split__body {
    flex: 0 1 34rem;
  }

  .split--center .actions {
    flex: 0 0 auto;
  }

  .cards,
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .values {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contents {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .site-footer__cols {
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
