:root {
  color-scheme: dark;
  --bg: #030303;
  --surface: rgba(10, 10, 11, 0.86);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f5f0;
  --muted: #a6a6a0;
  --dim: #6d6d68;
  --signal: #e9ff70;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(115deg, rgba(233, 255, 112, 0.08), transparent 28rem),
    linear-gradient(245deg, rgba(255, 255, 255, 0.06), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

button,
input {
  font: inherit;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 0 72px;
}

.hero {
  display: grid;
  justify-items: center;
  padding: 28px 0 clamp(34px, 6vw, 58px);
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 38px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 760;
}

.brand-mark {
  width: 17px;
  height: 17px;
  border: 2px solid var(--text);
  border-radius: 50%;
  box-shadow: inset 6px 0 0 var(--signal);
}

.kicker {
  margin: 0;
  color: var(--signal);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 860;
  letter-spacing: 0;
}

h1 {
  max-width: 980px;
  margin-top: 14px;
  font-size: clamp(58px, 11vw, 132px);
  line-height: 0.86;
}

h2 {
  font-size: clamp(34px, 6vw, 68px);
  line-height: 0.9;
}

.lede {
  max-width: 740px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.22;
}

.upload-panel,
.timeline-shell,
.summary-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 70%),
    var(--surface);
}

.upload-panel {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 4vw, 34px);
}

#upload-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
}

.upload-copy {
  display: grid;
  gap: 8px;
}

.upload-copy h2 {
  font-size: clamp(32px, 5vw, 58px);
}

.upload-controls {
  display: flex;
  min-width: min(420px, 100%);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  padding: 7px;
}

.file-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(233, 255, 112, 0.45);
  border-radius: 999px;
  background: rgba(233, 255, 112, 0.12);
  color: var(--signal);
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 840;
  white-space: nowrap;
}

.file-button input {
  display: none;
}

.file-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  min-height: 44px;
  width: fit-content;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 780;
  white-space: nowrap;
}

.button-light {
  border: 1px solid #eff2d6;
  background: #f5f7e9;
  color: #11120e;
}

.button-dark {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.status {
  color: var(--muted);
  min-height: 22px;
  margin: 0;
  font-weight: 680;
}

.results {
  display: grid;
  min-width: 0;
  gap: 16px;
  margin-top: 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  align-content: end;
  padding: 18px;
}

.summary-card span {
  color: var(--signal);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.summary-card strong {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 0.92;
}

.summary-card small {
  color: var(--muted);
  font-weight: 700;
}

.timeline-shell {
  min-width: 0;
  overflow: hidden;
  padding: clamp(18px, 4vw, 34px);
}

.timeline-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.timeline-track {
  position: relative;
  display: flex;
  gap: 18px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: scroll;
  overscroll-behavior-x: contain;
  padding: 46px max(18px, 3vw) 28px;
  scroll-padding-inline: max(18px, 3vw);
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--signal) transparent;
}

.timeline-track::-webkit-scrollbar {
  height: 12px;
}

.timeline-track::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.timeline-track::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--signal);
}

.timeline-track::after {
  display: block;
  flex: 0 0 max(18px, 3vw);
  content: "";
}

.timeline-track::before {
  position: absolute;
  top: 28px;
  left: 0;
  width: max(100%, var(--timeline-width, 100%));
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 255, 112, 0.72), transparent);
  content: "";
}

.moment-card {
  position: relative;
  display: grid;
  flex: 0 0 min(360px, calc(100vw - 92px));
  max-width: 360px;
  min-height: 330px;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 70%),
    rgba(3, 3, 3, 0.72);
  padding: 18px;
  scroll-snap-align: start;
  animation: momentIn 560ms ease both;
  animation-delay: calc(var(--i) * 90ms);
}

.moment-card::before {
  position: absolute;
  top: -25px;
  left: 22px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 22px rgba(233, 255, 112, 0.86);
  content: "";
}

.moment-type {
  width: fit-content;
  border-radius: 999px;
  background: rgba(233, 255, 112, 0.12);
  color: var(--signal);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.moment-card h3 {
  font-size: 28px;
  line-height: 0.95;
}

.moment-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.36;
}

.moment-card blockquote {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  border-left: 3px solid var(--signal);
  color: var(--text);
  padding-left: 12px;
  font-size: 18px;
  font-weight: 760;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
}

.moment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.moment-meta span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 760;
}

@keyframes momentIn {
  from {
    opacity: 0;
    transform: translateX(42px) scale(0.96);
  }
}

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

  #upload-form {
    grid-template-columns: 1fr;
  }

  .upload-controls {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .app {
    width: min(100% - 28px, 1180px);
  }

  h1 {
    font-size: clamp(46px, 16vw, 72px);
  }

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

  .timeline-heading {
    align-items: start;
    flex-direction: column;
  }

  .timeline-track {
    grid-auto-columns: minmax(260px, 84vw);
  }
}
