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

:root {
  --bg: #FAFAF7;
  --bg-alt: #F3F2ED;
  --surface: #FFFFFF;
  --text: #1C1917;
  --text-muted: #78716C;
  --border: #E7E5E0;

  --warm: #B45309;
  --warm-subtle: rgba(180, 83, 9, 0.06);
  --warm-border: rgba(180, 83, 9, 0.2);

  --cool: #4338CA;
  --cool-subtle: rgba(67, 56, 202, 0.06);
  --cool-border: rgba(67, 56, 202, 0.2);

  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Outfit', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ===== HERO ===== */
#hero {
  height: 100vh;
  min-height: 560px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-container {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

.hero-side {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: background-color 0.4s ease;
}

.hero-left {
  justify-content: flex-end;
  padding-right: 72px;
  background: rgba(180, 83, 9, 0.018);
}

.hero-right {
  justify-content: flex-start;
  padding-left: 72px;
  background: rgba(67, 56, 202, 0.018);
}

.hero-left:hover {
  background: rgba(180, 83, 9, 0.035);
}

.hero-right:hover {
  background: rgba(67, 56, 202, 0.035);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-left .hero-content {
  text-align: right;
}

.hero-right .hero-content {
  text-align: left;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -1px;
  margin-bottom: 14px;
  opacity: 0;
  animation: hero-text-in 0.7s ease forwards;
  animation-delay: 0.6s;
}

.name-warm {
  color: var(--warm);
}

.name-cool {
  color: var(--cool);
}

.hero-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 400;
  opacity: 0;
  animation: hero-text-in 0.6s ease forwards;
  animation-delay: 0.9s;
}

.hero-x {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-muted);
  z-index: 10;
  opacity: 0;
  animation: hero-x-in 0.5s ease forwards;
  animation-delay: 0.75s;
}

/* ===== HERO ANIMATIONS ===== */
.hero-left {
  animation: slide-from-left 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-right {
  animation: slide-from-right 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-from-left {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(0); }
}

@keyframes slide-from-right {
  0% { transform: translateX(100%); }
  100% { transform: translateX(0); }
}

@keyframes hero-text-in {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes hero-x-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ===== SCROLL INDICATOR ===== */
.scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  opacity: 0;
  animation: hint-in 0.5s ease forwards;
  animation-delay: 1.5s;
}

.scroll-mouse {
  width: 22px;
  height: 36px;
  border: 1.5px solid var(--text-muted);
  border-radius: 11px;
  position: relative;
  opacity: 0.5;
}

.scroll-wheel {
  width: 3px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 2px;
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll-bob 2s ease-in-out infinite;
}

@keyframes scroll-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
  50% { transform: translateX(-50%) translateY(6px); opacity: 0.3; }
}

@keyframes hint-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* ===== SECTIONS ===== */
.section {
  padding: 96px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  color: var(--text);
  margin-bottom: 8px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.subsection-heading {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  margin-top: 56px;
  margin-bottom: 24px;
}

/* ===== TAGS ===== */
.tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 14px;
}

.tag-warm {
  color: var(--warm);
  background: var(--warm-subtle);
}

.tag-cool {
  color: var(--cool);
  background: var(--cool-subtle);
}

/* ===== CARDS (ABOUT) ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.card-warm {
  border-top: 2px solid var(--warm);
}

.card-cool {
  border-top: 2px solid var(--cool);
}

.card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.card-warm:hover {
  border-color: var(--warm-border);
  border-top-color: var(--warm);
}

.card-cool:hover {
  border-color: var(--cool-border);
  border-top-color: var(--cool);
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 14px;
  color: var(--text);
}

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

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: gap 0.2s ease;
}

.card-link:hover {
  gap: 10px;
}

.link-warm {
  color: var(--warm);
}

.link-cool {
  color: var(--cool);
}

/* ===== CHESS STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat-warm:hover {
  border-color: var(--warm-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
}

.stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 500;
  color: var(--warm);
}

/* ===== GITHUB REPOS ===== */
.repo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.repo-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 28px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.repo-item:hover {
  border-color: var(--cool-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.repo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.repo-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--cool);
}

.repo-lang {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--cool-subtle);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.repo-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.repo-meta {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.repo-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.repo-placeholder, .push-placeholder {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 720px;
  margin: 0 auto;
}

/* ===== PUSH HISTORY ===== */
.push-list {
  max-width: 720px;
  margin: 0 auto;
}

.push-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

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

.push-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cool);
  margin-top: 7px;
  flex-shrink: 0;
}

.push-info {
  flex: 1;
  min-width: 0;
}

.push-repo {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--cool);
}

.push-msg {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.push-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 4px;
}

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

.footer-names {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.footer-x {
  margin: 0 14px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 300;
}

#footer p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== LOADING STATE ===== */
.loading-placeholder {
  position: relative;
  overflow: hidden;
}

.loading-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.02) 50%, transparent 100%);
  animation: shimmer 1.5s ease-in-out infinite;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-container {
    flex-direction: column;
  }

  .hero-left,
  .hero-right {
    justify-content: center;
    padding: 0 32px;
    animation: none;
    opacity: 1;
  }

  .hero-left .hero-content,
  .hero-right .hero-content {
    text-align: center;
  }

  .hero-name {
    font-size: clamp(2.4rem, 10vw, 3.8rem);
    animation-delay: 0.2s;
  }

  .hero-tagline {
    animation-delay: 0.4s;
  }

  .hero-x {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    text-align: center;
    padding: 8px 0;
    animation-delay: 0.3s;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .section {
    padding: 64px 0;
  }

  .container {
    padding: 0 24px;
  }
}

@media (max-width: 480px) {
  .hero-name {
    font-size: 2.2rem;
  }

  .card {
    padding: 28px 24px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .footer-names {
    font-size: 1.2rem;
  }

  .section {
    padding: 48px 0;
  }
}
