/* LifeBox marketing site.
 * Palette: mist blue-grey ground, white panels, slate ink, leaf green.
 * Type: Barlow Condensed (display, timer) echoing the LIFE/BOX wordmark,
 * Barlow (body). The one loud element is the hero box you can drop a phone into.
 */

@font-face {
  font-family: "Barlow";
  src: url("/assets/fonts/barlow-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/assets/fonts/barlow-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/assets/fonts/barlow-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/assets/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/assets/fonts/barlow-condensed-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --mist: #e4ebf0;
  --mist-deep: #d3dde5;
  --paper: #ffffff;
  --ink: #1e2a33;
  --steel: #5f7280;
  --leaf: #a8de8c;
  --leaf-deep: #2e6a2c;
  --line: #c4d0d9;

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;

  --gutter: clamp(16px, 5vw, 64px);
  /* Shared left/right edge: the gutter, or centered 1152px content on wide screens */
  --edge: max(var(--gutter), calc((100% - 1152px) / 2));
  --measure: 34rem;
  --radius-sm: 10px;
  --radius-lg: 22px;
}

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

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

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.55;
  overflow-x: hidden;
}

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

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

p {
  margin: 0;
}

a {
  color: var(--leaf-deep);
}

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

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

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--paper);
  padding: 8px 12px;
  z-index: 10;
}
.skip:focus {
  left: 8px;
}

/* ---------------------------------------------------------------- header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--edge);
}

.brand {
  color: var(--ink);
  display: inline-flex;
}
.brand-mark {
  width: 52px;
  height: 52px;
}

.signin {
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  padding: 8px 2px;
  border-bottom: 2px solid var(--leaf);
}
.signin:hover {
  border-color: var(--leaf-deep);
}

/* ------------------------------------------------------------------ hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: clamp(16px, 4vw, 48px) var(--edge) clamp(48px, 7vw, 96px);
}

.hero h1 {
  font-size: clamp(3.4rem, 8.5vw, 7.25rem);
  max-width: 9ch;
}

.lede {
  margin-top: 24px;
  max-width: var(--measure);
  font-size: 1.25rem;
  color: var(--ink);
}

/* signup form */

.signup {
  margin-top: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 30rem;
}

.signup input[type="email"] {
  font: inherit;
  min-height: 54px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  min-width: 0;
}
.signup input[type="email"]::placeholder {
  color: #8a9aa6;
}

.signup button,
.stage-btn {
  font: inherit;
  font-weight: 600;
  min-height: 54px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--leaf);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.signup button:hover,
.stage-btn:hover {
  background: #93d473;
}
.signup button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.signup-msg {
  grid-column: 1 / -1;
  font-size: 0.95rem;
  color: var(--steel);
}
.signup[data-status="error"] .signup-msg {
  color: #a3261a;
}
.signup[data-status="done"] .signup-msg {
  color: var(--leaf-deep);
  font-weight: 600;
}
.signup[data-status="done"] input,
.signup[data-status="done"] button {
  display: none;
}

/* ----------------------------------------------------------------- stage */

.stage {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.stage-art {
  width: min(100%, 440px);
  height: auto;
  overflow: visible;
}

.box-back {
  fill: var(--mist-deep);
}

.box-front {
  fill: none;
  stroke: var(--ink);
  stroke-width: 18;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.box-face {
  fill: var(--paper);
}

.box-label {
  font-family: var(--body);
  font-weight: 600;
  font-size: 19px;
  fill: var(--steel);
}

.box-time {
  font-family: var(--display);
  font-weight: 800;
  font-size: 66px;
  fill: var(--line);
  font-variant-numeric: tabular-nums;
  transition: fill 0.3s ease;
}

.phone {
  transition: transform 0.7s cubic-bezier(0.6, 0, 0.25, 1);
}

.phone-body {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 6;
}

.phone-screen {
  fill: #eef3f6;
  transition: fill 0.5s ease 0.35s;
}

.ping {
  fill: var(--leaf);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: left center;
  animation: ping-in 0.35s ease-out forwards;
}
.p1 { animation-delay: 0.5s; }
.p2 { animation-delay: 0.9s; fill: #c9d5dd; }
.p3 { animation-delay: 1.3s; }

@keyframes ping-in {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

/* phone in the box */
.stage[data-state="in"] .phone {
  transform: translateY(176px);
}
.stage[data-state="in"] .phone-screen {
  fill: var(--ink);
}
.stage[data-state="in"] .pings {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.stage[data-state="in"] .box-time {
  fill: var(--ink);
}

.stage-controls {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.stage-btn {
  background: var(--paper);
}
.stage[data-state="in"] .stage-btn {
  background: var(--paper);
}

.stage-msg {
  min-height: 1.6em;
  max-width: 24rem;
  color: var(--steel);
}

/* ------------------------------------------------------------ live total */

.live {
  background: var(--ink);
  color: var(--paper);
  padding: 28px var(--edge);
}
.live p {
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  font-weight: 500;
  line-height: 1.35;
}
.live-total {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.45em;
  color: var(--leaf);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------- shared sections */

main > section:not(.hero):not(.live) {
  padding: clamp(56px, 8vw, 112px) var(--edge) 0;
}

main h2 {
  font-size: clamp(2.6rem, 5.5vw, 4.25rem);
}

main h3 {
  font-size: clamp(1.7rem, 2.6vw, 2.1rem);
}

/* ----------------------------------------------------------------- steps */

.steps ol {
  list-style: none;
  counter-reset: step;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}

.steps li {
  counter-increment: step;
  border-top: 4px solid var(--ink);
  padding-top: 18px;
}

.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  color: var(--leaf-deep);
  margin-bottom: 10px;
}

.steps p {
  margin-top: 10px;
  color: var(--steel);
}

/* ------------------------------------------------------------------- app */

.app-intro p {
  margin-top: 18px;
  max-width: var(--measure);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  margin-top: clamp(40px, 6vw, 72px);
}
.feature.flip {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
}
.feature.flip figure {
  order: 2;
}

.feature figure {
  margin: 0;
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: clamp(12px, 2vw, 22px);
  box-shadow: 0 1px 0 var(--line), 0 24px 48px -32px rgba(30, 42, 51, 0.45);
}

.feature p {
  margin-top: 14px;
  max-width: 28rem;
  color: var(--steel);
}

/* ------------------------------------------------------------------- why */

.why h2 {
  max-width: 18ch;
}
.why p {
  margin-top: 24px;
  max-width: var(--measure);
}

/* ----------------------------------------------------------------- maker */

.maker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(20px, 5vw, 64px);
  align-items: start;
}
.maker p {
  max-width: var(--measure);
  padding-top: 6px;
}

/* ------------------------------------------------------------------- faq */

.faq h2 {
  margin-bottom: 24px;
}

.faq details {
  border-top: 2px solid var(--line);
  max-width: 48rem;
}
.faq details:last-of-type {
  border-bottom: 2px solid var(--line);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 40px 20px 0;
  font-weight: 600;
  font-size: 1.2rem;
  position: relative;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--leaf-deep);
}
.faq details[open] summary::after {
  content: "–";
}
.faq details p {
  padding: 0 0 20px;
  max-width: var(--measure);
  color: var(--steel);
}

/* ---------------------------------------------------------------- closer */

.closer {
  padding-bottom: clamp(56px, 8vw, 112px) !important;
}
.closer h2 {
  font-size: clamp(3rem, 7vw, 5.5rem);
}

/* ---------------------------------------------------------------- footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding: 28px var(--edge) 40px;
  border-top: 2px solid var(--line);
  color: var(--steel);
  font-size: 0.95rem;
}
.foot-mark {
  width: 34px;
  height: 34px;
  color: var(--ink);
}
.foot a {
  margin-left: auto;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage {
    order: -1;
  }
  .stage-art {
    width: min(100%, 320px);
  }
  .steps ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .feature,
  .feature.flip,
  .maker {
    grid-template-columns: minmax(0, 1fr);
  }
  .feature.flip figure {
    order: 0;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 1.0625rem;
  }
  .signup {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps ol {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .foot a {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .phone,
  .phone-screen,
  .box-time,
  .ping {
    transition: none !important;
    animation: none !important;
  }
  .ping {
    opacity: 1;
  }
}

/* Hidden SVG sprite holding the logo mark */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* --------------------------------------------------------------- reserve */

.hero-reserve {
  margin-top: 16px;
  font-size: 1rem;
  color: var(--steel);
}

.reserve-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 48px);
}

.reserve-sub {
  margin-top: 14px;
  color: var(--steel);
}

.price {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.terms {
  list-style: none;
  margin: 18px 0 24px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.terms li {
  padding-left: 26px;
  position: relative;
}
.terms li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 12px;
  height: 7px;
  border-left: 3px solid var(--leaf-deep);
  border-bottom: 3px solid var(--leaf-deep);
  transform: rotate(-45deg);
}

.reserve-btn {
  font: inherit;
  font-weight: 600;
  min-height: 56px;
  width: 100%;
  max-width: 22rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--leaf);
  color: var(--ink);
  cursor: pointer;
}
.reserve-btn:hover {
  background: #93d473;
}
.reserve-btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.reserve-msg {
  margin-top: 10px;
  font-size: 0.95rem;
  color: var(--steel);
}
.reserve-msg.is-error {
  color: #a3261a;
}

.banner {
  background: var(--leaf);
  color: var(--ink);
  font-weight: 600;
  padding: 14px var(--edge);
}

@media (max-width: 900px) {
  .reserve-card {
    grid-template-columns: minmax(0, 1fr);
  }
}
