:root {
  --bg: #0b0d0f;
  --surface: #121518;
  --surface-soft: rgba(18, 21, 24, 0.84);
  --text: #f5f3ed;
  --muted: #959b9d;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #ff5c35;
  --green: #66d28b;
  --green-dark: #153d28;
  --red: #f0525c;
  --red-dark: #4d171b;
  --yellow: #f2c14e;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
}

button,
a {
  color: inherit;
  font: inherit;
}

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

.background,
.background__video,
.background__collage,
.background__fallback,
.background__veil,
.background__grain {
  position: fixed;
  inset: 0;
}

.background {
  z-index: -2;
  overflow: hidden;
  background: var(--bg);
}

.background__video,
.background__collage {
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 900ms ease;
}

.background__collage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 2px;
  overflow: hidden;
  transform: none;
}

.collage__cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background-color: #090b0d;
  perspective: 1100px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.collage__cell:nth-child(n + 4) {
  display: none;
}

.collage__image {
  position: absolute;
  inset: 0;
  display: block;
  background-image: var(--collage-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transform: rotateY(180deg) scale(1.02);
  transform-origin: center;
  backface-visibility: hidden;
  transition:
    transform 900ms cubic-bezier(0.55, 0.08, 0.2, 1),
    opacity 80ms linear 410ms;
}

.collage__image.is-active {
  opacity: 1;
  transform: rotateY(0) scale(1.02);
  transition:
    transform 900ms cubic-bezier(0.55, 0.08, 0.2, 1),
    opacity 80ms linear;
}

.background__video.is-ready,
.background__collage.is-ready {
  opacity: 1;
}

.background__video.is-ready {
  animation: background-breathe 18s ease-in-out infinite alternate;
}

.background__collage {
  transition: opacity 900ms ease;
}

.background__fallback {
  z-index: 0;
  background:
    linear-gradient(135deg, rgba(255, 92, 53, 0.24), transparent 42%),
    linear-gradient(320deg, rgba(102, 210, 139, 0.16), transparent 46%),
    #11161b;
}

.background__veil {
  z-index: 2;
  background: rgba(4, 5, 6, 0.58);
}

.background__grain {
  z-index: 3;
  opacity: 0.055;
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 2px,
    rgba(255, 255, 255, 0.18) 3px
  );
  background-size: 100% 4px;
  pointer-events: none;
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(18, 21, 24, 0.94);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hero {
  position: relative;
  width: min(1440px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 28px clamp(20px, 5vw, 72px) 32px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.hero__top > .eyebrow {
  color: var(--text);
  font-size: clamp(1rem, 2vw, 1.55rem);
  font-weight: 900;
}

.eyebrow,
.hero__pretitle,
.hero__title,
.progress-copy,
.stat__label,
.stat__caption {
  letter-spacing: 0;
}

.eyebrow,
.hero__pretitle,
.stat__label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px;
}

.sync-pill__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 5px rgba(242, 193, 78, 0.1);
}

.sync-pill.is-online .sync-pill__dot {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(102, 210, 139, 0.1);
}

.sync-pill.is-offline .sync-pill__dot {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(240, 82, 92, 0.1);
}

.hero__content {
  width: min(960px, 100%);
  margin: auto;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero__pretitle {
  margin: 0 0 18px;
  color: rgba(245, 243, 237, 0.68);
}

.hero__counter {
  min-height: clamp(140px, 21vw, 240px);
  display: grid;
  place-items: center;
}

.hero__counter strong {
  display: block;
  color: rgba(255, 92, 53, 0.8);
  font-family: Impact, "Arial Narrow", "Segoe UI", sans-serif;
  font-size: clamp(8rem, 18vw, 14rem);
  font-weight: 900;
  line-height: 0.78;
  letter-spacing: 0;
  text-shadow: 0 14px 52px rgba(255, 92, 53, 0.2);
  transition: color 260ms ease, transform 340ms cubic-bezier(0.2, 0.9, 0.2, 1.35);
}

.hero__counter strong.is-bumping {
  transform: scale(1.06);
}

.hero__counter strong.is-complete {
  color: var(--green);
  text-shadow: 0 18px 70px rgba(102, 210, 139, 0.22);
}

.hero__title {
  max-width: 650px;
  margin: 18px 0 0;
  font-family: "Arial Narrow", "Segoe UI", Arial, sans-serif;
  font-size: clamp(1.1rem, 2.7vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.hero__wish {
  margin: 16px 0 0;
  color: rgba(245, 243, 237, 0.62);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
}

.scroll-cue {
  width: max-content;
  display: grid;
  gap: 10px;
  justify-items: start;
  color: rgba(245, 243, 237, 0.54);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.scroll-cue__line {
  position: relative;
  width: 80px;
  height: 1px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}

.scroll-cue__line::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--accent);
  animation: cue-line 2s ease-in-out infinite;
}

.progress-section {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: rgba(11, 13, 15, 0.93);
  backdrop-filter: blur(28px);
}

.section-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(72px, 10vw, 130px) 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.section-heading h2 {
  min-width: 3.7em;
  margin: 0;
  font-family: "Arial Narrow", "Segoe UI", Arial, sans-serif;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-align: center;
}

.month-switcher {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 18px);
}

.month-nav {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.month-nav:hover:not(:disabled) {
  color: var(--accent);
  border-color: rgba(255, 92, 53, 0.5);
  background: rgba(255, 92, 53, 0.08);
  transform: translateY(-2px);
}

.month-nav:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-copy {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 1.28rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.icon-button:hover {
  color: var(--accent);
  border-color: rgba(255, 92, 53, 0.5);
  background: rgba(255, 92, 53, 0.08);
  transform: rotate(-20deg);
}

.progress-track {
  height: 3px;
  margin: 34px 0 52px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 480ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progress-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.calendar {
  min-width: 0;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-grid.is-switching {
  animation: month-in 260ms ease both;
}

.weekday-row {
  margin-bottom: 8px;
  color: #737a7d;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.day,
.day-spacer {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 8px;
}

.day {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  overflow: hidden;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.day::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.day:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-3px);
}

.day:hover:not(:disabled)::before {
  transform: scaleX(1);
}

.day:active:not(:disabled) {
  transform: scale(0.96);
}

.day__number {
  position: relative;
  z-index: 1;
  font-family: "Arial Narrow", "Segoe UI", Arial, sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.55rem);
  font-weight: 850;
}

.day__status {
  position: absolute;
  right: 7px;
  bottom: 5px;
  z-index: 1;
  font-size: 0.68rem;
  font-weight: 900;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.day.is-visited {
  color: var(--green-dark);
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 14px 34px rgba(102, 210, 139, 0.13);
  animation: day-pop 320ms cubic-bezier(0.2, 0.9, 0.2, 1.25);
}

.day.is-missed {
  color: #fff2ef;
  border-color: var(--red);
  background: var(--red-dark);
}

.day.is-visited .day__status,
.day.is-missed .day__status {
  opacity: 1;
  transform: translateY(0);
}

.day.is-visited::before,
.day.is-missed::before {
  display: none;
}

.day.is-disabled:not(.is-missed) {
  color: #555b5e;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.015);
}

.day.is-disabled {
  cursor: not-allowed;
}

.calendar-legend {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  color: var(--muted);
  font-size: 0.74rem;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
}

.legend-dot--done {
  border-color: var(--green);
  background: var(--green);
}

.legend-dot--missed {
  border-color: var(--red);
  background: var(--red);
}

.stats {
  display: grid;
  gap: 12px;
}

.stat {
  min-height: 190px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.stat--record {
  min-height: 230px;
  background: var(--surface);
}

.countdown {
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: start;
  justify-content: space-between;
  gap: 6px;
}

.countdown div {
  min-width: 0;
  text-align: center;
}

.countdown strong,
.record-value {
  display: block;
  font-family: "Arial Narrow", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.record-status {
  display: block;
  min-height: 1.2em;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.countdown strong {
  font-size: clamp(1.45rem, 3.2vw, 2.35rem);
  line-height: 1;
}

.countdown span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.countdown i {
  color: var(--accent);
  font-size: 1.3rem;
  font-style: normal;
  line-height: 1;
  opacity: 0.5;
}

.stat__caption {
  color: var(--muted);
  font-size: 0.72rem;
}

.record-value {
  margin-top: 18px;
  color: var(--accent);
  font-size: clamp(4rem, 8vw, 6.8rem);
  font-weight: 900;
  line-height: 0.9;
}

.stat a {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: color 180ms ease, border-color 180ms ease;
}

.stat a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.closing {
  position: relative;
  z-index: 1;
  min-height: 48svh;
  display: grid;
  place-items: center;
  padding: 72px 24px;
  border-top: 1px solid var(--line);
  background: rgba(7, 8, 9, 0.85);
  text-align: center;
}

.closing__content p {
  max-width: 820px;
  margin: 20px 0 0;
  font-family: "Arial Narrow", "Segoe UI", Arial, sans-serif;
  font-size: clamp(2.5rem, 8vw, 6.8rem);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro {
  opacity: 0;
  animation: intro-rise 800ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.intro--1 {
  animation-delay: 80ms;
}

.intro--2 {
  animation-delay: 180ms;
}

.intro--3 {
  animation-delay: 280ms;
}

.intro--4 {
  animation-delay: 400ms;
}

.intro--5 {
  animation-delay: 500ms;
}

.intro--6 {
  animation-delay: 620ms;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

.icon-button:focus-visible,
.day:focus-visible,
.stat a:focus-visible,
.scroll-cue:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

@keyframes intro-rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cue-line {
  0% {
    transform: translateX(-110%);
  }
  60%,
  100% {
    transform: translateX(250%);
  }
}

@keyframes day-pop {
  0% {
    transform: scale(0.92);
  }
  70% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes background-breathe {
  from {
    transform: scale(1.02);
  }
  to {
    transform: scale(1.08);
  }
}

@keyframes month-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 901px) and (min-aspect-ratio: 2/1) {
  .background__collage {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .collage__cell:nth-child(4) {
    display: block;
  }
}

@media (max-width: 900px) {
  .background__collage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .collage__cell:nth-child(4) {
    display: block;
  }

  .collage__cell:nth-child(n + 5) {
    display: none;
  }

  .progress-layout {
    grid-template-columns: 1fr;
  }

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

  .stat {
    min-height: 210px;
  }
}

@media (max-width: 620px) {
  .background__collage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }

  .collage__cell:nth-child(n) {
    display: block;
  }

  .hero {
    min-height: 100svh;
    padding: 16px 14px 20px;
  }

  .hero__content {
    padding: 30px 0 24px;
  }

  .hero__pretitle {
    margin: 0 0 10px;
    font-size: 0.68rem;
  }

  .hero__counter {
    min-height: 86px;
  }

  .hero__counter strong {
    font-size: 6.5rem;
  }

  .hero__title {
    max-width: 340px;
    font-size: 1rem;
    line-height: 1.2;
    text-align: center;
  }

  .hero__wish {
    max-width: 330px;
    margin-top: 9px;
    font-size: 0.82rem;
    line-height: 1.35;
    text-align: center;
  }

  .section-shell {
    width: calc(100% - 24px);
    padding: 64px 0;
  }

  .section-heading {
    display: block;
  }

  .section-heading h2 {
    min-width: 3.6em;
    font-size: 2.2rem;
  }

  .month-switcher {
    width: max-content;
    max-width: 100%;
    margin-top: 10px;
    gap: 8px;
  }

  .month-nav {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .section-actions {
    width: 100%;
    margin-top: 18px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .progress-copy {
    max-width: none;
    font-size: 0.78rem;
    text-align: left;
  }

  .progress-track {
    margin: 20px 0 34px;
  }

  .weekday-row,
  .calendar-grid {
    gap: 4px;
  }

  .day__number {
    font-size: 0.94rem;
  }

  .day__status {
    right: 4px;
    bottom: 3px;
    font-size: 0.58rem;
  }

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

  .stat {
    min-height: 170px;
    padding: 20px;
  }

  .countdown {
    margin: 20px 0;
    justify-content: stretch;
  }

  .record-value {
    font-size: 3.5rem;
  }

  .calendar-legend {
    gap: 10px 14px;
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .intro,
  .reveal {
    opacity: 1;
    transform: none;
  }
}
