/* The Vacation hold toggle with the deliveries that pause: the settings card of a coffee subscription on black.
   A dark card with a 1px edge that catches the light and layered shadows; a glass track with a brushed metal knob;
   one accent, a warm sunset amber, that only lights up when the hold is on. */
:root {
  --page: #000000;            /* the page */
  --card: #121214;            /* the body of the card */
  --card-top: #18181b;        /* the top of the card, a touch lighter */
  --edge: rgba(255, 255, 255, 0.07); /* the 1px edge at rest */
  --ink: #efeff1;             /* the words */
  --muted: #85858f;           /* the small words */
  --faint: #55555d;           /* the words of a skipped delivery */
  --line: rgba(255, 255, 255, 0.06); /* the thin lines */
  --accent: #ffa95e;          /* the one accent: sunset amber */
  --accent-deep: #f0743a;     /* the deep end of the amber */
  --track: #232327;           /* the switch track when off */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-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: 16px;
  overflow: hidden;
}

/* the wrap is GSAP's (entrance), the card is CSS's */
.wrap {
  width: min(420px, 92vw);
  opacity: 0;
}

.card {
  position: relative;
  isolation: isolate;
  border-radius: 22px;
  padding: clamp(14px, 3.6vh, 22px) clamp(14px, 4.4vw, 22px) clamp(12px, 3vh, 18px);
  background: linear-gradient(180deg, var(--card-top), var(--card) 46%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 12px 28px -12px rgba(0, 0, 0, 0.8),
    0 40px 80px -40px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

/* the 1px edge: a conic gradient masked to the border, warm on the top right when the hold is on */
.card__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  z-index: 3;
}

.card__edge::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 90% at 100% 0%, var(--accent) 0%, rgba(255, 169, 94, 0.25) 32%, transparent 60%);
  opacity: var(--warm, 0);
}

/* the warm light that pours in from the top right corner */
.card__glow {
  position: absolute;
  right: -30%;
  top: -55%;
  width: 110%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 150, 80, 0.22), rgba(240, 116, 58, 0.08) 55%, transparent 75%);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

/* ---------------------------------------------------------------- the head */
.head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(10px, 3vw, 14px);
}

.tile {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #232327, #19191c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 10px -4px rgba(0, 0, 0, 0.8);
  color: #b9b9c2;
  transition: color 0.5s;
}

.tile.is-on {
  color: var(--accent);
}

.tile__bag {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.tile__wheel {
  stroke-width: 2.6;
}

.head__copy {
  min-width: 0;
}

.head__title {
  margin: 0;
  font-size: clamp(15px, 2.4vh, 17px);
  font-weight: 600;
  font-variation-settings: 'wdth' 104;
  letter-spacing: -0.005em;
}

.head__sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--muted);
}

/* two faces stacked in one cell; GSAP rolls one out and the other in */
.roll {
  display: grid;
  overflow: hidden;
}

.roll__face {
  grid-area: 1 / 1;
}

.roll__face + .roll__face {
  visibility: hidden;
}

/* ---------------------------------------------------------------- the switch */
.switch {
  position: relative;
  width: 54px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.switch__track {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: var(--track);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 1px 0 rgba(255, 255, 255, 0.04);
}

.switch__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 4px rgba(150, 50, 10, 0.35);
  opacity: 0;
}

/* the light that sweeps once over the glass when the switch turns on */
.switch__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: translateX(-120%);
}

/* the knob is GSAP's (x, width), the metal inside is CSS's */
.switch__knob {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.55), 0 6px 12px -4px rgba(0, 0, 0, 0.6);
}

.switch__metal {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(70% 55% at 35% 25%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%),
    conic-gradient(from 210deg, #f4f4f6, #a9a9b0, #e9e9ec, #8f8f96, #f4f4f6);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.7), inset 0 -1px 1px rgba(0, 0, 0, 0.25);
}

@media (hover: hover) {
  .switch:hover .switch__metal {
    filter: brightness(1.06);
  }
}

/* ---------------------------------------------------------------- the away dates */
.away {
  height: 0;
  overflow: hidden;
}

.away__in {
  margin-top: clamp(10px, 2.4vh, 14px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 169, 94, 0.1), rgba(255, 169, 94, 0.04));
  box-shadow: inset 0 0 0 1px rgba(255, 169, 94, 0.18);
}

.away__icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  flex: none;
}

.away__label {
  color: var(--accent);
  font-weight: 600;
}

.away__dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.away__arrow {
  width: 14px;
  height: 9px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.away__nights {
  margin-left: auto;
  color: var(--muted);
}

/* ---------------------------------------------------------------- the deliveries */
.list {
  margin-top: clamp(12px, 3vh, 18px);
  padding-top: clamp(10px, 2.4vh, 14px);
  border-top: 1px solid var(--line);
}

.list__label {
  margin: 0 0 clamp(4px, 1.2vh, 8px);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: clamp(6px, 1.5vh, 9px) 0;
}

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

.row__day {
  display: grid;
  place-items: center;
  height: 38px;
  border-radius: 10px;
  background: #1c1c1f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  line-height: 1;
}

.row__day b {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

.row__day span {
  font-size: 15px;
  font-weight: 600;
  font-variation-settings: 'wdth' 92;
  margin-bottom: 5px;
}

.row__what {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.row__name {
  justify-self: start;
  max-width: 100%;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__meta {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the thin line that crosses a skipped delivery's name */
.row__strike {
  position: absolute;
  left: 0;
  top: 0.68em;
  height: 1px;
  width: var(--strike-w, 60%);
  background: var(--faint);
  transform-origin: 0 50%;
  transform: scaleX(0);
  font-size: 13.5px;
}

.chip {
  display: grid;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 999px;
  padding: 5px 10px;
  color: #b4b4bd;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  min-width: 96px;
}

.chip__face {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.chip__face--on {
  visibility: hidden;
}

.chip__face svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- the next charge */
.foot {
  margin-top: clamp(8px, 2vh, 12px);
  padding: clamp(9px, 2.2vh, 12px) 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #0d0d0f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 1px 2px rgba(0, 0, 0, 0.5);
  font-size: 12.5px;
}

.foot__label {
  color: var(--muted);
}

.foot__value {
  text-align: right;
  color: #c9c9d0;
  white-space: nowrap;
}

.foot__value b {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 380px) {
  .head__sub {
    font-size: 11.5px;
  }
  .row {
    gap: 10px;
  }
  .row__meta {
    font-size: 11px;
  }
  .away__nights {
    display: none;
  }
}
