@font-face {
  font-family: 'BonyadeKoodak';
  src: url('fonts/BonyadeKoodak-VF.ttf') format('truetype');
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --mint: #aee5d3;
  --mint-soft: #edf7f3;
  --honey: #ffcf7b;
  --teal: #157c8c;
  --teal-text: #126c7a;
  --ink: #414042;
  --title: #242424;
  --muted: #6c6c6c;
  --error: #c23329;
  --white: #fff;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-panel: clamp(24px, 3vw, 40px);
}

* {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: 'BonyadeKoodak', Tahoma, system-ui, sans-serif;
  font-weight: 400;
  font-variation-settings: 'wght' 400, 'ROND' 10;
  line-height: 1.7;
}

button,
input,
select,
textarea {
  font: inherit;
  font-variation-settings: inherit;
  color: inherit;
}

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

a {
  color: inherit;
}

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

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

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

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 32px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 500;
  font-variation-settings: 'wght' 500, 'ROND' 10;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn[disabled] {
  cursor: default;
  opacity: 0.7;
}

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

.btn--cta:hover:not([disabled]) {
  background: #ffc35c;
}

.btn--outline {
  background: transparent;
  border-color: var(--teal);
  color: var(--teal-text);
  min-height: 44px;
  padding-inline: 24px;
  font-size: 16px;
}

.btn--outline:hover {
  background: var(--mint-soft);
}

/* Header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: clamp(16px, 3vw, 32px);
}

.top__logo img {
  width: clamp(64px, 8vw, 96px);
  height: auto;
}

/* Hero */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  min-height: clamp(520px, 58vw, 760px);
  overflow: hidden;
  background: var(--mint);
  border-radius: var(--radius-panel);
  isolation: isolate;
}

.hero__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.4vw, 32px);
  padding: clamp(32px, 5vw, 72px);
  padding-inline-start: clamp(32px, 6vw, 96px);
}

.hero__title {
  margin: 0;
  color: var(--title);
  font-size: clamp(32px, 4.2vw, 57px);
  font-weight: 700;
  font-variation-settings: 'wght' 700, 'ROND' 10;
  line-height: 1.3;
  text-wrap: balance;
}

.hero__text {
  margin: 0;
  max-width: 44ch;
  color: var(--ink);
  font-size: clamp(16px, 1.45vw, 20px);
  font-weight: 500;
  font-variation-settings: 'wght' 500, 'ROND' 10;
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero__art {
  position: relative;
  align-self: stretch;
  min-height: 100%;
}

.hero__art svg {
  position: absolute;
  /* The kid's feet sit 10% of the artwork's height above its bottom edge
     (see the viewBox), so the artwork is pushed down by that much to make
     the photo rest exactly on the bottom edge of the panel. */
  inset-block-end: -10.9%;
  inset-inline-end: -2%;
  width: auto;
  height: 108%;
  max-width: none;
}

.hero__stars {
  position: absolute;
  inset-block-start: clamp(16px, 3vw, 40px);
  inset-inline-end: clamp(16px, 3vw, 40px);
  width: clamp(48px, 7vw, 88px);
  height: auto;
  z-index: 1;
}

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero__copy {
    padding: 56px 24px 8px;
    padding-inline-start: 24px;
  }

  .hero__text {
    max-width: none;
  }

  .hero__art {
    height: clamp(340px, 92vw, 560px);
    overflow: hidden;
  }

  .hero__art svg {
    inset-inline-end: auto;
    inset-inline-start: 50%;
    inset-block-end: -11.3%;
    height: 112%;
    transform: translateX(50%);
  }
}

@media (max-width: 520px) {
  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
  }
}

/* Footer */

.foot {
  padding-block: 32px 48px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* Dialog */

.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 28px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(65, 64, 66, 0.28);
}

.dialog::backdrop {
  background: rgba(65, 64, 66, 0.55);
}

.dialog[open] {
  animation: pop 0.22s ease-out;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.dialog__inner {
  padding: clamp(20px, 4vw, 32px);
}

.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.dialog__title {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  font-variation-settings: 'wght' 700, 'ROND' 10;
  line-height: 1.4;
}

.dialog__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  margin-inline-end: -8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.dialog__close:hover {
  background: var(--mint-soft);
}

.dialog__close svg {
  width: 24px;
  height: 24px;
}

.dialog__lead {
  margin: 0 0 20px;
  font-size: 16px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__control {
  width: 100%;
  min-height: 52px;
  padding: 10px 24px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--ink);
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
}

.field__control::placeholder {
  color: var(--teal-text);
  opacity: 1;
}

.field__control:focus {
  outline: none;
  border-color: var(--teal);
}

.field__control[aria-invalid='true'] {
  border-color: var(--error);
  background: #fff0ee;
}

.field__control--ltr {
  direction: ltr;
  text-align: right;
}

.field__control--ltr::placeholder {
  direction: rtl;
}

.select {
  position: relative;
}

.select select {
  padding-inline-end: 24px;
  padding-inline-start: 52px;
  cursor: pointer;
}

.select select:invalid {
  color: var(--teal-text);
}

.select::after {
  content: '';
  position: absolute;
  inset-inline-start: 24px;
  inset-block-start: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--teal-text);
  border-bottom: 2px solid var(--teal-text);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.field__error {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding-inline: 12px;
  color: var(--error);
  font-size: 14px;
}

.field__error::before {
  content: '!';
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.field__control[aria-invalid='true'] ~ .field__error {
  display: flex;
}

.select[data-invalid='true'] ~ .field__error {
  display: flex;
}

.hp {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form__actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 6px;
}

.form__status {
  min-height: 1.6em;
  margin: 0;
  font-size: 15px;
}

.form__status[data-type='error'] {
  color: var(--error);
}

.btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  margin-inline-start: 10px;
  border: 2.5px solid rgba(65, 64, 66, 0.25);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn[data-loading='true'] .btn__spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0 8px;
  text-align: center;
}

.success__mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--teal-text);
}

.success__mark svg {
  width: 36px;
  height: 36px;
}

.success h3 {
  margin: 0;
  font-size: 22px;
}

.success p {
  margin: 0 0 8px;
  max-width: 36ch;
}

.dialog[data-state='done'] .form,
.dialog[data-state='done'] .dialog__lead {
  display: none;
}

.dialog[data-state='done'] .success {
  display: flex;
}

@media (max-width: 520px) {
  .form__actions .btn {
    width: 100%;
  }
}
