/* Two pages of Quire, a made-up writing app, and the ribbon between them. The ribbon is a stack of strips drawn by
   script.js: each strip is one pleat of the accordion, with a shade on top that darkens or lights it as it folds. */
:root {
  --cream: #f3efe6;         /* the home page, a warm paper white */
  --cream-deep: #e8e2d6;    /* the paper in the corners */
  --navy: #1a2340;          /* the pricing page, a deep ink blue */
  --navy-deep: #121a31;     /* the ink in the corners */
  --ink: #16171c;           /* the words on the paper */
  --muted: #7d7a73;         /* the small words on the paper */
  --frost: #c9cede;         /* the small words on the ink */
  --accent: #ff6a3d;        /* the one colour: a warm coral */
  --line: rgba(22, 23, 28, 0.12);       /* hairlines on the paper */
  --line-dark: rgba(243, 239, 230, 0.14); /* hairlines on the ink */
}

* { box-sizing: border-box; }

html { touch-action: manipulation; }

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

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

.stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- the pages ---- */
.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 3.4vh, 30px) clamp(16px, 4.5vw, 56px);
  visibility: hidden;
}

.page.is-on { visibility: visible; }

.page--home {
  background: radial-gradient(120% 90% at 50% 40%, var(--cream) 55%, var(--cream-deep) 100%);
  color: var(--ink);
}

.page--pricing {
  background: radial-gradient(120% 90% at 50% 40%, var(--navy) 50%, var(--navy-deep) 100%);
  color: var(--cream);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 32px);
  height: clamp(36px, 6vh, 46px);
}

.page--pricing .nav { justify-content: space-between; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
  font-weight: 640;
  font-size: clamp(15px, 2.4vh, 18px);
  letter-spacing: -0.01em;
}

.brand--small { opacity: 0.7; font-weight: 560; }

.brand__mark {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand__fold { stroke: var(--accent); }

.nav__links {
  display: flex;
  gap: clamp(12px, 2.4vw, 28px);
  margin-left: auto;
  font-size: 14px;
  color: var(--muted);
}

/* ---- the elastic pill ---- */
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: clamp(34px, 5.4vh, 42px);
  padding: 0 clamp(14px, 2vw, 20px);
  border: 0;
  border-radius: 999px;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 560;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.pill--navy { color: var(--cream); }
.pill--cream { color: var(--navy); }

.pill__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: inherit;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pill--navy .pill__bg {
  background: linear-gradient(180deg, #27325a, var(--navy));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(18, 26, 49, 0.25), 0 8px 22px -10px rgba(18, 26, 49, 0.55);
}

.pill--cream .pill__bg {
  background: linear-gradient(180deg, #fbf8f1, var(--cream));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 22px -10px rgba(0, 0, 0, 0.6);
}

/* a sweep of light that crosses the pill on hover */
.pill__sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
  transform: translateX(-110%);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.pill--cream .pill__sheen { background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.95) 50%, transparent 70%); }

.pill__label {
  font-variation-settings: 'wdth' 100;
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pill__arrow {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pill--navy .pill__arrow { stroke: var(--accent); }

.pill.is-hover .pill__bg { transform: scale(1.06, 1.1); }
.pill.is-hover .pill__label { font-variation-settings: 'wdth' 112; }
.pill.is-hover .pill__sheen { transform: translateX(110%); }
.pill.is-hover .pill__arrow { transform: translateX(3px); }
.pill.is-hover .pill__arrow--back { transform: translateX(-3px); }
.pill.is-press .pill__bg { transform: scale(0.94, 0.9); transition-duration: 0.18s; }

@media (hover: hover) {
  .pill:hover .pill__bg { transform: scale(1.06, 1.1); }
  .pill:hover .pill__label { font-variation-settings: 'wdth' 112; }
  .pill:hover .pill__sheen { transform: translateX(110%); }
  .pill:hover .pill__arrow { transform: translateX(3px); }
  .pill:hover .pill__arrow--back { transform: translateX(-3px); }
  .pill:active .pill__bg { transform: scale(0.94, 0.9); transition-duration: 0.18s; }
}

.pill:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; }

/* ---- the home page ---- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: clamp(4px, 2vh, 24px);
}

.eyebrow {
  margin: 0 0 clamp(8px, 1.8vh, 16px);
  font-size: clamp(11px, 1.7vh, 13px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 560;
}

.title {
  margin: 0;
  font-size: min(9.6vw, 9.2vh, 78px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 620;
  font-variation-settings: 'wdth' 92;
}

.title span { display: inline-block; }

.lede {
  margin: clamp(10px, 2.2vh, 20px) 0 0;
  max-width: 34em;
  font-size: min(3.6vw, 2.5vh, 17px);
  line-height: 1.45;
  color: var(--muted);
}

.note {
  position: relative;
  margin-top: clamp(14px, 3.6vh, 36px);
  width: min(100%, 420px);
  padding: clamp(10px, 2vh, 18px) clamp(12px, 2.4vw, 20px);
  display: grid;
  gap: clamp(6px, 1.2vh, 10px);
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf8, #f8f4ec);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(22, 23, 28, 0.05), 0 18px 36px -22px rgba(22, 23, 28, 0.35);
}

.note__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: clamp(11px, 1.8vh, 13px);
  margin-bottom: 2px;
}

.note__name { font-weight: 600; }
.note__count { color: var(--accent); font-variant-numeric: tabular-nums; }

.note__line {
  display: block;
  height: 5px;
  width: var(--w);
  border-radius: 3px;
  background: rgba(22, 23, 28, 0.08);
}

.note__line--crease {
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(255, 106, 61, 0.6) 0 6px, transparent 6px 11px);
}

/* ---- the pricing page ---- */
.hero--pricing { justify-content: center; }

.title--pricing {
  font-size: min(8vw, 7.4vh, 60px);
  max-width: 12em;
}

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.6vw, 16px);
  margin-top: clamp(14px, 3.6vh, 34px);
  max-width: 560px;
}

.plan {
  position: relative;
  display: grid;
  gap: clamp(4px, 0.9vh, 8px);
  padding: clamp(10px, 2.2vh, 20px) clamp(10px, 2vw, 18px);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 0 0 1px var(--line-dark), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 40px -24px rgba(0, 0, 0, 0.7);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.plan__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(200px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 106, 61, 0.16), transparent 70%);
  transition: opacity 0.4s ease;
}

.plan__name {
  font-size: clamp(12px, 1.9vh, 14px);
  color: var(--frost);
  font-weight: 560;
}

.plan__name em {
  font-style: normal;
  color: var(--accent);
  margin-left: 4px;
  font-size: 0.86em;
}

.plan__price {
  font-size: min(8vw, 6.4vh, 44px);
  font-weight: 620;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.plan__price small {
  font-size: 0.34em;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--frost);
  margin-left: 3px;
}

.plan__note {
  font-size: clamp(11px, 1.7vh, 13px);
  color: var(--frost);
  opacity: 0.8;
  line-height: 1.35;
}

.plan--star { box-shadow: inset 0 0 0 1px rgba(255, 106, 61, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 20px 40px -24px rgba(0, 0, 0, 0.7); }

@media (hover: hover) {
  .plan:hover { transform: translateY(-3px); }
  .plan:hover .plan__glow { opacity: 1; }
}

/* ---- the ribbon ---- */
.ribbon {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
}

.strip {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100px;
  transform-origin: 0 0;
  will-change: transform;
  box-shadow: 0 16px 30px -14px rgba(10, 14, 30, 0.38); /* the soft shadow the leading edge casts on the page */
}

.strip__shade {
  position: absolute;
  inset: 0;
  opacity: 0;
}

/* a pleat that faces the light and one that turns away from it, alternately */
.strip--up .strip__shade { background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.04) 70%, rgba(0, 0, 0, 0.06)); }
.strip--down .strip__shade { background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.42)); }

/* the crease along the edge of a pleat */
.strip__crease {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  opacity: 0;
  background: rgba(255, 255, 255, 0.5);
}

.ribbon--cream .strip__crease { background: rgba(26, 35, 64, 0.28); }

/* the band, the pill stretched into the first pleat */
.band {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform, width, height;
}
