@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5f3f0;
  --bg-alt: #eae7e3;
  --surface: #ffffff;
  --border: #d0ccc6;
  --border-strong: #b0aca6;
  --text: #1a1a1a;
  --text-muted: #6b6560;
  --accent: #1a1a1a;
  --accent-dim: #333333;
  --pixel-font: 'Press Start 2P', monospace;
  --body-font: 'Inter', -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body-font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  background-image: url('/images/logo-bg.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 60%;
  background-attachment: fixed;
}

/* Navbar */
/* Sticky Nav with embedded logo */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 3rem 0.5rem 0;
  background: rgba(245, 243, 240, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--accent);
  z-index: 100;
  overflow: visible;
}

.nav-logo-link {
  display: block;
  line-height: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 101;
  margin-left: 16px;
}

.nav-logo {
  height: 120px;
  width: auto;
  display: block;
  image-rendering: pixelated;
}

.nav-links {
  display: flex;
  gap: 4rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--pixel-font);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
  padding: 0.5rem 0;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem 4rem;
}

.hero-logo {
  width: 300px;
  height: auto;
  image-rendering: pixelated;
  margin-bottom: 1.5rem;
}

.hero-tagline {
  font-family: var(--pixel-font);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-sub {
  max-width: 500px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Page content */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 3rem 5rem;
}

.page-title {
  font-family: var(--pixel-font);
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--border-strong), transparent);
}

.page-desc {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.view-all-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--pixel-font);
  font-size: 0.55rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.15s;
}

.view-all-link:hover {
  color: var(--accent);
}

.page-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

/* Cards Grid */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.model-card {
  background: var(--surface);
  border: 1px solid var(--accent);
  padding: 1.75rem;
  position: relative;
  transition: box-shadow 0.2s;
}

.model-card:hover {
  box-shadow: 2px 2px 0 var(--accent);
}

.model-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.model-icon {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.model-icon-large {
  width: 80px;
  height: 80px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.model-detail-title {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.model-card-header h3 {
  margin-bottom: 0;
}

.model-card h3 {
  font-family: var(--pixel-font);
  font-size: 0.65rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.model-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.7;
}

.model-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dataset-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1rem;
  margin: 1rem 0;
  font-size: 0.85rem;
  color: var(--text);
}

.dataset-meta strong {
  font-family: var(--pixel-font);
  font-size: 0.55rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.15rem;
}

.param-badge {
  background: var(--accent);
  color: var(--surface);
  padding: 0.3rem 0.75rem;
  font-size: 0.6rem;
  font-weight: 700;
  font-family: var(--pixel-font);
}

.status-badge {
  font-family: var(--pixel-font);
  font-size: 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.download-btn {
  font-family: var(--pixel-font);
  font-size: 0.45rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--surface);
  text-decoration: none;
  letter-spacing: 0.05em;
  border: 1px solid var(--accent);
  transition: background 0.15s, color 0.15s;
}

.download-btn:hover {
  background: var(--surface);
  color: var(--accent);
}

/* Leaderboard Size Tabs */
.size-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border: 1px solid var(--accent);
  width: fit-content;
}

.size-tab {
  font-family: var(--pixel-font);
  font-size: 0.65rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  color: var(--text-muted);
  border: none;
  border-right: 1px solid var(--accent);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.05em;
}

.size-tab:last-child {
  border-right: none;
}

.size-tab:hover {
  background: var(--bg-alt);
  color: var(--accent);
}

.size-tab.active {
  background: var(--accent);
  color: var(--surface);
}

/* Leaderboard Table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--accent);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead {
  background: var(--accent);
}

th {
  text-align: left;
  padding: 1rem 1.25rem;
  color: var(--surface);
  font-family: var(--pixel-font);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  transition: background 0.15s;
}

tbody tr:hover {
  background: var(--bg-alt);
}

.rank-cell {
  font-family: var(--pixel-font);
  font-size: 0.65rem;
  color: var(--accent);
}

.score-cell {
  font-weight: 700;
  color: var(--accent);
}

/* Model rows - full width cards on models page */
.model-rows {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.model-row {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--accent);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s;
  overflow: hidden;
}

.model-row:hover {
  box-shadow: 2px 2px 0 var(--accent);
}

.model-row-icon {
  flex-shrink: 0;
  width: 140px;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-right: 1px solid var(--accent);
  overflow: hidden;
}

.model-row-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.model-row-info {
  flex: 1;
  padding: 1.25rem 1.5rem;
}

.model-row-info h3 {
  font-family: var(--pixel-font);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.model-row-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.model-row-action {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 2rem;
  border-left: 1px solid var(--accent);
}

.pixel-arrow {
  font-family: var(--pixel-font);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* Model card as link */
.model-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}

/* Back link */
.back-link {
  font-family: var(--pixel-font);
  font-size: 0.55rem;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--accent);
}

/* Model Detail */
.model-detail-header {
  margin-bottom: 2.5rem;
}

.model-detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
}

.detail-section {
  margin-bottom: 2.5rem;
}

.detail-heading {
  font-family: var(--pixel-font);
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  padding-left: 1.5rem;
  position: relative;
}

.feature-list li::before {
  content: '>';
  font-family: var(--pixel-font);
  font-size: 0.5rem;
  position: absolute;
  left: 0;
  color: var(--accent);
}

.download-btn-large {
  display: inline-block;
  font-family: var(--pixel-font);
  font-size: 0.65rem;
  padding: 1rem 2.5rem;
  background: var(--accent);
  color: var(--surface);
  text-decoration: none;
  letter-spacing: 0.08em;
  border: 3px solid var(--accent);
  transition: background 0.15s, color 0.15s;
}

.download-btn-large:hover {
  background: var(--surface);
  color: var(--accent);
}

/* Spec sidebar */
.spec-card {
  background: var(--surface);
  border: 1px solid var(--accent);
  padding: 1.5rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  font-family: var(--pixel-font);
  font-size: 0.45rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spec-value {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  text-transform: capitalize;
}

.app-tag {
  border-color: var(--text);
  font-weight: 600;
}

.contribution-note {
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 2rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.contribution-note h3 {
  font-family: var(--pixel-font);
  font-size: 0.55rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* Course cards */
.course-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.course-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--accent);
  padding: 1.5rem 2rem;
  transition: box-shadow 0.2s;
}

.course-card:hover {
  box-shadow: 4px 4px 0 var(--accent);
}

.course-card-info h3 {
  font-family: var(--pixel-font);
  font-size: 0.65rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.course-card-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.course-meta {
  display: flex;
  gap: 0.75rem;
}

.course-tag {
  font-family: var(--pixel-font);
  font-size: 0.4rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 0.3rem 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.course-card-action {
  flex-shrink: 0;
  padding-left: 2rem;
  border-left: 1px solid var(--accent);
  margin-left: 2rem;
}

.course-pricing {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.price-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.course-price {
  font-family: var(--pixel-font);
  font-size: 0.7rem;
  color: var(--accent);
  min-width: 3rem;
  text-align: right;
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--border);
}

.contribute-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.contribute-section p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 1rem 0 1.5rem;
}

.contribute-amounts {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.contribute-btn {
  min-width: 4rem;
}

/* Contact form */
.contact-form {
  margin-top: 2rem;
  max-width: 500px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-family: var(--pixel-font);
  font-size: 0.45rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--body-font);
  font-size: 0.9rem;
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  box-shadow: 3px 3px 0 var(--accent);
}

.form-group textarea {
  resize: vertical;
}

/* About */
.about-content {
  max-width: 600px;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

/* Footer */
footer {
  text-align: center;
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--accent);
  color: var(--text-muted);
  font-family: var(--pixel-font);
  font-size: 0.45rem;
  letter-spacing: 0.05em;
  line-height: 2;
}

/* Mobile */
@media (max-width: 640px) {
  .navbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .nav-logo {
    height: 60px;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .nav-links a {
    font-size: 0.5rem;
  }

  .page {
    padding: 2rem 1.25rem 3rem;
  }

  .page-title {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.5rem 0.6rem;
  }

  .size-tabs {
    flex-wrap: wrap;
  }

  .size-tab {
    font-size: 0.5rem;
    padding: 0.5rem 0.8rem;
  }

  .model-row {
    flex-wrap: wrap;
  }

  .model-row-icon {
    width: 80px;
    height: 80px;
  }

  .model-row-img {
    width: 60px;
    height: 60px;
  }

  .model-row-action {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    border-left: none;
    border-top: 1px solid var(--accent);
    padding: 0.75rem;
  }

  .model-detail-grid {
    grid-template-columns: 1fr;
  }

  .model-card {
    clip-path: polygon(
      0 6px, 6px 6px, 6px 0,
      calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px,
      100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%,
      6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px)
    );
  }
}
