:root {
  color-scheme: dark;
  --ink: #f5f1e8;
  --muted: rgba(239, 242, 247, 0.58);
  --line: rgba(230, 236, 246, 0.22);
  --warm: #ffc56c;
  --cool: #7bd8d5;
  --approach: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #03040a;
}

body {
  min-height: 100svh;
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

.experience {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  background: #03040a;
}

.space-background,
.space-shade,
#universe,
.meeting-flash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.space-background {
  z-index: -4;
  object-fit: cover;
  opacity: 0.82;
  filter: saturate(0.9) contrast(1.12) brightness(0.66);
  animation: background-drift 34s ease-in-out infinite alternate;
  will-change: transform;
}

.space-shade {
  z-index: -3;
  background: rgba(1, 2, 8, 0.14);
  box-shadow:
    inset 0 0 180px 48px rgba(1, 2, 8, 0.82),
    inset 0 -170px 130px -90px rgba(1, 2, 8, 0.96);
  pointer-events: none;
}

#universe {
  z-index: -2;
  display: block;
  touch-action: none;
}

.event-meta {
  position: absolute;
  z-index: 2;
  top: max(28px, env(safe-area-inset-top));
  left: 5.5%;
  right: 5.5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: rgba(245, 241, 232, 0.72);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.event-status {
  display: flex;
  align-items: center;
  gap: 9px;
}

.status-pulse {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--cool);
  box-shadow: 0 0 14px rgba(123, 216, 213, 0.9);
  animation: status-pulse 2.2s ease-in-out infinite;
}

.event-meta time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.event-title {
  position: absolute;
  z-index: 2;
  top: 12%;
  left: 5.5%;
  width: min(660px, 60%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--warm);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

h1 {
  margin: 0;
  max-width: 100%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 68px;
  font-weight: 400;
  line-height: 0.92;
  text-wrap: balance;
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.76);
}

h1 span {
  display: block;
}

h1 span:last-child {
  margin-top: 8px;
  color: rgba(245, 241, 232, 0.76);
  font-size: 30px;
  line-height: 1.05;
}

.countdown {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: max(38px, calc(env(safe-area-inset-bottom) + 24px));
  width: min(870px, 88%);
  transform: translateX(-50%);
}

.countdown-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

#countdown-label {
  color: var(--ink);
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.time-unit {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  min-width: 0;
  padding: 18px 24px 16px;
}

.time-unit + .time-unit::before {
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 0;
  width: 1px;
  background: var(--line);
  content: "";
}

.time-unit strong {
  min-width: 2ch;
  color: var(--ink);
  font-size: 58px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  line-height: 0.8;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.7);
}

.time-unit span {
  padding-bottom: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 1px;
  margin-top: 18px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.12);
}

#progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  transform: scaleX(var(--approach));
  transform-origin: left center;
  background: var(--warm);
  box-shadow: 0 0 14px rgba(255, 197, 108, 0.62);
}

#progress-point {
  position: absolute;
  top: 50%;
  left: calc(var(--approach) * 100%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #fff5d9;
  box-shadow: 0 0 18px rgba(255, 197, 108, 0.9);
}

.meeting-flash {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  background: rgba(255, 245, 215, 0.08);
}

.rotate-gate {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: none;
  place-items: center;
  overflow: hidden;
  padding: 32px;
  background: #03040a;
  text-align: center;
}

.rotate-gate::before {
  position: absolute;
  inset: -4%;
  opacity: 0.32;
  background: url("assets/cosmic-field.png") center / cover no-repeat;
  filter: brightness(0.52) saturate(0.82);
  content: "";
}

.rotate-gate::after {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 120px 24px rgba(0, 0, 0, 0.88);
  content: "";
}

.rotate-gate-content {
  position: relative;
  z-index: 1;
  max-width: 320px;
}

.rotate-symbol {
  display: block;
  margin-bottom: 22px;
  color: var(--warm);
  font-size: 58px;
  line-height: 1;
  text-shadow: 0 0 24px rgba(255, 197, 108, 0.48);
  transform: rotate(-28deg);
  animation: rotate-prompt 1.9s ease-in-out infinite;
}

.rotate-gate p {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.12;
  text-shadow: 0 3px 28px rgba(0, 0, 0, 0.88);
}

body.is-met .meeting-flash {
  animation: meeting-flash 2.8s ease-out both;
}

body.is-met .status-pulse {
  background: var(--warm);
  box-shadow: 0 0 18px rgba(255, 197, 108, 0.95);
}

body.is-met #progress-fill {
  background: var(--cool);
  box-shadow: 0 0 18px rgba(123, 216, 213, 0.8);
}

noscript {
  position: fixed;
  z-index: 20;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 12px;
  background: #10131d;
  color: #fff;
  text-align: center;
}

@keyframes background-drift {
  0% {
    transform: scale(1.06) translate3d(-0.8%, -0.5%, 0);
  }
  100% {
    transform: scale(1.09) translate3d(0.8%, 0.5%, 0);
  }
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes meeting-flash {
  0% {
    opacity: 0;
  }
  16% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes rotate-prompt {
  0%,
  100% {
    transform: rotate(-28deg) scale(0.96);
  }
  50% {
    transform: rotate(48deg) scale(1.04);
  }
}

@media (max-width: 900px) {
  .event-title {
    width: 78%;
  }

  h1 {
    font-size: 52px;
  }

  h1 span:last-child {
    font-size: 25px;
  }

  .time-unit {
    padding-right: 16px;
    padding-left: 16px;
  }

  .time-unit strong {
    font-size: 48px;
  }
}

@media (max-width: 640px) {
  .space-shade {
    box-shadow:
      inset 0 0 100px 24px rgba(1, 2, 8, 0.74),
      inset 0 -130px 100px -60px rgba(1, 2, 8, 0.96);
  }

  .event-meta {
    top: max(20px, env(safe-area-inset-top));
    left: 20px;
    right: 20px;
    gap: 12px;
    font-size: 9px;
  }

  .event-status {
    gap: 7px;
  }

  #event-status-text {
    max-width: 92px;
  }

  .event-title {
    top: 12%;
    left: 20px;
    width: calc(100% - 40px);
  }

  .eyebrow {
    margin-bottom: 9px;
    font-size: 9px;
  }

  h1 {
    font-size: 39px;
    line-height: 0.94;
  }

  h1 span:last-child {
    margin-top: 7px;
    font-size: 20px;
  }

  .countdown {
    bottom: max(24px, calc(env(safe-area-inset-bottom) + 18px));
    width: calc(100% - 40px);
  }

  .countdown-heading {
    gap: 12px;
    margin-bottom: 10px;
    font-size: 8px;
  }

  .time-unit {
    display: block;
    padding: 14px 7px 12px;
    text-align: center;
  }

  .time-unit strong {
    display: block;
    font-size: 35px;
    line-height: 0.9;
  }

  .time-unit span {
    display: block;
    padding-top: 8px;
    padding-bottom: 0;
    font-size: 7px;
  }

  .progress-track {
    margin-top: 13px;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .rotate-gate {
    display: grid;
  }
}

@media (max-height: 650px) and (orientation: landscape) {
  .event-meta {
    top: 16px;
  }

  .event-title {
    top: 16%;
    width: 48%;
  }

  h1 {
    font-size: 38px;
  }

  h1 span:last-child {
    font-size: 19px;
  }

  .countdown {
    right: 5%;
    bottom: 24px;
    left: auto;
    width: 52%;
    transform: none;
  }

  .time-unit {
    padding: 11px 8px 10px;
  }

  .time-unit strong {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .space-background,
  .status-pulse,
  .rotate-symbol,
  body.is-met .meeting-flash {
    animation: none;
  }
}
