/* ============================================================
   EcoCampus — "Field Ledger" aesthetic
   Warm paper, deep forest ink, clay accents, ledger typography.
   ============================================================ */

:root {
  --paper:     #f3ecdd;
  --paper-2:   #ebe1cc;
  --ink:       #2b2620;
  --ink-soft:  #5a5246;
  --forest:    #233d2c;
  --forest-2:  #345240;
  --clay:      #b5562f;
  --clay-2:    #d97b4f;
  --gold:      #c79a3d;
  --sage:      #8aa68a;
  --line:      rgba(43, 38, 32, 0.16);
  --shadow:    rgba(43, 38, 32, 0.18);

  --display: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Subtle paper grain via layered radial noise */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(circle at 20% 30%, #000 0.5px, transparent 0.5px),
    radial-gradient(circle at 70% 65%, #000 0.5px, transparent 0.5px),
    radial-gradient(circle at 45% 85%, #000 0.5px, transparent 0.5px);
  background-size: 3px 3px, 4px 4px, 5px 5px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 900px 500px at 12% -10%, rgba(199, 154, 61, 0.16), transparent 60%),
    radial-gradient(ellipse 800px 600px at 110% 10%, rgba(35, 61, 44, 0.10), transparent 55%),
    var(--paper);
}

/* ---------------------------------------------------------- */
/* Masthead                                                     */
/* ---------------------------------------------------------- */
.masthead {
  max-width: 920px;
  margin: 0 auto;
  padding: 56px 32px 28px;
  text-align: center;
  position: relative;
}

.masthead__rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 15%, var(--line) 85%, transparent);
  margin: 0 auto;
}

.masthead__inner {
  padding: 34px 0 14px;
  animation: riseIn 0.9s cubic-bezier(.2,.8,.2,1) both;
}

.masthead__kicker {
  font-family: var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--clay);
  margin: 0 0 18px;
}

.masthead__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(48px, 9vw, 92px);
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--forest);
}
.masthead__title em {
  font-style: italic;
  font-weight: 300;
  color: var(--clay);
}

.masthead__subtitle {
  max-width: 520px;
  margin: 18px auto 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.back-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--clay);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.back-link:hover { border-color: var(--clay); color: var(--forest); }

.masthead__sprig {
  width: 220px;
  height: auto;
  margin: 6px auto 8px;
  display: block;
  opacity: 0.75;
  animation: drawIn 1.6s ease-out 0.3s both;
}
.masthead__sprig path {
  fill: none;
  stroke: var(--sage);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 360;
  stroke-dashoffset: 360;
  animation: draw 1.8s ease-out forwards;
}
.masthead__sprig path:nth-child(2) { animation-delay: 0.2s; stroke: var(--clay-2); }
.masthead__sprig path:nth-child(3) { animation-delay: 0.4s; stroke: var(--gold); }
.masthead__sprig path:nth-child(4) { animation-delay: 0.6s; stroke: var(--forest-2); }
.masthead__sprig path:nth-child(5) { animation-delay: 0.8s; stroke: var(--clay); }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes drawIn { from { opacity: 0; } to { opacity: 0.75; } }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------- */
/* Stats strip                                                  */
/* ---------------------------------------------------------- */
.stats {
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 32px 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
}
.stats__loading { color: var(--ink-soft); font-style: italic; grid-column: 1 / -1; text-align: center; }

.stat {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 20px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0));
  position: relative;
  animation: riseIn 0.7s cubic-bezier(.2,.8,.2,1) both;
}
.stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 26px; height: 2px;
  background: var(--clay);
}
.stat__value {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 600;
  color: var(--forest);
  line-height: 1;
}
.stat__label {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------- */
/* Section blocks                                               */
/* ---------------------------------------------------------- */
main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 32px;
}

.block {
  padding: 56px 0 12px;
}

.block__heading {
  font-family: var(--display);
  font-weight: 500;
  font-size: 26px;
  color: var(--forest);
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 8px;
}
.block__index {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--clay);
  letter-spacing: 0.1em;
  border: 1px solid var(--clay);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.block__rule {
  flex: 1;
  height: 1px;
  background: var(--line);
  align-self: center;
}
.block__lede {
  margin: 0 0 28px;
  color: var(--ink-soft);
  max-width: 620px;
  font-size: 13.5px;
}

/* ---------------------------------------------------------- */
/* Leaderboard "ledger" rows                                    */
/* ---------------------------------------------------------- */
.ledger {
  border-top: 1px solid var(--line);
}
.ledger__row {
  display: grid;
  grid-template-columns: 44px 1.4fr 1fr 70px 120px;
  gap: 14px;
  align-items: center;
  padding: 13px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  opacity: 0;
  animation: rowIn 0.5s ease-out forwards;
}
.ledger__rank {
  font-family: var(--display);
  font-size: 18px;
  color: var(--clay);
  font-weight: 600;
}
.ledger__row--top .ledger__rank { color: var(--gold); }
.ledger__name { font-weight: 600; color: var(--ink); }
.ledger__dept { color: var(--ink-soft); font-size: 12px; }
.ledger__year { color: var(--ink-soft); font-size: 11px; text-align: right; letter-spacing: 0.06em; }
.ledger__points {
  text-align: right;
  font-weight: 600;
  color: var(--forest);
}
.ledger__points::after { content: " pts"; font-weight: 400; color: var(--ink-soft); font-size: 10px; }
.ledger__bar-track {
  height: 5px;
  background: var(--paper-2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.ledger__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--forest-2));
  border-radius: 4px;
  width: 0;
  transition: width 1s cubic-bezier(.2,.8,.2,1);
}

@keyframes rowIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---------------------------------------------------------- */
/* Department impact bars                                       */
/* ---------------------------------------------------------- */
.bars { display: flex; flex-direction: column; gap: 16px; }
.bar-row { display: grid; grid-template-columns: 200px 1fr 130px; gap: 16px; align-items: center; }
.bar-row__label { font-size: 13px; font-weight: 600; }
.bar-row__sub { display: block; font-size: 11px; color: var(--ink-soft); font-weight: 400; margin-top: 2px; }
.bar-row__track {
  height: 22px;
  background: var(--paper-2);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.bar-row__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--clay-2), var(--clay));
  transition: width 1.1s cubic-bezier(.2,.8,.2,1);
  position: relative;
}
.bar-row__value {
  font-size: 13px;
  text-align: right;
  font-weight: 600;
  color: var(--forest);
  white-space: nowrap;
}

/* ---------------------------------------------------------- */
/* Initiatives timeline                                         */
/* ---------------------------------------------------------- */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.timeline__item {
  position: relative;
  opacity: 0;
  animation: riseIn 0.6s ease-out forwards;
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--clay);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--clay);
}
.timeline__title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--forest);
  margin: 0 0 4px;
}
.timeline__meta {
  font-size: 11.5px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.timeline__meta span { color: var(--clay); }
.timeline__progress-track {
  height: 6px;
  background: var(--paper-2);
  border-radius: 4px;
  overflow: hidden;
  max-width: 360px;
}
.timeline__progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--sage), var(--forest));
  transition: width 1.1s cubic-bezier(.2,.8,.2,1);
}
.timeline__progress-label {
  font-size: 10.5px;
  color: var(--ink-soft);
  margin-top: 6px;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------- */
/* Action catalogue cards                                       */
/* ---------------------------------------------------------- */
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.catalog__card {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 16px 16px 14px;
  background: rgba(255,255,255,0.3);
  opacity: 0;
  animation: riseIn 0.5s ease-out forwards;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.catalog__card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -14px var(--shadow);
  border-color: var(--clay);
}
.catalog__category {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay);
  margin: 0 0 8px;
}
.catalog__name {
  font-family: var(--display);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
  line-height: 1.35;
}
.catalog__row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-soft);
  border-top: 1px dotted var(--line);
  padding-top: 8px;
}
.catalog__row strong { color: var(--forest); font-weight: 600; }

/* ---------------------------------------------------------- */
/* Resource usage                                               */
/* ---------------------------------------------------------- */
.usage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.usage__card {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 16px;
  opacity: 0;
  animation: riseIn 0.5s ease-out forwards;
}
.usage__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 2px;
  color: var(--forest);
}
.usage__type {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.usage__compare { display: flex; flex-direction: column; gap: 6px; }
.usage__bar-row { display: grid; grid-template-columns: 36px 1fr 90px; gap: 8px; align-items: center; font-size: 11px; }
.usage__bar-track { height: 9px; background: var(--paper-2); border-radius: 3px; overflow: hidden; }
.usage__bar-fill { height: 100%; width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.usage__bar-fill--jan { background: var(--sage); }
.usage__bar-fill--feb { background: var(--clay); }
.usage__delta {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
}
.usage__delta--down { color: var(--forest-2); }
.usage__delta--up { color: var(--clay); }

/* ---------------------------------------------------------- */
/* Redemptions receipts                                         */
/* ---------------------------------------------------------- */
.receipts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.receipts li {
  display: grid;
  grid-template-columns: 110px 1fr auto auto;
  gap: 16px;
  align-items: baseline;
  padding: 12px 4px;
  border-bottom: 1px dotted var(--line);
  font-size: 12.5px;
  opacity: 0;
  animation: riseIn 0.45s ease-out forwards;
}
.receipts time { color: var(--ink-soft); font-size: 11px; }
.receipts .reward { color: var(--ink-soft); }
.receipts .student { font-weight: 600; }
.receipts .spent { color: var(--clay); font-weight: 600; text-align: right; white-space: nowrap; }

/* ---------------------------------------------------------- */
/* Footer                                                       */
/* ---------------------------------------------------------- */
.colophon {
  max-width: 920px;
  margin: 40px auto 0;
  padding: 0 32px 60px;
  text-align: center;
}
.colophon p {
  margin-top: 22px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.colophon code {
  font-family: var(--mono);
  background: var(--paper-2);
  padding: 1px 6px;
  border-radius: 3px;
}

/* ---------------------------------------------------------- */
/* Responsive                                                   */
/* ---------------------------------------------------------- */
@media (max-width: 640px) {
  .ledger__row { grid-template-columns: 32px 1fr 70px; }
  .ledger__dept, .ledger__year { display: none; }
  .bar-row { grid-template-columns: 1fr; gap: 6px; }
  .bar-row__value { text-align: left; }
  .receipts li { grid-template-columns: 1fr; gap: 2px; }
  .receipts .spent { text-align: left; }
}
