:root {
  color-scheme: dark;
  --night: #14110f;
  --night-deep: #090807;
  --ash: #201b18;
  --bone: #efe2c2;
  --bone-muted: rgba(239, 226, 194, 0.72);
  --gold: #d7b56d;
  --ember: #a2462f;
  --ember-bright: #d96642;
  --green: #8ca977;
  --rule: rgba(239, 226, 194, 0.18);
  --shadow: 0 30px 100px rgba(0, 0, 0, 0.45);
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Inter", system-ui, sans-serif;
  font-family: var(--body);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--night-deep);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(215, 181, 109, 0.18), transparent 38rem),
    linear-gradient(120deg, #080706, var(--night) 40%, #100d0c);
  color: var(--bone);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  width: min(100%, 62rem);
  margin: 0 auto;
  overflow: hidden;
}

.screen {
  position: relative;
  padding: max(2rem, env(safe-area-inset-top)) 1.1rem max(2rem, env(safe-area-inset-bottom));
}

.hero {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 1.4rem;
}

.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, black, transparent);
}

.masthead,
.section-heading {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin-bottom: 0.45rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.masthead h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(4.6rem, 19vw, 10rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.78;
}

.latin {
  max-width: 34rem;
  margin-top: 1rem;
  color: var(--bone-muted);
  font-family: var(--display);
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-style: italic;
}

.empty-state,
.countdown-card,
.profile-form {
  position: relative;
  z-index: 1;
  border: 1px solid var(--rule);
  border-radius: 1.5rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    rgba(20, 17, 15, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.empty-state {
  display: grid;
  gap: 1rem;
  justify-items: start;
  max-width: 38rem;
  padding: 1.2rem;
  color: var(--bone-muted);
}

.empty-state.is-error {
  border-color: rgba(217, 102, 66, 0.48);
  color: #ffd1c3;
}

.hourglass {
  width: 4rem;
  height: 5.2rem;
  border-top: 4px solid var(--gold);
  border-bottom: 4px solid var(--gold);
  clip-path: polygon(0 0, 100% 0, 56% 50%, 100% 100%, 0 100%, 44% 50%);
  background: linear-gradient(to bottom, transparent 42%, var(--ember) 42% 58%, transparent 58%);
  opacity: 0.9;
}

.countdown-card {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.orbital {
  position: relative;
  display: grid;
  min-height: 18rem;
  place-items: center;
}

.orbital-ring {
  position: absolute;
  width: min(78vw, 23rem);
  aspect-ratio: 1;
  border: 1px solid rgba(215, 181, 109, 0.32);
  border-radius: 50%;
  box-shadow:
    inset 0 0 60px rgba(215, 181, 109, 0.08),
    0 0 80px rgba(162, 70, 47, 0.16);
}

.orbital-ring::before,
.orbital-ring::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(239, 226, 194, 0.16);
  border-radius: 50%;
}

.orbital-ring::before {
  inset: 12%;
}

.orbital-ring::after {
  inset: 24%;
}

.orbital-core {
  position: relative;
  display: grid;
  width: min(55vw, 15rem);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(162, 70, 47, 0.32), rgba(20, 17, 15, 0.92) 64%);
  text-align: center;
}

.orbital-core span {
  display: block;
  font-family: var(--display);
  font-size: clamp(3.4rem, 14vw, 6.4rem);
  line-height: 0.82;
}

.orbital-core small,
.countdown-grid small,
.model-panel small,
.contributors small,
.metric-label {
  color: var(--bone-muted);
  font-size: 0.72rem;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.countdown-grid div,
.model-panel > div {
  border: 1px solid var(--rule);
  border-radius: 1rem;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.035);
}

.countdown-grid span {
  display: block;
  overflow: hidden;
  font-size: clamp(1.55rem, 8vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prediction,
.disclaimer,
.privacy-note {
  color: var(--bone-muted);
  line-height: 1.65;
}

.prediction strong {
  color: var(--bone);
}

.life-strip {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 0.22rem;
  padding: 0.2rem 0;
}

.life-cell {
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(239, 226, 194, 0.14);
}

.life-cell.is-lived {
  background: rgba(239, 226, 194, 0.72);
}

.life-cell.is-now {
  outline: 2px solid var(--ember-bright);
  outline-offset: 2px;
}

.life-cell.is-expected {
  background: var(--gold);
}

.life-cell.is-uncertain {
  background: rgba(215, 181, 109, 0.18);
}

.model-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.model-panel strong {
  display: block;
  margin: 0.22rem 0;
  font-size: 1.1rem;
}

.is-protective strong,
.contributors .protective strong {
  color: var(--green);
}

.is-risk strong,
.contributors .risk strong {
  color: var(--ember-bright);
}

.contributors h3 {
  margin-bottom: 0.7rem;
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 400;
}

.contributors ul {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contributors li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.55rem;
}

.contributors small {
  grid-column: 1 / -1;
}

.form-screen {
  padding-top: 1rem;
}

.section-heading h2 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.profile-form {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.field-pair {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
}

label span {
  color: var(--bone-muted);
  font-size: 0.76rem;
  font-weight: 650;
}

input,
select {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 0.8rem;
  background: rgba(9, 8, 7, 0.72);
  color: var(--bone);
  padding: 0.8rem;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.25rem;
}

button {
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bone);
  color: var(--night);
  font-weight: 800;
  padding: 0.72rem 1rem;
}

button[data-action] {
  background: transparent;
  color: var(--bone);
}

.privacy-note,
.disclaimer {
  margin-bottom: 0;
  font-size: 0.78rem;
}

@media (min-width: 720px) {
  .screen {
    padding-inline: 2rem;
  }

  .countdown-card {
    grid-template-columns: minmax(19rem, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
  }

  .orbital {
    grid-row: span 5;
  }

  .model-panel,
  .field-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .life-strip {
    grid-template-columns: repeat(45, 1fr);
  }
}
