/*
 * Measurements follow the Figma file "Vape-Free Kids - Website": frame "Desktop - 7" (1440px wide)
 * and, below 52rem, frame "iPhone 16 - 1" (393px wide).
 * Die Grotesk C/D are Klim Type Foundry fonts: drop licensed .woff2 files into /assets/fonts/
 * and add @font-face rules below. Until then Inter Tight stands in.
 */

:root {
  --ink: #000;
  --paper: #fff;
  --page: #f5f2f2;
  --pink: #ff6eb0;
  --error: #b00020;
  --success: #1b6e2d;
  --gutter: clamp(1.25rem, 5.5vw, 5rem); /* 20px on mobile, 80px at 1440 */
  --max: 90rem; /* 1440 */
  --font-display: "Die Grotesk D", "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-ui: "Die Grotesk C", "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: Helvetica, "Helvetica Neue", Arial, sans-serif;
  --text-body: 1.25rem; /* 20px on desktop and mobile */
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.15;
  color: var(--ink);
  background: var(--page);
}

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

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.875rem, 2.85vw, 2.5625rem); /* 41px */
}

p {
  margin: 0;
}

a {
  color: inherit;
}

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Buttons: 15px/20px padding, 2px border, Die Grotesk C Bold 16px */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8125rem 1.125rem;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button:hover {
  background: #333;
  border-color: #333;
}

.button--outline {
  background: transparent;
  color: var(--ink);
}

.button--outline:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* White buttons on the black menu */
.button--inverse {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}

.button--inverse:hover {
  border-color: #ddd;
  background: #ddd;
}

.button--inverse-outline {
  border-color: var(--paper);
  background: transparent;
  color: var(--paper);
}

.button--inverse-outline:hover {
  background: var(--paper);
  color: var(--ink);
}

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.link-button {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* Header */

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 84.125rem; /* 1346 */
  min-height: 6.5rem; /* 104 */
  padding: 0 1rem;
  margin: 0 auto;
}

.site-header .logo img {
  width: clamp(7.5rem, 11.2vw, 10.0625rem); /* 161px */
}

.site-header__actions {
  display: flex;
  gap: 1.25rem;
}

.menu-button {
  display: none;
  padding: 0.75rem 0;
  border: 0;
  background: none;
  cursor: pointer;
}

/* Split sections (hero, contact): 720 / 720 at 1440 */

.split {
  display: grid;
}

.split__content {
  padding: clamp(2.5rem, 5vw, 3.75rem) var(--gutter);
}

.split__media {
  min-height: 24rem;
}

@media (min-width: 52rem) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .split__content {
    padding-left: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  }
}

.photo {
  background-color: #ccc;
  background-size: cover;
  background-position: center;
}

.photo--hero {
  background-color: #d5576a;
  background-image: url("/assets/img/hero.jpg");
}

.photo--products {
  background-color: #d9d9d9;
  background-image: url("/assets/img/products.jpg");
}

.photo--contact {
  background-color: #2c5b44;
  background-image: url("/assets/img/contact.jpg");
}

/* Hero: 620px tall, pink #ff6eb0, 515px text column */

.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.4375rem; /* 23 */
  background: var(--pink);
}

.hero__title {
  max-width: 32rem; /* 515 */
  font-size: clamp(2.5rem, 4.5vw, 4.0625rem); /* 65px */
}

.hero__sub {
  max-width: 32rem;
}

@media (min-width: 52rem) {
  .hero {
    min-height: 38.75rem; /* 620 */
  }
}

/* Letter: white, 80px padding, 777px body + 403px sidebar with 89px gap */

.letter-section {
  background: var(--paper);
}

.letter {
  display: grid;
  gap: 2.5rem;
  padding-top: var(--gutter);
  padding-bottom: var(--gutter);
}

.letter__body {
  display: flex;
  flex-direction: column;
  gap: 1.4375rem;
}

.letter__text p {
  margin-bottom: 1.15em;
}

.letter__text p:last-child {
  margin-bottom: 0;
}

.letter__recipients {
  display: flex;
  flex-direction: column;
  gap: 1.4375rem;
  align-self: start;
  font-size: 1rem;
}

.letter__date {
  padding: 0.625rem 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-size: 0.875rem;
}

.letter__recipients ul {
  margin: 0;
  padding: 0 0 1.4375rem;
  border-bottom: 2px solid var(--ink);
  list-style: none;
}

.letter__recipients li + li {
  margin-top: 1.15em;
}

.letter__recipients strong {
  display: block;
}

@media (min-width: 60rem) {
  .letter {
    grid-template-columns: minmax(0, 777fr) minmax(16rem, 403fr);
    gap: clamp(3rem, 6.2vw, 5.5625rem); /* 89 */
  }
}

/* Sign: product photo background, 845px white card */

.sign {
  padding: 4rem var(--gutter); /* 64 */
}

.card {
  max-width: 52.8125rem; /* 845 */
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 1.875rem); /* 30 */
  background: var(--paper);
}

.card__title {
  margin-bottom: 1.4375rem;
  font-size: clamp(1.75rem, 2.45vw, 2.1875rem); /* 35px */
  text-align: center;
}

/* Forms: underlined fields, 15px vertical padding, label sits in the field until filled */

.form {
  display: flex;
  flex-direction: column;
  gap: 1.4375rem;
}

.contact .form {
  gap: 1.25rem;
}

.field {
  position: relative;
  display: block;
  border-bottom: 1px solid var(--ink);
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 1.375rem 0 0.5rem;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  resize: vertical;
}

.field textarea {
  min-height: 8.625rem; /* Message box in the design is 6 lines tall */
}

.field input:focus,
.field textarea:focus {
  outline: none;
}

.field:focus-within {
  box-shadow: 0 1px 0 0 var(--ink);
}

.field__label {
  position: absolute;
  left: 0;
  top: 0.9375rem;
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.15s ease;
}

/* is-filled is set by main.js because autofill doesn't reliably update :placeholder-shown */
.field:focus-within .field__label,
.field.is-filled .field__label,
.field input:not(:placeholder-shown) + .field__label,
.field textarea:not(:placeholder-shown) + .field__label {
  transform: translateY(-0.6rem) scale(0.65);
}

/* Kept separate: a browser that doesn't know one of these selectors drops the whole rule */
.field input:autofill + .field__label {
  transform: translateY(-0.6rem) scale(0.65);
}

.field input:-webkit-autofill + .field__label {
  transform: translateY(-0.6rem) scale(0.65);
}

/* Stop Chrome/Safari painting a yellow or blue autofill background over the underlined field */
.field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 100px var(--field-bg, var(--page)) inset;
  -webkit-text-fill-color: var(--ink);
}

.card .field {
  --field-bg: var(--paper);
}

@media (prefers-reduced-motion: reduce) {
  .field__label {
    transition: none;
  }
}

.field.is-invalid {
  border-bottom-color: var(--error);
}

.field.is-invalid .field__label {
  color: var(--error);
}

.form__consent {
  font-size: 1rem;
}

.form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.form__footer--stacked {
  flex-direction: column;
  align-items: flex-start;
}

.form__status:empty {
  display: none;
}

.form__status {
  font-size: 1rem;
  font-weight: 700;
}

.form__status.is-error {
  color: var(--error);
}

.form__status.is-success {
  color: var(--success);
}

/* Signatures: white, 64px vertical padding, 4 columns with 125px gutters */

.signatures-section {
  background: var(--paper);
}

.signatures {
  display: flex;
  flex-direction: column;
  gap: 2.4375rem; /* 39 */
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.signatures__header {
  padding: 1.8125rem 0; /* 29 */
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
}

.signatures__count {
  font-size: clamp(2.75rem, 4.5vw, 4.0625rem); /* 65px */
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.signatures__label {
  font-size: clamp(1.25rem, 1.95vw, 1.75rem); /* 28px */
  letter-spacing: 0.02em;
}

.signatures__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr));
  gap: 1.1875rem clamp(1.5rem, 8.7vw, 7.8125rem); /* 19 / 125 */
  margin: 0;
  padding: 0;
  list-style: none;
}

.signatures__list li {
  overflow-wrap: anywhere;
}

.signatures__more {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.signatures__more[hidden] {
  display: none;
}

@media (min-width: 64rem) {
  .signatures__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Contact */

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

.contact__intro {
  max-width: 33.125rem; /* 530 */
}

@media (min-width: 52rem) {
  .contact {
    min-height: 51.0625rem; /* 817 */
  }
}

/* Footer: black, 80px padding */

.site-footer {
  padding: var(--gutter) 0;
  background: var(--ink);
  color: var(--paper);
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 3.125rem; /* 50 */
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2.5rem clamp(2.5rem, 10vw, 9.5rem);
}

.site-footer__social {
  display: flex;
  flex-direction: column;
  gap: 0.9375rem;
}

.site-footer__heading {
  font-weight: 700;
}

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

.site-footer__small {
  font-size: 0.875rem;
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.4375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__links a {
  text-decoration: none;
}

.site-footer__links a:hover {
  text-decoration: underline;
}

.site-footer__copyright {
  font-size: 0.9375rem;
}

.logo--footer {
  margin-left: auto;
}

.logo--footer img {
  width: clamp(10rem, 17.85vw, 16.0625rem); /* 257px */
}

.social {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--paper);
  color: #1b1b2f;
}

.social svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.field__error {
  margin-top: -0.75rem;
  color: var(--error);
  font-size: 0.875rem;
}

/* Mobile menu (a <dialog>, so it traps focus and closes on Escape) */

.menu {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0.9375rem var(--gutter) 2.5rem;
  border: 0;
  background: var(--ink);
  color: var(--paper);
}

.menu[open] {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.menu::backdrop {
  background: var(--ink);
}

.menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu__close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  cursor: pointer;
}

.menu :focus-visible {
  outline-color: var(--paper);
}

.menu__links {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-ui);
  font-size: 1.5rem;
  font-weight: 700;
}

.menu__links li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.menu__links a {
  display: block;
  padding: 1rem 0;
  text-decoration: none;
}

.menu__actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: auto;
}

/* Letter toggle: mobile only */

.letter__toggle {
  display: none;
  align-items: center;
  gap: 0;
}

.letter__toggle img {
  transform: rotate(180deg); /* the Figma icon points up; closed shows it pointing down */
}

.letter__toggle[aria-expanded="true"] img {
  transform: none;
}

/* Mobile: Figma frame "iPhone 16 - 1" */

@media (max-width: 51.99rem) {
  h2 {
    font-size: 2rem; /* 32px */
  }

  .site-header {
    background: var(--paper);
  }

  .site-header__inner {
    min-height: 0;
    padding: 0.9375rem var(--gutter); /* 15 / 20 */
  }

  .site-header .logo img {
    width: 6.375rem; /* 102px */
  }

  .site-header__actions {
    display: none;
  }

  .menu-button {
    display: block;
  }

  /* Hero: photo above the pink block */
  .hero .split__media {
    order: -1;
    min-height: 0;
    aspect-ratio: 393 / 342; /* keeps the design's framing on wider phones and tablets */
    max-height: 70vh;
  }

  .hero__content {
    justify-content: flex-start;
    padding: var(--gutter);
  }

  .hero__title {
    font-size: 2.5rem; /* 40px */
  }

  .letter,
  .signatures {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .letter {
    gap: 1.875rem; /* 30 */
  }

  .letter__toggle {
    display: inline-flex;
  }

  /* Closed state shows the greeting and first two paragraphs */
  .js .letter__text:not(.is-expanded) p:nth-child(n + 4) {
    display: none;
  }

  .sign {
    padding: 2.5rem var(--gutter);
  }

  .card__title {
    font-size: 2.1875rem; /* 35px */
  }

  .card .form__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 1.4375rem;
  }

  .card .form__footer .button {
    width: 100%;
  }

  .signatures__count {
    font-size: 2.5rem; /* 40px */
  }

  .signatures__label {
    font-size: 1.75rem; /* 28px */
  }

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

  .logo--footer {
    margin-left: 0;
  }
}

/* Tablets: two columns of names rather than one */
@media (min-width: 40rem) and (max-width: 51.99rem) {
  .signatures__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
