:root {
  --night: #161B23;
  --loom: #222A35;
  --thread: #333E4D;
  --cotton: #F4EFE2;
  --ash: #A3ADBB;
  --gold: #F2A516;
  --gold-pale: #FFE08A;
  --gem: #22D3EE;
  --error: #FF9E8A;
  --display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--cotton);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
}
p, h1, h2, ul, ol { margin: 0; padding: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gem); outline-offset: 2px; }

/* Header */
.top {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .04em;
}
.langs { display: flex; gap: 2px; }
.langs button {
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 40px;
  font-size: 14px;
  color: var(--ash);
}
.langs button[aria-pressed="true"] { color: var(--night); background: var(--gold-pale); font-weight: 600; }

/* Picker */
.page { max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); }
.pick { padding: 22px 0 56px; }
h1 {
  font-size: clamp(30px, 6.4vw, 54px);
  line-height: 1.08;
  letter-spacing: -.02em;
  font-weight: 700;
  max-width: 17em;
}
.lede { margin-top: 10px; color: var(--ash); font-size: 18px; }

.readout {
  margin-top: 30px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.term { display: flex; align-items: baseline; gap: 10px; font-size: 20px; }
.term output {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(76px, 21vw, 164px);
  line-height: .95;
  letter-spacing: -.04em;
  color: var(--gold-pale);
  font-variant-numeric: tabular-nums;
}
.sum {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 7.5vw, 58px);
  line-height: 1;
  white-space: nowrap;
}
.sum .rub { font-family: var(--body); font-weight: 600; margin-left: .14em; }

/* The woven day strip: one lozenge is one day. */
.loom { position: relative; margin-top: 14px; }
.weave {
  height: 92px;
  display: grid;
  grid-template-columns: repeat(26, minmax(0, 1fr));
  align-items: center;
  border-radius: 6px;
}
.weave i {
  display: block;
  height: calc(var(--h) * 100%);
  margin: 0 -24%;
  background: var(--thread);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  transition: background-color .12s linear;
}
.weave i.on { background: linear-gradient(180deg, var(--gold-pale), var(--gold)); }
.weave i.end { background: var(--gem); }
#range {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 92px;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
  touch-action: pan-y;
}
#range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 92px; }
#range::-moz-range-thumb { width: 16px; height: 92px; border: 0; }
#range:focus-visible ~ .weave { outline: 2px solid var(--gem); outline-offset: 4px; }
.scale {
  display: grid;
  grid-template-columns: repeat(26, minmax(0, 1fr));
  margin-top: 6px;
  color: var(--ash);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.scale span { justify-self: center; }
.drag { margin-top: 8px; color: var(--ash); font-size: 15px; }

.better {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  color: var(--gold-pale);
}
.better button {
  background: none;
  border: 0;
  padding: 6px 0;
  min-height: 40px;
  color: var(--gem);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.packs {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.packs button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  padding: 13px 14px;
  background: var(--loom);
  border: 2px solid transparent;
  border-radius: 12px;
  text-align: left;
}
.packs b { font-weight: 500; font-size: 15px; color: var(--ash); }
.packs span { font-family: var(--display); font-weight: 600; font-size: clamp(15px, 3.6vw, 20px); white-space: nowrap; }
.packs button[aria-pressed="true"] { border-color: var(--gold); }
.packs button[aria-pressed="true"] b { color: var(--cotton); }

.renew { margin-top: 20px; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); margin: 0; }
#renewBox { margin-top: 8px; max-width: 560px; }
#renewLink, .link {
  width: 100%;
  background: var(--loom);
  border: 1px solid var(--thread);
  border-radius: 10px;
  padding: 13px 14px;
}
.note { margin-top: 8px; color: var(--ash); font-size: 15px; }

.pay {
  display: block;
  width: 100%;
  max-width: 420px;
  margin-top: 22px;
  padding: 17px 20px;
  border: 0;
  border-radius: 12px;
  background: var(--gold);
  color: #1B1505;
  font-weight: 700;
  font-size: 19px;
  text-align: center;
  text-decoration: none;
}
.pay:hover:not(:disabled) { background: var(--gold-pale); }
.pay:disabled { opacity: .65; cursor: default; }
.methods { margin-top: 10px; color: var(--ash); font-size: 15px; }
.error { margin-top: 12px; color: var(--error); }

/* Below the picker */
.info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  padding: 34px 0 44px;
  border-top: 1px solid var(--thread);
}
h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.facts { list-style: none; }
.facts li { padding: 5px 0; color: var(--cotton); }
.steps { list-style-position: inside; }
.steps li { padding: 5px 0; }
.steps li::marker { color: var(--gold-pale); font-weight: 700; }

.foot {
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px var(--gutter) 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  color: var(--ash);
  font-size: 15px;
}

/* Order status page */
.order { padding-top: 34px; padding-bottom: 60px; max-width: 620px; }
.order h1 { font-size: clamp(30px, 6vw, 44px); }
.order h1 a { text-decoration: none; }
.order .link { margin-top: 24px; font-size: 15px; }
.order .pay { max-width: none; margin-top: 12px; }
.order #payLink { margin-top: 24px; }
.order .note { margin-top: 18px; }
.ghost {
  display: block;
  margin-top: 8px;
  padding: 15px 20px;
  border: 1px solid var(--thread);
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
}

/* Terms and privacy */
.legal { padding-top: 22px; padding-bottom: 44px; max-width: 720px; }
.legal h1 { font-size: clamp(28px, 5vw, 40px); margin-bottom: 8px; }
.legal h2 { margin: 26px 0 6px; font-size: 18px; }
.legal p { color: var(--cotton); }

@media (min-width: 760px) {
  :root { --gutter: 28px; }
  .info { grid-template-columns: 1fr 1fr; gap: 56px; }
  .pick { padding-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .weave i { transition: none; }
}
