/* ==========================================================================
   PRICING: one screen, on the paper.
   The pictures are the homepage's (docs/brand.md, "One night, on one page"):
   this page's name is in ink on the paper, as a section's is there, and the
   four plans are folders. A page of the night desk sticks out of each a
   little, and now and then Smudge pokes his head out of the recommended one
   and holds on to its front. Each folder says what its month's credits buy.
   Under them a skinny bar of night sky is Enterprise. Nothing scrolls on a
   computer; on a phone and a tablet the folders are a row you swipe. Loaded
   after craft.css.
   ========================================================================== */
.pp-page { background: var(--paper); }
.pp { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }

/* ---------------------------------------------------------------- the head
   The homepage's own section head (.hd__t), set left: the title and a line under it, and the
   controls on the right, level with the line. It starts under the nav. */
.pp__head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 40px; padding-top: clamp(104px, 14vh, 132px); }
.pp__lede { margin-top: clamp(8px, 1.4vh, 14px); max-width: 34em; font-size: clamp(14.5px, 1.9vh, 16.5px); color: var(--ink-2); }
.pp__lede b { color: var(--ink); }

.pp__ctl { display: flex; align-items: center; gap: 10px; flex: none; }
.tog { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: rgba(23, 19, 15, .06); border: 1px solid var(--rule); }
.tog button { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--ink-2); transition: background-color .15s, color .15s; }
.tog button:hover { color: var(--ink); }
.tog button[aria-checked="true"] { color: var(--ink); background: var(--card, #fff); box-shadow: 0 1px 2px rgba(23, 19, 15, .14); }
.tog i { font: 500 10.5px/1 var(--f-tag); font-style: normal; padding: 4px 5px 3px; border-radius: 4px; color: var(--ink); background: var(--signal); }
.curr select {
  height: 44px; padding: 0 34px 0 14px; border-radius: 12px; appearance: none; -webkit-appearance: none; cursor: pointer;
  font: 500 12.5px/1 var(--f-tag); letter-spacing: .04em; color: var(--ink);
  background: var(--card, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%2317130F' stroke-width='1.5'/%3E%3C/svg%3E") right 12px center / 12px no-repeat;
  border: 1px solid var(--rule);
}
.curr select option { color: var(--ink); background: var(--paper); }

/* ---------------------------------------------------------------- the paper */
.pp__wrap { flex: 1; display: flex; flex-direction: column; padding-bottom: clamp(12px, 2vh, 22px); }

.pp__plans {
  position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.1vw, 16px); align-items: stretch;
  margin-top: clamp(18px, 3.4vh, 34px);
}

/* ---------------------------------------------------------------- a plan: a folder
   A back with a tab (the plan's name on it), a page of the case sticking out, and the front the plan
   is written on. Drawn in CSS, softly shaded like the homepage's folder; the whole folder casts one
   shadow. */
.pc {
  --tab-h: 34px; --lip: 34px;                                   /* the tab's height; how much back shows above the front: the page's room */
  --back: #E2D5B9; --back-2: #D6C7A6; --f1: #FCF8EE; --f2: #F3EBD9; --edge: rgba(107, 84, 41, .28);
  --fg: var(--ink); --fg-2: #6E6352; --well: rgba(107, 84, 41, .06); --hair: rgba(107, 84, 41, .2);
  position: relative; isolation: isolate; display: flex; flex-direction: column; min-width: 0;
  padding-top: calc(var(--tab-h) + var(--lip)); color: var(--fg);
  filter: drop-shadow(0 1px 1px rgba(13, 9, 5, .14)) drop-shadow(0 16px 22px rgba(13, 9, 5, .18));
  animation: rise .7s var(--ease) calc(var(--i) * 80ms + 80ms) backwards;
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
.pc--free { --back: #DCD6C8; --back-2: #CFC8B7; --f1: #F8F6F0; --f2: #EEEAE0; --edge: rgba(80, 72, 58, .26); --fg-2: #6A645A; --well: rgba(80, 72, 58, .05); --hair: rgba(80, 72, 58, .18); }
.pc--feat { --back: #E0A021; --back-2: #CF8D14; --f1: #FFD861; --f2: #F5BD35; --edge: rgba(122, 78, 0, .4); --fg-2: #5C4614; --well: rgba(90, 58, 0, .08); --hair: rgba(90, 58, 0, .2); }

/* the back, its tab and the curve where they meet */
.pc__back { position: absolute; z-index: 0; inset: var(--tab-h) 0 0; border-radius: 6px 16px 16px 16px; background: linear-gradient(180deg, var(--back), var(--back-2)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 0 0 1px var(--edge); }
.pc__tab {
  position: absolute; z-index: 0; top: 0; left: 0; display: flex; align-items: center; gap: 8px; height: calc(var(--tab-h) + 8px); padding: 0 18px 8px 16px;
  font: 850 clamp(19px, 2.6vh, 22px)/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; color: var(--fg);
  background: var(--back); border-radius: 13px 13px 0 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 1px 0 0 var(--edge), inset -1px 0 0 var(--edge), inset 0 1px 0 0 var(--edge);
}
.pc__tab::after { content: ""; position: absolute; left: 100%; bottom: 8px; width: 16px; height: 16px; margin-left: -1px; background: radial-gradient(circle at 100% 0, transparent 15px, var(--back) 15.5px); }
.pc__tab small { padding: 3px 6px 2px; border-radius: 5px; font: 500 9.5px/1.2 var(--f-tag); letter-spacing: .08em; color: var(--signal); background: var(--ink); }
/* a page of the case, sticking out over the front a little: a print of the night, the width of the
   folder, with a print's paper edge. It is the one place this page has a picture, and it is a strip
   of one: each folder's is a different place (the homepage's own pictures, standing in until each
   plan's is painted: docs/banner-art.md, "The folders' pages"). The picture is set from its top left
   in the page's own pixels (--pic-w wide, --pic-y down), so every screen shows the same strip at the
   same size. Point at a folder and its page comes up a few pixels more */
.pc__sheet {
  position: absolute; z-index: 1; top: calc(var(--tab-h) + 5px); left: 12px; right: 14px; height: 66px; border: 3px solid #FFFDF8; border-radius: 4px;
  background: #0D0905 var(--pic, none) var(--pic-x, 50%) calc(-1 * var(--pic-y, 0px)) / var(--pic-w, 356px) auto no-repeat;
  box-shadow: 0 0 0 1px rgba(23, 19, 15, .18), 0 1px 2px rgba(13, 9, 5, .18); transform: rotate(-1.2deg); transition: transform .32s var(--ease);
}
.pc:hover .pc__sheet { transform: translateY(-5px) rotate(-1.2deg); }
.pc--free .pc__sheet { --pic: url("../img/street.webp"); --pic-w: 712px; --pic-x: 0%; --pic-y: 250px; }                 /* the street: the phone box, lit */
.pc--personal .pc__sheet { --pic: url("../img/art/scene-newsroom.webp"); --pic-x: 90%; --pic-y: 186px; }                /* one desk: a mug, a notebook, a marked page */
.pc--pro .pc__sheet { --pic: url("../img/art/scene-servers.webp"); --pic-x: 0%; --pic-y: 30px; }                        /* the racks, their lights on */
.pc--team .pc__sheet { --pic: url("../img/art/scene-newsroom.webp"); --pic-x: 40%; --pic-y: 92px; }                     /* a floor of desks */
.pc--feat .pc__sheet { right: 46%; }

/* the front: what the plan is */
.pc__front {
  position: relative; z-index: 3; flex: 1; display: flex; flex-direction: column; gap: clamp(8px, 1.3vh, 11px);
  padding: clamp(14px, 2vh, 18px) clamp(14px, 1.3vw, 18px) clamp(14px, 2vh, 18px);
  border-radius: 14px 14px 16px 16px; background: linear-gradient(180deg, var(--f1), var(--f2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 0 0 1px var(--edge), 0 -3px 8px -4px rgba(13, 9, 5, .22);
}

.pc__price { display: flex; align-items: baseline; gap: 7px; }
.pc__price b { font: 850 clamp(42px, 6.2vh, 58px)/.9 var(--f-display); letter-spacing: -.01em; }
.pc__price span { font: 500 11.5px/1 var(--f-tag); color: var(--fg-2); }
.pc__price em { align-self: center; margin-left: auto; font: 500 11px/1 var(--f-tag); font-style: normal; padding: 5px 7px 4px; border-radius: 6px; color: var(--ink); background: var(--signal); }
.pc--feat .pc__price em { color: var(--signal); background: var(--ink); }
.pc__price em:empty { display: none; }
.pc__price.is-stamped b, .pc__price.is-stamped em { animation: stamp .38s var(--ease); }
@keyframes stamp { from { transform: translateY(-6px); opacity: 0; } }

.pc__bill { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; margin-top: -4px; font: 500 11px/1.3 var(--f-tag); letter-spacing: .02em; color: var(--fg-2); }
.pc__seats { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.pc__seats button { width: 24px; height: 24px; border-radius: 7px; font: 700 15px/1 var(--f-sans); color: var(--fg); border: 1px solid var(--hair); background: rgba(255, 255, 255, .7); transition: border-color .15s; }
.pc__seats button:hover { border-color: var(--ink); }
.pc__seats small { margin-left: 4px; font: 500 10.5px/1 var(--f-tag); text-transform: uppercase; letter-spacing: .06em; color: var(--fg-2); }
.pc__seats output { min-width: 24px; text-align: center; font: 850 17px/1 var(--f-display); color: var(--fg); }

/* the meter: the month's credits, and what they buy */
.pc__meter { display: grid; gap: 8px; padding: 10px 12px 11px; border-radius: 11px; background: var(--well); border: 1px solid var(--hair); }
.pc__cred { font-size: 13px; color: var(--fg-2); }
.pc__cred b { margin-right: 3px; font: 850 21px/1 var(--f-display); color: var(--fg); }
.pc__buys { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px dashed var(--hair); padding-top: 8px; }
.pc__buys div { display: flex; flex-direction: column-reverse; gap: 3px; }
.pc__buys div + div { padding-left: 12px; border-left: 1px dashed var(--hair); }
.pc__buys dd { font: 850 24px/1 var(--f-display); color: var(--fg); }
.pc__buys dt { font: 500 10px/1.25 var(--f-tag); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2); }

.pc__pts { display: grid; gap: 5px; font-size: 14px; line-height: 1.3; }
.pc__pts li { display: grid; grid-template-columns: 15px minmax(0, 1fr); gap: 8px; align-items: start; }
.pc__pts svg { width: 15px; height: 15px; margin-top: 1px; color: var(--fg); }
.pc__pts .bar { padding: 0 4px; border-radius: 2px; color: var(--paper); background: var(--ink); }

.pc__cta { margin-top: auto; width: 100%; }
.craft .pc .pc__cta.btn--line { background: rgba(255, 255, 255, .72); }
.pc__cta.is-current { pointer-events: none; opacity: .65; }

/* ---------------------------------------------------------------- Smudge, in the recommended folder
   He sits inside it, between the sheet and the front, his face over the edge; the front hides his
   arms, and two hands over its edge hold on. The svg is 104 x 102 units, so at --sm wide one unit
   is --sm / 104: his middle is half way across, and the front's edge crosses him 62 units down
   (just under his shoulders, so his own arms stay behind it). */
.pc__peek {
  --sm: 112px; --u: calc(var(--sm) / 104);
  position: absolute; z-index: 2; left: 64%; top: calc(var(--tab-h) + var(--lip) - 62 * var(--u)); width: var(--sm); height: calc(102 * var(--u)); margin-left: calc(var(--sm) / -2); cursor: pointer;
}
.pc__smudge {
  display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 -1px 0 rgba(255, 214, 130, .4)) drop-shadow(0 0 12px rgba(255, 196, 64, .22));
  transform: translateY(96%); transition: transform .42s cubic-bezier(.5, 0, .75, .3);
}
.pc.is-out .pc__smudge { transform: none; transition: transform .7s cubic-bezier(.3, 1.45, .5, 1); }
.pc__hands { --sm: 112px; --u: calc(var(--sm) / 104); position: absolute; z-index: 4; left: 64%; top: calc(var(--tab-h) + var(--lip) - 7px); width: 0; pointer-events: none; }
.pc__hands i {
  position: absolute; top: 0; width: calc(23 * var(--u)); height: calc(16 * var(--u)); margin-left: calc(-11.5 * var(--u)); border-radius: 50% 50% 42% 42% / 60% 60% 40% 40%;
  background: radial-gradient(120% 110% at 40% 20%, #5A5A5B, #3B3B3C 58%, #2F2F30);
  box-shadow: 0 2px 2px rgba(0, 0, 0, .3), 0 5px 9px -3px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .1);
  opacity: 0; translate: 0 -12px; scale: .7;
  transition: translate .2s var(--ease), scale .2s var(--ease), opacity .14s;
}
.pc.is-out .pc__hands i { opacity: 1; translate: 0 0; scale: 1; transition: translate .3s cubic-bezier(.3, 1.6, .5, 1) .32s, scale .3s cubic-bezier(.3, 1.6, .5, 1) .32s, opacity .12s .32s; }
.pc__hands i:first-child { left: calc(-25 * var(--u)); transform: rotate(-8deg); }
.pc__hands i:last-child { left: calc(25 * var(--u)); transform: rotate(8deg); }
/* over the Pro button he lets go and cheers */
.pc.is-out.is-cheer .pc__hands i { opacity: 0; translate: 0 -16px; scale: .8; transition-delay: 0s; }

/* ---------------------------------------------------------------- Enterprise: a skinny bar of night sky */
.pp__ent {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; gap: 14px;
  min-height: clamp(70px, 10vh, 92px); margin-top: clamp(16px, 2.8vh, 30px); padding: 10px 26px 10px 28px; gap: clamp(16px, 2vw, 28px); border-radius: 18px;
  color: var(--on-night); background: radial-gradient(120% 220% at 88% 120%, rgba(255, 176, 56, .22), transparent 55%), radial-gradient(80% 200% at 8% -60%, rgba(150, 110, 200, .16), transparent 60%), linear-gradient(100deg, #07060B, #110D16 55%, #0B0807);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 16px 30px -18px rgba(13, 9, 5, .6);
}
/* the stars: three layers of points, the nearest drifting and twinkling */
.pp__stars, .pp__stars::before, .pp__stars::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-repeat: repeat; }
.pp__stars { background-image: radial-gradient(1px 1px at 12px 9px, rgba(255, 255, 255, .7), transparent), radial-gradient(1px 1px at 61px 31px, rgba(255, 255, 255, .5), transparent), radial-gradient(1px 1px at 97px 14px, rgba(255, 236, 190, .6), transparent), radial-gradient(1px 1px at 140px 40px, rgba(255, 255, 255, .45), transparent), radial-gradient(1px 1px at 173px 6px, rgba(255, 255, 255, .55), transparent); background-size: 190px 46px; }
.pp__stars::before { background-image: radial-gradient(1.5px 1.5px at 30px 22px, #FFF6DD, transparent), radial-gradient(1.5px 1.5px at 151px 12px, #FFD84D, transparent), radial-gradient(1.5px 1.5px at 251px 38px, #FFF, transparent); background-size: 310px 46px; animation: twinkle 3.2s ease-in-out infinite alternate; }
.pp__stars::after { background-image: radial-gradient(2px 2px at 80px 16px, #FFF8E6, transparent), radial-gradient(2px 2px at 330px 34px, #FFE7A0, transparent); background-size: 460px 46px; animation: drift 60s linear infinite; }
@keyframes twinkle { from { opacity: .35; } to { opacity: 1; } }
@keyframes drift { to { background-position: -460px 0; } }
.pp__ent-k { flex: none; font: 850 clamp(38px, 5.6vh, 54px)/.9 var(--f-display); text-transform: uppercase; letter-spacing: .01em; color: #F6F1E4; text-shadow: 0 0 24px rgba(255, 216, 77, .25); }
.pp__ent-t { flex: 1; min-width: 0; font-size: 15px; line-height: 1.4; color: rgba(243, 239, 228, .78); }
.pp__ent-t b { color: var(--signal-night); }
.pp__ent-a { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: var(--r-btn); font-size: 14.5px; font-weight: 700; color: var(--ink); background: var(--signal); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 2px 2px 0 #A87D00; transition: transform .12s var(--ease), box-shadow .12s var(--ease); }
.pp__ent:hover .pp__ent-a { transform: translate(-1px, -1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 3px 3px 0 #A87D00; }
.pp__ent-a svg { width: 12px; height: 12px; transition: transform .2s var(--ease); }
.pp__ent:hover .pp__ent-a svg { transform: translateX(3px); }
.pp__ent:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 0 0 1px rgba(255, 216, 77, .35), 0 16px 30px -18px rgba(13, 9, 5, .6); }

.pp__fine { margin-top: 10px; font-size: 12px; color: var(--graphite); text-align: center; }
.pp__fine a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 2px; }

/* ---------------------------------------------------------------- shorter screens */
@media (min-width: 901px) and (max-height: 820px) {
  .pp__head { padding-top: 96px; }
  .pp__lede { display: none; }
  .pc { --lip: 24px; }
}
@media (min-width: 901px) and (max-height: 720px) {
  .pp__fine { display: none; }
  .pc__pts li:nth-child(2) { display: none; }
}
@media (max-width: 1100px) and (min-width: 901px) {
  .pc__pts { font-size: 13px; }
  .pc__seats small { display: none; }
}

/* ---------------------------------------------------------------- phones and tablets: the cards are a row you swipe */
@media (max-width: 900px) {
  .pp__head { padding-top: 92px; }
  .pc__front { gap: 9px; padding: 14px; }
  .pc__meter { padding: 9px 10px 10px; gap: 6px; }
  .pp__head { flex-direction: column; align-items: stretch; gap: 14px; }
  .pp__title { font-size: clamp(30px, 10.4vw, 52px); white-space: nowrap; }
  .pp__lede { margin-top: 6px; font-size: 14px; line-height: 1.45; }
  .pp__ctl { justify-content: space-between; }
  .tog button { height: 34px; padding: 0 12px; font-size: 13.5px; }
  .curr select { height: 42px; }

  /* (a row that scrolls sideways clips what rises above it, and Smudge's head rises 17px over his
     folder with a glow round it: the row keeps that much room at the top, taken back from the gap above) */
  .pp__plans {
    display: flex; gap: 12px; margin-inline: calc(-1 * var(--gutter)); margin-top: -14px; padding: 36px var(--gutter) 18px;
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .pp__plans::-webkit-scrollbar { display: none; }
  .pp__plans.is-snap { scroll-snap-type: x mandatory; }
  .pc { flex: 0 0 min(84vw, 340px); scroll-snap-align: center; }

  .pp__ent { margin-top: 8px; min-height: 64px; padding: 8px 12px 8px 16px; gap: 12px; }
  .pp__ent-k { font-size: 34px; }
  .pp__ent-t { font-size: 13px; }
  .pp__ent-a { height: 38px; padding: 0 12px; font-size: 13.5px; }
  .pp__fine { display: none; }
}
@media (max-width: 900px) and (max-height: 760px) {
  .pp__lede { display: none; }
}
@media (max-width: 560px) {
  .pp__ent-t { display: none; }
  .pp__ent { justify-content: space-between; }
}
@media (max-width: 900px) and (max-height: 640px) {
  .pp__head { padding-top: 80px; }
  .pc { --lip: 14px; }
  .pc__pts { display: none; }
  .pp__head { gap: 10px; }
  .pp__title { font-size: min(36px, 10.2vw); }
  .pc__price b { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .pc, .pp__stars::before, .pp__stars::after, .pc__price.is-stamped b, .pc__price.is-stamped em { animation: none; }
  .pc__smudge, .pc__hands i, .pc__sheet { transition: none !important; }
}
/* narrower folders: Smudge moves along the edge, clear of the tab */
@media (max-width: 1100px) {
  .pc__peek, .pc__hands { left: 74%; }
}
@media (max-width: 360px) {
  .pp__ent { padding-inline: 14px 10px; gap: 8px; }
  .pp__ent-k { font-size: 25px; }
  .pp__ent-a svg { display: none; }
  .pp__ent-a { height: 36px; padding: 0 10px; gap: 6px; font-size: 12.5px; }
}

/* ---------------------------------------------------------------- the same folders on the homepage
   index.html's pricing section uses this page's cards and controls (page-pricing.js) under its own
   centred head: the controls at the two ends of a row of their own */
.home-pricing .hplans__ctl { justify-content: space-between; margin: clamp(20px, 3vw, 32px) 0 14px; }
.home-pricing .hplans { margin-top: 0; padding-top: 6px; }
@media (max-width: 900px) {
  .home-pricing .plans-swipe { display: flex; }
  /* in the swipe row a deep shadow is clipped into a grey band on the paper: a close one instead */
  .home-pricing .hplans { margin-top: -30px; padding-top: 36px; padding-bottom: 18px; }
  .home-pricing .pc { filter: drop-shadow(0 1px 1px rgba(13, 9, 5, .14)) drop-shadow(0 6px 8px rgba(13, 9, 5, .12)); }
}
