:root {
  --bg: #0A0B0D;
  --metal-1: #3A3D42;
  --metal-2: #8E939B;
  --metal-3: #E9EBEE;
  --metal-4: #9BA0A8;
  --metal-5: #43464B;
  --text-hi: #F4F5F6;
  --text-mid: #A7ACB4;
  --text-dim: #7C828C;
  --accent: #C9D4E0;
  --focus: #B8CCE4;
  --line: rgba(255, 255, 255, .14);
  --mx: 50%;
  --my: 45%;
  color-scheme: dark;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

html,
body {
  overscroll-behavior: none;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text-hi);
  font-family: "Space Grotesk", system-ui, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.ambient-layer,
.spotlight-layer,
.vignette-layer,
.grain-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient-layer {
  z-index: 0;
  inset: -45vmax;
  background:
    radial-gradient(circle at 34% 38%, rgba(184, 204, 228, .045), transparent 34%),
    conic-gradient(
      from 30deg at 50% 48%,
      transparent 0deg,
      rgba(255, 255, 255, .03) 72deg,
      transparent 138deg,
      rgba(255, 255, 255, .06) 218deg,
      transparent 292deg,
      rgba(255, 255, 255, .03) 360deg
    );
  filter: blur(72px);
  animation: ambient-drift 48s linear infinite;
}

.spotlight-layer {
  z-index: 1;
  background: radial-gradient(
    900px 600px at var(--mx, 50%) var(--my, 45%),
    rgba(233, 235, 238, .10),
    rgba(155, 160, 168, .025) 42%,
    transparent 72%
  );
}

.vignette-layer {
  z-index: 20;
  background: radial-gradient(
    ellipse at center,
    transparent 42%,
    rgba(0, 0, 0, .24) 72%,
    rgba(0, 0, 0, .72) 120%
  );
}

.grain-layer {
  z-index: 30;
  inset: -20%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 320 320' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.85'/%3E%3C/svg%3E");
  opacity: .06;
  mix-blend-mode: overlay;
  animation: grain-jitter 900ms steps(4) infinite;
}

.app-shell {
  position: relative;
  z-index: 10;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.view {
  width: 100%;
}

.view.is-entering {
  animation: view-enter 300ms cubic-bezier(.22, 1, .36, 1) both;
}

.view.is-leaving {
  position: absolute;
  inset: 0;
  pointer-events: none;
  animation: view-leave 300ms ease-in both;
}

.site-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(24px, 5vh, 56px) 16px;
}

.card-stage {
  position: relative;
  width: min(calc(100vw - 32px), 680px, 86dvh);
  aspect-ratio: 3.4 / 2.145;
  isolation: isolate;
}

.fallback-card,
#webgl-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 18px;
}

.fallback-card {
  overflow: hidden;
  background: linear-gradient(
    115deg,
    var(--metal-1) 0%,
    var(--metal-2) 28%,
    var(--metal-3) 46%,
    var(--metal-4) 60%,
    var(--metal-5) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .48),
    inset 0 -1px 0 rgba(0, 0, 0, .28),
    0 28px 70px rgba(0, 0, 0, .48),
    0 8px 24px rgba(0, 0, 0, .32);
  transition: opacity 400ms ease-out;
}

html:not(.js) .fallback-card {
  animation: card-enter 1200ms cubic-bezier(.16, 1, .3, 1) both;
}

html.js .fallback-card {
  visibility: hidden;
  opacity: 0;
}

html.js .card-stage.webgl-failed .fallback-card {
  visibility: visible;
  opacity: 1;
  animation: none;
}

/* Mirrors exist only to serve the 3D buttons; where no canvas exists they are
   duplicate tab stops of the visible fallback actions — remove them. */
html:not(.js) .card-stage .sr-only,
html.js .card-stage.webgl-failed .sr-only {
  display: none;
}

.fallback-card::before {
  position: absolute;
  inset: 1px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), transparent 18%),
    radial-gradient(circle at 66% 38%, rgba(255, 255, 255, .13), transparent 34%);
  content: "";
  pointer-events: none;
}

.fallback-card::after {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='.24'/%3E%3C/svg%3E");
  content: "";
  mix-blend-mode: soft-light;
  opacity: .16;
  pointer-events: none;
}

.fallback-monogram {
  position: absolute;
  top: 34%;
  left: 50%;
  z-index: 1;
  color: #555a61;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(46px, 8vw, 84px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .48), 0 -1px 1px rgba(0, 0, 0, .24);
  transform: translate(-50%, -50%);
}

.fallback-actions {
  position: absolute;
  top: 87.5%;
  right: 8%;
  left: 8%;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  transform: translateY(-50%);
}

.fallback-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 14px 0;
  border: 0;
  background: none;
  color: #4a4f56;
  font-size: clamp(8px, 3.1vw, 21px);
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .48), 0 -1px 1px rgba(0, 0, 0, .22);
  white-space: nowrap;
  transition: color 180ms ease-out, text-shadow 180ms ease-out;
}

.fallback-action:first-child {
  justify-content: flex-start;
  text-align: left;
}

.fallback-action:last-child {
  justify-content: flex-end;
  text-align: right;
}

.fallback-action:hover {
  color: #3f444b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .58), 0 0 12px rgba(201, 212, 224, .32);
}

#webgl-canvas {
  display: block;
  opacity: 0;
  touch-action: none;
  transition: opacity 400ms ease-out;
}

.card-stage.webgl-ready #webgl-canvas {
  opacity: 1;
}

.chip,
.slot-button,
.schedule-action,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 22px rgba(0, 0, 0, .18);
  color: var(--text-mid);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 180ms ease-out, color 180ms ease-out, transform 180ms ease-out, background-color 180ms ease-out;
}

.chip {
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .12em;
  line-height: 1;
  text-transform: uppercase;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.chip:hover,
.slot-button:hover,
.schedule-action:hover,
.icon-button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, .35);
  color: var(--text-hi);
  transform: translateY(-1px);
}

.schedule-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(20px, 5vw, 56px) 12px;
}

.schedule-panel {
  width: min(100%, 560px);
  padding: clamp(20px, 5vw, 34px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(233, 235, 238, .075), rgba(58, 61, 66, .035) 52%),
    rgba(17, 19, 24, .82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 28px 80px rgba(0, 0, 0, .4);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -10px 0 10px;
  padding: 0 6px;
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease-out;
}

.back-link:hover {
  color: var(--text-hi);
}

.schedule-header {
  margin-bottom: 28px;
  text-align: center;
}

.schedule-header h1 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(38px, 8vw, 54px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1;
}

.event-summary {
  margin: 12px 0 0;
  color: var(--text-mid);
  font-size: 12px;
  line-height: 1.6;
}

.month-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.month-nav h2,
.slot-section h2 {
  margin: 0;
  color: var(--text-hi);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .04em;
  text-align: center;
}

.icon-button {
  width: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 17px;
}

.icon-button:disabled {
  opacity: .28;
  cursor: not-allowed;
}

.calendar-scroll {
  overflow-x: auto;
  padding: 2px;
  scrollbar-color: var(--metal-1) transparent;
}

.weekday-grid,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(44px, 1fr));
  min-width: 308px;
}

.weekday {
  display: grid;
  min-height: 28px;
  place-items: center;
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.day-button,
.day-spacer,
.day-skeleton {
  min-width: 44px;
  min-height: 44px;
}

.day-button {
  position: relative;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-hi);
  cursor: pointer;
  transition: border-color 160ms ease-out, background-color 160ms ease-out, color 160ms ease-out;
}

.day-button:hover:not(:disabled) {
  border-color: var(--line);
  background: rgba(255, 255, 255, .06);
}

.day-button:disabled {
  color: var(--text-dim);
  opacity: .34;
  cursor: not-allowed;
}

.day-button.is-today::after {
  position: absolute;
  right: 50%;
  bottom: 5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
  transform: translateX(50%);
}

.day-button.is-selected {
  border-color: rgba(201, 212, 224, .52);
  background: rgba(201, 212, 224, .13);
  color: var(--text-hi);
}

.day-skeleton {
  position: relative;
  overflow: hidden;
  border: 5px solid transparent;
  border-radius: 11px;
  background: rgba(255, 255, 255, .045);
  background-clip: padding-box;
}

.day-skeleton::after {
  position: absolute;
  inset: 5px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .09), transparent);
  content: "";
  transform: translateX(-110%);
  animation: skeleton-shimmer 1.3s ease-in-out infinite;
}

.slot-section {
  padding-top: 24px;
}

.slot-section h2 {
  text-align: left;
}

.slot-status {
  min-height: 20px;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

.slot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.slot-button {
  padding: 10px 17px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .04em;
}

.slot-button.is-selected {
  border-color: rgba(201, 212, 224, .52);
  background: rgba(201, 212, 224, .13);
  color: var(--text-hi);
}

.booking-error {
  margin: 16px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(184, 204, 228, .25);
  border-radius: 10px;
  background: rgba(184, 204, 228, .06);
  color: var(--text-mid);
  font-size: 12px;
  line-height: 1.5;
}

.booking-form {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.booking-form label {
  margin-top: 10px;
  color: var(--text-mid);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.booking-form label span {
  color: var(--text-dim);
}

.booking-form input,
.booking-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  color: var(--text-hi);
  caret-color: var(--accent);
  resize: vertical;
}

.booking-form input[readonly] {
  color: var(--text-mid);
  cursor: default;
}

.selected-slot {
  color: var(--accent);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 24px;
  font-style: italic;
  line-height: 1.25;
}

.schedule-action {
  width: 100%;
  margin-top: 18px;
  padding: 13px 20px;
  border-radius: 999px;
  color: var(--text-hi);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.schedule-action:disabled {
  opacity: .55;
  cursor: wait;
}

.offline-state,
.success-state {
  padding: 22px 0 8px;
  text-align: center;
}

.offline-state p {
  margin: 0 0 20px;
  color: var(--text-mid);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 26px;
  font-style: italic;
  line-height: 1.25;
}

.success-state h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(28px, 7vw, 40px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
}

.success-state p {
  margin: 16px 0 0;
  color: var(--text-mid);
  font-size: 13px;
  line-height: 1.6;
}

@keyframes ambient-drift {
  to { transform: rotate(1turn); }
}

@keyframes grain-jitter {
  0% { transform: translate3d(-3%, 2%, 0); }
  25% { transform: translate3d(2%, -4%, 0); }
  50% { transform: translate3d(4%, 3%, 0); }
  75% { transform: translate3d(-4%, -2%, 0); }
  100% { transform: translate3d(1%, 4%, 0); }
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(24px) rotateX(3deg) scale(.98); }
  to { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes view-leave {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

@keyframes skeleton-shimmer {
  to { transform: translateX(110%); }
}

@media (max-width: 520px) {
  .site-shell {
    padding-inline: 16px;
  }

  .card-stage {
    width: min(calc(100vw - 32px), 78dvh);
  }

  .chip {
    padding-inline: 17px;
    font-size: 11px;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .site-shell {
    padding-block: 16px;
  }

  .card-stage {
    width: min(64vw, 76dvh);
  }

}

@media (prefers-reduced-motion: reduce) {
  .ambient-layer,
  .day-skeleton::after {
    animation: none;
  }

  .spotlight-layer,
  .grain-layer {
    display: none;
  }

  html:not(.js) .fallback-card {
    animation: none;
  }

  .view.is-entering,
  .view.is-leaving {
    animation: none;
  }

  .chip,
  .slot-button,
  .schedule-action,
  .icon-button,
  .day-button,
  .back-link {
    transition: none;
  }

  .chip:hover,
  .slot-button:hover,
  .schedule-action:hover,
  .icon-button:hover:not(:disabled) {
    transform: none;
  }
}
