:root {
  color-scheme: dark;
  --panel-border: rgba(148, 163, 184, 0.22);
  --panel-border-hover: rgba(103, 232, 249, 0.45);
  --panel-shadow: 0 12px 30px rgba(2, 6, 14, 0.45);
}

/* Heading policy:
   H1: page identity
   H2: section title
   H3: panel/card title
*/
.heading-kicker {
  font-size: 0.67rem;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgb(148 163 184);
}

.heading-h1 {
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: rgb(244 244 245);
}

.heading-h1-hero {
  font-size: 2.7rem;
  line-height: 1.05;
  letter-spacing: 0.2em;
  font-weight: 600;
  color: rgb(244 244 245);
}

.heading-h2 {
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: rgb(228 228 231);
}

.heading-h3 {
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: rgb(228 228 231);
}

@media (min-width: 768px) {
  .heading-h1 {
    font-size: 2.3rem;
  }
  .heading-h1-hero {
    font-size: 4.2rem;
  }
  .heading-h2 {
    font-size: 1.45rem;
  }
  .heading-h3 {
    font-size: 1.08rem;
  }
}

body {
  background:
    radial-gradient(1000px 550px at 100% -20%, rgba(103, 232, 249, 0.1), transparent),
    radial-gradient(900px 450px at -10% 0%, rgba(148, 163, 184, 0.08), transparent),
    linear-gradient(180deg, rgba(4, 7, 12, 0.45), rgba(5, 7, 11, 0.95)),
    #05070b;
}

.bg-grid {
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 38%, transparent 95%);
}

.ideal-card,
.metric-card,
.surface-card,
.surface-table {
  position: relative;
  border-color: var(--panel-border);
  background:
    linear-gradient(180deg, rgba(15, 22, 35, 0.72), rgba(9, 14, 24, 0.7));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.02),
    var(--panel-shadow);
  transition:
    border-color 240ms ease,
    box-shadow 240ms ease,
    transform 240ms ease;
}

.ideal-card::before,
.metric-card::before,
.surface-card::before,
.surface-table::before {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.35), transparent);
  opacity: 0.35;
  pointer-events: none;
}

.ideal-card:hover,
.metric-card:hover,
.surface-card:hover {
  border-color: var(--panel-border-hover);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 34px rgba(2, 6, 14, 0.56);
  transform: translateY(-1px);
}

.fade-up {
  opacity: 0;
  animation: fade-up 650ms ease forwards;
}

.delay-100 {
  animation-delay: 100ms;
}

.delay-200 {
  animation-delay: 200ms;
}

.delay-300 {
  animation-delay: 300ms;
}

.metric-flash {
  animation: metric-flash 520ms ease;
}

@keyframes fade-up {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes metric-flash {
  0% {
    box-shadow: 0 0 0 rgba(103, 232, 249, 0.55);
  }
  60% {
    box-shadow: 0 0 22px rgba(103, 232, 249, 0.35);
  }
  100% {
    box-shadow: 0 0 0 rgba(103, 232, 249, 0);
  }
}

.monthly-chart-frame {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 0.5rem;
  align-items: end;
}

.monthly-y-axis {
  height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding-right: 0.15rem;
}

.monthly-y-tick {
  font-size: 0.58rem;
  line-height: 1;
  letter-spacing: 0.08em;
  color: rgb(113 113 122);
  text-transform: uppercase;
}

.monthly-usage-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.4rem;
  align-items: end;
}

.monthly-usage-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.monthly-usage-bars {
  height: 128px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.18rem;
  padding: 0 0.12rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.monthly-bar {
  width: 42%;
  min-height: 0;
  border-radius: 2px 2px 0 0;
  transition: opacity 220ms ease;
}

.monthly-bar-single {
  width: 78%;
}

.monthly-bar-api {
  background: linear-gradient(180deg, rgba(103, 232, 249, 0.95), rgba(34, 211, 238, 0.55));
}

.monthly-bar-chatgpt {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.9), rgba(113, 113, 122, 0.55));
}

.monthly-usage-col:hover .monthly-bar {
  opacity: 0.82;
}

.monthly-usage-label {
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgb(148 163 184);
}

@media (min-width: 768px) {
  .monthly-chart-frame {
    grid-template-columns: 52px minmax(0, 1fr);
    column-gap: 0.65rem;
  }

  .monthly-y-axis {
    height: 152px;
  }

  .monthly-y-tick {
    font-size: 0.62rem;
  }

  .monthly-usage-bars {
    height: 152px;
  }

  .monthly-usage-label {
    font-size: 0.68rem;
  }
}

.section-label {
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgb(103 232 249);
}

.tag-chip,
.relation-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.35rem 0.7rem;
  font-size: 0.64rem;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tag-chip {
  color: rgb(228 228 231);
  background: rgba(15, 23, 42, 0.5);
}

.relation-chip {
  color: rgb(103 232 249);
  background: rgba(6, 31, 38, 0.55);
  border-color: rgba(103, 232, 249, 0.22);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.5rem 0.85rem;
  font-size: 0.64rem;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.filter-chip:hover {
  border-color: rgba(103, 232, 249, 0.4);
}

.filter-chip-project {
  color: rgb(103 232 249);
  background: rgba(6, 31, 38, 0.42);
  border-color: rgba(103, 232, 249, 0.22);
}

.filter-chip-project.filter-chip-active {
  background: rgba(34, 211, 238, 0.18);
  border-color: rgba(103, 232, 249, 0.65);
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.12);
}

.filter-chip-topic {
  color: rgb(228 228 231);
  background: rgba(15, 23, 42, 0.45);
}

.filter-chip-topic.filter-chip-active {
  color: rgb(244 244 245);
  background: rgba(39, 39, 42, 0.85);
  border-color: rgba(148, 163, 184, 0.38);
}

.note-body {
  color: rgb(228 228 231);
}

.note-body h2,
.note-body h3 {
  margin-top: 2rem;
  color: rgb(244 244 245);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.note-body h2 {
  font-size: 1.1rem;
  line-height: 1.3;
}

.note-body h3 {
  font-size: 0.95rem;
  line-height: 1.4;
}

.note-body p,
.note-body ul {
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.95;
  color: rgb(212 212 216);
}

.note-body ul {
  padding-left: 1.2rem;
}

.note-body li + li {
  margin-top: 0.5rem;
}

.note-body code {
  border-radius: 0.25rem;
  background: rgba(15, 23, 42, 0.72);
  padding: 0.08rem 0.32rem;
  font-size: 0.88em;
  color: rgb(103 232 249);
}
