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

:root {
  --bg: #f2f0eb;
  --ink: #111;
  --accent: #c8401a;
  --muted: #666;
  --border: #ccc;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── LAYOUT WRAPPER ─── */
.page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ─── HEADER ─── */
header {
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 72px;
  animation: fadeIn 0.5s ease both;
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.8rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

.logo span { color: var(--accent); }

/* ─── TAGS ─── */
.tag {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.item-tag {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 3px 7px;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 2px;
}

.item-tag.coming-soon {
  background: #111;
  color: #fff;
  font-size: 0.7em;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  border: none;
  opacity: 0.5;
}

li:has(.item-tag.coming-soon) {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 16px 48px;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  animation: fadeIn 0.6s ease 0.9s both;
}

footer a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.1em;
  transition: color 0.15s;
}

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

.footer-links {
  display: flex;
  gap: 24px;
}

/* ─── HERO ─── */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 60px;
}

.hero-label {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  animation: slideRight 0.6s ease 0.1s both;
}

.hero-label::after {
  content: '█';
  font-size: 0.85em;
  margin-left: 4px;
  animation: blink 1.1s step-end infinite;
}

.hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(5rem, 7vw, 4rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  margin-bottom: 28px;
  position: relative;
  animation: fadeUp 0.75s cubic-bezier(.25,.8,.25,1) 0.2s both;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}

.hero h1 em::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 4px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  animation: lineGrow 0.7s cubic-bezier(.25,.8,.25,1) 0.9s both;
}

.hero p {
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  max-width: 420px;
  line-height: 1.9;
  animation: fadeUp 0.65s ease 0.35s both;
}

/* ─── STAT BAR ─── */
.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.7s ease 0.55s both;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hero-stat-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

.hero-stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.45;
}

/* ─── TICKER STRIP ─── */
.ticker-wrap {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 7px 0;
  opacity: 0.3;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7em;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  animation: fadeIn 0.8s ease 0.6s both;
  margin-bottom: 0;
}

.ticker-inner {
  display: inline-block;
  animation: ticker 28s linear infinite;
}

.ticker-inner span {
  margin: 0 32px;
}

/* ─── CATEGORY GRID ─── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  margin-bottom: 0;
  animation: fadeIn 0.4s ease 0.4s both;
}

.card {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 36px 28px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: background 0.15s, transform 0.22s ease, box-shadow 0.22s ease;
  animation: cardReveal 0.65s cubic-bezier(.25,.8,.25,1) both;
}

.card:nth-child(1) { animation-delay: 0.45s; }
.card:nth-child(2) { animation-delay: 0.58s; }
.card:nth-child(3) { animation-delay: 0.71s; }

.card:hover {
  background: #e8e5de;
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

.card-num {
  font-size: 0.7em;
  color: var(--muted);
  letter-spacing: 0.12em;
  margin-bottom: 28px;
  animation: fadeIn 0.5s ease both;
}

.card-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
  animation: dotPulse 2s ease-in-out infinite;
}

.card:nth-child(2) .card-dot { animation-delay: 0.4s; }
.card:nth-child(3) .card-dot { animation-delay: 0.8s; }

.card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4rem;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
  line-height: 1;
  display: inline-block;
}

.card-sub {
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  line-height: 2.1;
  flex: 1;
}

.card-arrow {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: inline-block;
  margin-top: 28px;
  opacity: 0.6;
  transition: transform 0.15s, opacity 0.2s ease;
}

.card:hover .card-arrow {
  transform: translateX(5px);
  opacity: 1;
}

/* ─── CATEGORY PAGE ─── */
.category-header {
  margin-bottom: 12px;
}

.back-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  margin-bottom: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.back-btn:hover { color: var(--ink); }

.category-header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 0.95;
  margin-bottom: 10px;
}

.category-header h1 em {
  font-style: normal;
  color: var(--accent);
}

.category-header .desc {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 48px;
}

/* ─── SUB-CATEGORY COLUMNS ─── */
.sub-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  flex: 1;
}

.sub-col {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 28px;
}

.sub-col-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.module-list {
  list-style: none;
}

.module-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: padding-left 0.1s;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  line-height: 1.5;
  color: var(--ink);
}

.module-list li:last-child { border-bottom: none; }
.module-list li:hover { padding-left: 6px; }

.item-num {
  font-size: 0.68rem;
  color: var(--muted);
  min-width: 20px;
  padding-top: 2px;
}

.item-name { flex: 1; }

/* ─── AUTH PAGES ─── */
.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.auth-box {
  width: 100%;
  max-width: 480px;
}

.auth-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.auth-box h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.8rem, 6vw, 4.2rem);
  line-height: 0.95;
  margin-bottom: 40px;
}

.auth-box h1 em {
  font-style: normal;
  color: var(--accent);
}

.auth-form {
  border-top: 1px solid var(--border);
}

.form-field {
  border-bottom: 1px solid var(--border);
  padding: 20px 0 4px;
  position: relative;
}

.form-field label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.form-field input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 0 0 12px;
  letter-spacing: 0.03em;
}

.form-field input::placeholder { color: #bbb; }

.form-field input:focus ~ .field-line {
  transform: scaleX(1);
}

.field-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.auth-actions {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--bg);
  border: none;
  padding: 14px 32px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: #333; }

.auth-switch {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.06em;
}

.auth-switch a:hover { text-decoration: underline; }

.auth-error {
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-top: 16px;
  min-height: 1rem;
}

/* ─── MOBILE NAV OVERLAY ─── */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 100;
}

.mobile-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
  transform-origin: center;
}

.mobile-nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-nav-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 90;
  flex-direction: column;
  padding: 100px 32px 40px;
  border-top: 3px solid var(--ink);
}

.mobile-nav-overlay.open { display: flex; }

.mobile-nav-overlay a {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.15s, padding-left 0.2s;
}

.mobile-nav-overlay a:hover {
  color: var(--accent);
  padding-left: 10px;
}

.mobile-nav-overlay a span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.mobile-nav-footer {
  margin-top: auto;
  display: flex;
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.mobile-nav-footer a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border: none;
  padding: 0;
  display: inline;
}

.mobile-nav-footer a:hover { color: var(--ink); }

/* ─── KEYFRAMES ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes lineGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(40px) rotate(-1deg); }
  to   { opacity: 1; transform: translateY(0) rotate(0deg); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50%       { transform: scale(1.6); opacity: 1; }
}

/* ─── TABLET (max 768px) ─── */
@media (max-width: 768px) {
  .page-wrapper { padding: 0 24px; }

  header {
    margin-bottom: 48px;
    flex-wrap: wrap;
    gap: 4px;
  }

  .logo { font-size: 2.2rem; }
  .tag { font-size: 0.68rem; }

  footer {
    padding: 14px 24px;
    flex-direction: column;
    gap: 6px;
  }

  .grid { grid-template-columns: 1fr; }
  .card { padding: 24px 20px; }

  .sub-columns { grid-template-columns: 1fr; }
  .sub-col { padding: 20px; }

  .category-header h1 { font-size: clamp(2.4rem, 10vw, 4rem); }

  .mobile-nav-toggle { display: flex; }
  body.nav-open { overflow: hidden; }

  .hero-stats {
    gap: 20px;
    flex-wrap: wrap;
  }

  .hero-stat-num { font-size: 1.7rem; }
}

/* ─── MOBILE (max 480px) ─── */
@media (max-width: 480px) {
  .page-wrapper { padding: 0 16px; }

  header {
    margin-bottom: 36px;
    padding: 10px 0;
  }

  .logo { font-size: 1.9rem; }

  .tag {
    font-size: 0.62rem;
    letter-spacing: 0.05em;
  }

  footer {
    padding: 12px 16px;
    font-size: 0.65rem;
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  .footer-links { gap: 16px; }

  .hero { margin-bottom: 40px; }

  .hero p {
    font-size: 0.88rem;
    max-width: 100%;
  }

  .hero-label { font-size: 0.75rem; }

  .card { padding: 20px 16px; }
  .card-title { font-size: 2rem; }
  .card-sub { font-size: 0.78rem; }

  .card-arrow {
    font-size: 0.72rem;
    margin-top: 20px;
  }

  .back-btn {
    margin-bottom: 32px;
    font-size: 0.72rem;
  }

  .category-header h1 { font-size: clamp(2.2rem, 12vw, 3.5rem); }

  .category-header .desc {
    font-size: 0.76rem;
    margin-bottom: 32px;
  }

  .sub-col { padding: 16px; }

  .sub-col-title {
    font-size: 1.4rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .module-list li {
    font-size: 0.8rem;
    padding: 12px 0;
    flex-wrap: wrap;
    gap: 6px;
  }

  .item-tag { font-size: 0.58rem; }

  .auth-wrapper {
    align-items: flex-start;
    padding: 20px 0 40px;
  }

  .auth-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary {
    width: 100%;
    text-align: center;
    font-size: 0.72rem;
  }

  .form-field input { font-size: 0.88rem; }
  .auth-switch { font-size: 0.68rem; }
}