@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Marcellus&display=swap');

/* Use locally installed Larken if available (avoids 404 network probes until licensed woff2 files are added) */
@font-face {
  font-family: 'Larken';
  src: local('Larken Regular'), local('Larken');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Larken';
  src: local('Larken Medium');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Larken';
  src: local('Larken Bold');
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

/* ACM KLH Visual Identity & Colour Reference (2026–27) */
:root {
  /* Chapter-wide identity */
  --acm-blue: #3BB3F2;
  --acm-blue-hover: #1FA0E4;
  --klu-red: #C62828;
  --klh-purple: #632B97;

  /* Neutral colours */
  --white: #FFFFFF;
  --off-white: #FAFAF9;
  --light-grey: #E5E7EB;
  --charcoal: #1F2937;

  /* Semantic tokens mapped strictly to the official palette */
  --bg: var(--white);
  --surface: var(--off-white);
  --ink: var(--charcoal);
  --muted: rgba(31, 41, 55, 0.72);
  --line: var(--light-grey);
  --line-strong: var(--charcoal);
  --accent: var(--acm-blue);
  --accent-hover: var(--acm-blue-hover);
  --purple: var(--klh-purple);
  --danger: var(--klu-red);

  --font-display: 'Larken', 'Marcellus', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Larken', 'Marcellus', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-mono: 'Larken', 'Marcellus', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  border-top: 4px solid var(--acm-blue);
}

a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

button,
input,
textarea,
select {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.display {
  font-family: var(--font-display);
}

.muted {
  color: var(--muted);
}

/* Header & Layout */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px clamp(24px, 4vw, 96px);
  padding: clamp(24px, 4vw, 64px) clamp(20px, 7vw, 120px) 0;
}

.brand-logo {
  display: block;
  width: clamp(160px, 14vw, 240px);
  aspect-ratio: 1105 / 555;
  overflow: hidden;
  flex: none;
}

.brand-logo img {
  display: block;
  width: 115.84%;
  margin-left: -1.81%;
  margin-top: -30.77%;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-meta .mono {
  color: var(--klh-purple);
  font-weight: 500;
}

.site-nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 14px clamp(20px, 3.5vw, 64px);
}

.site-nav a,
.site-nav button {
  position: relative;
  display: block;
  padding: 8px 0;
  font-size: clamp(15px, 1.1vw, 19px);
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
}

.site-nav a:hover,
.site-nav button:hover {
  color: var(--accent-hover);
}

.site-nav a.active::after,
.site-nav button.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

.site-main {
  padding: 0 clamp(20px, 7vw, 120px);
}

.hairline {
  height: 1px;
  background: var(--line);
}

.top-rule {
  margin-top: clamp(32px, 4.5vw, 72px);
}

.kicker-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding-top: 32px;
}

.kicker-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.accent-bar {
  width: 48px;
  height: 4px;
  background: var(--accent);
  display: inline-block;
}

.hero-title {
  margin: clamp(36px, 4.5vw, 72px) 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 7.5vw, 132px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--ink);
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 32px clamp(32px, 6vw, 112px);
  padding: clamp(32px, 3.5vw, 56px) 0;
}

.intro-lead {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 44px);
  line-height: 1.14;
  letter-spacing: -0.02em;
  max-width: 19em;
}

.meta-col {
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-left: 1px solid var(--line);
  padding-left: clamp(20px, 3vw, 56px);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-value {
  font-family: var(--font-display);
  font-size: clamp(20px, 1.7vw, 28px);
}

/* Status Banner */
.status-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 18px 20px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--klh-purple);
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

/* Buttons & Chips */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 28px 0 8px;
}

.btn,
.chip {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.btn:hover,
.chip:hover {
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

.btn-primary,
.chip.active {
  background: var(--charcoal);
  color: var(--white);
  border-color: var(--charcoal);
}

.btn-primary:hover,
.chip.active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--white);
}

.btn-accent {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--white);
}

.btn-danger {
  color: var(--danger);
  border-color: rgba(198, 40, 40, 0.35);
}

.btn-danger:hover {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Tracks & Statements */
.track-block {
  padding-top: clamp(40px, 4.5vw, 76px);
}

.track-head {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px 32px;
  align-items: end;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-strong);
}

.track-head h2 {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.statement-card {
  display: flex;
  flex-wrap: wrap;
  gap: 12px clamp(24px, 5vw, 84px);
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.statement-code {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.06em;
  min-width: 110px;
  padding-top: 6px;
  color: var(--klh-purple);
  font-weight: 500;
}

.statement-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 760px;
  flex: 1;
}

.statement-content h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 1.8vw, 30px);
  line-height: 1.2;
}

.statement-content p {
  margin: 0;
  font-size: clamp(15px, 1.05vw, 18px);
  line-height: 1.65;
  color: var(--muted);
  white-space: pre-line;
}

.statement-meta {
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  white-space: pre-line;
}

/* Schedule */
.day-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px clamp(32px, 6vw, 112px);
  border-top: 1px solid var(--line-strong);
  padding: clamp(32px, 3.5vw, 56px) 0 clamp(40px, 4.5vw, 72px);
}

.day-title {
  margin: 12px 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 5vw, 84px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(84px, 130px) minmax(0, 1fr);
  gap: 12px 28px;
  padding: 0 0 36px clamp(20px, 3vw, 44px);
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  background: var(--white);
  border: 2px solid var(--accent);
}

/* Results */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  border-top: 1px solid var(--line-strong);
}

.podium-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px clamp(20px, 2.5vw, 40px) 44px 0;
  border-bottom: 1px solid var(--line);
}

.podium-num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(72px, 8vw, 144px);
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 44px clamp(24px, 3vw, 44px);
  padding-top: 36px;
}

.showcase-thumb {
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.showcase-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Footer */
.site-footer {
  margin-top: clamp(64px, 7vw, 120px);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 36px clamp(20px, 7vw, 120px);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 32px;
  font-size: 13px;
}

/* Admin Dashboard Specific */
.admin-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px) 80px;
}

.login-wrap {
  max-width: 460px;
  margin: clamp(48px, 10vh, 110px) auto;
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--klh-purple);
  padding: 36px;
  background: var(--white);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.panel {
  border: 1px solid var(--line);
  padding: 24px;
  margin-top: 24px;
  background: var(--white);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.toggle-card {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
}

.badge.live {
  background: rgba(59, 179, 242, 0.14);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.badge.embargo {
  background: rgba(99, 43, 151, 0.1);
  border-color: var(--klh-purple);
  color: var(--klh-purple);
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-row {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.item-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--charcoal);
  border-left: 4px solid var(--accent);
  color: var(--white);
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.18);
  max-width: 420px;
}

.toast.error {
  background: var(--klu-red);
  border-left-color: var(--white);
}

.hidden {
  display: none !important;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Edit Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 55, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--acm-blue);
  padding: 28px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 768px) {
  .site-nav {
    margin-left: 0;
    width: 100%;
  }

  .meta-col {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 24px;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-bottom: 28px;
  }

  .login-wrap,
  .panel,
  .modal-card {
    padding: 20px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}
