/* ==========================================================
   DESIGN TOKENS
   ========================================================== */
:root {
  /* Colors */
  --bg: #F9F9F9;
  --surface: #FFFFFF;
  --text: #111111;
  --text-muted: #444444;
  --border: #E5E5E5;
  --accent: #1A1A1A;
  --accent-blue: #0066FF;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;

  /* Type scale */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.85rem;    /* ~13.6px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.5rem;     /* 24px */
  --text-2xl: 2rem;      /* 32px */
  --text-3xl: 2.5rem;    /* 40px */
  --text-hero: 3.5rem;   /* 56px */

  /* Weights */
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;
  --w-bold: 700;

  /* Layout */
  --max-width: 1100px;
  --reading-width: 680px;
  --section-pad: 80px;
  --gap: 24px;
  --content-pad: 24px;

  /* Transitions */
  --ease-fast: 150ms ease;
  --ease-base: 200ms ease;
  --ease-slow: 400ms ease-out;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--w-regular);
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: var(--w-bold);
}

/* ==========================================================
   UTILITY
   ========================================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

.reading-col {
  max-width: var(--reading-width);
}

.muted {
  color: var(--text-muted);
}

.section-title {
  font-size: var(--text-xl);
  font-weight: var(--w-semibold);
  margin-bottom: 40px;
}

/* ==========================================================
   NAVIGATION
   ========================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(249, 249, 249, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color var(--ease-base);
  border-bottom: 1px solid transparent;
}

.nav--scrolled {
  border-bottom-color: var(--border);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--content-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav__brand {
  font-size: var(--text-base);
  font-weight: var(--w-semibold);
  color: var(--text);
  text-decoration: none;
}

.nav__links {
  display: flex;
  gap: 32px;
}

.nav__link {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--ease-fast);
  padding: 4px 0;
  position: relative;
}

.nav__link:hover,
.nav__link--active {
  color: var(--text);
}

.nav__link--active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--accent);
}

/* Mobile toggle */
.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 10px;
}

.nav__toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: transform var(--ease-base), opacity var(--ease-base);
}

.nav__toggle.is-active span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav__toggle.is-active span:nth-child(2) {
  opacity: 0;
}
.nav__toggle.is-active span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  padding: 12px 24px;
  border-radius: 6px;
  transition: background var(--ease-fast), color var(--ease-fast),
              border-color var(--ease-fast);
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}

.btn--primary {
  background: var(--accent);
  color: var(--surface);
  border: 1px solid var(--accent);
}

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

.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--outline:hover {
  border-color: var(--accent);
}

.btn--submit {
  background: var(--accent);
  color: var(--surface);
  border: 1px solid var(--accent);
  width: 100%;
  font-weight: var(--w-semibold);
  padding: 14px 24px;
}

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

/* ==========================================================
   TAGS / PILLS
   ========================================================== */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: var(--w-regular);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ==========================================================
   SCROLL REVEAL
   ========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--ease-slow), transform var(--ease-slow);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Prevent subpixel blur on transformed elements */
.card,
.card__img {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

.card__img {
  transform: translateZ(0);
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  font-weight: var(--w-medium);
  color: #1b5e20;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #2e7d32;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(46, 125, 50, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(46, 125, 50, 0);
  }
}

/* Interactive Skill Tag & Card Highlight */
.tag {
  transition: all var(--ease-fast);
  cursor: pointer;
  user-select: none;
}

.tag:hover, .tag.is-active {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tag.is-dimmed {
  opacity: 0.35;
}

/* Quick Console Floating Launch Button */
.console-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  transition: all var(--ease-fast);
}

.console-trigger:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--bg);
}

.console-trigger kbd {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.65rem;
}


/* ==========================================================
   RESPONSIVE — GLOBAL
   ========================================================== */
@media (max-width: 1024px) {
  :root {
    --section-pad: 72px;
    --text-hero: 2.75rem;
  }
}

@media (max-width: 640px) {
  :root {
    --section-pad: 56px;
    --text-hero: 2.25rem;
    --text-xl: 1.35rem;
    --content-pad: 20px;
  }

  .nav__links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(249, 249, 249, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 8px var(--content-pad) 16px;
  }

  .nav__links.is-open {
    display: flex;
  }

  .nav__link {
    display: block;
    padding: 14px 0;
    font-size: var(--text-base);
    border-bottom: 1px solid var(--border);
  }

  .nav__links li:last-child .nav__link {
    border-bottom: none;
  }

  .nav__toggle {
    display: flex;
  }
}
