/* Landing page. The scale is the one loud thing; everything else stays quiet. */

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

.hero {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(1.5rem, 5vw, 4rem) clamp(3rem, 8vw, 6rem);
  align-items: start;
}
@media (min-width: 62rem) {
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(22rem, 0.95fr); }
  .hero-copy { position: sticky; top: 2rem; padding-top: 2.5rem; }
}
.lede { font-size: var(--step-1); line-height: 1.45; max-width: var(--measure); margin-top: 1.5rem; color: var(--muted); }
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; }
.fine { font-size: var(--step--1); max-width: 18rem; }

/* ---------- the scale ---------- */

.scale {
  --gear: var(--blaze); --food: #e9c46a; --water: #7fb5c9; --fuel: #a9b8a6;
  background: var(--panel); color: var(--panel-ink);
  border-radius: 1.6rem; padding: clamp(1.1rem, 3vw, 1.75rem);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 8%, transparent) inset, 0 30px 60px -30px color-mix(in srgb, var(--spruce) 55%, transparent);
  view-transition-name: scale;
}
.scale-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.scale-title { font-weight: 640; font-size: var(--step-1); line-height: 1.2; }
.scale-sub { font-size: var(--step--1); opacity: 0.65; }

.seg { display: inline-grid; grid-auto-flow: column; padding: 3px; border-radius: 0.6rem; background: color-mix(in srgb, var(--frost) 10%, transparent); }
.seg button {
  font: inherit; font-size: var(--step--1); font-weight: 600; color: inherit;
  min-width: 2.6rem; min-height: 1.9rem; border: 0; border-radius: 0.45rem; background: transparent; cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s;
}
.seg button[aria-pressed="true"] { background: var(--frost); color: var(--spruce); }

.readout { display: flex; align-items: baseline; gap: 0.6rem; margin-top: 1.25rem; }
.digits {
  display: inline-flex; overflow: hidden;
  font-stretch: 62%; font-weight: 800; line-height: 1;
  font-size: clamp(5rem, 3rem + 11vw, 9.5rem); letter-spacing: -0.02em;
  height: 1em;
}
.digits .col { display: inline-block; height: 1em; }
.digits .col > span {
  display: flex; flex-direction: column;
  transition: transform 0.9s var(--spring);
  will-change: transform;
}
.digits .col > span > b { height: 1em; font-weight: inherit; display: block; }
.digits .dot { height: 1em; }
.unit { font-stretch: 70%; font-weight: 600; font-size: var(--step-2); opacity: 0.7; }

.split { display: flex; gap: 3px; height: 0.7rem; margin-top: 1.1rem; }
.split i { display: block; height: 100%; border-radius: 3px; flex: 0 0 auto; width: 0; min-width: 4px; transition: width 0.8s var(--spring); }
[data-part="gear"] { background: var(--gear); }
[data-part="food"] { background: var(--food); }
[data-part="water"] { background: var(--water); }
[data-part="fuel"] { background: var(--fuel); }

.legend { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 0.5rem; margin: 0.8rem 0 0; font-size: var(--step--1); }
.legend dt { display: flex; align-items: center; gap: 0.4rem; opacity: 0.7; }
.legend dt b { width: 0.55rem; height: 0.55rem; border-radius: 2px; }
.legend dd { margin: 0; font-weight: 620; }

.days {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.25rem; padding-block: 0.9rem;
  border-block: 1px solid var(--panel-line); font-weight: 560;
}
.stepper { display: inline-flex; align-items: center; gap: 0.25rem; }
.stepper button {
  width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--panel-line);
  background: transparent; color: inherit; font: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer;
  transition: transform 0.3s var(--spring), background-color 0.2s;
}
.stepper button:hover { background: color-mix(in srgb, var(--frost) 10%, transparent); }
.stepper button:active { transform: scale(0.88); transition-duration: 0.06s; }
.stepper button[disabled] { opacity: 0.35; cursor: default; }
.stepper output { min-width: 2.2rem; text-align: center; font-size: var(--step-1); font-weight: 700; }

.gear { list-style: none; margin: 0; padding: 0; }
.gear li {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.75rem;
  padding-block: 0.6rem; border-bottom: 1px solid var(--panel-line);
  transition: opacity 0.35s var(--ease);
}
.gear li:last-child { border-bottom: 0; padding-bottom: 0; }
.gear li.out { opacity: 0.45; }
.gear .name { font-weight: 560; line-height: 1.25; }
.gear .brand { display: block; font-size: var(--step--1); font-weight: 400; opacity: 0.6; }
.gear .oz { font-size: var(--step--1); opacity: 0.8; text-align: right; }
.gear .worn-tag {
  font: inherit; font-size: 0.75rem; font-weight: 600; margin-left: 0.5rem; padding: 0.1rem 0.5rem;
  color: inherit; background: transparent; border: 1px solid var(--panel-line); border-radius: 99px; cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.gear .worn-tag[aria-pressed="true"] { background: var(--frost); color: var(--spruce); border-color: var(--frost); }

.switch {
  position: relative; width: 3rem; height: 1.8rem; flex: none;
  border: 0; border-radius: 99px; padding: 0; cursor: pointer;
  background: color-mix(in srgb, var(--frost) 18%, transparent);
  transition: background-color 0.3s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: calc(1.8rem - 6px); height: calc(1.8rem - 6px);
  border-radius: 50%; background: var(--frost);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.35);
  transition: transform 0.45s var(--spring), width 0.2s var(--ease);
}
.switch:active::after { width: calc(1.8rem + 2px); }
.switch[aria-checked="true"] { background: var(--blaze); }
.switch[aria-checked="true"]::after { transform: translateX(1.2rem); }
.switch[aria-checked="true"]:active::after { transform: translateX(calc(1.2rem - 8px)); }

/* ---------- how it works ---------- */

.how { padding-block: clamp(3rem, 8vw, 6rem); border-top: 1px solid var(--line); }
.how h2 { max-width: 16ch; }
.how-grid { display: grid; gap: 2rem clamp(1.5rem, 4vw, 3.5rem); margin-top: clamp(2rem, 5vw, 3.5rem); }
@media (min-width: 52rem) { .how-grid { grid-template-columns: repeat(3, 1fr); } }
.how-grid h3 { padding-top: 1rem; border-top: 3px solid var(--ink); margin-bottom: 0.75rem; }
.how-grid p { color: var(--muted); }

.worn { margin-top: clamp(3rem, 8vw, 6rem); display: grid; gap: 1rem 3rem; align-items: end; }
@media (min-width: 52rem) { .worn { grid-template-columns: 1.4fr 1fr; } }
.worn-big { font-stretch: 66%; font-weight: 780; font-size: var(--step-4); line-height: 0.95; letter-spacing: -0.015em; color: var(--accent-text); text-wrap: balance; }
.worn p:last-child { color: var(--muted); max-width: 30rem; padding-bottom: 0.6rem; }

/* ---------- devices ---------- */

.devices { padding-block: clamp(3rem, 8vw, 6rem); border-top: 1px solid var(--line); }
.devices ul { list-style: none; padding: 0; margin: clamp(2rem, 5vw, 3rem) 0 0; }
.devices li { display: grid; grid-template-columns: minmax(5.5rem, 12rem) 1fr; gap: 1rem; padding-block: 1.1rem; border-top: 1px solid var(--line); align-items: baseline; }
.devices li b { font-stretch: 70%; font-size: var(--step-2); font-weight: 760; line-height: 1; }
.devices li span { color: var(--muted); max-width: var(--measure); }

/* ---------- price ---------- */

.price { padding-block: clamp(3rem, 8vw, 6rem); border-top: 1px solid var(--line); }
.plans { display: grid; gap: 1rem; margin-top: clamp(2rem, 5vw, 3rem); max-width: 52rem; }
@media (min-width: 44rem) { .plans { grid-template-columns: 1fr 1.25fr; } }
.plan { border: 1px solid var(--line); border-radius: 1.2rem; padding: 1.5rem; }
.plan.pro { background: var(--panel); color: var(--panel-ink); border-color: transparent; }
.plan-price { font-stretch: 64%; font-weight: 800; font-size: var(--step-4); line-height: 1; margin: 0.6rem 0 1.2rem; }
.plan-price small { font-size: var(--step-0); font-stretch: 100%; font-weight: 500; opacity: 0.7; }
.plan ul { list-style: none; margin: 0; padding: 0; }
.plan li { padding-block: 0.55rem; border-top: 1px solid var(--line); }
.plan.pro li { border-color: var(--panel-line); }
