/* --- Tokens --- */

:root {
  /* Colors */
  --color-cream: #f4e8dd;
  --color-navy: #28213D;
  --color-navy-soft: rgba(40, 33, 61, 0.72);

  /* Type */
  --font-display: "Caveat Brush", "Segoe Print", "Comic Sans MS", cursive;
  --font-body: "Poppins", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* Shape + rhythm */
  --radius-pill: 999px;
  --radius-card: 10px;
  --gutter: clamp(1.25rem, 3.2vw, 2rem);
  --border: 2px solid var(--color-navy);
  --container-large: 2000px;
  --container-medium: 1280px;

  /* Caveat Brush is a touch narrower than the lettering in the mockup,
     so display type is stretched slightly to keep the proportions. */
  --stretch: 1.15;
}

/* --- Reset --- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The display type is stretched with a transform, which can push a few pixels
     past the viewport edge on narrow screens. */
  overflow-x: clip;
}

body {
  min-height: 100vh;
  background-color: var(--color-cream);
  color: var(--color-navy);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

/* --- Accessibility helpers --- */

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

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -150%);
  z-index: 10;
  padding: 0.6rem 1.1rem;
  background: var(--color-navy);
  color: var(--color-cream);
  border-radius: 0 0 var(--radius-pill) var(--radius-pill);
  text-decoration: none;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

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

/* --- Components --- */

.secondary-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.75rem;
}

.autoscroll-container {
  overflow: hidden;
}

.autoscroll-track {
  width: max-content;
  animation: autoscroll 30s linear infinite;
}

.autoscroll-container:hover .autoscroll-track {
  animation-play-state: paused;
}

.sm-only {
  display: none;
}

.not-sm-only {
  display: initial;
}

/* --- Headlines --- */

.headlines {
  margin: 2rem auto 3rem;
  max-width: var(--container-medium);
  position: relative;
}

.headlines::before, .headlines::after {
  content: '';
  display: block;
  position: absolute;
  width: 10%;
  height: 100%;
}

.headlines::before {
  z-index: 1;
  background: linear-gradient(90deg,rgba(244, 232, 221, 1) 0%, rgba(244, 232, 221, 0.01) 100%);
}

.headlines::after {
  top: 0;
  right: 0;
  background: linear-gradient(-90deg,rgba(244, 232, 221, 1) 0%, rgba(244, 232, 221, 0.01) 100%);
}

.headlines__track {
  display: flex;
}

.headline {
  display: flex;
  align-items: center;
  padding-right: 2rem;
}

/* --- Header --- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem var(--gutter);
  margin: 0 auto;
  max-width: var(--container-large);
}

.social {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social__label {
  font-size: 1.0625rem;
}

.social__list {
  display: flex;
  gap: 1rem;
}

.social__link {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background-color: var(--color-navy);
  color: var(--color-cream);
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.2s ease;
}

.social__link svg {
  width: 15px;
  height: 15px;
}

.social__link:hover {
  transform: scale(1.1);
}

/* --- Buttons --- */

.btn {
  display: inline-block;
  background-color: var(--color-navy);
  color: var(--color-cream);
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(40, 33, 61, 0.22);
}

.btn:active {
  transform: translateY(0);
}

/* --- Hero --- */

.hero {
  display: flex;
  justify-content: center;
}

.hero__media {
  position: relative;
  width: min(560px, 92vw);
  container-type: inline-size;
}

.hero__image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
}

.btn--hero {
  position: absolute;
  left: 50%;
  bottom: 4.4%;
  transform: translateX(-50%);
  font-size: 1.15rem;
  font-size: clamp(0.85rem, 3.2cqw, 1.15rem);
  padding: 0.68em 1.55em;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(40, 33, 61, 0.2);
}

.btn--hero:hover {
  transform: translateX(-50%) scale(1.1);
}

/* --- Intro --- */

.intro {
  padding: 0.9rem var(--gutter) 0;
  text-align: center;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.2vw, 2.55rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
  transform: scaleX(var(--stretch));
}

/* The wishlist heading is set smaller than the intro heading in the mockup. */
.section-title--small {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.intro__text {
  max-width: 30.6rem;
  margin: 0.9rem auto 0;
  font-size: clamp(1.05rem, 1.65vw, 1.3125rem);
  line-height: 1.4;
}

/* --- Features --- */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 300px));
  gap: 4rem;
  justify-content: center;
  padding: 0 var(--gutter);
}

.feature {
  text-align: center;
}

.feature__image {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-card);
}

.feature__title {
  margin: 0.9rem auto 0;
}

.feature__text {
  max-width: 18rem;
  margin: 0.85rem auto 0;
  font-size: 1.05rem;
  line-height: 1.5;
}

/* --- Waitlist --- */

.waitlist {
  margin-top: 4rem;
  padding: 0 var(--gutter);
  text-align: center;
}

.waitlist__title {
  text-transform: uppercase;
}

.waitlist__note {
  max-width: 21rem;
  margin: 2rem auto 0;
  font-size: 1.125rem;
}

/* --- Footer --- */

.site-footer {
  margin-top: 7rem;
  padding: 0 var(--gutter) 2.75rem;
  color: var(--color-navy-soft);
  font-size: 0.9375rem;
  text-align: center;
}

/* --- Responsive --- */

@media (max-width: 62rem) {
  /* Below this width there is not enough room to stretch the display type. */
  :root {
    --stretch: 1;
  }

  .section-title,
  .brand__name {
    transform: none;
  }

  .features {
    grid-template-columns: repeat(auto-fit, minmax(240px, 300px));
    gap: 3.5rem 2.5rem;
  }
}

@media (max-width: 40rem) {
  .sm-only {
    display: initial;
  }

  .not-sm-only {
    display: none;
  }

  .site-header {
    justify-content: space-between;
    gap: 1rem;
  }

  .social__label {
    display: none;
  }

  .brand__mark {
    width: 40px;
    height: 40px;
  }

  .brand__name {
    font-size: 2.4rem;
  }

  .social {
    gap: 0.75rem 1rem;
    justify-content: space-between;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .feature__text {
    max-width: 22rem;
  }

  .site-footer {
    margin-top: 4.5rem;
  }
}

/* --- Motion preferences --- */

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --- Animations --- */

@keyframes autoscroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
