/* Fonts */
@font-face {
  font-family: "Amarna";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("../fonts/amarna-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Amarna";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("../fonts/amarna-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "DM Serif Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-serif-display-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "DM Serif Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-serif-display-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Tokens (shared with the app at app.simplesanta.io) */
:root {
  color-scheme: light;

  --ivory: #faf7f2;
  --sand: #f4ede3;
  --ink: #1d1b18;
  --stone: #6a645c;
  --linen: #e6dfd4;
  --cranberry: #9e2a36;
  --cranberry-deep: #7a1f29;
  --gold: #c9a26b;
  --cream: #f3e6d3;
  --flake: #c4ccd4;

  --avatar-cranberry: #9e2a36;
  --avatar-pine: #2f5d4a;
  --avatar-midnight: #27344f;
  --avatar-plum: #6b3a5b;
  --avatar-copper: #9a5a2f;

  --font-body: "Amarna", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "DM Serif Display", Georgia, serif;
  --text-sm: 0.9rem;
  --text-base: clamp(1.02rem, 0.98rem + 0.2vw, 1.12rem);
  --text-lg: clamp(1.2rem, 1.1rem + 0.45vw, 1.45rem);
  --text-xl: clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem);
  --text-hero: clamp(2.6rem, 1.6rem + 4.4vw, 4.6rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 5rem;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --border: 1px solid var(--linen);
  --shadow-card: 0 1px 2px rgb(29 27 24 / 0.04), 0 18px 44px -20px rgb(29 27 24 / 0.25);
  --shadow-lift: 0 2px 4px rgb(29 27 24 / 0.06), 0 16px 34px -14px rgb(29 27 24 / 0.3);

  --measure: 60ch;
  --page-width: 68rem;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 150ms;
  --dur: 280ms;
  --dur-slow: 700ms;
  --stagger: 90ms;
}

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

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Snow: fixed layers behind the page, as in the app. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(circle at 34px 412px, var(--flake) 1.4px, transparent 2.4px),
    radial-gradient(circle at 141px 57px, var(--flake) 1.8px, transparent 2.8px),
    radial-gradient(circle at 262px 233px, var(--flake) 1.1px, transparent 2.1px),
    radial-gradient(circle at 388px 120px, var(--flake) 1.6px, transparent 2.6px),
    radial-gradient(circle at 470px 350px, var(--flake) 1.2px, transparent 2.2px),
    radial-gradient(circle at 92px 300px, var(--flake) 1.9px, transparent 2.9px),
    radial-gradient(circle at 318px 452px, var(--flake) 1.3px, transparent 2.3px),
    radial-gradient(circle at 505px 18px, var(--flake) 1.5px, transparent 2.5px),
    radial-gradient(circle at 199px 160px, var(--flake) 1px, transparent 2px);
  background-size: 530px 470px;
  opacity: 0.8;
}

body::after {
  background-image:
    radial-gradient(circle at 75px 610px, var(--flake) 2.4px, transparent 3.4px),
    radial-gradient(circle at 300px 90px, var(--flake) 2px, transparent 3px),
    radial-gradient(circle at 610px 400px, var(--flake) 2.7px, transparent 3.7px),
    radial-gradient(circle at 455px 250px, var(--flake) 1.8px, transparent 2.8px),
    radial-gradient(circle at 160px 330px, var(--flake) 2.2px, transparent 3.2px),
    radial-gradient(circle at 720px 640px, var(--flake) 1.9px, transparent 2.9px);
  background-size: 770px 690px;
  opacity: 0.55;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* The tilted preview card and gift overhang their column; keep that from widening the page. */
main {
  overflow-x: clip;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  margin: 0 0 var(--space-4);
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--text-hero);
}

h2 {
  font-size: var(--text-xl);
}

h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

p {
  margin: 0 0 var(--space-4);
  max-width: var(--measure);
}

a {
  color: var(--cranberry);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--cranberry-deep);
}

:focus-visible {
  outline: 2px solid var(--cranberry);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding-inline: var(--space-4);
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -3rem;
  padding: var(--space-2) var(--space-3);
  background: #ffffff;
  z-index: 10;
}

.skip-link:focus {
  top: var(--space-2);
}

/* Buttons */
.button {
  display: inline-block;
  font-weight: 650;
  color: #ffffff;
  background: var(--cranberry);
  border-radius: var(--radius-pill);
  padding: var(--space-3) var(--space-6);
  text-decoration: none;
}

.button:hover {
  color: #ffffff;
  background: var(--cranberry-deep);
  box-shadow: var(--shadow-lift);
}

.button--small {
  padding: var(--space-2) var(--space-5);
}

/* Header */
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-5);
  padding-bottom: var(--space-4);
}

.brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--cranberry);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.site-nav a:not(.button) {
  color: var(--stone);
  text-decoration: none;
}

.site-nav a:not(.button):hover {
  color: var(--ink);
}

/* Hero */
.hero {
  display: grid;
  gap: var(--space-7);
  align-items: center;
  padding-top: var(--space-7);
  padding-bottom: var(--space-8);
}

.hero__lede {
  font-size: var(--text-lg);
  color: var(--stone);
  margin-bottom: var(--space-6);
}

/* Product preview: a drawing of the app's "your person" card, not a screenshot. */
.preview {
  position: relative;
  justify-self: center;
  width: min(100%, 22rem);
  padding-bottom: var(--space-6);
}

.preview__card {
  background: #ffffff;
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  rotate: -2deg;
}

.preview__kicker {
  color: var(--stone);
  margin: var(--space-3) 0 0;
}

.preview__name {
  font-family: var(--font-display);
  font-size: 3.2rem;
  line-height: 1;
  margin: 0 0 var(--space-4);
}

.preview__label {
  display: grid;
  gap: var(--space-2);
  background: var(--sand);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--stone);
  margin-bottom: var(--space-4);
}

.preview__lines {
  display: grid;
  gap: 0.4rem;
}

.preview__lines i {
  display: block;
  height: 0.5rem;
  border-radius: var(--radius-pill);
  background: #e3d8c9;
}

.preview__lines i:nth-child(1) { width: 45%; }
.preview__lines i:nth-child(2) { width: 75%; }
.preview__lines i:nth-child(3) { width: 60%; }

.preview__name {
  min-height: 1em;
}

/* Typing caret, shown only while the script is running. */
.typewriter.is-typing::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.8em;
  margin-left: 4px;
  background: var(--cranberry);
  vertical-align: baseline;
}

/* Demo status steps: real radio buttons, so they work without JavaScript. */
.preview__steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  border: 1px solid #958c80;
  border-radius: var(--radius-pill);
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 650;
  text-align: center;
  color: var(--stone);
}

.preview__step {
  position: relative;
  padding: var(--space-2) 0;
  cursor: pointer;
}

.preview__step + .preview__step {
  border-left: var(--border);
}

.preview__step input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.preview__step:hover {
  color: var(--ink);
  background: var(--sand);
}

/* Steps before the chosen one read as done. */
.preview__step:has(~ .preview__step input:checked) {
  color: var(--ink);
  background: var(--sand);
}

.preview__step:has(input:checked) {
  color: #ffffff;
  background: var(--cranberry);
}

.preview__step:has(input:focus-visible) {
  outline: 2px solid var(--cranberry);
  outline-offset: -4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.preview__gift {
  position: absolute;
  right: -1.5rem;
  bottom: -1.75rem;
  /* Decorative; clicks pass through to the Shipped step underneath. */
  pointer-events: none;
}

/* Avatars */
.avatar {
  --size: 2.75rem;
  display: inline-grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  color: #ffffff;
  background: var(--avatar-cranberry);
}

.avatar__icon {
  width: 58%;
  height: 58%;
  fill: currentColor;
}

.avatar--pine { background: var(--avatar-pine); }
.avatar--midnight { background: var(--avatar-midnight); }
.avatar--plum { background: var(--avatar-plum); }
.avatar--copper { background: var(--avatar-copper); }

/* Gift box (same drawing as the app) */
.giftbox {
  position: relative;
  width: 6.5rem;
  height: 6.1rem;
  transform-origin: 50% 100%;
}

.giftbox__body,
.giftbox__lid {
  position: absolute;
  background:
    linear-gradient(90deg, transparent 42%, var(--cream) 42% 58%, transparent 58%),
    var(--cranberry);
}

.giftbox__body {
  inset: auto 0.45rem 0;
  height: 3.7rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.giftbox__lid {
  inset: 1.2rem 0 auto;
  height: 1.3rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 10px -6px rgb(29 27 24 / 0.45);
}

.giftbox__bow {
  position: absolute;
  top: 0.05rem;
  left: 50%;
  width: 3.4rem;
  height: 1.4rem;
  translate: -50% 0;
}

.giftbox__bow::before,
.giftbox__bow::after {
  content: "";
  position: absolute;
  top: 0;
  width: 1.6rem;
  height: 1.25rem;
  border: 0.35rem solid var(--gold);
  border-radius: 50% 50% 10% 50%;
}

.giftbox__bow::before {
  left: 0;
  rotate: -18deg;
}

.giftbox__bow::after {
  right: 0;
  rotate: 18deg;
  border-radius: 50% 50% 50% 10%;
}

/* How it works */
.steps {
  padding-bottom: var(--space-8);
}

.steps__list {
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-5);
}

.step {
  background: #ffffff;
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-6) var(--space-5);
}

.step .avatar {
  margin-bottom: var(--space-4);
}

.step p {
  margin: 0;
  color: var(--stone);
}

/* Privacy */
.privacy {
  padding-bottom: var(--space-8);
}

.privacy__card {
  background: var(--sand);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-5);
}

.privacy__card p {
  font-size: var(--text-lg);
  margin: 0;
}

/* Invite */
.invite {
  padding-bottom: var(--space-8);
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: var(--space-5) 0;
  font-size: var(--text-sm);
  color: var(--stone);
  border-top: var(--border);
}

.site-footer p {
  margin: 0;
}

@media (min-width: 48rem) {
  .hero {
    grid-template-columns: 1.2fr 1fr;
    padding-top: var(--space-8);
  }

  .steps__list {
    grid-template-columns: repeat(2, 1fr);
  }

  .privacy__card {
    padding: var(--space-7);
  }
}

@media (min-width: 68rem) {
  .steps__list {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Motion: only for people who haven't asked their system to reduce it. */
@media (prefers-reduced-motion: no-preference) {
  body::before {
    animation: snowfall 40s linear infinite;
  }

  body::after {
    animation: snowfall-slow 70s linear infinite;
  }

  .hero__text > *,
  .preview,
  .step {
    animation: rise var(--dur-slow) var(--ease-out) both;
  }

  .hero__text > :nth-child(2) { animation-delay: calc(var(--stagger) * 1); }
  .hero__text > :nth-child(3) { animation-delay: calc(var(--stagger) * 2); }
  .preview { animation-delay: calc(var(--stagger) * 3); }

  .step:nth-child(1) { animation-delay: calc(var(--stagger) * 4); }
  .step:nth-child(2) { animation-delay: calc(var(--stagger) * 5); }
  .step:nth-child(3) { animation-delay: calc(var(--stagger) * 6); }
  .step:nth-child(4) { animation-delay: calc(var(--stagger) * 7); }

  .giftbox {
    animation: wiggle 3.6s ease-in-out 1.5s infinite;
  }

  .preview__step {
    transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
  }

  .typewriter.is-typing::after {
    animation: blink 1s steps(1) infinite;
  }

  /* Marking the demo as shipped sends the gift on a little hop. */
  .preview:has(input[value="shipped"]:checked) .preview__gift {
    animation: hop 700ms var(--ease-out);
  }

  .button {
    transition:
      background-color var(--dur-fast) ease,
      box-shadow var(--dur) var(--ease-out),
      translate var(--dur) var(--ease-out);
  }

  .button:hover {
    translate: 0 -1px;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 16px;
  }
}

@keyframes snowfall {
  to {
    background-position: 530px 470px;
  }
}

@keyframes snowfall-slow {
  to {
    background-position: -770px 690px;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes hop {
  30% {
    translate: 8px -26px;
    rotate: 8deg;
  }
  60% {
    translate: 14px 0;
    rotate: -3deg;
  }
}

@keyframes wiggle {
  0%,
  72%,
  100% {
    rotate: 0deg;
  }
  76% {
    rotate: -5deg;
  }
  82% {
    rotate: 4deg;
  }
  88% {
    rotate: -3deg;
  }
  94% {
    rotate: 1deg;
  }
}
