/* ── Door tablet (open the link with ?door): covers the calendar after a minute without a touch ── */
/* Registered so they can fade: the colour of the moment, the status light, and how far the meeting has come. */
@property --c { syntax: "<color>"; inherits: true; initial-value: #4a3647; }
@property --dot { syntax: "<color>"; inherits: true; initial-value: #8a7686; }
@property --p { syntax: "<percentage>"; inherits: true; initial-value: 0%; }
.door {
  --free: #36572a; --busy: #892d1c;              /* --c is free, busy, or plum while loading */
  position: fixed; inset: 0; z-index: 30; isolation: isolate; overflow: hidden;
  display: grid; place-content: center; justify-items: center; gap: clamp(10px, 2vmin, 16px);
  padding: clamp(76px, 15vmin, 136px) clamp(16px, 4vmin, 44px);
  background: radial-gradient(140% 120% at 50% -10%, #35252f, #1a1219 68%) #1a1219; color: var(--paper); user-select: none; cursor: pointer;
  /* A tap lifts the screen away; it comes back down the same way. */
  opacity: 0; visibility: hidden; transform: translateY(-32px);
  transition: opacity .2s ease, transform .26s var(--ease-sheet), visibility 0s .26s, --c .7s ease, --dot .7s ease;
}
.door.on { opacity: 1; visibility: visible; transform: none; transition: opacity .45s ease, transform .6s var(--ease-out), --c .7s ease, --dot .7s ease; }
.door[data-state="free"] { --c: var(--free); --dot: #6dbb55; }
.door[data-state="busy"] { --c: var(--busy); --dot: #e2553a; }
/* The colour also lights the wall behind the cards, so the room's state reads from down the corridor. It breathes, very slowly. */
.door::before {
  content: ""; position: absolute; inset: -6%; z-index: -1; pointer-events: none;
  background: radial-gradient(58% 62% at 50% 48%, color-mix(in oklab, color-mix(in oklab, var(--c), #fff 10%) 80%, transparent), transparent 74%);
}
.door.on::before { animation: breathe 7s ease-in-out infinite alternate; }
@keyframes breathe { from { opacity: .7; transform: scale(1); } to { opacity: 1; transform: scale(1.07); } }
/* A little grain keeps the dark gradients from banding on tablet screens. */
.door::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .06;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.door header {
  position: absolute; inset: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: clamp(18px, 4vmin, 40px) clamp(22px, 4.8vmin, 52px);
}
.door .brand { gap: .6em; font-size: clamp(1.125rem, 3.2vmin, 1.875rem); font-weight: 650; letter-spacing: -.02em; }
/* The dot by the name is a status light here: a brighter green or red than the card, so it shows on the dark backdrop. */
.door .brand i { width: .5em; height: .5em; background: var(--dot); box-shadow: 0 0 0 .22em color-mix(in srgb, var(--dot) 26%, transparent); }
.door time { display: grid; justify-items: end; gap: .1em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.door time b { font-size: clamp(1.75rem, 5.4vmin, 3.25rem); font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.door time b.tick { animation: tick .5s var(--ease-out); }                     /* the minute rolls over */
@keyframes tick { from { opacity: 0; transform: translateY(.22em); } }
.door time span { font-size: clamp(.8125rem, 2.1vmin, 1.125rem); opacity: .62; }
.door time span::first-letter { text-transform: uppercase; }
.door time span.off { opacity: 1; color: #ffb38f; font-weight: 600; }
.tip { position: absolute; inset: auto 0 clamp(16px, 3.6vmin, 36px); margin: 0; text-align: center; font-size: clamp(.8125rem, 2vmin, 1.0625rem); opacity: .42; }

/* Two cards of the same width in the middle of the screen: the status, and a thinner one for what comes next. */
.status, .next { width: min(86vw, 98vmin, 47rem); }
.door.on .status, .door.on .next { animation: card-in .8s var(--ease-out) .06s backwards; }
.door.on .next { animation-delay: .15s; }
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(.975); } }
/* When the room turns free or booked, or the next meeting changes, the new text fades in while the colour shifts. */
.swap > * { animation: swap-in .55s var(--ease-out) backwards; }
@keyframes swap-in { from { opacity: 0; transform: translateY(.25em); filter: blur(5px); } }
.status {
  position: relative; aspect-ratio: 2 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0;
  padding: clamp(22px, 5.4vmin, 52px); border: 0; border-radius: clamp(24px, 5vmin, 44px); color: #fff; font: inherit; text-align: center; cursor: pointer;
  background:
    radial-gradient(110% 140% at 0% 0%, color-mix(in oklab, var(--c) 88%, #fff), transparent 62%),
    linear-gradient(165deg, var(--c), color-mix(in oklab, var(--c) 80%, #000));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), inset 0 0 0 1px rgb(255 255 255 / .07),
    0 1px 2px rgb(0 0 0 / .35), 0 28px 56px -20px rgb(0 0 0 / .6), 0 70px 120px -50px color-mix(in srgb, var(--c) 85%, transparent);
  transition: transform .16s var(--ease-out);
}
.status:active { transform: scale(.98); }
.status span:empty { display: none; }
.status .state { font-size: clamp(3.5rem, 15vmin, 8.25rem); font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.status .cta {
  position: relative; overflow: hidden;
  margin-top: clamp(20px, 4.4vmin, 38px); display: inline-flex; align-items: center; gap: .6em; padding: .78em 1.5em .78em 1.25em; border-radius: 999px;
  background: #fff; color: color-mix(in oklab, var(--free) 72%, #000); font-size: clamp(1rem, 2.7vmin, 1.4375rem); font-weight: 650; letter-spacing: -.01em;
  box-shadow: 0 1px 1px rgb(0 0 0 / .2), 0 12px 24px -10px rgb(0 0 0 / .5);
}
.status .cta svg { width: .95em; height: .95em; }
/* Every ten seconds a soft band of light crosses the button, as a quiet invitation to tap. */
.door.on .cta::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-110%);
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--free) 24%, transparent) 50%, transparent 70%);
  animation: sheen 10s ease-in-out 4s infinite;
}
@keyframes sheen { 0%, 88% { transform: translateX(-110%); } 100% { transform: translateX(110%); } }
/* Booked: no status word, the red card is the booking itself. From the top left: its title, a line across the card, its time.
   The line fills from the left as the meeting goes on (--p), so a glance shows how much of it is left. */
[data-state="busy"] .status { align-items: stretch; justify-content: flex-start; text-align: left; }
.status .what {
  font-size: clamp(1.875rem, 7.4vmin, 4rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere;
}
.status .span {
  position: relative; margin-top: .62em; padding-top: .6em; transition: --p 1s ease;
  font-size: clamp(1.25rem, 4.6vmin, 2.5rem); font-weight: 500; letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
.status .span::before {
  content: ""; position: absolute; inset: 0 0 auto; height: max(3px, .09em); border-radius: 99px;
  background: linear-gradient(to right, rgb(255 255 255 / .95) var(--p), rgb(255 255 255 / .26) 0);
}
.next {
  display: flex; align-items: baseline; gap: clamp(12px, 2.4vmin, 20px); min-width: 0; padding: clamp(15px, 3vmin, 26px) clamp(22px, 5.4vmin, 52px);
  border-radius: clamp(18px, 3.4vmin, 30px); background: rgb(237 239 232 / .07);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), inset 0 0 0 1px rgb(237 239 232 / .06);
  font-size: clamp(1rem, 2.7vmin, 1.4375rem);
}
.next .lbl { font-size: .68em; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; opacity: .6; }
.next b { flex: 1; min-width: 0; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next .time { font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .8; }
.next.none { justify-content: center; }
.next.none b { flex: none; font-weight: 500; opacity: .62; }

@media (prefers-reduced-motion: reduce) {
  .door, .status:active { transform: none; }
  .door.on::before, .door.on .status, .door.on .next, .door.on .cta::after, .swap > *, .door time b.tick { animation: none; }
}
