@font-face {
  font-family: "Neue Machina";
  src: url("/static/fonts/NeueMachina-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neue Machina";
  src: url("/static/fonts/NeueMachina-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neue Machina";
  src: url("/static/fonts/NeueMachina-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --cipr-green: #78e150;
  --black: #09080c;
  --white: #ffffff;
  --steel-gray: #bfc5cc;
  --dark-gray: #3b3b3b;
  --bg: var(--white);
  --text: var(--black);
  --muted: var(--dark-gray);
  --surface: var(--white);
  --line: var(--dark-gray);
  --grid-line: var(--dark-gray);
  --input-bg: var(--white);
}

:root[data-theme="dark"] {
  --bg: var(--black);
  --text: var(--white);
  --muted: var(--steel-gray);
  --surface: var(--black);
  --line: var(--dark-gray);
  --grid-line: var(--dark-gray);
  --input-bg: var(--black);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Neue Machina", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 14px clamp(16px, 4vw, 56px);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 40px;
  color: var(--black);
  background: var(--cipr-green);
  font-weight: 700;
}

.day-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--cipr-green) var(--black);
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.day-nav a,
.refresh-link,
.theme-toggle,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.theme-toggle {
  cursor: pointer;
}

.day-nav a span {
  margin-left: 8px;
  color: var(--cipr-green);
}

.day-nav a:hover,
.refresh-link:hover,
.theme-toggle:hover,
.download-button:hover,
.day-nav a:focus-visible,
.refresh-link:focus-visible,
.theme-toggle:focus-visible,
.download-button:focus-visible {
  color: var(--black);
  background: var(--cipr-green);
  border-color: var(--cipr-green);
  outline: 0;
}

.day-nav a:hover span,
.day-nav a:focus-visible span {
  color: var(--black);
}

.page {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 56px);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 28px 0 38px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.file-info p,
.stats p,
.section-head span,
.hall-head span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 940px;
  margin-top: 12px;
  font-size: clamp(42px, 8vw, 104px);
  line-height: 0.98;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(104px, 1fr));
  gap: 10px;
}

.stats div {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
}

.stats span {
  display: block;
  color: var(--cipr-green);
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
}

.notice {
  margin: 24px 0 0;
  padding: 14px 16px;
  color: var(--black);
  background: var(--cipr-green);
  font-weight: 500;
}

.search-panel {
  display: grid;
  grid-template-columns: auto minmax(220px, 520px) 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
}

.search-panel label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
}

.search-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  outline: 0;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  border-color: var(--cipr-green);
}

.search-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.day-section {
  scroll-margin-top: 96px;
  padding: 42px 0 8px;
}

.section-head,
.hall-head {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.section-head {
  padding-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1;
}

.section-head span {
  color: var(--cipr-green);
}

.hall-list {
  display: grid;
  gap: 28px;
  padding-top: 28px;
}

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

.hall-head {
  min-height: 56px;
  padding: 14px 16px;
  background: var(--surface);
}

.hall-head > div {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.hall-head h3 {
  font-size: 20px;
  overflow-wrap: anywhere;
}

.hall-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 30px;
  color: var(--black);
  background: var(--cipr-green);
}

.hall-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--cipr-green);
  background: var(--surface);
  color: var(--cipr-green);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.hall-toggle:hover,
.hall-toggle:focus-visible {
  background: var(--cipr-green);
  color: var(--black);
  outline: 0;
}

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

.file-card {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100%;
  background: var(--surface);
}

[hidden] {
  display: none !important;
}

.file-info {
  padding: 16px;
}

.file-info h4 {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.file-info p {
  margin-top: 12px;
  text-transform: none;
}

.download-button {
  margin: 0 16px 16px;
  border-color: var(--cipr-green);
  color: var(--cipr-green);
}

.empty-state {
  padding: 22px 16px;
  color: var(--muted);
  background: var(--surface);
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .day-nav {
    grid-column: 1 / -1;
    order: 3;
  }

  .top-actions {
    justify-content: flex-end;
  }

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

  .search-panel {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hall-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hall-toggle {
    width: 100%;
  }
}
