/* ─────────────────────────────────────────────
   TOKENS
───────────────────────────────────────────── */
:root {
  --bg:        #080a0f;
  --surface:   #0d1018;
  --card:      #111520;
  --border:    #1e2a3d;
  --border-hi: #2e4060;
  --text:      #d8e8f5;
  --muted:     #5d7a99;
  --accent:    #00d4ff;
  --accent-2:  #39ff8a;
  --red:       #ff4466;
  --font-mono: 'Space Mono', monospace;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─────────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,.03) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
}
.noise {
  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.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 1; opacity: .5;
}
.scanline {
  position: fixed; top: -6px; left: 0; right: 0; height: 6px;
  background: linear-gradient(transparent, rgba(0,212,255,.06), transparent);
  animation: scanline 8s linear infinite;
  pointer-events: none; z-index: 2;
}
@keyframes scanline { 0% { top: -6px; } 100% { top: 100vh; } }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { padding-left: 1.2rem; }
li { margin-bottom: .3rem; }
strong { color: var(--text); font-weight: 600; }
em { font-style: italic; color: var(--accent); }

/* ─────────────────────────────────────────────
   LAYOUT
───────────────────────────────────────────── */
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 10; }
.section { padding: 80px 0 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; }

/* ─────────────────────────────────────────────
   TYPOGRAPHY
───────────────────────────────────────────── */
.mono { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .04em; }
.tag  { color: var(--accent); }
.muted { color: var(--muted); }
.section-label {
  color: var(--accent); font-size: .75rem; letter-spacing: .12em;
  text-transform: uppercase; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.section-title { font-size: clamp(28px, 3.5vw, 42px); font-weight: 700; line-height: 1.2; margin-bottom: 48px; }

/* ─────────────────────────────────────────────
   HEADER
───────────────────────────────────────────── */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: rgba(8,10,15,.88); backdrop-filter: blur(14px);
  z-index: 100; margin: 0 -24px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-text strong { font-size: 1rem; letter-spacing: -.01em; }
.brand-text .mono { font-size: .7rem; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--card) url('../images/me.jpg') center/cover no-repeat;
  flex-shrink: 0; box-shadow: 0 0 12px rgba(0,212,255,.25);
}
nav { display: flex; align-items: center; gap: 20px; }
nav a { color: var(--muted); font-size: .9rem; transition: color .2s; }
nav a:hover { color: var(--text); text-decoration: none; }
nav a.nav-cta {
  background: var(--accent); color: var(--bg);
  padding: 8px 16px; border-radius: 8px;
  font-weight: 700; font-size: .85rem;
  transition: opacity .2s, transform .15s;
}
nav a.nav-cta:hover { opacity: .9; transform: translateY(-1px); text-decoration: none; }
.hamburger { display: none; }

/* ─────────────────────────────────────────────
   HERO
───────────────────────────────────────────── */
.hero { padding: 80px 0 40px; }
.hero-eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; color: var(--muted); }
.blink-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2); display: inline-block;
  box-shadow: 0 0 8px var(--accent-2);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }

.hero-title {
  font-size: clamp(40px, 7vw, 76px); font-weight: 700;
  line-height: 1.08; letter-spacing: -.02em;
  margin-bottom: 24px; overflow: hidden;
}
.hero-title .reveal-line {
  display: block; transform: translateY(110%);
  animation: slide-up .7s var(--ease-out-expo) forwards;
}
.hero-title .reveal-line:nth-child(2) { animation-delay: .12s; }
.hero-title .accent-line { color: var(--accent); }
@keyframes slide-up { to { transform: translateY(0); } }

.hero-sub { max-width: 560px; color: var(--muted); font-size: 1.05rem; margin-bottom: 32px; }

/* ─────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────── */
.btns { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px;
  border: 1px solid var(--border-hi); background: var(--card);
  color: var(--text); font-family: var(--font-body);
  font-size: .9rem; font-weight: 500; cursor: pointer;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); box-shadow: 0 0 16px rgba(0,212,255,.12); transform: translateY(-2px); text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, rgba(0,212,255,.15), rgba(57,255,138,.08));
  border-color: var(--accent); color: var(--accent); font-weight: 600;
}
.btn.primary:hover { box-shadow: 0 0 24px rgba(0,212,255,.2); color: var(--accent); }

/* ─────────────────────────────────────────────
   TERMINAL
───────────────────────────────────────────── */
.terminal-block {
  background: #060810; border: 1px solid var(--border-hi);
  border-radius: 14px; overflow: hidden; max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(0,212,255,.05);
}
.terminal-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: #0a0d14;
  border-bottom: 1px solid var(--border);
}
.tdot { width: 12px; height: 12px; border-radius: 50%; }
.tdot.red { background: #ff5f57; }
.tdot.yellow { background: #febc2e; }
.tdot.green { background: #28c840; }
.terminal-body {
  padding: 16px; font-family: var(--font-mono);
  font-size: .78rem; line-height: 1.9; min-height: 120px; color: #7fa8c9;
}
.terminal-body .cmd { color: var(--accent-2); }
.terminal-body .out { color: var(--muted); }
.terminal-body .hi  { color: var(--accent); }
.terminal-body .err { color: var(--red); }
.cursor {
  display: inline-block; width: 8px; height: 14px;
  background: var(--accent); vertical-align: middle;
  animation: cursor-blink .8s step-end infinite; margin-left: 2px;
}
@keyframes cursor-blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ─────────────────────────────────────────────
   STATS BAR
───────────────────────────────────────────── */
.stats-bar {
  display: flex; align-items: center;
  padding: 24px 28px; background: var(--card);
  border: 1px solid var(--border); border-radius: 16px; margin: 48px 0 0;
}
.stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-num { font-size: 2.4rem; font-weight: 700; color: var(--accent); line-height: 1; letter-spacing: -.02em; }
.stat-label { font-size: .72rem; color: var(--muted); text-align: center; letter-spacing: .04em; text-transform: uppercase; }
.stat-divider { width: 1px; height: 48px; background: var(--border); margin: 0 8px; }

/* ─────────────────────────────────────────────
   ABOUT
───────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 320px 1fr; gap: 40px; align-items: start; }
.about-img-wrap { position: relative; }
.about-img {
  width: 100%; aspect-ratio: 3/4; border-radius: 20px;
  border: 1px solid var(--border); background: var(--card) center/cover no-repeat;
}
.about-text h2 { font-size: clamp(24px, 3vw, 36px); line-height: 1.2; margin-bottom: 20px; font-weight: 700; }
.about-text p { color: var(--muted); margin-bottom: 16px; }
.about-text p strong { color: var(--text); }
.tags-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tags-row .tag, .tag {
  display: inline-block; background: rgba(0,212,255,.07);
  border: 1px solid rgba(0,212,255,.2); color: var(--accent);
  padding: 4px 10px; border-radius: 6px;
  font-size: .72rem; letter-spacing: .06em;
}

/* ─────────────────────────────────────────────
   FREELANCE BANNER
───────────────────────────────────────────── */
.freelance-banner {
  display: flex; gap: 20px; align-items: flex-start;
  background: linear-gradient(135deg, rgba(57,255,138,.06), rgba(0,212,255,.04));
  border: 1px solid rgba(57,255,138,.25);
  border-radius: 16px; padding: 24px 28px; margin-bottom: 32px;
}
.freelance-icon {
  color: var(--accent-2); background: rgba(57,255,138,.1);
  border: 1px solid rgba(57,255,138,.2); border-radius: 12px;
  width: 52px; height: 52px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.freelance-title { font-weight: 600; color: var(--accent-2); margin-bottom: 8px; font-size: 1rem; }
.freelance-banner p { color: var(--muted); font-size: .9rem; margin: 0; }
.freelance-banner p strong { color: var(--text); }

/* ─────────────────────────────────────────────
   SERVICES
───────────────────────────────────────────── */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 0;
}
.services-single { display: block; }

.service-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 28px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
  position: relative; overflow: hidden;
}
.service-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(400px at var(--mx,50%) var(--my,50%), rgba(0,212,255,.06), transparent 70%);
  opacity: 0; transition: opacity .4s; pointer-events: none;
}
.service-card:hover::before { opacity: 1; }
.service-card:hover { border-color: var(--border-hi); transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,.35); }
.service-card--featured { padding: 32px; }

.service-icon {
  color: var(--accent); margin-bottom: 16px;
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  background: rgba(0,212,255,.08); border-radius: 12px; border: 1px solid rgba(0,212,255,.15);
}
.service-card h3 { font-size: 1.05rem; margin-bottom: 10px; font-weight: 600; }
.service-card p { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.service-card ul { color: var(--muted); font-size: .85rem; }
.service-card li { margin-bottom: 4px; }

.service-features { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 20px 0; }
.sf-label { color: var(--accent); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.sf-col ul { color: var(--muted); font-size: .85rem; }
.service-cta-row {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--border);
}
.price-note { color: var(--muted); font-size: .72rem; }

/* ─────────────────────────────────────────────
   SKILLS
───────────────────────────────────────────── */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.skill-group { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.skill-group-label { color: var(--accent); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; }
.skill-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.skill-pills span {
  background: rgba(255,255,255,.04); border: 1px solid var(--border-hi);
  color: var(--text); font-size: .78rem; padding: 5px 11px; border-radius: 6px;
  transition: border-color .2s, color .2s;
}
.skill-pills span:hover { border-color: var(--accent); color: var(--accent); }

/* ─────────────────────────────────────────────
   TIMELINE — clean structure, date above card
───────────────────────────────────────────── */
.timeline {
  display: flex; flex-direction: column; gap: 32px;
  position: relative; padding-left: 28px;
}
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(to bottom, var(--accent), var(--border) 80%);
  border-radius: 2px;
}
.timeline-entry { position: relative; }
.timeline-dot {
  position: absolute; left: -28px; top: 20px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(0,212,255,.4); z-index: 1;
}
.timeline-content { display: flex; flex-direction: column; gap: 8px; }
.when { font-size: .72rem; color: var(--accent); letter-spacing: .06em; }

.timeline-card {
  display: grid; grid-template-columns: 200px 1fr;
  overflow: hidden; border-radius: 16px;
  background: var(--card); border: 1px solid var(--border);
  transition: border-color .25s;
}
.timeline-card:hover { border-color: var(--border-hi); }
.tl-img { background: #0a0d14 center/cover no-repeat; min-height: 160px; border-right: 1px solid var(--border); }
.tl-body { padding: 22px; }
.tl-body h3 { font-size: 1rem; margin-bottom: 10px; }
.tl-body h3 a { color: var(--text); }
.tl-body h3 a:hover { color: var(--accent); text-decoration: none; }
.tl-body p { color: var(--muted); font-size: .88rem; margin-bottom: 10px; }
.tl-body ul { color: var(--muted); font-size: .85rem; }

/* ─────────────────────────────────────────────
   CONTACT
───────────────────────────────────────────── */
.contact-wrap {
  display: grid; grid-template-columns: 1fr 1.4fr;
  gap: 48px; padding: 40px;
  position: relative; overflow: hidden;
}
.contact-wrap::before {
  content: ''; position: absolute; top: -60%; left: -30%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,212,255,.06) 0%, transparent 70%);
  pointer-events: none;
}
.contact-text h2 { font-size: clamp(24px, 2.8vw, 34px); line-height: 1.2; font-weight: 700; margin-bottom: 14px; }
.contact-text p { color: var(--muted); }

.contact-links-big { display: flex; flex-direction: column; gap: 12px; }
.contact-link-big {
  display: flex; align-items: center; gap: 16px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 20px; color: var(--text);
  transition: border-color .2s, background .2s, transform .15s;
  text-decoration: none;
}
.contact-link-big:hover {
  border-color: var(--accent); background: rgba(0,212,255,.05);
  transform: translateX(4px); text-decoration: none; color: var(--text);
}
.clb-icon {
  color: var(--accent); background: rgba(0,212,255,.08);
  border: 1px solid rgba(0,212,255,.15); border-radius: 10px;
  width: 44px; height: 44px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.clb-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.clb-label { font-size: .68rem; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; }
.clb-value { font-size: .88rem; color: var(--muted); }
.clb-arrow { color: var(--muted); flex-shrink: 0; transition: transform .2s; }
.contact-link-big:hover .clb-arrow { transform: translateX(3px); color: var(--accent); }

/* ─────────────────────────────────────────────
   LIGHTBOX
───────────────────────────────────────────── */
#lightbox {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.85); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
  cursor: zoom-out;
}
#lightbox.open { opacity: 1; pointer-events: all; }
#lightbox-img {
  max-width: 90vw; max-height: 88vh;
  object-fit: contain; border-radius: 12px;
  border: 1px solid var(--border-hi);
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
  transform: scale(.92);
  transition: transform .3s var(--ease-out-expo);
}
#lightbox.open #lightbox-img { transform: scale(1); }

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
footer { padding: 40px 0 24px; margin-top: 80px; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .78rem; }
.back-top { color: var(--muted); transition: color .2s; }
.back-top:hover { color: var(--accent); text-decoration: none; }

/* ─────────────────────────────────────────────
   ANIMATIONS
───────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-up { to { transform: translateY(0); } }

.reveal-up { animation: fade-up .7s var(--ease-out-expo) .1s both; }
.reveal-up + .reveal-up { animation-delay: .25s; }

.service-card,
.skill-group,
.timeline-entry,
.stats-bar {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s var(--ease-out-expo), transform .65s var(--ease-out-expo);
}
.service-card.animated,
.skill-group.animated,
.timeline-entry.animated,
.stats-bar.animated {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-up { animation: none; }
  .service-card, .skill-group, .timeline-entry, .stats-bar {
    opacity: 1; transform: none; transition: none;
  }
}

/* ─────────────────────────────────────────────
   RESPONSIVE — tablet
───────────────────────────────────────────── */
@media (max-width: 820px) {
  /* Hamburger */
  .hamburger {
    display: flex; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px; z-index: 110;
  }
  .hamburger span {
    display: block; width: 24px; height: 2px;
    background: var(--text); border-radius: 2px;
    transition: transform .3s, opacity .3s;
  }
  nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: rgba(8,10,15,.97);
    border-bottom: 1px solid var(--border); padding: 24px; gap: 20px;
    backdrop-filter: blur(14px); z-index: 100;
  }
  nav.open { display: flex; }
  nav a { font-size: 1.1rem; }

  /* Layout */
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .about-img { aspect-ratio: 4/3; max-width: 420px; }
  .contact-wrap { grid-template-columns: 1fr; gap: 32px; }
  .skills-grid, .service-features, .expertise-grid { grid-template-columns: 1fr; }
  .timeline-card { grid-template-columns: 1fr; }
  .tl-img { min-height: 180px; border-right: none; border-bottom: 1px solid var(--border); }

  /* Stats */
  .stats-bar { flex-wrap: wrap; gap: 0; padding: 20px 16px; }
  .stat { min-width: 50%; padding: 16px 0; }
  .stat-divider { display: none; }
  .stat-num { font-size: 2rem; }

  /* Timeline */
  .timeline { padding-left: 20px; }
}

/* ─────────────────────────────────────────────
   RESPONSIVE — mobile
───────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Base sizing */
  html { font-size: 17px; }
  .wrap { padding: 0 18px; }
  .section { padding: 60px 0 0; }

  /* Header */
  .site-header { padding: 16px 18px; margin: 0 -18px; }
  .brand-text strong { font-size: 1.05rem; }
  .avatar { width: 38px; height: 38px; }

  /* Hero */
  .hero { padding: 48px 0 32px; }
  .hero-title { font-size: clamp(36px, 10vw, 52px); }
  .hero-sub { font-size: 1rem; }
  .btns { flex-direction: column; gap: 10px; }
  .btns .btn { width: 100%; justify-content: center; padding: 14px 20px; font-size: 1rem; }
  .terminal-block { max-width: 100%; }
  .terminal-body { font-size: .82rem; }

  /* Stats */
  .stats-bar { margin-top: 32px; padding: 16px; }
  .stat { min-width: 50%; padding: 14px 0; }
  .stat-num { font-size: 2.2rem; }
  .stat-label { font-size: .75rem; }

  /* About */
  .about-img { aspect-ratio: 3/2; }
  .about-text h2 { font-size: 1.6rem; }
  .about-text p { font-size: .95rem; }
  .tags-row .tag { font-size: .78rem; padding: 5px 12px; }

  /* Section titles */
  .section-title { font-size: 1.8rem; margin-bottom: 28px; }
  .section-label { font-size: .78rem; }

  /* Cards */
  .service-card { padding: 22px; }
  .service-card h3 { font-size: 1.05rem; }
  .service-card p { font-size: .92rem; }

  /* Skills */
  .skill-group { padding: 18px; }
  .skill-pills span { font-size: .82rem; padding: 6px 13px; }

  /* Timeline */
  .timeline { padding-left: 18px; gap: 24px; }
  .timeline-dot { left: -22px; width: 12px; height: 12px; }
  .tl-img { min-height: 160px; }
  .tl-body { padding: 18px; }
  .tl-body h3 { font-size: 1rem; }
  .tl-body p { font-size: .9rem; }

  /* Contact */
  .contact-wrap { padding: 24px 20px; gap: 24px; }
  .contact-text h2 { font-size: 1.6rem; }
  .contact-link-big { padding: 14px 16px; gap: 12px; }
  .clb-value { font-size: .82rem; }

  /* Footer */
  footer { padding: 32px 0 20px; margin-top: 60px; }
  .footer-inner { flex-direction: column; gap: 10px; text-align: center; }
}