/* Meditate together. Black and bright gold, phone-first. */

:root {
  --bg: #000;
  --gold: #f6d37a;
  --gold-bright: #ffe7a8;
  --gold-deep: #e2b04a;
  --ink: #1a1204;
  --cream: #f7f2e8;
  --cream-soft: #efe6d6;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body: Outfit, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
}

body {
  font-family: var(--body);
  font-weight: 300;
  font-size: 1.1875rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% -10%, rgba(246, 211, 122, 0.16), rgba(0, 0, 0, 0) 58%);
}

.shell {
  position: relative;
  width: min(100%, 28rem);
  margin: 0 auto;
  min-height: 100svh;
  padding: 0.35rem 1.15rem calc(2rem + env(safe-area-inset-bottom, 0px));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: calc(64px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  margin-bottom: 1.15rem;
  border-bottom: 1px solid rgba(246, 211, 122, 0.32);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  line-height: 0;
}

.brand-logo {
  display: block;
  height: 44px;
  width: auto;
}

.back-line {
  margin: 0.1rem 0 0;
  text-align: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  min-width: 44px;
  padding: 0.15rem 0.85rem;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--gold);
  font-family: var(--body);
  font-size: 1.05rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--gold-bright);
}

.name-label {
  display: block;
  margin: 0.55rem 0 0.35rem;
  color: var(--gold);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.3;
}

.name-field {
  width: 100%;
  min-height: 52px;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(246, 211, 122, 0.78);
  border-radius: 16px;
  background: transparent;
  color: var(--cream);
  font-family: var(--body);
  font-size: 1.175rem;
  font-weight: 400;
  line-height: 1.2;
}

.name-hint {
  margin: 0.35rem 0 0.15rem;
  color: var(--cream-soft);
  font-size: 1.05rem;
  line-height: 1.4;
}

h1 {
  margin: 0 0 0.7rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 2.65rem;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-wrap: balance;
  color: var(--cream);
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--gold);
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

.lede {
  margin: 0 0 0.85rem;
  color: var(--cream-soft);
  font-size: 1.2rem;
  line-height: 1.45;
}

.note {
  margin: 1rem 0 0;
  color: var(--cream-soft);
  font-size: 1.05rem;
  line-height: 1.4;
}

.lengths {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1.15rem 0 1rem;
}

.lengths[hidden] { display: none !important; }

.chosen {
  margin: 1.15rem 0 1.15rem;
  padding: 1.05rem 1.15rem 1.15rem;
  border: 1px solid rgba(246, 211, 122, 0.78);
  border-radius: 18px;
  background: rgba(246, 211, 122, 0.06);
}

.chosen[hidden] { display: none !important; }

.chosen-kicker {
  margin: 0 0 0.4rem;
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

.chosen-title {
  margin: 0;
  font-family: var(--display);
  font-size: 2.15rem;
  font-weight: 500;
  line-height: 1.12;
  color: var(--cream);
}

.chosen-length {
  margin: 0.4rem 0 0;
  color: var(--gold-bright);
  font-size: 1.2rem;
  letter-spacing: 0.06em;
}

.tap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 44px;
  cursor: pointer;
}

.choice {
  width: 100%;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid rgba(246, 211, 122, 0.78);
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  font-family: var(--body);
  font-size: 1.175rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
}

.choice-mark { display: none; }

.choice[aria-checked="true"] {
  border-color: transparent;
  background: linear-gradient(180deg, var(--gold-bright) 0%, #f0c85a 48%, var(--gold-deep) 100%);
  color: var(--ink);
}

.choice[aria-checked="true"] .choice-mark {
  display: inline;
  font-size: 1rem;
}

.btn {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  font-family: var(--body);
  font-size: 1.175rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}

.btn-gold {
  border: 0;
  background: linear-gradient(180deg, var(--gold-bright) 0%, #f0c85a 46%, var(--gold-deep) 100%);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-line {
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
}

.invite {
  margin: 0.3rem 0 0.9rem;
  padding: 1rem 1rem;
  border: 1px solid rgba(246, 211, 122, 0.8);
  border-radius: 16px;
  background: rgba(246, 211, 122, 0.07);
  color: var(--gold-bright);
  font-size: 1.15rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.status {
  min-height: 1.7rem;
  margin: 0.45rem 0 0.2rem;
  color: var(--gold);
  font-size: 1.15rem;
  line-height: 1.4;
}

.people {
  list-style: none;
  margin: 0.75rem 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.person {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 60px;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(246, 211, 122, 0.45);
  border-radius: 16px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--display);
  font-size: 1.45rem;
  line-height: 1;
}

.person-name {
  flex: 1;
  font-size: 1.25rem;
  color: var(--cream);
}

.person-role {
  color: var(--gold);
  font-size: 1.05rem;
}

.step-center {
  text-align: center;
}

.step-center .lede,
.step-center .with-line,
.step-center .eyebrow {
  margin-left: auto;
  margin-right: auto;
}

.count-num {
  margin: 0.4rem 0 0.6rem;
  color: var(--gold);
  font-family: var(--display);
  font-size: 7.5rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 0.85;
}

.clock {
  margin: 0.2rem 0 0.35rem;
  color: var(--cream);
  font-family: var(--display);
  font-size: 5.15rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  line-height: 1;
}

.ring {
  width: 132px;
  height: 132px;
  margin: 0.35rem auto 0.85rem;
  border: 1px solid rgba(246, 211, 122, 0.9);
  border-radius: 50%;
  box-shadow:
    0 0 0 12px rgba(246, 211, 122, 0.07),
    inset 0 0 0 1px rgba(255, 231, 168, 0.4);
}

.with-line {
  margin: 0 0 1rem;
  color: var(--cream-soft);
  font-size: 1.2rem;
  line-height: 1.4;
}

.privacy {
  margin: 0.1rem 0 0.15rem;
}

.privacy-line {
  margin: 0;
  color: var(--cream-soft);
  font-size: 1.05rem;
  line-height: 1.4;
}

.how {
  width: auto;
  margin: 0 0 0.1rem;
  padding: 0.35rem 0.2rem;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-family: var(--body);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: underline;
  text-decoration-color: rgba(246, 211, 122, 0.55);
  text-underline-offset: 0.22em;
}

.how.tap {
  min-height: 44px;
}

.how-panel {
  margin: 0 0 0.45rem;
  color: var(--cream);
  font-size: 1.05rem;
  line-height: 1.45;
}

/* The host invitation fits one phone screen. Copy and Share stay equal.
   Enter the waiting room is the gold button directly under them.
   A circle of light rests in the quiet space below. */
body:has(#step-invite:not([hidden])) .top {
  min-height: 52px;
  margin-bottom: 0.7rem;
}

body:has(#step-invite:not([hidden])) .shell {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding-bottom: max(0.7rem, env(safe-area-inset-bottom, 0px));
}

body:has(#step-invite:not([hidden])) main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#step-invite:not([hidden]) {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#step-invite .eyebrow {
  margin-bottom: 0.32rem;
}

#step-invite h1 {
  margin-bottom: 0.42rem;
  font-size: 2.28rem;
  line-height: 1.08;
}

#step-invite .lede {
  margin-bottom: 0.42rem;
  font-size: 1.16rem;
  line-height: 1.32;
}

#step-invite .invite {
  margin: 0.32rem 0 0.62rem;
  padding: 0.65rem 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

#step-invite .invite-actions {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
}

#step-invite .invite-actions .btn {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  margin-top: 0;
  min-height: 48px;
  padding: 0.55rem 0.6rem;
}

#step-invite .status {
  min-height: 0;
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

#step-invite .status:empty {
  display: none;
}

#step-invite #enter-room {
  margin-top: 0.7rem;
  min-height: 48px;
}

#step-invite .invite-hint {
  margin: 0.42rem 0 0;
  color: var(--gold);
  font-size: 1.08rem;
  line-height: 1.25;
  text-align: center;
}

#step-invite .circle-of-light {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 0;
  margin: 0.2rem 0 0;
}

#step-invite .light-stage {
  position: relative;
  width: min(62vw, 14.75rem);
  max-width: 100%;
  aspect-ratio: 1;
  flex: 0 1 auto;
  min-height: 0;
  max-height: 100%;
}

@media (min-height: 800px) {
  #step-invite .light-stage {
    width: min(68vw, 17.5rem);
  }
}

#step-invite .light-ring {
  display: block;
  width: 100%;
  height: 100%;
}

#step-invite .halo {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(246, 211, 122, 0.35));
}

#step-invite .flame {
  opacity: 0.42;
}

#step-invite .flame.is-lit {
  opacity: 1;
}

#step-invite .flame-body {
  fill: #241e12;
  stroke: rgba(246, 211, 122, 0.42);
  stroke-width: 0.65;
}

#step-invite .flame.is-lit .flame-body {
  fill: url("#flame-lit");
  stroke: #ffe7a8;
  stroke-width: 0.4;
}

#step-invite .wick {
  fill: rgba(246, 211, 122, 0.18);
}

#step-invite .flame.is-lit .wick {
  fill: #fff8e4;
}

#step-invite .flame-glow {
  fill: #f6d37a;
  opacity: 0;
}

#step-invite .flame.is-lit .flame-glow {
  opacity: 0.62;
}

#step-invite .light-you {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  transform: translate(-50%, -52%);
  color: var(--cream);
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
}

#step-invite .light-caption {
  margin: 0;
  color: var(--cream);
  font-size: 0.92rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  line-height: 1.35;
  text-align: center;
}

#step-waiting h1 {
  font-size: 2.35rem;
  margin-bottom: 0.4rem;
}

#step-waiting .lede {
  margin-bottom: 0.4rem;
}

#step-waiting .people {
  margin: 0.45rem 0 0.65rem;
  gap: 0.4rem;
}

#step-waiting .person {
  min-height: 52px;
  padding: 0.2rem 0.7rem;
}

#step-closed h1 {
  font-style: italic;
  font-size: 2.55rem;
}

#step-countdown,
#step-meditation,
#step-closed {
  padding-top: 0.85rem;
}

:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 3px;
}

@media (hover: hover) {
  .btn-gold:hover { filter: brightness(1.06); }
  .btn-line:hover,
  .choice:hover { background-color: rgba(246, 211, 122, 0.1); }
  .choice[aria-checked="true"]:hover { background-color: transparent; }
}

.welcome {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1.35rem;
  background: rgba(0, 0, 0, 0.72);
}

.welcome-card {
  width: min(100%, 22rem);
  margin: 0;
  padding: 1.55rem 1.3rem 1.3rem;
  border: 1px solid rgba(246, 211, 122, 0.85);
  border-radius: 18px;
  background: #000;
  text-align: center;
  outline: none;
}

.welcome-card h2 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 2.45rem;
  line-height: 1.08;
  color: var(--cream);
}

.welcome-card p {
  margin: 0 0 1.2rem;
  color: var(--cream-soft);
  font-size: 1.2rem;
  line-height: 1.45;
}

@media (prefers-reduced-motion: no-preference) {
  .ring { animation: together-breath 7.5s ease-in-out infinite; }
  .person.is-new { animation: together-arrive 0.45s ease; }
  .welcome { animation: welcome-fade 0.48s ease; }
  #step-closed:not([hidden]) { animation: together-fade 0.6s ease; }
  #step-invite .halo,
  #step-invite .flame.is-lit .flame-glow {
    animation: light-breath 6s ease-in-out infinite;
  }
}

@keyframes together-breath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

@keyframes together-arrive {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes welcome-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes together-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes light-breath {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .ring,
  .person.is-new,
  .welcome,
  #step-closed {
    animation: none !important;
    opacity: 1;
  }

  .circle-of-light .halo,
  .circle-of-light .flame.is-lit {
    animation: none !important;
    opacity: 1;
  }
}

.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;
}

[hidden] { display: none !important; }

/* Programmatic heading focus (tabindex -1) does not draw the gold ring.
   A keyboard user who reaches a control still gets :focus-visible. */
.step h1:focus {
  outline: none;
}
.step h1.is-quiet-focus:focus,
.step h1.is-quiet-focus:focus-visible {
  outline: none;
}
.step h1:focus-visible:not(.is-quiet-focus) {
  outline: 3px solid var(--gold-bright);
  outline-offset: 3px;
}
