/* The Pre-order button with the tear-off calendar: a pill of black lacquer on a white page, with a little paper desk
   calendar set into its left end. Colours here; the tearing, the light and the words are moved by script.js. */
:root {
  --page: #ffffff;          /* the page */
  --lacquer-top: #2c2c2f;   /* the top of the pill */
  --lacquer: #121214;       /* the body of the pill */
  --lacquer-low: #070708;   /* the bottom of the pill */
  --ink: #f6f3ee;           /* the words on the pill */
  --muted: rgba(246, 243, 238, 0.56); /* the small line under the title */
  --accent: #ff5a1f;        /* the one accent: the binding of the pad, the ring, the tick */
  --paper: #fbfaf6;         /* the sheets of the calendar */
  --paper-shade: #e8e4db;   /* the edges of the sheets under it */
  --paper-ink: #17161a;     /* the day on the sheets */
  --focus: #ff5a1f;         /* the ring of the keyboard's focus */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

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

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

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: min(72px, 12vh) 16px;
}

.pre {
  display: grid;
  justify-items: center;
  padding: 18px 0 44px;
}

/* the button itself carries no transform (GSAP moves .pre__body inside it) */
.pre__btn {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.pre__btn:focus-visible .pre__body {
  box-shadow: 0 0 0 3px var(--page), 0 0 0 5px var(--focus), 0 10px 24px -10px rgba(0, 0, 0, 0.45);
}

.pre__body {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  column-gap: 12px;
  width: min(320px, calc(100vw - 32px));
  height: 60px;
  padding: 0 22px 0 10px;
  border-radius: 999px;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.18),
    0 4px 8px -2px rgba(0, 0, 0, 0.18),
    0 14px 28px -12px rgba(0, 0, 0, 0.42),
    0 26px 44px -26px rgba(255, 90, 31, 0.0);
  transition: box-shadow 0.4s ease;
}

@media (hover: hover) {
  .pre__btn:hover .pre__body {
    box-shadow:
      0 1px 1px rgba(0, 0, 0, 0.18),
      0 6px 12px -3px rgba(0, 0, 0, 0.2),
      0 20px 36px -14px rgba(0, 0, 0, 0.46),
      0 26px 44px -22px rgba(255, 90, 31, 0.32);
  }
}

.pre.is-hover .pre__body {
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.18),
    0 6px 12px -3px rgba(0, 0, 0, 0.2),
    0 20px 36px -14px rgba(0, 0, 0, 0.46),
    0 26px 44px -22px rgba(255, 90, 31, 0.32);
}

/* the lacquer: a gradient, a fine edge that takes the light on top, a darker lip underneath */
.pre__skin {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, var(--lacquer-top) 0%, var(--lacquer) 46%, var(--lacquer-low) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.pre__skin::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  top: 1px;
  height: 46%;
  border-radius: 999px 999px 40% 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0));
}

/* the soft light that follows the pointer */
.pre__light {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(120px 70px at var(--lx, 50%) var(--ly, 0%), rgba(255, 255, 255, 0.13), transparent 70%);
}

/* the band of light that runs across while the date is being held */
.pre__glint {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 46%;
  opacity: 0;
  transform: translateX(-120%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 140, 90, 0.16) 40%, rgba(255, 255, 255, 0.22) 50%, rgba(255, 140, 90, 0.16) 60%, transparent);
}

/* the pad: a little block of paper sheets with an orange binding and two metal rings */
.pad {
  position: relative;
  z-index: 2;
  width: 40px;
  height: 44px;
}

.pad__depth {
  position: absolute;
  left: 1px;
  right: 1px;
  top: 8px;
  bottom: -2px;
  border-radius: 5px;
  background: linear-gradient(180deg, var(--paper-shade), #cfcac0);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.45), 0 0 0 0.5px rgba(0, 0, 0, 0.25);
}

.pad__depth::before {
  content: '';
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.5);
}

.pad__sheets {
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  bottom: 1px;
}

.sheet {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 13px 1fr;
  justify-items: center;
  align-items: center;
  border-radius: 2px 2px 5px 5px;
  background: linear-gradient(180deg, #ffffff 0%, var(--paper) 55%, #f1eee7 100%);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.16);
  color: var(--paper-ink);
  transform-origin: 2px 1px;
  will-change: transform;
}

/* the perforation along the top of every sheet */
.sheet::before {
  content: '';
  position: absolute;
  left: 3px;
  right: 3px;
  top: 2px;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0 1.5px, transparent 1.5px 3px);
}

.sheet__month {
  padding-top: 3px;
  font-size: 7.5px;
  line-height: 1;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.sheet__day {
  margin-top: -3px;
  font-size: 18px;
  line-height: 1;
  font-weight: 640;
  font-stretch: 86%;
  letter-spacing: -0.03em;
  font-feature-settings: 'zero' 0;
}

.sheet__ring {
  position: absolute;
  left: 50%;
  top: 64%;
  width: 29px;
  height: 23px;
  transform: translate(-50%, -50%);
  overflow: visible;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  pointer-events: none;
}

.sheet__ring path {
  opacity: 0;
}

/* the corner that lifts a little under the pointer */
.sheet__curl {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 11px;
  height: 11px;
  border-radius: 0 0 5px 0;
  background: linear-gradient(315deg, var(--page) 0 48%, #d9d4ca 50%, #ffffff 78%);
  box-shadow: -1px -1px 2px rgba(0, 0, 0, 0.12);
  transform-origin: 100% 100%;
  transform: scale(0);
}

.sheet--torn {
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.16), 0 6px 10px -4px rgba(0, 0, 0, 0.35);
}

.pad__bind {
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  height: 7px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, #ff7a45, var(--accent) 60%, #d9430f);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  z-index: 3;
}

.pad__bind i {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 7px;
  border-radius: 2px;
  background: linear-gradient(90deg, #8d8f95, #f4f4f6 45%, #9a9ca2);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.pad__bind i:first-child { left: 10px; }
.pad__bind i:last-child { right: 10px; }

/* the words */
.pre__words {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: left;
}

.pre__line {
  display: flex;
  align-items: center;
  min-width: 0;
}

.pre__title {
  font-size: 16px;
  line-height: 1.1;
  font-weight: 600;
  font-stretch: 100%;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.pre__sub {
  font-size: 12px;
  line-height: 1.1;
  font-weight: 450;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pre__tick {
  display: inline-flex;
  width: 0;
  overflow: hidden;
  flex: none;
}

.pre__tick svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.pre__tick path {
  opacity: 0;
}

.pre__rule {
  position: relative;
  z-index: 1;
  width: 1px;
  height: 26px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

.pre__price {
  position: relative;
  z-index: 1;
  font-size: 15px;
  font-weight: 560;
  font-stretch: 92%;
  color: var(--ink);
}

@media (max-width: 360px) {
  .pre__body { column-gap: 10px; padding-right: 18px; }
}
