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

/* ===== LIGHT THEME (default) ===== */
:root {
  color-scheme: light dark;

  --bg:            #ffffff;
  --bg-surface:    #f8fafc;
  --bg-card:       #ffffff;
  --border:        #e2e8f0;
  --border-hover:  #cbd5e1;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-subtle:   #94a3b8;

  --accent:        #3b82f6;
  --accent-hover:  #2563eb;
  --accent-dim:    rgba(59, 130, 246, 0.08);
  --accent-ring:   rgba(59, 130, 246, 0.2);

  --header-bg:     rgba(255, 255, 255, 0.85);
  --nav-mobile-bg: rgba(255, 255, 255, 0.98);
  --card-shadow:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --dot-color:     rgba(0, 0, 0, 0.04);
  --hero-glow-1:   rgba(59, 130, 246, 0.08);
  --hero-glow-2:   rgba(99, 102, 241, 0.05);

  --radius:    12px;
  --radius-sm:  8px;
  --max-w:     1100px;
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', ui-monospace, monospace;
}

/* ===== DARK THEME ===== */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:            #09090b;
  --bg-surface:    #111113;
  --bg-card:       #18181b;
  --border:        #27272a;
  --border-hover:  #3f3f46;
  --text:          #fafafa;
  --text-muted:    #a1a1aa;
  --text-subtle:   #52525b;

  --accent:        #3b82f6;
  --accent-hover:  #60a5fa;
  --accent-dim:    rgba(59, 130, 246, 0.12);
  --accent-ring:   rgba(59, 130, 246, 0.25);

  --header-bg:     rgba(9, 9, 11, 0.85);
  --nav-mobile-bg: rgba(9, 9, 11, 0.97);
  --card-shadow:   none;
  --dot-color:     rgba(255, 255, 255, 0.035);
  --hero-glow-1:   rgba(59, 130, 246, 0.13);
  --hero-glow-2:   rgba(99, 102, 241, 0.07);
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.2s, color 0.2s;
}

a    { color: inherit; text-decoration: none; }
svg  { display: block; flex-shrink: 0; }

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
  border-top: 1px solid var(--border);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font);
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-hover);
}
.btn-outline:hover {
  border-color: var(--text-muted);
  background: var(--bg-surface);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); }

.btn-sm {
  padding: 0.4rem 0.875rem;
  font-size: 0.825rem;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--bg-surface);
  border-color: var(--border-hover);
  color: var(--text);
}

.icon-sun  { display: none; }
.icon-moon { display: block; }
:root[data-theme="dark"] .icon-sun  { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 0.25s, border-color 0.25s;
}

.header.scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 0.75rem;
}

.logo {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex: 1;
  justify-content: flex-end;
}

.nav-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.nav-link:hover,
.nav-link[aria-current="page"] { color: var(--text); }

.header-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Hamburger */
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}
.menu-btn:hover { background: var(--bg-surface); }
.menu-btn span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ===== HERO ===== */
.hero {
  position: relative;
  padding: 8rem 0 6.5rem;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 55% at 50% -5%, var(--hero-glow-1), transparent 70%),
    radial-gradient(ellipse 50% 40% at 85% 70%, var(--hero-glow-2), transparent 70%);
  pointer-events: none;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}

.hero-content {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-ring);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}

/* ===== WORD ANIMATION ===== */
@keyframes wordExit {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}
@keyframes wordEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anim-word {
  display: inline-block;
  color: var(--accent);
  margin-inline: 0.2em;
}
.anim-word.exiting { animation: wordExit 0.28s ease forwards; }
.anim-word.entering { animation: wordEnter 0.35s ease forwards; }

.hero-title {
  font-size: clamp(1.875rem, 4.5vw, 2.875rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

/* Fixed height = 2 × line-height. Text bottom-aligns so short combos sit flush
   against "so you don't have to." with no gap, while layout never shifts. */
.hero-anim-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-end;
  align-items: flex-end;
  height: 2.4em;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 2.5rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ===== SECTION HEADER ===== */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-subtle);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.875rem;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* ===== CARD GRID ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.125rem;
}

/* ===== FEATURE CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-hover); }

.card-icon {
  color: var(--accent);
  margin-bottom: 1.125rem;
}

.card h3 {
  font-size: 0.975rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ===== APP CARDS ===== */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  transition: border-color 0.2s, transform 0.2s;
}
.app-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.app-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.app-icon {
  font-size: 1.1rem;
  color: var(--accent);
  line-height: 1;
}

.pill {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.app-card h3 {
  font-size: 0.975rem;
  font-weight: 600;
}

.app-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.app-url {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-subtle);
  margin-top: 0.5rem;
}

/* ===== CONTACT ===== */
.contact-box {
  max-width: 540px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3.5rem 2.5rem;
  box-shadow: var(--card-shadow);
  text-align: center;
}

.contact-box h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.contact-box p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-logo {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}
.footer-nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.footer-nav a:hover { color: var(--text); }

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-subtle);
}

/* ===== ABOUT PAGE ===== */
.page-hero {
  position: relative;
  padding: 5rem 0 4rem;
  text-align: center;
  overflow: hidden;
}

.page-hero .hero-bg { opacity: 0.5; }

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.page-hero .lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

.about-body {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
}
.about-body p + p { margin-top: 1.25rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.125rem;
  max-width: 800px;
  margin: 3.5rem auto 0;
}

@keyframes statFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  box-shadow: var(--card-shadow);
  text-align: center;
  opacity: 0;
}

.stat-grid.counted .stat-card {
  animation: statFadeUp 0.5s ease forwards;
  animation-delay: calc(var(--i) * 120ms);
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.credentials-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.credentials-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cred-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  text-align: center;
}

.alumni-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  justify-content: center;
}

.alumni-pill {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  padding: 0.45rem 1rem;
  border-radius: 999px;
}

.lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.lang-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.lang-flag {
  font-size: 2rem;
  line-height: 1;
}

.lang-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .credentials-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 680px) {
  .nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    background: var(--nav-mobile-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem 1.5rem;
    gap: 0.25rem;
  }
  .nav.open { display: flex; }
  .nav-link {
    font-size: 1rem;
    padding: 0.5rem 0;
    width: 100%;
  }
  .nav .btn { margin-top: 0.5rem; }

  .menu-btn { display: flex; }

  .card-grid  { grid-template-columns: 1fr; }
  .stat-grid  { grid-template-columns: repeat(2, 1fr); }

  .hero    { padding: 5rem 0 4rem; }
  .section { padding: 4rem 0; }

  .contact-box { padding: 2rem 1.5rem; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

@media (max-width: 420px) {
  .hero-actions,
  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn { justify-content: center; }
}
