:root {
  --paper: #f6f3f0;
  --ink: #270f00;
  --line: rgba(39, 15, 0, 0.9);
  --line-soft: rgba(39, 15, 0, 0.2);
  --soft: rgba(39, 15, 0, 0.58);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.shell {
  width: min(100%, 1440px);
  min-height: 100vh;
  margin: 0 auto;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 106px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
}

.project-link {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 54px;
  align-items: center;
  overflow: hidden;
  width: min(100%, 460px);
  min-height: 58px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 0 0 var(--ink);
  transition: color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.project-link span {
  position: relative;
  z-index: 1;
  padding: 0 19px;
}

.project-link strong {
  display: inline-block;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  font-size: 15px;
  font-weight: 750;
  transition: background-size 220ms ease;
}

.project-link::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -40%;
  left: -35%;
  width: 18%;
  height: 180%;
  background: rgba(246, 243, 240, 0.14);
  transform: skewX(-18deg);
  animation: projectLinkSweep 4.5s ease-in-out infinite;
  pointer-events: none;
}

.project-link::after {
  content: "↗";
  position: relative;
  z-index: 1;
  display: grid;
  width: 54px;
  height: 100%;
  place-items: center;
  border-left: 1px solid var(--paper);
  font-family: var(--sans);
  font-size: 24px;
  animation: projectArrowFloat 1.8s ease-in-out infinite;
  transition: transform 160ms ease;
}

.project-link:hover,
.project-link:focus-visible {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--ink);
  outline: none;
  transform: translate(-3px, -3px);
}
.project-link:hover strong,
.project-link:focus-visible strong { background-size: 100% 1px; }
.project-link:hover::after,
.project-link:focus-visible::after {
  border-left-color: var(--ink);
  animation: none;
  transform: translate(3px, -3px);
}
.project-link:active {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(0, 0);
  transition-duration: 70ms;
}

@keyframes projectLinkSweep {
  0%, 58% { left: -35%; }
  78%, 100% { left: 125%; }
}

@keyframes projectArrowFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(2px, -2px); }
}

.live-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.live-mark::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--ink);
  border-radius: 50%;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.7fr);
  min-height: 430px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(30px, 5vw, 74px);
  border-right: 1px solid var(--line);
}

.eyebrow,
.label {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 940px;
  margin: 36px 0 28px;
  font-size: clamp(42px, 6.2vw, 94px);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.075em;
}

h1 strong { font-weight: 760; }

.intent {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(13px, 1.4vw, 18px);
  line-height: 1.45;
}

.score-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
}

.score {
  margin-top: 30px;
  font-size: clamp(110px, 15vw, 220px);
  font-weight: 260;
  line-height: 0.8;
  letter-spacing: -0.1em;
}

.score small {
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0;
}

.grade {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.metric {
  min-height: 145px;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.metric:last-child { border-right: 0; }

.metric-value {
  margin-top: 28px;
  font-size: clamp(24px, 3vw, 46px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.055em;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
}

.chart-section,
.timeline-section,
.summary-section {
  padding: clamp(24px, 3.5vw, 50px);
  border-bottom: 1px solid var(--line);
}

.chart-section { border-right: 1px solid var(--line); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 30px;
}

h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 44px);
  font-weight: 430;
  letter-spacing: -0.055em;
}

.chart-wrap {
  position: relative;
  height: 300px;
  border: 1px solid var(--line);
}

canvas { width: 100%; height: 100%; }

.legend {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 18px;
  margin-right: 7px;
  border-top: 1px solid var(--ink);
  vertical-align: middle;
}

.legend .average::before { border-top-style: dashed; opacity: 0.55; }

.timeline {
  border-top: 1px solid var(--line);
}

.event {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft);
}

.event-time,
.event-score {
  font-family: var(--mono);
  font-size: 9px;
}

.event-state { font-size: 14px; line-height: 1.35; }
.event-message { margin-top: 5px; color: var(--soft); font-size: 12px; }

.empty {
  padding: 24px 0;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10px;
}

.summary-section {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 0.55fr 1.45fr;
  gap: 40px;
}

.summary-text {
  margin: 0;
  font-size: clamp(20px, 2.3vw, 34px);
  line-height: 1.28;
  letter-spacing: -0.035em;
}

.footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  min-height: 84px;
  padding: 22px 26px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.designer { text-decoration: none; border-bottom: 1px solid var(--ink); }

.loading {
  min-height: 65vh;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .hero,
  .report-grid { grid-template-columns: 1fr; }
  .hero-copy,
  .chart-section { border-right: 0; }
  .hero-copy { border-bottom: 1px solid var(--line); }
  .score-panel { min-height: 280px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .summary-section { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .shell { border: 0; }
  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 16px;
  }
  .project-link { width: 100%; min-height: 62px; line-height: 1.25; }
  .project-link strong { display: block; margin-top: 3px; font-size: 16px; }
  .live-mark { justify-self: end; }
  .hero-copy,
  .score-panel,
  .chart-section,
  .timeline-section,
  .summary-section { padding: 24px 18px; }
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 110px; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
  .event { grid-template-columns: 55px 1fr; }
  .event-score { grid-column: 2; }
  .footer { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .project-link,
  .project-link::after,
  .project-link::before,
  .project-link strong {
    animation: none;
    transition: none;
  }
}
