/* =============================================================
   style.css
   ============================================================= */

/* ---- Reset & base ---- */

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

:root {
  --color-bg: #f5f5f3;
  --color-surface: #ffffff;
  --color-border: rgba(0, 0, 0, 0.10);
  --color-border-mid: rgba(0, 0, 0, 0.18);
  --color-text: #1a1a1a;
  --color-text-muted: #6b6b6b;
  --color-text-hint: #9e9e9e;
  --color-accent: #185FA5;
  --color-accent-bg: #E6F1FB;
  --color-accent-text: #0C447C;
  --radius-md: 8px;
  --radius-lg: 12px;
  --nav-height: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a1a;
    --color-surface: #242424;
    --color-border: rgba(255, 255, 255, 0.10);
    --color-border-mid: rgba(255, 255, 255, 0.18);
    --color-text: #f0f0f0;
    --color-text-muted: #a0a0a0;
    --color-text-hint: #707070;
    --color-accent: #5ba3e8;
    --color-accent-bg: #0d2d47;
    --color-accent-text: #a8d0f5;
  }
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---- Nav ---- */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--color-surface);
  border-bottom: 0.5px solid var(--color-border);
}

.nav-logo {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  user-select: none;
}

.nav-logo-accent {
  color: #c41146;
}

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

.nav-links a {
  font-size: 14px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

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

.nav-links a.active {
  font-weight: 500;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: var(--color-text);
  padding: 4px;
}

@media (max-width: 600px) {
  .nav-toggle {
    display: flex;
    align-items: center;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-surface);
    border-bottom: 0.5px solid var(--color-border);
    padding: 1rem 1.5rem;
    gap: 1rem;
  }

  .nav-links.open {
    display: flex;
  }
}

/* ---- Layout ---- */

.site {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* ---- Hero ---- */

.hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
}

.hero h1 {
  font-size: 26px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 15px;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.hero-btns {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-btns button {
  font-size: 13px;
  font-family: inherit;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--color-border-mid);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.hero-btns button:hover {
  background: var(--color-bg);
}

/* ---- Section labels & page headings ---- */

.home-section {
  margin-top: 1rem;
}

.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-hint);
  margin-bottom: 1rem;
}

.page-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text);
  margin-top: 2rem;
  margin-bottom: 0.4rem;
}

.page-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 1.75rem;
}

/* ---- Major cards ---- */

.major-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 2.5rem;
}

.major-grid--full {
  grid-template-columns: 1fr;
}

.major-card {
  background: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}

.major-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.major-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.major-card h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.major-card p {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-bottom: 10px;
}

.major-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.major-links a {
  font-size: 12px;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---- Search bar ---- */

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface);
  border: 0.5px solid var(--color-border-mid);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 1.25rem;
  transition: border-color 0.15s;
}

.search-bar:focus-within {
  border-color: var(--color-accent);
}

.search-bar i {
  font-size: 18px;
  color: var(--color-text-hint);
  flex-shrink: 0;
}

.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text);
  width: 100%;
}

.search-bar input::placeholder {
  color: var(--color-text-hint);
}

/* ---- Class cards ---- */

.class-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.class-card {
  background: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}

.class-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.class-code {
  font-size: 12px;
  font-weight: 500;
  background: var(--color-accent-bg);
  color: var(--color-accent-text);
  padding: 3px 8px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  flex-shrink: 0;
}

.class-card h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.class-card p {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-bottom: 10px;
}

.class-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.class-links a {
  font-size: 12px;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

.no-results {
  text-align: center;
  padding: 2.5rem;
  color: var(--color-text-hint);
  font-size: 14px;
}

/* ---- FAQ ---- */

.faq-group {
  margin-bottom: 2rem;
}

.faq-group-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-hint);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 0.5px solid var(--color-border);
}

.faq-item {
  padding: 1rem 0;
  border-bottom: 0.5px solid var(--color-border);
  cursor: pointer;
  outline: none;
}

.faq-item:focus-visible .faq-q span {
  text-decoration: underline;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-q span {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.faq-q i {
  font-size: 16px;
  color: var(--color-text-hint);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-a {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-top: 10px;
  display: none;
}

.faq-item.open .faq-a {
  display: block;
}

.faq-item.open .faq-q i {
  transform: rotate(180deg);
}