/* The film lab pricing: the plans of a film developing lab on warm paper, each one a camera on a wooden shelf in
   front of a coloured backdrop. Cameras, rolls, box and prints are drawn by the script from the colours below. */
:root {
  --page: #f4ebdd;          /* the page */
  --card: #fffaf1;          /* the plans */
  --edge: #e6d9c4;          /* their edge */
  --ink: #221b16;           /* titles and prices */
  --muted: #7a6c5e;         /* the quieter words */
  --accent: #d9482b;        /* the plan chosen and its button */
  --accent-ink: #fff6ec;    /* the words on it */
  --save: #1f6f6b;          /* what paying yearly saves */
  --save-tint: #d7ece6;
  --track: #eadfcd;         /* the billing switch */
  --back-0: #f2b84b;        /* the backdrop behind each camera */
  --back-1: #e8775a;
  --back-2: #3f8c86;
  --wood: #b77a45;          /* the shelf */
  --wood-dark: #7d4d29;
  --kraft: #c99c62;         /* the year pack */
  --kraft-dark: #9a7140;
  --chrome: #d9dadb;        /* camera metal */
  --leather: #2a2522;       /* camera leatherette */
  --tan: #8a5a36;           /* the twin lens camera's leather */
  --card-yellow: #f6c445;   /* the disposable camera */
  --card-green: #2f7d58;
  --film-0: #f3c13a;        /* the rolls of each plan */
  --film-1: #e2452f;
  --film-2: #2a6fb0;
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Instrument Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.stage {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: clamp(10px, 3vh, 32px) 0;
  overflow: hidden;
}

.lab {
  width: min(960px, 100%);
  padding: 0 16px;
}

.lab__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2px 20px;
  margin-bottom: clamp(10px, 2.4vh, 20px);
}

.lab__brand {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lab__title {
  margin: 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: clamp(22px, min(4.2vw, 5vh), 36px);
  font-weight: 600;
  font-variation-settings: 'opsz' 72, 'SOFT' 50;
  letter-spacing: -0.02em;
  line-height: 1.04;
}

.lab__title em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

/* ---------------------------------------------------------------- the billing switch */
.bill {
  position: relative;
  display: flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--track);
}

.bill__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(60, 40, 20, 0.14), 0 4px 12px -4px rgba(60, 40, 20, 0.26);
}

.bill__opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 14px 'Instrument Sans Variable', system-ui, sans-serif;
  cursor: pointer;
  transition: color 0.3s;
}

.bill__opt[aria-checked='true'] {
  color: var(--ink);
}

.bill__free {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--save-tint);
  color: var(--save);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.bill__opt:focus-visible,
.tab:focus-visible,
.plan__btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- the plan tabs (phone only) */
.tabs {
  display: none;
}

/* ---------------------------------------------------------------- the plans */
.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 14px;
  border: 1px solid var(--edge);
  border-radius: 22px;
  background: var(--card);
  transition: border-color 0.35s, box-shadow 0.35s;
}

.plan.is-pick {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 20px 40px -24px rgba(120, 40, 20, 0.5);
}

.plan__tag {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 18px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* the little photo studio: backdrop, shelf, camera, rolls */
.plan__window {
  position: relative;
  height: clamp(118px, 24vh, 196px);
  overflow: hidden;
  border-radius: 14px;
  cursor: pointer;
}

.plan__window svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.plan__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: clamp(8px, 1.6vh, 14px) 6px 0;
}

.plan__name {
  margin: 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.plan__what {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.plan__price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: clamp(6px, 1.4vh, 12px);
}

.price {
  display: inline-flex;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: clamp(30px, min(4vw, 6vh), 40px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* one slot per digit: the new digit drops in, the old one drops out */
.price__d {
  position: relative;
  display: inline-block;
  overflow: hidden;
  height: 1.08em;
  padding-top: 0.04em;
}

.price__d span {
  display: inline-block;
}

.plan__per {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.plan__line {
  min-height: 1.3em;
  margin: 3px 0 0;
  color: var(--save);
  font-size: 12.5px;
  font-weight: 600;
}

.plan__list {
  display: grid;
  gap: 5px;
  margin: clamp(8px, 1.6vh, 14px) 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.plan__list li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.plan__list svg {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

.plan__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  margin-top: auto;
  padding: 0 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 650 14px 'Instrument Sans Variable', system-ui, sans-serif;
  font-stretch: 100%;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s, font-stretch 0.3s;
}

.plan__spacer {
  height: clamp(10px, 1.8vh, 16px);
}

.plan__btn svg {
  width: 15px;
  height: 15px;
}

.plan.is-pick .plan__btn {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

@media (hover: hover) {
  .plan__btn:hover {
    font-stretch: 112%;
  }

  .tab:hover {
    color: var(--ink);
  }
}

/* ---------------------------------------------------------------- a phone: one plan at a time, chosen by tab */
@media (max-width: 640px) {
  .lab__head {
    grid-template-columns: minmax(0, 1fr);
  }

  .bill {
    justify-self: start;
    margin-top: 6px;
  }

  .bill__opt {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
  }

  .tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
  }

  .tab {
    flex: 1;
    height: 28px;
    border: 1px solid var(--edge);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: 650 13px 'Instrument Sans Variable', system-ui, sans-serif;
    cursor: pointer;
    transition: color 0.3s, background 0.3s, border-color 0.3s;
  }

  .tab[aria-selected='true'] {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--card);
  }

  .plans {
    grid-template-columns: minmax(0, 1fr);
  }

  .plan {
    grid-area: 1 / 1;
    visibility: hidden;
  }

  .plan.is-shown {
    visibility: visible;
  }

  .plan__window {
    height: clamp(84px, 22vh, 140px);
  }

  .lab__brand {
    font-size: 10.5px;
  }

  .lab__title {
    font-size: clamp(20px, 6vw, 26px);
  }

  .plan {
    padding: 8px 8px 10px;
  }

  .plan__name {
    font-size: 18px;
  }

  .plan__what {
    font-size: 12px;
  }

  .price {
    font-size: clamp(26px, 8vw, 32px);
  }

  .plan__spacer {
    height: 8px;
  }

  .plan__list {
    display: none;
  }

  .plan__price {
    margin-top: 4px;
  }

  .plan__btn {
    height: 36px;
  }
}

@media (max-height: 520px) {
  .plan__list {
    display: none;
  }
}
