/* Global variables */
:root {
  --bg: #0d1117;
  --bg2: #111820;
  --bg3: #161e28;
  --navy: #0f2236;
  --blue: #2a7dd4;
  --blue-light: #4a9de4;
  --cyan: #38bdf8;
  --text: #e2e8f0;
  --text-muted: #7d9ab5;
  --text-dim: #3d5a73;
  --border: #1e3347;
  --border-light: #243d54;
  --card: #111d2a;
}

/* Reset & basics */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

/* NOISE OVERLAY */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.4;
}

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 4rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  color: var(--cyan);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--cyan); }

/* HERO */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 4rem 4rem;
  position: relative;
  overflow: hidden;
  max-width: 1500px;      /* limit width */
  margin: 0 auto;         /* centre the hero on large screens */
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
  opacity: 0.3;
}

/* HERO (continued) */

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42,125,212,0.12) 0%, transparent 70%);
  top: 50%;
  right: -100px;
  transform: translateY(-50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 780px;
}

.hero-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--cyan);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}

.hero-tag::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--cyan);
}

.hero-name {
  font-family: 'Syne', sans-serif;
  font-size: clamp(3.5rem, 7vw, 6.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.35s forwards;
}

.hero-name span {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--blue-light);
}

.hero-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.45s forwards;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 3rem;
  line-height: 1.8;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.55s forwards;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.65s forwards;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  background: var(--blue);
  color: white;
  text-decoration: none;
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  border-radius: 4px;
  transition: background 0.2s, transform 0.2s;
}

.btn-primary:hover { background: var(--blue-light); transform: translateY(-1px); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  border-radius: 4px;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-1px); }

.hero-stats {
  position: absolute;
  right: 4rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  opacity: 0;
  animation: fadeIn 1s ease 0.9s forwards;
}

.stat {
  text-align: right;
  border-right: 2px solid var(--blue);
  padding-right: 1.2rem;
}

.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

/* SECTIONS */
section {
  padding: 6rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--cyan);
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3rem;
  letter-spacing: -0.02em;
}

/* SKILLS */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.skill-card {
  background: var(--card);
  padding: 1.8rem;
  transition: background 0.2s;
}

.skill-card:hover { background: var(--bg3); }

.skill-icon {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.skill-name {
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  background: var(--navy);
  color: var(--cyan);
  border-radius: 3px;
  letter-spacing: 0.03em;
  border: 1px solid rgba(56,189,248,0.15);
}

/* PROJECTS */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.project-card:hover { border-color: var(--border-light); transform: translateY(-3px); }
.project-card:hover::before { transform: scaleX(1); }

.project-type {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--blue-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.project-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.project-link {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap 0.2s;
}

.project-link:hover { gap: 0.7rem; }

/* EXPERIENCE */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--blue), transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: 3rem;
  padding-left: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.4rem;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px rgba(42,125,212,0.2);
}

.timeline-date {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.timeline-role {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.timeline-company {
  font-size: 0.9rem;
  color: var(--blue-light);
  margin-bottom: 0.75rem;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* WRITING SECTION */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
}

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem 1.8rem;
  text-decoration: none;
  display: block;
  transition: border-color 0.2s, transform 0.2s;
}

.post-card:hover { border-color: var(--blue-light); transform: translateY(-2px); }

.post-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.post-title {
  font-family: 'Syne', sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* CONTACT */
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-text {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
}

.contact-link:hover { color: var(--cyan); }

.contact-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.contact-link:hover .contact-icon { border-color: var(--cyan); }

.availability {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
}

.avail-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: #4ade80;
  margin-bottom: 1rem;
}

.avail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74,222,128,0.2);
  animation: pulse 2s ease infinite;
}

.avail-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.avail-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--cyan); }

/* DIVIDER */
.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 4rem;
  max-width: calc(100% - 8rem);
}

/* ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(74,222,128,0.2); }
  50% { box-shadow: 0 0 0 6px rgba(74,222,128,0.1); }
}

.fade-in-section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-section.visible {
  opacity: 1;
  transform: none;
}

/* MODAL */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
}

.modal.open {
  display: block;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1350px, calc(100% - 3rem));
  max-height: calc(100vh - 4rem);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-y: auto;
  padding: 3rem;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { transform: translate(-50%, calc(-50% + 16px)); opacity: 0; }
  to { transform: translate(-50%, -50%); opacity: 1; }
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  background: none;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  margin-bottom: 1.5rem;
}

.modal-close:hover { border-color: var(--cyan); color: var(--cyan); }

.modal-loading,
.modal-error {
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
}

/* Prose styles for rendered markdown */
.prose h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.prose h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.prose p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1.1rem;
}

.prose ul,
.prose ol {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  padding-left: 1.5rem;
  margin-bottom: 1.1rem;
}

.prose li { margin-bottom: 0.3rem; }

.prose a { color: var(--cyan); text-decoration: none; }
.prose a:hover { text-decoration: underline; }

.prose code {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  background: var(--navy);
  color: var(--cyan);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid rgba(56,189,248,0.15);
}

.prose pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text);
}

.prose blockquote {
  border-left: 3px solid var(--blue);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* HAMBURGER */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* RESPONSIVE */
@media (max-width: 768px) {
  nav {
    padding: 0 1.5rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(13, 17, 23, 0.97);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    border-top: 1px solid var(--border);
  }

  .nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 852px) { /*768*/
  nav {
    padding: 0 1.5rem;
    gap: 1rem;
  }

  .nav-links {
    gap: 1.2rem;
  }

  .nav-links a {
    font-size: 0.7rem;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 6rem 1.5rem 4rem;
    min-height: 100svh;
  }

  .hero-stats {
    position: static;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 3rem;
    opacity: 0;
    animation: fadeIn 1s ease 0.9s forwards;
  }

  .stat {
    text-align: left;
    border-right: none;
    border-left: 2px solid var(--blue);
    padding-right: 0;
    padding-left: 1rem;
  }

  section {
    padding: 4rem 1.5rem;
  }

  .contact-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  footer {
    padding: 1.5rem;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .section-divider {
    margin: 0 1.5rem;
    max-width: calc(100% - 3rem);
  }
}

