/* CSS: Modern, minimal, mobile-first. Python/backend themed with retro-classy fonts. */
:root {
  --bg: #0a0e12;             /* deep terminal black */
  --surface: #0f1419;        /* surface layer */
  --elev: #151d23;           /* elevated panels */
  --text: #e8eaee;           /* high-contrast text */
  --muted: #94a3b8;          /* secondary text */
  --line: #1e2830;           /* subtle dividers */
  --accent: #88c0d0;         /* cool cyan (python-inspired) */
  --accent-2: #a3be8c;       /* soft green (backend/terminal) */
  --accent-warm: #d08770;    /* warm accent for highlights */

  --radius: 12px;
  --radius-sm: 8px;
  --ring: 0 0 0 1px rgba(136,192,208,0.15), 0 8px 24px -8px rgba(0,0,0,0.5);

  --container: 1120px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 72px;
  --space-8: 96px;

  --font-sans: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Space Mono', ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(1200px 800px at 88% -8%, rgba(136,192,208,0.08), transparent 38%),
              radial-gradient(900px 600px at 12% -8%, rgba(163,190,140,0.08), transparent 38%),
              var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--container);
  padding: 0 var(--space-4);
  margin: 0 auto;
}

.section { padding: var(--space-7) 0; }
.section-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(24px, 2.6vw, 36px);
  letter-spacing: -0.3px;
  margin: 0 0 var(--space-5);
  color: #dde4f0;
}
.section-title::before {
  content: "// ";
  color: var(--accent);
  font-weight: 400;
  opacity: 0.7;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.15) blur(10px);
  background: linear-gradient(to bottom, rgba(10,14,18,0.85), rgba(10,14,18,0.4));
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: var(--space-3); font-family: var(--font-mono); }
.brand-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(136,192,208,0.15), rgba(163,190,140,0.15));
  border: 1px solid var(--line);
  box-shadow: var(--ring);
  font-weight: 600; font-size: 14px; color: var(--accent);
}
.brand-name { font-weight: 500; letter-spacing: -0.2px; font-size: 15px; }

.nav { display: none; gap: var(--space-4); align-items: center; font-size: 14px; }
.nav a { color: var(--muted); font-weight: 500; transition: color .2s ease; }
.nav a:hover { color: var(--accent); }

.nav-toggle {
  appearance: none; background: transparent; border: 0; padding: 10px; cursor: pointer;
  display: grid; gap: 4px;
}
.nav-toggle .bar { width: 22px; height: 2px; background: var(--text); display: block; transition: transform .2s ease, opacity .2s ease; }

@media (min-width: 960px) {
  .nav { display: flex; }
  .nav-toggle { display: none; }
}

/* Mobile menu */
.mobile-open #site-nav {
  position: absolute; inset: 64px var(--space-4) auto; display: grid; gap: var(--space-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-4); box-shadow: var(--ring);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px; border-radius: 8px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  font-family: var(--font-sans);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0a0e12; border-color: rgba(136,192,208,0.3); }
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 4px 16px -4px rgba(136,192,208,0.4); }
.btn-outline { border-color: var(--line); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: rgba(136,192,208,0.05); }
.btn-ghost { background: rgba(255,255,255,0.02); border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { background: rgba(255,255,255,0.04); border-color: var(--accent-2); color: var(--accent-2); }

/* Hero */
.hero { padding-top: var(--space-8); }
.hero-inner { display: grid; gap: var(--space-6); align-items: center; }
.hero-title { 
  font-size: clamp(28px, 4.8vw, 52px); line-height: 1.12; margin: 0 0 var(--space-3); 
  font-family: var(--font-sans); font-weight: 700; letter-spacing: -0.8px;
}
.muted { color: var(--muted); font-weight: 400; }
.highlight { color: var(--text); }
.hero-subtitle { 
  color: var(--accent); margin: 0 0 var(--space-4); font-weight: 600; 
  font-family: var(--font-mono); font-size: clamp(14px, 1.8vw, 16px); letter-spacing: -0.2px;
}
.hero-body { color: #cbd5e1; margin: 0 0 var(--space-5); max-width: 64ch; line-height: 1.65; }
.hero-cta { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.hero-media { display: grid; place-items: center; }
.hero-media img { 
  width: 220px; height: 220px; border-radius: 20px; border: 1px solid var(--line); 
  box-shadow: var(--ring); background: var(--surface); 
}

@media (min-width: 960px) {
  .hero-inner { grid-template-columns: 1.25fr 1fr; }
  .hero-media img { width: 300px; height: 300px; }
}

/* About */
.about-grid { display: grid; gap: var(--space-4); color: #cbd5e1; line-height: 1.7; }
@media (min-width: 720px) { .about-grid { grid-template-columns: 1fr 1fr; gap: var(--space-5); } }

/* Skills */
.skills-grid { display: grid; gap: var(--space-4); }
@media (min-width: 800px) { .skills-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
.skill-group { 
  background: var(--surface); border: 1px solid var(--line); 
  padding: var(--space-4); border-radius: var(--radius); box-shadow: var(--ring);
  position: relative; overflow: hidden;
}
.skill-group::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0.5;
}
.skill-group h3 { 
  margin: 0 0 var(--space-3); font-size: 15px; color: var(--accent); 
  font-family: var(--font-mono); letter-spacing: -0.2px; font-weight: 600;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.tags li { 
  padding: 7px 12px; border-radius: 6px; 
  background: rgba(136,192,208,0.08); border: 1px solid rgba(136,192,208,0.15); 
  color: #d1dce8; font-size: 13px; font-family: var(--font-mono);
  transition: background .2s ease, border-color .2s ease;
}
.tags li:hover { background: rgba(136,192,208,0.12); border-color: rgba(136,192,208,0.25); }

/* Timeline */
.timeline { position: relative; list-style: none; padding-left: 0; margin: 0; }
.timeline:before { 
  content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; 
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%); 
  opacity: 0.4;
}
.timeline-item { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: var(--space-4); padding-bottom: var(--space-5); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item .dot { 
  width: 20px; height: 20px; border-radius: 50%; 
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); 
  border: 3px solid var(--bg); position: relative; top: 3px; 
  box-shadow: 0 0 0 3px rgba(136,192,208,0.2); z-index: 1;
}
.timeline-item .content { 
  background: var(--surface); border: 1px solid var(--line); 
  border-radius: var(--radius-sm); padding: var(--space-4); box-shadow: var(--ring);
}
.timeline-item .content h3 { margin: 0 0 6px; font-size: 17px; color: #e0e7f0; font-weight: 600; }
.timeline-item .meta { 
  margin: 0 0 12px; color: var(--accent); font-size: 13px; 
  font-family: var(--font-mono); font-weight: 500;
}
.timeline-item .content p { margin: 0; color: #cbd5e1; line-height: 1.65; }
.timeline-item .project-list { 
  margin: 0; padding-left: 18px; list-style: none; 
  display: grid; gap: var(--space-3);
}
.timeline-item .project-list li { 
  position: relative; color: #cbd5e1; line-height: 1.65; padding-left: 14px;
}
.timeline-item .project-list li::before {
  content: "▸"; position: absolute; left: 0; color: var(--accent-2); font-weight: 700;
}
.timeline-item .project-list strong { color: var(--accent); font-weight: 600; }
.timeline-item .project-list em { 
  color: var(--muted); font-style: normal; font-size: 13px; 
  font-family: var(--font-mono);
}

/* Projects */
.projects-grid { display: grid; gap: var(--space-4); }
@media (min-width: 860px) { .projects-grid { grid-template-columns: repeat(3, 1fr); } }
.project-card { 
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; 
  background: var(--elev); box-shadow: var(--ring); 
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.project-card:hover { 
  transform: translateY(-4px); 
  box-shadow: 0 16px 48px -16px rgba(0,0,0,0.6); 
  border-color: rgba(136,192,208,0.3);
}
.project-card img { 
  aspect-ratio: 16 / 9; object-fit: cover; 
  background: var(--surface); border-bottom: 1px solid var(--line); 
}
.project-body { padding: var(--space-4); }
.project-body h3 { margin: 0 0 10px; font-size: 17px; color: #e0e7f0; font-weight: 600; }
.project-body p { margin: 0; color: #cbd5e1; line-height: 1.65; }
.project-body em { 
  display: block; margin-top: 8px; color: var(--muted); font-style: normal; 
  font-size: 12px; font-family: var(--font-mono);
}

/* Contact */
.contact { text-align: center; max-width: 800px; }
.contact p { color: #cbd5e1; }
.contact .contact-cta { 
  margin-top: var(--space-5); display: flex; gap: var(--space-3); 
  justify-content: center; flex-wrap: wrap; 
}

/* Footer */
.site-footer { 
  border-top: 1px solid var(--line); padding: var(--space-5) 0; 
  background: linear-gradient(to top, rgba(10,14,18,0.8), rgba(10,14,18,0)); 
}
.footer-inner { 
  display: flex; align-items: center; justify-content: space-between; 
  gap: var(--space-3); flex-wrap: wrap; font-size: 14px;
}
.footer-inner p { margin: 0; color: var(--muted); }
.back-to-top { color: var(--muted); transition: color .2s ease; }
.back-to-top:hover { color: var(--accent); }

/* Reveal animations */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .65s ease, transform .65s ease; }
  [data-reveal].revealed { opacity: 1; transform: none; }
}

/* Accessibility focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
