/* =============================================================
   Portfolio — karaktaka
   Modern dark DevOps aesthetic, zero external dependencies
   ============================================================= */

:root {
  --bg:           #0d1117;
  --bg-card:      #161b22;
  --bg-card-hover:#1c2230;
  --border:       #30363d;
  --accent:       #58a6ff;
  --accent-green: #3fb950;
  --text:         #c9d1d9;
  --text-muted:   #8b949e;
  --text-heading: #e6edf3;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --nav-h:        60px;
  --max-w:        960px;
  --r:            8px;
  --t:            0.2s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-h);
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background var(--t);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-heading);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.blink {
  color: var(--accent-green);
  animation: blink 1.2s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--t);
}
.nav-links a:hover { color: var(--text-heading); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--t);
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 48px) 24px 100px;
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent-green);
  margin-bottom: 10px;
}
.hero-name {
  font-size: clamp(3.2rem, 10vw, 6.5rem);
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 24px;
}
.hero-tagline {
  max-width: 500px;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 40px;
}
.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  border-radius: var(--r);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #0d1117;
  border: 1px solid var(--accent);
}
.btn-primary:hover {
  background: #79b8ff;
  border-color: #79b8ff;
  text-decoration: none;
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--text-muted);
  color: var(--text-heading);
  text-decoration: none;
}

/* Scroll hint */
.hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: floatY 2.5s ease-in-out infinite;
}
@keyframes floatY {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%     { transform: translateX(-50%) translateY(8px); }
}
.scroll-dot { animation: scrollDot 2.5s ease-in-out infinite; }
@keyframes scrollDot {
  0%   { transform: translateY(0);  opacity: 1; }
  100% { transform: translateY(8px); opacity: 0; }
}

/* ── Sections ───────────────────────────────────────────────── */
.section { padding: 80px 24px; }
.dark-section { background: var(--bg-card); }
.container { max-width: var(--max-w); margin: 0 auto; }

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 14px;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 36px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ── About ──────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 48px;
  align-items: start;
}
.about-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
  filter: grayscale(20%);
  transition: filter var(--t);
}
.about-avatar:hover { filter: grayscale(0); }

.about-text p {
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.8;
}
.about-text p:last-child { margin-bottom: 0; }

.about-stats {
  display: flex;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 20px;
  text-align: center;
  min-width: 100px;
}
.stat-number {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  line-height: 1.2;
}
.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Skills ─────────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.skill-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  transition: border-color var(--t);
}
.dark-section .skill-group { background: var(--bg); }
.skill-group:hover { border-color: var(--accent); }

.skill-group-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: rgba(88,166,255,0.1);
  color: var(--accent);
  border: 1px solid rgba(88,166,255,0.25);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}
.tag.tag-sm {
  font-size: 0.72rem;
  padding: 2px 8px;
}

/* ── Timeline ───────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 32px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 32px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker {
  position: absolute;
  left: -28px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  z-index: 1;
}
.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 24px;
  transition: border-color var(--t);
}
.timeline-content:hover { border-color: var(--accent); }
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.timeline-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
}
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-green);
  white-space: nowrap;
}
.timeline-content p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.75;
  margin-bottom: 14px;
}
.timeline-content .tags { margin-top: 4px; }

/* ── Connect ────────────────────────────────────────────────── */
.connect-lead {
  color: var(--text-muted);
  margin-bottom: 28px;
}
.connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.connect-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  color: var(--text);
  text-decoration: none;
  transition: all var(--t);
}
.connect-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  text-decoration: none;
}
.connect-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(88,166,255,0.1);
  border-radius: var(--r);
  color: var(--accent-green);
  flex-shrink: 0;
}
/* GitHub & LinkedIn use filled icons */
.connect-card:nth-child(1) .connect-icon,
.connect-card:nth-child(2) .connect-icon { color: var(--accent); }

.connect-icon svg { width: 20px; height: 20px; }

.connect-info { flex: 1; min-width: 0; }
.connect-name {
  display: block;
  font-weight: 600;
  color: var(--text-heading);
  font-size: 0.9rem;
}
.connect-handle {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}
.connect-arrow {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color var(--t);
}
.connect-card:hover .connect-arrow { color: var(--accent); }

/* ── 404 ───────────────────────────────────────────────────── */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.error-code {
  font-family: var(--font-mono);
  font-size: clamp(6rem, 20vw, 12rem);
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  letter-spacing: -0.05em;
  user-select: none;
}
.error-title {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 600;
  color: var(--text-heading);
  margin: 16px 0 12px;
}
.error-msg {
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto 32px;
  line-height: 1.75;
}
.error-prompt {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-green);
  margin-bottom: 28px;
}
.error-prompt::before { content: '$ '; color: var(--text-muted); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}
.footer-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── Scroll reveal ──────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    width: 100%;
    flex-direction: column;
    gap: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: block;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links li:last-child a { border-bottom: none; }

  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-avatar-col { display: flex; justify-content: center; }
  .about-avatar { width: 120px; height: 120px; }

  .hero-scroll { display: none; }
}

@media (max-width: 480px) {
  .about-stats { flex-direction: column; }
  .stat-card { min-width: unset; }
}
