/* ==========================================================================
   Design tokens — sourced from the club's Design Components deck.
   Aligned to CofC's official brand guidelines (charleston.edu/marketing-communications).
   Rule from the deck: never tint the maroon; avoid pairing maroon with black alone.
   ========================================================================== */
:root {
  --maroon: #660000;
  --maroon-dark: #3d0000;
  --gold: #bfa87c;

  /* Muted a shade from the deck's raw teal — the fully-saturated originals
     (especially teal-dark at ~99% saturation) read as a bright, modern
     tech accent that fought the muted, warm maroon/gold instead of sitting
     alongside it. Same hues, toned down so they read as one family. */
  --teal: #448a82;
  --teal-dark: #12423d;
  --mint: #7fc9bc;
  --teal-light: #e6f2ef;

  --white: #ffffff;
  --ink: #1b1e1d;
  --muted: #6b6560;
  --card-bg: #f8f3ea;
  --paper: #fbf8f2;
  --border: #e7ded0;
  --link-color: var(--teal-dark);

  --font-heading: Cambria, Georgia, "Times New Roman", serif;
  --font-body: Calibri, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Courier New", Consolas, monospace;

  --radius: 10px;
  --shadow-soft: 0 4px 16px rgba(61, 0, 0, 0.06);
  --shadow-lift: 0 10px 24px rgba(61, 0, 0, 0.12);
  /* Grows past the old fixed 1120px on wide screens so boxed sections use
     the extra space instead of floating in a sea of margin, but plateaus
     at 1600px so text columns and card grids don't get unreadably wide. */
  --max-width: clamp(1120px, 78vw, 1600px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scrollbar-color: var(--border) transparent; scrollbar-width: thin; }

svg { width: 1.1em; height: 1.1em; vertical-align: -0.15em; flex-shrink: 0; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: var(--gold); color: var(--maroon-dark); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

a, .btn, .card, .footer-socials a, .main-nav a {
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: bold;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

/* Fluid type: scales smoothly between the mobile and desktop sizes instead
   of jumping at breakpoints, so headings stay well-proportioned at any
   viewport width. */
h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.4rem); }
h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.85rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.3rem); }

p { margin: 0 0 1em; }

a {
  color: var(--link-color);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

code, pre {
  font-family: var(--font-mono);
}
pre {
  background: var(--ink);
  color: var(--white);
  padding: 1em;
  border-radius: var(--radius);
  overflow-x: auto;
}
code {
  background: var(--card-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
pre code { background: none; padding: 0; }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* For a boxed section whose content is inherently narrow (a single card, a
   short FAQ) — shrinks the colored box to hug that content instead of
   stretching the full container width and leaving one side empty. Sections
   built from a grid that actually benefits from the extra width (stats,
   contact cards, tool logos) skip this and keep the full container. */
.container-fit {
  width: fit-content;
  max-width: 100%;
}

.kicker {
  display: block;
  font-family: var(--font-heading);
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--teal-dark);
  margin-bottom: 0.5em;
}
.hero .kicker, .section-dark .kicker { color: var(--mint); }

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  background: var(--maroon-dark);
  color: var(--white);
  /* Flush with the top of the viewport, so only the trailing edge curves —
     a square top would look odd floating away from the browser edge. */
  border-radius: 0 0 var(--radius) var(--radius);
}
.site-header .container {
  display: flex;
  align-items: center;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
}
.brand img {
  height: 40px;
  width: auto;
}
.brand-text {
  font-family: var(--font-heading);
  font-weight: bold;
  color: var(--white);
  font-size: 1.05rem;
  line-height: 1.15;
}
.brand-text small {
  display: block;
  font-family: var(--font-body);
  font-weight: normal;
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.06);
  color: var(--white);
  border-radius: 50%;
  cursor: pointer;
}
.theme-toggle:hover { background: rgba(255,255,255,0.14); }
.theme-toggle-sun { display: none; }
[data-theme="dark"] .theme-toggle-sun { display: inline-flex; }
[data-theme="dark"] .theme-toggle-moon { display: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--gold);
  color: var(--white);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
}

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin: 0;
  padding: 0;
}
.main-nav a {
  position: relative;
  color: var(--white);
  font-weight: bold;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--gold);
  text-decoration: none;
}
.main-nav a:hover::after,
.main-nav a.active::after { transform: scaleX(1); }

@media (max-width: 780px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .main-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0.9rem; padding: 0.75rem 0 1rem; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 2rem 0 2.25rem;
}
/* Color lives on the boxed container, not the full-bleed section, so it can
   never stretch into an edge-to-edge band on a wide viewport. */
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
  background: var(--maroon-dark);
  color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 2.25rem 2rem;
}
.hero h1 { font-size: clamp(2.1rem, 1.7rem + 1.7vw, 2.7rem); color: var(--white); }
.hero p.lede {
  font-size: 1.1rem;
  color: #f1e9e9;
  max-width: 42ch;
}
.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}
.hero-media {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  background: var(--maroon-dark);
  aspect-ratio: 16 / 9;
}
.hero-media video,
.hero-media iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .hero .container { padding: 1.5rem 1.1rem; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-body);
  font-weight: bold;
  font-size: 0.82rem;
  padding: 0.5em 1em;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gold);
  color: var(--maroon-dark);
}
.btn-primary:hover { background: #cfba90; text-decoration: none; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border-color: var(--white);
  color: var(--white);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); text-decoration: none; transform: translateY(-1px); }
.btn-teal {
  background: var(--teal-dark);
  color: var(--white);
}
.btn-teal:hover { background: var(--teal); text-decoration: none; transform: translateY(-1px); }

/* ==========================================================================
   Sections & cards
   ========================================================================== */
.section {
  padding: 2.5rem 0;
}
.section-light { background: var(--paper); }
/* Tint/dark sections carry their color on the boxed .container, never on the
   full-bleed section, so on a wide viewport the color never runs edge to
   edge — it's always a contained card the width of the content. */
.section-tint .container {
  background: var(--teal-light);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
}
.section-dark .container {
  background: var(--maroon-dark);
  color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 2rem 1.75rem;
}
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark p { color: #e9dede; }

.breadcrumbs { font-size: 0.82rem; margin-bottom: 0.9rem; color: #e9dede; }
.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .crumb-sep { margin: 0 0.5em; opacity: 0.6; }
.breadcrumbs [aria-current="page"] { color: var(--white); font-weight: bold; }

.section-head {
  max-width: 60ch;
  margin-bottom: 1.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
}
.card h3 { margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }
.card-link { margin-top: auto; padding-top: 0.8rem; align-self: flex-start; }
a.card { display: block; color: inherit; }
a.card:hover {
  border-color: var(--gold);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

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

/* Icon-circle, three tones — matches the deck's core component slide */
.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
}
.icon-circle svg { width: 22px; height: 22px; }
.icon-circle.on-maroon { background: var(--maroon); color: var(--white); }
.icon-circle.on-teal { background: var(--teal); color: var(--white); }
.icon-circle.on-dark { background: rgba(255,255,255,0.12); color: var(--mint); }
.icon-circle .initials { font-family: var(--font-heading); font-weight: bold; font-size: 0.95rem; }

/* Icon rows */
.icon-row-list {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.icon-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.icon-row h4 {
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: 1.05rem;
  margin: 0 0 0.25em;
}
.icon-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.section-dark .icon-row p { color: #d8cfcf; }

/* Stat callouts */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.2rem;
  text-align: center;
}
.stat-callout .stat-number {
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: 3rem;
  color: var(--gold);
  line-height: 1;
}
.stat-callout .stat-label {
  margin-top: 0.5em;
  font-size: 0.9rem;
  color: #e9dede;
}
.js .stat-callout {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.js .stat-callout.in-view { opacity: 1; transform: translateY(0); }

/* Contact cards */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.contact-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  text-align: center;
}
.contact-card .icon-circle { margin: 0 auto 0.6rem; }
.contact-card .label {
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal-dark);
  margin-bottom: 0.3em;
}
.contact-card .value { font-size: 0.95rem; word-break: break-word; }

/* Timeline (vertical) */
.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--gold);
}
.timeline li {
  position: relative;
  padding: 0 0 1.8rem 1.6rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--maroon);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--gold);
}
.timeline .tl-meta {
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: 0.85rem;
  color: var(--teal-dark);
  display: block;
  margin-bottom: 0.15em;
}
.timeline li.is-skipped { opacity: 0.55; }
.timeline li.is-skipped::before { background: var(--muted); box-shadow: 0 0 0 2px var(--card-bg); }

/* Tool/tech logo strip — white-on-transparent marks, needs a dark section */
.tool-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 2rem;
  /* A dozen fixed-width logos never fill a wide container; centering keeps
     the leftover space symmetric instead of a lopsided gap on the right. */
  justify-content: center;
}
.tool-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 84px;
  min-height: 56px;
  opacity: 0.85;
}
.tool-logo:hover { opacity: 1; }
.tool-logo img { height: 34px; width: auto; max-width: 64px; }
.tool-logo svg { height: 34px; width: 34px; color: var(--white); }
.tool-wordmark {
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: 1.7rem;
  color: var(--white);
  line-height: 34px;
}
.tool-logo span {
  font-size: 0.72rem;
  text-align: center;
  color: #d8cfcf;
  line-height: 1.2;
}

/* Filter chips (Competitions) */
.filter-chips { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
.chip {
  font-family: var(--font-body);
  font-weight: bold;
  font-size: 0.82rem;
  padding: 0.45em 1em;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink);
  cursor: pointer;
}
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed="true"] {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--white);
}

/* Schedule table */
.sched-filter { margin: 0 0 1.5rem; }
.sched-filter input {
  width: 100%;
  max-width: 360px;
  padding: 0.6em 0.9em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.sched-filter-empty { margin-top: 0.8rem; color: var(--muted); }
table.schedule tr.is-next { box-shadow: inset 3px 0 0 var(--gold); }
.table-wrap {
  overflow-x: auto;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.table-wrap.is-scrollable::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.5rem;
  background: linear-gradient(to right, transparent, var(--paper));
  pointer-events: none;
}
table.schedule {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.schedule th {
  font-family: var(--font-heading);
  text-align: left;
  background: var(--maroon-dark);
  color: var(--white);
  padding: 0.7em 0.8em;
}
table.schedule td {
  padding: 0.65em 0.8em;
  border-bottom: 1px solid var(--border);
}
table.schedule tr:nth-child(even) { background: var(--card-bg); }
table.schedule tr.is-skipped { opacity: 0.55; font-style: italic; }
table.schedule .cal-link { font-size: 0.85rem; white-space: nowrap; }

/* Below ~700px the table has no room to breathe (8 columns, long wrapping
   text), so it becomes a stack of labeled cards instead of a scrolling
   table — a horizontal-scroll table at this width reads as broken rather
   than as "swipe for more." */
@media (max-width: 700px) {
  .table-wrap { overflow-x: visible; border: none; border-radius: 0; }
  .table-wrap.is-scrollable::after { display: none; }
  table.schedule thead { display: none; }
  table.schedule, table.schedule tbody, table.schedule tr, table.schedule td {
    display: block;
    width: 100%;
  }
  table.schedule tr {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
  }
  table.schedule td {
    padding: 0.3em 0;
    border-bottom: none;
  }
  table.schedule td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-heading);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.2em;
  }
  table.schedule td[data-label="#"] { display: none; }
  table.schedule td.sched-topic { font-weight: bold; font-size: 1.05rem; }
  table.schedule td.cal-link {
    border-top: 1px solid var(--border);
    margin-top: 0.4rem;
    padding-top: 0.7rem;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.72rem;
  font-weight: bold;
  padding: 0.3em 0.7em;
  border-radius: 999px;
  background: var(--teal-light);
  color: var(--teal-dark);
  margin: 0 0.4em 0.4em 0;
}
.badge svg { width: 0.95em; height: 0.95em; }
.badge-gold { background: #f3ecd9; color: var(--maroon-dark); }

/* Click-to-toggle 12/24-hour time, used anywhere a meeting time appears */
.time-toggle {
  cursor: pointer;
  border-bottom: 1px dotted currentColor;
  white-space: nowrap;
}
.time-toggle:hover { color: var(--teal-dark); }
[data-theme="dark"] .time-toggle:hover,
[data-theme="hacker"] .time-toggle:hover { color: var(--mint); }
.section-dark .time-toggle:hover { color: var(--gold); }

/* FAQ accordion (native <details>/<summary>, no JS needed) */
.faq { max-width: 78ch; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
}
.faq-item summary {
  font-family: var(--font-heading);
  font-weight: bold;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-body);
  color: var(--muted);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin: 0.8rem 0 0; color: var(--muted); }

/* Generic markdown content areas (about, resources, history, posts) */
.prose { max-width: 78ch; }
.prose h2 { margin-top: 1.6em; }
.ext-link-icon { width: 0.72em; height: 0.72em; margin-left: 0.2em; vertical-align: -0.05em; flex-shrink: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.92rem;
}
.prose table th, .prose table td {
  border: 1px solid var(--border);
  padding: 0.5em 0.7em;
  text-align: left;
}
.prose table th { background: var(--card-bg); }
.prose blockquote {
  border-left: 3px solid var(--gold);
  margin: 1.2em 0;
  padding: 0.2em 1.2em;
  color: var(--muted);
}
.prose figure.video_container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1.2em 0;
  border-radius: var(--radius);
}
.prose figure.video_container iframe {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  border: 0;
}
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.2em 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

/* Table of contents */
.toc {
  max-width: 78ch;
  margin: 0 0 2rem;
}
.toc-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin: 0 0 0.6em;
}
.toc nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
}
.toc nav ul ul {
  list-style: none;
  margin: 0.3em 0 0;
  padding-left: 1.1em;
}
.toc nav li { margin: 0.35em 0; }
.toc nav a { color: var(--link-color); }

/* Guide prev/next pager */
.guide-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  max-width: 78ch;
  flex-wrap: wrap;
}
.guide-pager-link { font-weight: bold; }
.guide-pager-link.next { margin-left: auto; text-align: right; }

/* Back to top */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--maroon);
  color: var(--white);
  border: none;
  box-shadow: var(--shadow-lift);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.18s ease;
  z-index: 40;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--maroon-dark); }
.back-to-top svg { width: 20px; height: 20px; }

/* Search loading skeleton, shown until Pagefind's UI takes over */
.pagefind-skeleton { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.5rem; }
.pf-skel-input, .pf-skel-row {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--card-bg) 25%, var(--border) 37%, var(--card-bg) 63%);
  background-size: 400% 100%;
  animation: pf-shimmer 1.4s ease infinite;
}
.pf-skel-input { height: 44px; }
.pf-skel-row { height: 20px; width: 70%; }
@keyframes pf-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* Pagefind search — themed via its own CSS custom properties, adapts with light/dark/hacker */
:root {
  --pagefind-ui-primary: var(--maroon-dark);
  --pagefind-ui-text: var(--ink);
  --pagefind-ui-background: var(--paper);
  --pagefind-ui-border: var(--border);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 10px;
  --pagefind-ui-font: var(--font-body);
}
.pagefind-search { margin-bottom: 2rem; }

/* Post list */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.post-list .card {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.post-list time { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--maroon-dark);
  color: #e9dede;
  padding: 2rem 0 1.5rem;
  margin-top: 1.5rem;
  /* Mirrors the header: flush with the bottom of the viewport, so only the
     leading edge curves. */
  border-radius: var(--radius) var(--radius) 0 0;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
}
.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.footer-socials a {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.5em 1em;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.06);
  color: var(--white);
  font-weight: bold;
  font-size: 0.85rem;
}
.footer-socials a:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
  text-decoration: none;
  transform: translateY(-1px);
}
.footer-socials svg { width: 16px; height: 16px; }
.site-footer .copyright { font-size: 0.82rem; color: #c7a8a8; }

/* Secret hacker-theme toggle: intentionally near-invisible until hovered */
#theme-easter-egg {
  position: fixed;
  right: 10px;
  bottom: 8px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.12);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  z-index: 40;
}
#theme-easter-egg:hover { color: var(--mint); }

@media (max-width: 600px) {
  .section { padding: 1.75rem 0; }
  .section-tint .container, .section-dark .container { padding: 1.4rem 1.1rem; }
}

/* ==========================================================================
   Motion — hero entrance only (pure CSS, no JS dependency)
   ========================================================================== */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero .kicker, .hero h1, .hero p.lede, .hero .hero-actions, .hero-media {
  animation: fade-up 0.6s ease both;
}
.hero h1 { animation-delay: 0.05s; }
.hero p.lede { animation-delay: 0.12s; }
.hero .hero-actions { animation-delay: 0.18s; }
.hero-media { animation-delay: 0.24s; }

/* ==========================================================================
   Dark mode — on-brand dark palette (distinct from the hacker easter egg).
   The header/hero/footer/stat/page-head sections are already dark in every
   mode, so this mainly flips the currently-light sections and cards.
   ========================================================================== */
:root[data-theme="dark"] {
  --ink: #f1e9e5;
  --muted: #c2b3ae;
  /* The header/hero/footer/stat/page-head boxes keep the brand's own
     maroon-dark (#3d0000, unchanged) in every mode. Light mode gets away
     with that because the page around it is pale — but the previous dark
     page (#241b1b) sat at nearly the same lightness as those boxes and
     blended right into them. Lighten the same warm brown-gray already used
     for --ink/--muted/--card-bg a couple steps further, rather than
     reaching for an unrelated hue (teal, neutral gray) — still clearly the
     same family, just enough lighter that the maroon boxes read as a
     distinct surface again. */
  --card-bg: #4a3737;
  --paper: #3c2c2c;
  --border: #6b5252;
  --link-color: var(--mint);
  --teal-light: #16332f;
  --shadow-lift: 0 10px 26px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .kicker { color: var(--mint); }
[data-theme="dark"] .contact-card .label { color: var(--mint); }
[data-theme="dark"] .timeline .tl-meta { color: var(--mint); }
[data-theme="dark"] .badge { background: var(--card-bg); color: var(--mint); border: 1px solid var(--border); }
[data-theme="dark"] .badge-gold { background: rgba(191, 168, 124, 0.16); color: var(--gold); border-color: rgba(191, 168, 124, 0.4); }
[data-theme="dark"] .prose blockquote { color: var(--muted); }
[data-theme="dark"] table.schedule tr:nth-child(even) { background: var(--card-bg); }

/* ==========================================================================
   Secret hacker theme — colors lifted from the old site's Cactus dark theme
   ($color-background #1d1f21, $color-accent-1 #38F376, $color-text #c9cacc,
   $color-meta #666, $color-quote #ccffb6). Toggled by the "_" button bottom-right.
   ========================================================================== */
:root[data-theme="hacker"] {
  --maroon: #232629;
  --maroon-dark: #1d1f21;
  --gold: #38f376;

  --teal: #38f376;
  --teal-dark: #14321f;
  --mint: #ccffb6;
  --teal-light: #17191a;

  --white: #c9cacc;
  --ink: #c9cacc;
  --muted: #808080;
  --card-bg: #202225;
  --paper: #1d1f21;
  --border: #666;
  --link-color: #38f376;

  --font-heading: "Courier New", Consolas, monospace;
  --font-body: "Courier New", Consolas, monospace;
}
/* Restrained on purpose, like the old theme: gray for most UI text/chrome,
   the one neon green reserved for links, the primary CTA, and stat numbers. */
[data-theme="hacker"] .kicker { color: var(--muted); }
[data-theme="hacker"] .contact-card .label { color: var(--muted); }
[data-theme="hacker"] .badge { background: var(--card-bg); color: var(--muted); border: 1px solid var(--border); }
[data-theme="hacker"] .icon-circle.on-maroon,
[data-theme="hacker"] .icon-circle.on-teal { background: var(--card-bg); color: var(--link-color); border: 1px solid var(--border); }
[data-theme="hacker"] .btn-teal:hover { color: #04140a; }
[data-theme="hacker"] .footer-socials a:hover { color: #04140a; }
[data-theme="hacker"] .btn-primary:hover { background: #7dffab; }
[data-theme="hacker"] .stat-callout .stat-number { text-shadow: 0 0 6px rgba(56,243,118,0.5); }
[data-theme="hacker"] .section-dark p,
[data-theme="hacker"] .section-dark .icon-row p,
[data-theme="hacker"] .stat-callout .stat-label,
[data-theme="hacker"] .site-footer,
[data-theme="hacker"] .site-footer .copyright { color: var(--muted); }

/* ==========================================================================
   Print — strip chrome, force light/legible colors regardless of theme.
   ========================================================================== */
@media print {
  .site-header, .site-footer, .back-to-top, #theme-easter-egg,
  .nav-toggle, .theme-toggle, .sched-filter, .filter-chips,
  .toc, .pagefind-search, .pagefind-skeleton, .hero-media,
  .table-wrap.is-scrollable::after, .ext-link-icon, .guide-pager {
    display: none !important;
  }
  * { box-shadow: none !important; text-shadow: none !important; animation: none !important; }
  body { background: #fff; color: #000; }
  .hero, .section-light, .section-tint, .section-dark,
  .hero .container, .section-tint .container, .section-dark .container {
    background: #fff !important;
    color: #000 !important;
  }
  .hero h1, .hero p.lede, .section-dark h2, .section-dark h3, .section-dark p,
  .breadcrumbs, .breadcrumbs [aria-current="page"] { color: #000 !important; }
  a { color: #000; text-decoration: underline; }
  .card, .contact-card { border: 1px solid #999; background: #fff; }
  table.schedule th { background: #eee !important; color: #000 !important; }
  .badge, .badge-gold { background: #eee !important; color: #000 !important; border: 1px solid #999; }
  @page { margin: 1.5cm; }
}
