@font-face {
  font-family: 'Inter';
  src: url('/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Fraunces';
  src: url('/fraunces.woff2') format('woff2');
  font-weight: 600 700;
  font-display: swap;
}

/* The emails' colors (packages/emails): the golden sky, the paper, the wooden tag, the nearest hill. */
:root {
  --forest: #0e2a1f;
  --green: #5aad81;
  --paper: #fbfcfa;
  --muted: #536559;
  --page: #eef6ef;
  --sky-top: #e3b490;
  --horizon: #f7d9ae;
  --hill: #86c499;
  --card: #fbf6ea;
  --card-edge: #e4d9c0;
  --ink: #3f5146;
  --wood: #c99a66;
  --wood-edge: #9c7448;
  color: var(--forest);
  background: var(--page);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
}

[hidden] {
  display: none !important;
}

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

/* The whole window: the sky, the hills, then the ground down to the bottom. */
html {
  background: var(--hill);
}

.scene {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sky {
  flex: 1 0 auto;
  padding: 28px 20px 40px;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--horizon) 100%);
}

.paper {
  max-width: 560px;
  margin: 0 auto;
  padding: 30px 30px 26px;
  border-radius: 6px;
  background: var(--card);
  border-bottom: 3px solid #d6c9ab;
  box-shadow:
    0 1px 0 var(--card-edge),
    0 16px 22px -16px rgb(40 48 28 / 0.4);
}

.tag {
  display: inline-block;
  margin-bottom: 20px;
  padding: 3px 10px;
  border-radius: 3px;
  border-bottom: 2px solid var(--wood-edge);
  background: var(--wood);
  color: #3b2a18;
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
}

h1 {
  margin: 0 0 16px;
  font: 600 30px/36px 'Fraunces', Georgia, serif;
  letter-spacing: -0.4px;
}

p {
  margin: 0;
  color: var(--ink);
}

.step {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

label {
  color: var(--ink);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

input {
  flex: 1 1 200px;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--card-edge);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--forest);
  font: inherit;
}

input.code {
  letter-spacing: 4px;
}

.button {
  height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--forest);
  border-radius: 8px;
  background: var(--forest);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button.wide {
  width: 100%;
  height: 48px;
  margin-top: 4px;
}

.button.secondary {
  justify-self: start;
  background: transparent;
  color: var(--forest);
}

.button:disabled {
  opacity: 0.6;
}

.link {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link.danger {
  color: #8a2a22;
}

.status {
  color: var(--forest);
  font-weight: 550;
}

/* While the page waits on the API or Stripe. */
.status.waiting {
  animation: waiting 1.4s ease-in-out infinite alternate;
}

@keyframes waiting {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status.waiting {
    animation: none;
  }
}

/* The two plans, the yearly one first and chosen. */
.plans {
  display: grid;
  gap: 10px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}

.plan {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 2px 12px;
  padding: 14px 16px 14px 46px;
  border: 1.5px solid var(--card-edge);
  border-radius: 10px;
  background: #fffdf8;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.plan input {
  position: absolute;
  top: 17px;
  left: 16px;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--forest);
}

.plan:has(input:checked) {
  border-color: var(--forest);
  box-shadow: 0 0 0 1px var(--forest);
}

.plan-name {
  color: var(--forest);
  font-weight: 600;
}

.plan-price {
  color: var(--ink);
  text-align: right;
}

.plan-price strong {
  color: var(--forest);
  font: 600 22px/1 'Fraunces', Georgia, serif;
}

.plan-detail {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 14px;
}

.badge {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2f0e4;
  color: #1f5a3c;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.aside {
  color: var(--muted);
  font-size: 14px;
}

.problem {
  margin-top: 16px;
  color: #8a2a22;
}

/* The dino and the name, on the sky above the paper, where they read clearly. */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  /* Lined up with the paper's left edge. */
  margin: 0 max(0px, calc((100% - 560px) / 2)) 24px;
  color: var(--forest);
  font: 650 26px/1 'Fraunces', Georgia, serif;
  text-decoration: none;
}

/* The hills, and the ground they stand on. */
.hills {
  display: block;
  width: 100%;
  height: clamp(80px, 12vw, 150px);
  margin-top: -1px;
  background: var(--horizon);
}

.ground {
  display: grid;
  gap: 6px;
  margin-top: -1px;
  padding: 0 20px 40px;
  background: var(--hill);
  font-size: 13px;
  line-height: 20px;
}

.ground > * {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.ground p,
.ground a {
  color: var(--forest);
}

.ground .link {
  font-size: 13px;
}

input:focus-visible,
.button:focus-visible,
.link:focus-visible,
.plan:has(input:focus-visible) {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .sky {
    padding: 32px 14px 28px;
  }

  .paper {
    padding: 24px 20px 20px;
  }
}
