/* Furrow: the pricing page. It is built from the landing page's pieces (landing.css). What is
   its own is here: a plain opening, its title and first words side by side with no picture
   behind them; the plans, set out by product; the ground in section with a shaft sunk as far
   as the chosen depth may dig; and three pieces of the workspace that deal with money. */

/* The opening: the title in the dark above ground, and under it the ground in section, lit
   along its surface, with the plans standing in the soil. The same ground the page digs into
   further down. */
.plans-top {
  padding-top: clamp(132px, 14vw, 188px);
}

.ground {
  position: relative;
  isolation: isolate;
  margin-top: clamp(56px, 6vw, 88px);
  padding: clamp(88px, 9vw, 132px) 0 clamp(72px, 8vw, 120px);
}

/* The soil gives way to the page's dark again below the plans. */
.ground::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(to top, var(--bg) 8%, transparent);
}

.plans-top h1 {
  max-width: 8em;
  font: 400 clamp(52px, 6.6vw, 100px) / 0.94 var(--display);
  letter-spacing: -0.02em;
}

.plans-top h1 em {
  font-style: italic;
  letter-spacing: -0.01em;
}

/* Plans: one tile to a product. In each, what is free and what has to be run are two wells
   cut into the tile, so the two can be told apart without a table. */
.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* What the page believes, said once under the plans, with the way to the manifesto. */
.belief {
  grid-column: 1 / -1;
  max-width: 44em;
  margin: clamp(40px, 5vw, 72px) auto 0;
  color: var(--body);
  text-align: center;
}

.belief-line {
  margin-bottom: 18px;
  color: var(--fg);
  font: italic 400 clamp(28px, 3vw, 42px) / 1.1 var(--display);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.belief p + p {
  margin-top: 14px;
}

.plan {
  padding: 36px 36px 32px;
}

.plan-head h2 {
  margin-top: 10px;
  font: 400 clamp(34px, 3.3vw, 46px) / 1.04 var(--display);
  letter-spacing: -0.012em;
}

.plan-head p:not(.label) {
  max-width: 27em;
  margin-top: 10px;
  color: var(--body);
}

.plan-tier {
  margin-top: 16px;
  padding: 24px 26px 26px;
  border-radius: 18px;
  background: var(--well);
  box-shadow: var(--sunk);
}

.plan-head + .plan-tier {
  margin-top: 28px;
}

.plan-price {
  margin-top: 8px;
  font: 400 clamp(40px, 3.8vw, 54px) / 1 var(--display);
  letter-spacing: -0.016em;
}

.plan-tier ul {
  display: grid;
  gap: 9px;
  margin: 18px 0 0;
  padding: 0;
  color: var(--body);
  font-size: 15.5px;
  line-height: 1.5;
  list-style: none;
}

/* Each line is marked with one hard pixel of ember. */
.plan-tier li {
  position: relative;
  padding-left: 20px;
}

.plan-tier li::before {
  content: "";
  position: absolute;
  top: 0.58em;
  left: 1px;
  width: 6px;
  height: 6px;
  background: var(--ember);
}

.plan-tier .today {
  margin-top: 18px;
  font-size: 14.5px;
}

/* The way in stands at the foot of its tile, so the two line up whatever is above them. */
.plan .button {
  align-self: flex-start;
  margin-top: auto;
}

.plan .plan-tier:last-of-type {
  margin-bottom: 28px;
}

/* The dig: the ground in section, three depths marked down it, and a shaft of the sources'
   own type sunk as far as the chosen one. `data-depth` holds the choice (pricing.js sets it
   from the dial), `--reach` is how far down the ground that lies, and each figure beside the
   ground is written once per depth, with only the chosen one shown. */

.frame.dig {
  --quick: 31%;
  --auto: 60%;
  --deep: 91%;
  --reach: var(--auto);
  background: var(--surface);
}

.dig[data-depth="quick"] {
  --reach: var(--quick);
}

.dig[data-depth="deep"] {
  --reach: var(--deep);
}

.frame-dials > .label {
  margin-left: auto;
  align-self: center;
}

.dig-body {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

/* A well, with the last of the dusk above the surface the picture paints. */
.dig-ground {
  --shaft-left: 61%;
  --shaft-width: clamp(84px, 20%, 132px);
  --shaft-mid: calc(var(--shaft-left) + var(--shaft-width) / 2);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 480px;
  margin: 28px;
  border-radius: 18px;
  background: linear-gradient(to bottom, #23123B, #6B2A72 14px, #D4627C 28px, var(--well) 29px);
  box-shadow: var(--sunk);
}

/* The shaft is cut from the top of the ground to its foot and shown as far as `--reach`. */
.dig-shaft {
  position: absolute;
  inset: 0 auto 0 var(--shaft-left);
  width: var(--shaft-width);
  background: linear-gradient(to bottom, rgba(12, 10, 16, 0), var(--well) 34px);
  box-shadow:
    inset 9px 0 12px -8px #000,
    inset -9px 0 12px -8px #000;
  clip-path: inset(0 0 calc(100% - var(--reach)) 0);
}

/* Light going down it: brightest at the surface, cooler the deeper it goes. */
.dig-shaft .glyphs {
  inset: 0;
  background-image: linear-gradient(to bottom, #FFF6EC 0%, #FFD0B0 12%, #FF9D83 30%, #F6667C 52%, #BC46A8 74%, #8A5BE0 100%);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 26%, #000 74%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 26%, #000 74%, transparent);
  font-size: 11.5px;
}

.dig-levels li {
  position: absolute;
  inset: var(--at) 0 auto;
}

.dig-levels [data-level="quick"] {
  --at: var(--quick);
}

.dig-levels [data-level="auto"] {
  --at: var(--auto);
}

.dig-levels [data-level="deep"] {
  --at: var(--deep);
}

.dig-levels li::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  border-top: 1px dashed rgba(244, 239, 233, 0.24);
}

/* The chosen depth's line is lit, and brightest where the shaft comes down on it. */
.dig-levels li::after {
  content: "";
  position: absolute;
  inset: -22px 0 auto;
  height: 44px;
  background:
    linear-gradient(to right, rgba(255, 122, 92, 0), var(--ember) 30%, #FFD0B0 var(--shaft-mid), var(--ember) 92%, rgba(255, 122, 92, 0)) center / 100% 2px no-repeat,
    radial-gradient(ellipse 13% 50% at var(--shaft-mid) 50%, rgba(255, 140, 104, 0.5), rgba(255, 122, 92, 0));
  opacity: 0;
  pointer-events: none;
}

.dig[data-depth="quick"] [data-level="quick"]::after,
.dig[data-depth="auto"] [data-level="auto"]::after,
.dig[data-depth="deep"] [data-level="deep"]::after {
  opacity: 1;
}

/* A depth's name and what it allows, on a plate hung over its line. It is a second label for
   that depth's radio in the dial, so the picture can be clicked too. */
.dig-levels label {
  position: absolute;
  z-index: 1;
  bottom: 9px;
  left: 22px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 10px;
  padding: 7px 13px 8px;
  border-radius: 10px;
  background: rgba(9, 7, 12, 0.62);
  color: var(--soft);
  cursor: pointer;
}

.dig-levels .label {
  grid-column: 1 / -1;
}

.dig-levels b {
  color: var(--body);
  font: 400 30px/1.05 var(--display);
}

.dig-levels i {
  font-size: 14px;
  font-style: normal;
}

.dig-levels label:hover,
.dig[data-depth="quick"] [data-level="quick"] label,
.dig[data-depth="auto"] [data-level="auto"] label,
.dig[data-depth="deep"] [data-level="deep"] label {
  background: rgba(9, 7, 12, 0.84);
  color: var(--body);
}

.dig-levels label:hover b,
.dig[data-depth="quick"] [data-level="quick"] b,
.dig[data-depth="auto"] [data-level="auto"] b,
.dig[data-depth="deep"] [data-level="deep"] b {
  color: var(--fg);
}

.dig[data-depth="quick"] [data-level="quick"] .label,
.dig[data-depth="auto"] [data-level="auto"] .label,
.dig[data-depth="deep"] [data-level="deep"] .label {
  color: var(--ember);
}

.dig-facts {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 40px 40px 12px;
}

.dig [data-d] {
  display: none;
}

.dig[data-depth="quick"] [data-d="quick"],
.dig[data-depth="auto"] [data-d="auto"],
.dig[data-depth="deep"] [data-d="deep"] {
  display: inline;
}

.dig-sum {
  margin-top: 10px;
  font: 400 clamp(88px, 9.4vw, 136px) / 0.86 var(--display);
  letter-spacing: -0.03em;
}

.dig-of {
  max-width: 19em;
  margin-top: 20px;
  color: var(--body);
  font-size: 19px;
  line-height: 1.5;
}

.dig-of b {
  color: var(--fg);
  font-weight: 500;
}

/* Tall enough for its longest wording, so the figure does not jump between depths. */
.dig-also {
  max-width: 27em;
  min-height: 4.5em;
  margin-top: 16px;
  color: var(--soft);
  font-size: 15px;
}

.dig-also a {
  color: #FF9D83;
  font-weight: 500;
  white-space: nowrap;
}

.dig-also a:hover {
  color: #FFC4B2;
}

/* Where the money goes: three tiles. The free one is the warm one; the last runs the full
   width, with its words beside its piece of the workspace. */

.tile--warm {
  background: var(--surface-warm);
}

.tab .limits {
  padding: 14px 18px 24px;
}

.bento .tile--across {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: 48px;
  align-items: center;
}

.tile--across .tile-art {
  margin-top: 0;
}

/* Model calls, each with who made it and how it was paid for. */
.calls li {
  display: grid;
  grid-template-columns: 8.4em minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 14px;
  padding: 14px 18px 15px;
}

.calls li + li {
  border-top: 1px solid var(--line);
}

.calls li:last-child {
  padding-bottom: 22px;
}

.calls b {
  font: 400 clamp(20px, 1.9vw, 25px) / 1.2 var(--display);
}

.paid {
  color: var(--soft);
  font: 500 11.5px/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.paid::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--iris);
}

.paid--metered::before {
  background: var(--ember);
}

/* At the ceiling: what the design does with an allowance, and beside it the allowance itself,
   cut the way a run would hold it. */

.terms {
  display: grid;
  gap: 24px;
  max-width: 31em;
  margin-top: 40px;
}

.terms dt {
  font: 400 clamp(23px, 2.1vw, 28px) / 1.1 var(--display);
}

.terms dd {
  margin-top: 8px;
  color: var(--body);
  font-size: 16px;
}

/* One bar, cut in the proportions the allowance is held in. */
.split {
  display: flex;
  gap: 3px;
  height: 14px;
  margin: 24px 22px 0;
}

.split span {
  border-radius: 3px;
}

.split span:first-child {
  flex: 75;
  border-radius: 7px 3px 3px 7px;
  background: linear-gradient(to right, #FFB08E, var(--ember));
}

.split span:nth-child(2) {
  flex: 15;
  background: var(--orchid);
}

.split span:last-child {
  flex: 10;
  border-radius: 3px 7px 7px 3px;
  background: var(--iris);
}

.split-key {
  display: grid;
  gap: 8px;
  padding: 18px 22px 22px;
}

.split-key div {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 12px;
}

.split-key div::before {
  content: "";
  align-self: center;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember);
}

.split-key div:nth-child(2)::before {
  background: var(--orchid);
}

.split-key div:last-child::before {
  background: var(--iris);
}

.split-key dt {
  color: var(--body);
  font-size: 15.5px;
}

.split-key dd {
  font: 400 23px/1.2 var(--display);
}

.request {
  border-top: 1px solid var(--line);
}

.request > .label {
  padding: 18px 22px 0;
}

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

  .dig-body,
  .bento .tile--across {
    grid-template-columns: minmax(0, 1fr);
  }

  .dig-facts {
    padding: 4px 28px 32px;
  }

  .bento .tile--across {
    row-gap: 28px;
  }
}

@media (max-width: 720px) {
  .frame-dials > .label {
    margin-left: 0;
  }

  .dig-ground {
    --shaft-left: 64%;
    min-height: 400px;
    margin: 20px;
    border-radius: 14px;
  }

  .dig-levels label {
    left: 12px;
  }

  .dig-facts {
    padding: 0 20px 26px;
  }

  /* Who, which model, how it was paid for: one under another. */
  .calls li {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }

  .split {
    margin-inline: 18px;
  }

  .split-key {
    padding-inline: 18px;
  }

  .request > .label {
    padding-inline: 18px;
  }
}

/* Motion: the opening comes in from the top down; the shaft sinks or draws back to the depth
   chosen, that depth's line lights, and the figures beside it change with a short fade. None
   of it runs for readers who ask for less. */
@media (prefers-reduced-motion: no-preference) {
  .plans-top .head,
  .plans-top .plan {
    animation: arrive 0.6s var(--ease) backwards;
  }

  .plans-top .plan {
    animation-delay: 0.12s;
  }

  .plans-top .plan + .plan {
    animation-delay: 0.2s;
  }

  .dig-shaft {
    transition: clip-path 0.8s var(--ease);
  }

  .dig-levels li::after {
    transition: opacity 0.45s;
  }

  .dig-levels label,
  .dig-levels b,
  .dig-levels .label {
    transition:
      color 0.25s,
      background-color 0.25s;
  }

  .dig [data-d] {
    animation: appear 0.35s ease-out;
  }
}
