:root {
  color-scheme: dark;
  --bg: #07080d;
  --ink: #f7f2e9;
  --muted: #b9b1a5;
  --line: rgba(255, 255, 255, 0.16);
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --gold: #f7c96d;
  --coral: #ff7a6b;
  --cyan: #6ce4ff;
  --green: #7be2a7;
  --violet: #b99cff;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 122, 107, 0.22), transparent 32rem),
    radial-gradient(circle at 82% 22%, rgba(108, 228, 255, 0.18), transparent 30rem),
    linear-gradient(135deg, #07080d 0%, #11101a 42%, #0b1719 100%);
  overflow-x: hidden;
}

body.alt-mood {
  --gold: #90f3d0;
  --coral: #fd9f73;
  --cyan: #a7c7ff;
  --green: #f5d06f;
  --violet: #ff9bc8;
}

body.celebration-day {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 122, 107, 0.28), transparent 32rem),
    radial-gradient(circle at 82% 22%, rgba(108, 228, 255, 0.25), transparent 30rem),
    radial-gradient(circle at 52% 6%, rgba(247, 201, 109, 0.2), transparent 24rem),
    linear-gradient(135deg, #07080d 0%, #11101a 42%, #0b1719 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 13, 0.72);
  backdrop-filter: blur(18px);
}

.brand,
nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand {
  font-weight: 800;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 32px rgba(247, 201, 109, 0.24);
  flex: 0 0 auto;
  overflow: hidden;
}

.brand-mark img {
  width: 2.9rem;
  height: 2.9rem;
  object-fit: contain;
}

nav a {
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 180ms ease;
}

nav a:hover {
  color: var(--ink);
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 4.7rem);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(20rem, 0.92fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 5rem);
  padding: clamp(3rem, 8vw, 6rem) 0 3rem;
}

.eyebrow,
.small-label {
  margin: 0;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 800;
}

h1,
h2 {
  font-family: "Noto Serif SC", serif;
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 11ch;
  margin-top: 0.7rem;
  font-size: clamp(3.2rem, 9vw, 7.8rem);
  line-height: 0.92;
}

.hero-text {
  max-width: 42rem;
  margin: 1.35rem 0 0;
  color: rgba(247, 242, 233, 0.78);
  font-size: clamp(1.02rem, 2vw, 1.28rem);
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.primary-action,
.ghost-action {
  min-height: 3rem;
  padding: 0 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-action {
  display: inline-grid;
  place-items: center;
  color: #101014;
  background: linear-gradient(135deg, var(--gold), var(--coral));
}

.ghost-action {
  background: rgba(255, 255, 255, 0.07);
}

.hero-orbit {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 34rem;
  perspective: 900px;
}

.age-card,
.birthday-card,
.story-stage {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(12, 14, 22, 0.76));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.age-card {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: min(82vw, 24rem);
  aspect-ratio: 1;
  border-radius: 50%;
  transform-style: preserve-3d;
}

.age-card-icon {
  position: absolute;
  top: 12%;
  right: 13%;
  width: clamp(3.4rem, 9vw, 5.8rem);
  height: clamp(3.4rem, 9vw, 5.8rem);
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 0 22px rgba(247, 201, 109, 0.34));
}

.age-card strong {
  font-size: clamp(7rem, 22vw, 13rem);
  line-height: 0.82;
  color: transparent;
  background: linear-gradient(145deg, var(--ink), var(--gold), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
}

.age-card span:last-child {
  color: var(--muted);
  font-weight: 800;
}

.orbit-ring {
  position: absolute;
  width: 92%;
  max-width: 30rem;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  animation: spin 18s linear infinite;
}

.ring-one {
  transform: rotateX(66deg) rotateZ(15deg);
}

.ring-two {
  width: 72%;
  animation-duration: 12s;
  animation-direction: reverse;
  transform: rotateX(74deg) rotateZ(-20deg);
  border-color: rgba(108, 228, 255, 0.3);
}

.floating-note {
  position: absolute;
  padding: 0.56rem 0.82rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 8, 13, 0.58);
  color: var(--ink);
  font-weight: 800;
  animation: drift 5s ease-in-out infinite;
}

.note-one {
  top: 18%;
  left: 8%;
}

.note-two {
  right: 7%;
  top: 31%;
  animation-delay: -1.8s;
}

.note-three {
  bottom: 18%;
  left: 24%;
  animation-delay: -3s;
}

.countdown-panel,
.life-clock-section,
.studio-strip,
.featured-story,
.message-section,
.source-section {
  margin: 3rem 0;
}

.life-clock-section {
  padding: 3rem 0 1rem;
}

.life-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
}

.life-grid article {
  min-width: 0;
  min-height: 10rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(12, 14, 22, 0.76));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

.life-grid span,
.life-grid small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.life-grid strong {
  display: block;
  margin: 0.5rem 0 0.3rem;
  color: transparent;
  background: linear-gradient(135deg, var(--gold), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.countdown-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  padding: clamp(1.1rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 14, 22, 0.82);
  backdrop-filter: blur(16px);
}

.countdown-panel h2 {
  margin-top: 0.4rem;
  font-size: clamp(1.35rem, 3vw, 2.3rem);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(4.2rem, 1fr));
  gap: 0.7rem;
  min-width: min(100%, 31rem);
}

.countdown div {
  display: grid;
  place-items: center;
  min-height: 5.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.countdown strong {
  color: var(--cyan);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.countdown span {
  color: var(--muted);
  font-size: 0.8rem;
}

.studio-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.studio-strip article,
.timeline-card,
.source-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 14, 22, 0.82);
}

.studio-strip article {
  min-height: 13rem;
  padding: 1.2rem;
  transition: transform 200ms ease, background 200ms ease;
}

.studio-strip article:hover {
  transform: translateY(-0.35rem);
  background: var(--panel-strong);
}

.studio-strip span {
  color: var(--coral);
  font-weight: 900;
}

.studio-strip h2,
.source-section h2 {
  margin-top: 1rem;
  font-size: 1.35rem;
}

.studio-strip p,
.section-heading p,
.story-stage p,
.birthday-card p,
.source-section li,
.timeline-card p {
  color: var(--muted);
  line-height: 1.8;
}

.archive-section {
  padding: 4rem 0 2rem;
}

.section-heading {
  display: grid;
  gap: 0.8rem;
  max-width: 46rem;
  margin-bottom: 1.4rem;
}

.section-heading h2 {
  font-size: clamp(2.2rem, 5vw, 4.5rem);
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-card {
  position: relative;
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-height: 10rem;
  padding: 1.1rem;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.timeline-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  transform: translateX(-100%);
  transition: transform 600ms ease;
}

.timeline-card:hover {
  border-color: rgba(247, 201, 109, 0.52);
  background: rgba(255, 255, 255, 0.11);
  transform: translateY(-0.25rem) rotateX(1.5deg);
}

.timeline-card:hover::before {
  transform: translateX(100%);
}

.date-chip {
  display: grid;
  place-items: center;
  min-height: 7rem;
  border-radius: 8px;
  color: #111;
  background: linear-gradient(145deg, var(--gold), var(--cyan));
  font-weight: 900;
  text-align: center;
}

.date-chip span {
  display: block;
  color: rgba(17, 17, 17, 0.72);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.timeline-card h3 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.25rem, 3vw, 2rem);
}

.timeline-card p {
  margin: 0.6rem 0 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.tag-row span {
  padding: 0.32rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
}

.read-link {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  min-width: 6.4rem;
  min-height: 2.7rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.featured-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.74fr);
  gap: 1rem;
  align-items: stretch;
}

.story-stage {
  position: relative;
  min-height: 28rem;
  padding: clamp(1.2rem, 4vw, 2.4rem);
  border-radius: 8px;
  overflow: hidden;
}

.scene-grid {
  position: absolute;
  inset: 0;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 62% 45%, #000, transparent 72%);
}

.story-label {
  position: relative;
  display: inline-flex;
  padding: 0.4rem 0.66rem;
  border-radius: 999px;
  color: #111;
  background: var(--green);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.story-stage h2 {
  position: relative;
  max-width: 9ch;
  margin-top: 4rem;
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  line-height: 1;
}

.story-stage p {
  position: relative;
  max-width: 42rem;
}

.quote-stack {
  display: grid;
  gap: 0.8rem;
}

.quote-card {
  min-height: 8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(12, 14, 22, 0.78);
  text-align: left;
  font: inherit;
  line-height: 1.7;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.quote-card span {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
}

.quote-card.active,
.quote-card:hover {
  transform: translateX(-0.3rem);
  background: rgba(255, 255, 255, 0.14);
}

.message-section {
  display: grid;
  place-items: center;
  min-height: 34rem;
}

.birthday-card {
  width: min(100%, 46rem);
  padding: clamp(1.4rem, 5vw, 3rem);
  border-radius: 8px;
}

.birthday-card h2 {
  margin-top: 0.6rem;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
}

.signature {
  margin-top: 2rem;
  color: var(--cyan);
  font-weight: 900;
}

.source-section {
  padding: 1.2rem;
}

.source-section ul {
  display: grid;
  gap: 0.55rem;
  padding-left: 1.2rem;
}

.source-section a {
  color: var(--cyan);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

@keyframes spin {
  to {
    rotate: 360deg;
  }
}

@keyframes drift {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -0.8rem;
  }
}

@media (max-width: 820px) {
  .site-header {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero,
  .featured-story {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    max-width: 9ch;
  }

  .hero-orbit {
    min-height: 25rem;
  }

  .countdown-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .studio-strip {
    grid-template-columns: 1fr;
  }

  .life-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-card {
    grid-template-columns: 1fr;
  }

  .date-chip {
    width: 100%;
    min-height: 5.5rem;
  }

  .read-link {
    width: 100%;
  }
}

@media (max-width: 520px) {
  main,
  footer {
    width: min(100% - 1rem, 1180px);
  }

  nav a {
    font-size: 0.82rem;
  }

  .brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-actions {
    flex-direction: column;
  }

  .primary-action,
  .ghost-action {
    width: 100%;
  }

  .countdown {
    grid-template-columns: repeat(2, 1fr);
    min-width: 0;
  }

  .life-grid {
    grid-template-columns: 1fr;
  }

  .life-grid article {
    min-height: 8rem;
  }

  .floating-note {
    font-size: 0.84rem;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
