:root {
  --brand:         #8FD8C3;  /* primary mint */
  --brand-deep:    #176676;  /* deep teal accent */
  --brand-soft:    #B6E2D3;  /* secondary mint */
  --brand-wash:    #E7FEF7;  /* mint hover wash */
  --accent-rose:   #d4527a;  /* mascot rosy accent */
  --surface:       #FFFCF5;  /* cream page bg */
  --white:         #ffffff;

  --neutral-100:   #f1f4f0;
  --neutral-200:   #e8eee9;
  --neutral-300:   #cdd8d2;
  --neutral-400:   #7a8e92;
  --neutral-500:   #3d5a60;
  --neutral-800:   #1a3a40;  /* ink, tinted teal */

  --font-heading: 'Quicksand', system-ui, -apple-system, sans-serif;
  --font-body:    'Be Vietnam Pro', system-ui, -apple-system, sans-serif;

  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-pill: 9999px;

  /* soft, deep-teal-tinted — never black */
  --shadow-sm: 0 2px 6px rgba(23,102,118,.07), 0 1px 2px rgba(23,102,118,.04);
  --shadow-md: 0 8px 20px rgba(23,102,118,.08), 0 2px 4px rgba(23,102,118,.04);

  --duration-fast: 150ms;
  --ease-out: cubic-bezier(.22,.61,.36,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--neutral-500);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-md);
}

.header-inner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-overline {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,252,245,.7);
  line-height: 1;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  color: #FFFCF5;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255,252,245,.85);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,252,245,.35);
  transition: background var(--duration-fast) var(--ease-out),
              color     var(--duration-fast) var(--ease-out);
}

.ext-link:hover {
  background: rgba(255,252,245,.18);
  color: #FFFCF5;
}

/* ── Main ────────────────────────────────────────────────────────────────── */

main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */

.breadcrumb {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--neutral-400);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb a {
  color: var(--brand-deep);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--duration-fast) var(--ease-out);
}

.breadcrumb a:hover { color: var(--accent-rose); text-decoration: underline; }

.breadcrumb-sep {
  margin: 0 5px;
  color: var(--neutral-300);
  font-size: 0.75rem;
  user-select: none;
}

/* ── Meta ────────────────────────────────────────────────────────────────── */

.meta {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neutral-400);
  margin-bottom: 1rem;
}

/* ── Table ───────────────────────────────────────────────────────────────── */

.listing-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--neutral-200);
}

.listing-table thead th {
  background: var(--brand-wash);
  padding: 0.5625rem 1rem;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--brand-deep);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--neutral-200);
}

.listing-table thead th:first-child { width: 3rem; text-align: center; padding-left: 0.75rem; }
.listing-table thead th:nth-child(3),
.listing-table thead th:nth-child(4) { width: 8rem; text-align: right; }

.listing-table tbody tr {
  border-bottom: 1px solid var(--neutral-200);
  transition: background var(--duration-fast) var(--ease-out);
}

.listing-table tbody tr:last-child { border-bottom: none; }
.listing-table tbody tr:hover { background: var(--brand-wash); }

.listing-table tbody td {
  padding: 0.6875rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.4;
}

/* Icon column */
.icon-cell {
  width: 3rem;
  text-align: center;
  padding-left: 0.75rem !important;
  color: var(--brand);
}
.icon-cell.is-dir    { color: var(--brand-deep); }
.icon-cell.is-parent { color: var(--neutral-400); }

.icon {
  display: inline-block;
  vertical-align: middle;
}

/* Name column links */
.listing-table tbody td a {
  color: var(--neutral-800);
  text-decoration: none;
  font-weight: 400;
  transition: color var(--duration-fast) var(--ease-out);
}

.listing-table tbody td a:hover { color: var(--brand-deep); text-decoration: underline; }

/* Directory rows get slightly bolder name */
.icon-cell.is-dir + td a { font-weight: 600; }

/* Size + Date columns */
.listing-table tbody td:nth-child(3),
.listing-table tbody td:nth-child(4) {
  text-align: right;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--neutral-400);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

footer {
  text-align: center;
  padding: 1.25rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--neutral-400);
  border-top: 1px solid var(--neutral-200);
}

footer a {
  color: var(--neutral-500);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--duration-fast) var(--ease-out);
}

footer a:hover { color: var(--brand-deep); }

/* ── 404 ─────────────────────────────────────────────────────────────────── */

.not-found {
  text-align: center;
  padding: 5rem 1.5rem;
}

.not-found .icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: var(--brand-wash);
  border-radius: var(--radius-pill);
  color: var(--brand-deep);
  margin-bottom: 1.5rem;
}

.not-found h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.not-found p {
  font-size: 0.9375rem;
  color: var(--neutral-400);
  margin-bottom: 2rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #FFFCF5;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 24px -8px rgba(23,102,118,.45);
  transition: filter      var(--duration-fast) var(--ease-out),
              box-shadow  var(--duration-fast) var(--ease-out),
              transform   var(--duration-fast) var(--ease-out);
}

.btn-primary:hover {
  filter: brightness(1.03);
  box-shadow: 0 12px 28px -8px rgba(23,102,118,.55);
}

.btn-primary:active {
  filter: brightness(0.97);
  transform: translateY(1px) scale(0.98);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  main { padding: 1rem 1rem 2.5rem; }

  .listing-table thead th:nth-child(4),
  .listing-table tbody td:nth-child(4) { display: none; }

  .listing-table tbody td { padding: 0.8125rem 0.75rem; }
  .icon-cell { padding-left: 0.5rem !important; }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
