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

:root {
  --bg:        #080c14;
  --bg2:       #0d1421;
  --bg3:       #111b2e;
  --border:    rgba(0, 170, 255, 0.12);
  --border2:   rgba(0, 170, 255, 0.22);
  --blue:      #00aaff;
  --blue-dim:  rgba(0, 170, 255, 0.08);
  --blue-glow: rgba(0, 170, 255, 0.15);
  --text:      #e8edf5;
  --text-dim:  #8a9ab8;
  --text-faint:#4a5a78;
  --font-head: 'Syne', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

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

/* ── NAV ─────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.dot { color: var(--blue); }
.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin-left: auto;
}
.nav-links a {
  font-size: 0.875rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--blue); }
.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--blue);
  border-radius: 4px;
  color: var(--blue);
  background: transparent;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.03em;
}
.nav-cta:hover { background: var(--blue); color: var(--bg); }

/* ── HERO ────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 2rem 80px;
  position: relative;
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 170, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 170, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0,170,255,0.06) 0%, transparent 65%);
  pointer-events: none;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-inner > *:not(.hero-visual) { grid-column: 1; }
.hero-visual { grid-column: 2; grid-row: 1 / 8; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--blue);
  border: 1px solid var(--border2);
  background: var(--blue-dim);
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  width: fit-content;
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-heading {
  font-family: var(--font-head);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.accent { color: var(--blue); }

.hero-sub {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  letter-spacing: 0.01em;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: 520px;
  margin-bottom: 1rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-block;
  background: var(--blue);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.7rem 1.6rem;
  border-radius: 4px;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border2);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 0.7rem 1.4rem;
  border-radius: 4px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

.hero-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: fit-content;
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
}
.stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}
.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border2);
}

/* ── TERMINAL ─────────────────────────────────── */
.terminal {
  background: #050a12;
  border: 1px solid var(--border2);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 170, 255, 0.08);
}
.terminal-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.t-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
}
.t-dot.red    { background: #ff5f57; }
.t-dot.yellow { background: #febc2e; }
.t-dot.green  { background: #28c840; }
.t-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-left: 0.5rem;
}
.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
}
.t-prompt { color: var(--blue); margin-right: 0.5rem; }
.t-out    { color: var(--text-faint); }
.t-success { color: #28c840; }
.cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ── SKILLS STRIP ─────────────────────────────── */
.skills-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  padding: 0.9rem 2rem;
  overflow: hidden;
}
.skills-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.sep { color: var(--text-faint); }

/* ── SECTION SHARED ───────────────────────────── */
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--blue);
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}
.section-heading {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.section-sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 560px;
  margin-bottom: 3rem;
}

/* ── PROJECTS ─────────────────────────────────── */
.projects {
  padding: 100px 2rem;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  position: relative;
  transition: border-color 0.25s, transform 0.25s;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.project-card::before {
  content: attr(data-index);
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}
.project-card:hover {
  border-color: var(--border2);
  transform: translateY(-4px);
}

.project-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.project-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.project-icon.security { background: rgba(255, 80, 80, 0.12); color: #ff6b6b; }
.project-icon.agri     { background: rgba(40, 200, 64, 0.1);  color: #4dd07a; }
.project-icon.backup   { background: rgba(255, 170, 0, 0.1);  color: #ffaa33; }
.project-icon.cost     { background: rgba(0, 170, 255, 0.1);  color: var(--blue); }

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.project-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.75;
  flex: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.project-tech span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid rgba(0, 170, 255, 0.15);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.project-footer {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  transition: color 0.2s;
}
.project-link:hover { color: var(--blue); }

/* ── ARCHITECTURE ─────────────────────────────── */
.arch {
  padding: 80px 2rem;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.arch-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  transition: border-color 0.2s;
}
.arch-card:hover { border-color: var(--border2); }
.arch-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.arch-card h4 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.arch-card p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.65;
}

/* ── CONTACT ──────────────────────────────────── */
.contact {
  padding: 120px 2rem;
  text-align: center;
}
.contact-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.contact-heading {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}
.contact-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 480px;
  margin-bottom: 2.5rem;
  line-height: 1.75;
}
.contact-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  border: 1px solid var(--border2);
  transition: all 0.2s;
}
.contact-btn.email {
  background: rgba(34, 197, 94, 0.08);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.25);
}
.contact-btn.email:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.45);
}
.contact-btn.linkedin {
  background: rgba(10, 102, 194, 0.1);
  color: #5eaeff;
  border-color: rgba(10, 102, 194, 0.3);
}
.contact-btn.linkedin:hover {
  background: rgba(10, 102, 194, 0.2);
  border-color: rgba(10, 102, 194, 0.5);
}
.contact-btn.github {
  background: var(--blue-dim);
  color: var(--blue);
}
.contact-btn.github:hover { background: rgba(0, 170, 255, 0.14); }

/* ── FOOTER ───────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  padding: 1.5rem 2rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.footer-links {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.footer-links a {
  color: var(--text-faint);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--blue); }

.arch-card strong {
  color: var(--blue);
  font-weight: 500;
}
/* ── RESPONSIVE — TABLET (max 900px) ─────────── */
@media (max-width: 900px) {
  .hero-inner {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }
  .hero-visual { width: 100%; }
  .hero-heading { font-size: 3rem; }
  .projects-grid { grid-template-columns: 1fr 1fr; }
  .arch-grid { grid-template-columns: 1fr 1fr; }
}

/* ── RESPONSIVE — MOBILE (max 600px) ─────────── */
@media (max-width: 600px) {
  /* Nav */
  .nav-inner { padding: 0 1rem; gap: 0.75rem; }
  .nav-links { display: none; }
  .nav-cta { font-size: 0.75rem; padding: 0.4rem 0.8rem; }

  /* Hide terminal on mobile — content is what matters on small screens */
  .hero-visual { display: none; }

  /* Hero — clean padding, no overflow */
  .hero { padding: 100px 1.25rem 60px; min-height: auto; }
  .hero-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
  }

  /* Typography */
  .hero-heading { font-size: 2.4rem; letter-spacing: -0.02em; line-height: 1.05; }
  .hero-sub { font-size: 0.8rem; }
  .hero-desc { font-size: 0.875rem; max-width: 100%; }

  /* Buttons — full width and stackable */
  .hero-actions { flex-direction: column; gap: 0.75rem; width: 100%; }
  .btn-primary, .btn-ghost {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Stats — compact 3 column grid */
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    width: 100%;
    padding: 0.875rem 1rem;
  }
  .stat-divider { display: none; }
  .stat-num { font-size: 1.2rem; }
  .stat-label { font-size: 0.6rem; }

  /* Skills strip */
  .skills-strip { padding: 0.75rem 1rem; }
  .skills-inner { font-size: 0.72rem; gap: 0.35rem 0.5rem; }

  /* Projects */
  .projects { padding: 60px 1.25rem; }
  .projects-grid { grid-template-columns: 1fr; gap: 1rem; }
  .section-heading { font-size: 1.75rem; }
  .section-sub { font-size: 0.875rem; margin-bottom: 2rem; }
  .project-card { padding: 1.25rem; }
  .project-tech span { font-size: 0.65rem; }

  /* Architecture */
  .arch { padding: 60px 1.25rem; }
  .arch-grid { grid-template-columns: 1fr; gap: 1rem; }
  .arch-card { padding: 1.25rem; }

  /* Contact */
  .contact { padding: 80px 1.25rem; }
  .contact-heading { font-size: 2rem; }
  .contact-links { flex-direction: column; width: 100%; }
  .contact-btn { width: 100%; justify-content: center; }

  /* Footer */
  .footer { padding: 1.25rem 1rem; }
  .footer-inner { flex-direction: column; gap: 0.75rem; text-align: center; }
  .footer-links { justify-content: center; flex-wrap: wrap; }

  /* Section inner padding */
  .section-inner { padding: 0 1.25rem; }
}

/* ── FADE-IN ANIMATION ────────────────────────── */
.hero-badge, .hero-heading, .hero-sub, .hero-desc,
.hero-actions, .hero-stats {
  animation: fadeUp 0.6s ease both;
}
.hero-badge    { animation-delay: 0.1s; }
.hero-heading  { animation-delay: 0.2s; }
.hero-sub      { animation-delay: 0.3s; }
.hero-desc     { animation-delay: 0.4s; }
.hero-actions  { animation-delay: 0.5s; }
.hero-stats    { animation-delay: 0.6s; }
.hero-visual   { animation: fadeUp 0.7s 0.3s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── PARAGRAPH & SPACING RESET FOR MOBILE ──────── */
/* Targets all screens under 768px                  */
@media (max-width: 768px) {
  /* Reset constrained max-widths that cause awkward spacing on small screens */
  .hero-desc,
  .section-sub,
  .contact-desc,
  .arch-card p,
  .project-desc {
    max-width: 100% !important;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  /* Reduce large bottom margins on section intros */
  .section-sub { margin-bottom: 1.5rem; }
  .hero-desc { margin-bottom: 0.75rem; }
  .contact-desc { margin-bottom: 1.5rem; }

  /* Reduce oversized section top/bottom padding */
  .projects { padding-top: 50px; padding-bottom: 50px; }
  .arch     { padding-top: 50px; padding-bottom: 50px; }
  .contact  { padding-top: 60px; padding-bottom: 60px; }

  /* Ensure nothing overflows the viewport horizontally */
  * { max-width: 100vw; }
  body { overflow-x: hidden; }
}