:root {
  --bg: #0a0a08;
  --bg-elevated: #131310;
  --bg-card: #1a1a16;
  --text: #e8e4d9;
  --text-dim: #8a8677;
  --text-muted: #5a5750;
  --accent: #c4f54a;
  --accent-dim: #8ab832;
  --negative: #ff6b5a;
  --positive: #4af5a2;
  --line: #2a2a24;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: crosshair;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

.ambient-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}

.glow-1 {
  top: -200px;
  right: -100px;
  background: var(--accent);
  animation: float-glow 20s ease-in-out infinite;
}

.glow-2 {
  bottom: -200px;
  left: -200px;
  background: var(--negative);
  animation: float-glow 25s ease-in-out infinite reverse;
}

@keyframes float-glow {
  0%,
  100% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(30px, -40px);
  }
  66% {
    transform: translate(-20px, 30px);
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

header {
  padding: 3rem 0 1rem;
  opacity: 0;
  animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3rem;
}

.logo {
  font-family: 'Instrument Serif', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.logo span {
  color: var(--accent);
}

.date-now {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.hero {
  margin-bottom: 4rem;
}

.hero h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--text);
  opacity: 0;
  animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-meta {
  display: flex;
  gap: 3rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  opacity: 0;
  animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.meta-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.meta-value {
  font-family: 'Instrument Serif', serif;
  font-size: 2rem;
  color: var(--text);
}

.meta-value.accent {
  color: var(--accent);
}
.meta-value.negative {
  color: var(--negative);
}

.chart-section {
  margin-bottom: 4rem;
  opacity: 0;
  animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-title {
  font-family: 'Instrument Serif', serif;
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-dim);
}

.section-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 100px;
}

.chart-container {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2rem 2rem 1.5rem;
  overflow: hidden;
}

.chart-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 400px;
}

canvas#weightChart {
  width: 100% !important;
  height: 100% !important;
}

.chart-legend {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.legend-dot.weight {
  background: var(--accent);
}
.legend-dot.trend {
  background: var(--text-muted);
}
.legend-dot.forecast {
  background: rgba(196, 245, 74, 0.4);
  border: 1px dashed var(--accent);
}

.vacation-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  padding: 0.3rem 0.7rem;
  border: 1px dashed var(--text-muted);
  border-radius: 2px;
  margin-top: 1rem;
}

.data-section {
  margin-bottom: 6rem;
  opacity: 0;
  animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.data-card {
  background: var(--bg);
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
  cursor: default;
}

.data-card:hover {
  background: var(--bg-elevated);
}

.data-card.vacation-gap {
  grid-column: 1 / -1;
  justify-content: center;
  background: var(--bg-elevated);
  padding: 0.8rem;
}

.data-card-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.data-date {
  font-size: 0.85rem;
  color: var(--text);
}

.data-weight {
  font-family: 'Instrument Serif', serif;
  font-size: 1.6rem;
  color: var(--text);
}

.data-change {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
}

.data-change.loss {
  color: var(--accent);
  background: rgba(196, 245, 74, 0.08);
}
.data-change.gain {
  color: var(--negative);
  background: rgba(255, 107, 90, 0.08);
}
.data-change.neutral {
  color: var(--text-muted);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 3rem;
  opacity: 0;
  animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

.stat-card {
  background: var(--bg);
  padding: 1.5rem;
  text-align: center;
}

.stat-number {
  font-family: 'Instrument Serif', serif;
  font-size: 2.2rem;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-number.green {
  color: var(--accent);
}
.stat-number.red {
  color: var(--negative);
}

.stat-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

footer {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) 1.2s forwards;
  margin-bottom: 2rem;
}

.footer-left {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.footer-right {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.progress-section {
  margin-bottom: 3rem;
  opacity: 0;
  animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) 0.85s forwards;
}

.progress-bar-wrap {
  position: relative;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  margin-top: 1rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 2px;
  width: 0%;
  animation: fill-bar 2s cubic-bezier(0.16, 1, 0.3, 1) 1.5s forwards;
}

@keyframes fill-bar {
  to {
    width: var(--progress);
  }
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
}

.progress-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.progress-label span {
  color: var(--text-dim);
  font-family: 'Instrument Serif', serif;
  font-size: 0.9rem;
  font-style: italic;
}

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

.chart-tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 0.6rem 0.9rem;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
  font-size: 0.75rem;
}

.chart-tooltip .tt-date {
  color: var(--text-muted);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.2rem;
}

.chart-tooltip .tt-weight {
  font-family: 'Instrument Serif', serif;
  font-size: 1.2rem;
  color: var(--text);
}

::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 2px;
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--line);
  margin: 0 0 3rem;
  position: relative;
}

.divider::after {
  content: '\25C6';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding: 0 1rem;
  color: var(--text-muted);
  font-size: 0.5rem;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 3rem;
  }
  .hero-meta {
    flex-wrap: wrap;
    gap: 1.5rem;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .chart-canvas-wrap {
    height: 300px;
  }
  .data-grid {
    grid-template-columns: 1fr;
  }
  .header-top {
    flex-direction: column;
    gap: 0.5rem;
  }
}
