/* ============================================================
   faisalmerfin.dev — homepage
   Plain CSS, no build step. Dark theme default, light optional.
   ============================================================ */

:root,
[data-theme="dark"] {
  --bg: #0a0e14;
  --bg-soft: #0f1520;
  --bg-card: #121927;
  --border: #1f2a3c;
  --text: #dbe4f0;
  --text-dim: #8b99ad;
  --accent: #00add8;            /* Go cyan */
  --accent-soft: rgba(0, 173, 216, 0.12);
  --accent-strong: #25d0fa;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --term-bg: #0c1118;
  --grid-line: rgba(139, 153, 173, 0.07);
}

[data-theme="light"] {
  --bg: #f7f9fc;
  --bg-soft: #eef2f8;
  --bg-card: #ffffff;
  --border: #dde5ef;
  --text: #1c2733;
  --text-dim: #5b6b7e;
  --accent: #007d9c;
  --accent-soft: rgba(0, 125, 156, 0.10);
  --accent-strong: #00add8;
  --shadow: 0 12px 32px rgba(28, 39, 51, 0.10);
  --term-bg: #101722;
  --grid-line: rgba(28, 39, 51, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.mono, .eyebrow, .prompt, .terminal, .logo, .section-title, .card-domain, .entry-when, .tags span, .stat-num, .site-footer {
  font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.accent { color: var(--accent); }

::selection { background: var(--accent); color: #06121a; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.site-nav { margin-left: auto; display: flex; gap: 22px; }
.site-nav a {
  color: var(--text-dim); text-decoration: none; font-size: 14px;
  transition: color .2s ease;
}
.site-nav a:hover { color: var(--accent); }

.theme-toggle {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; transition: color .2s, border-color .2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ---------- hero ---------- */
.hero {
  padding: 88px 0 64px;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 36px 36px;
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: 48px; align-items: center;
}
.eyebrow { color: var(--accent); font-size: 14px; margin-bottom: 14px; }
.hero h1 {
  font-size: clamp(38px, 6vw, 56px);
  line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 14px;
}
.role { font-size: 17px; color: var(--text-dim); margin-bottom: 18px; font-weight: 500; }
.summary { color: var(--text-dim); max-width: 56ch; margin-bottom: 28px; }
.summary strong { color: var(--text); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 10px;
  font-size: 14.5px; font-weight: 600; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .2s, color .2s, border-color .2s;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #06121a; box-shadow: 0 6px 18px rgba(0, 173, 216, .25); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-links { display: flex; gap: 14px; }
.hero-links a {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-dim); transition: color .2s, border-color .2s, transform .15s;
}
.hero-links a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* terminal */
.terminal {
  background: var(--term-bg); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
  font-size: 13.5px;
}
.terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.red { background: #ff5f57; } .dot.yellow { background: #febc2e; } .dot.green { background: #28c840; }
.terminal-title { margin-left: 8px; color: #5b6b7e; font-size: 12px; }
.terminal-body { padding: 18px 18px 20px; line-height: 1.9; }
.terminal-body p { color: #c8d3e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.terminal-body .out { color: #7f8fa3; }
.prompt { color: var(--accent); font-weight: 600; }
.cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- stats ---------- */
.stats { border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; padding: 34px 24px;
}
.stat { text-align: center; }
.stat-num { display: block; font-size: 30px; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.stat-label { font-size: 13px; color: var(--text-dim); }

/* ---------- sections ---------- */
.section { padding: 76px 0 8px; }
.section-title { font-size: 24px; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.01em; }
.section-sub { color: var(--text-dim); margin-bottom: 34px; max-width: 64ch; }

/* ---------- project cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 60px; }
.card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; text-decoration: none; color: var(--text);
  transition: transform .18s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-icon { font-size: 26px; line-height: 1; }
.card-domain { font-size: 12px; color: var(--accent); }
.card h3 { font-size: 18px; letter-spacing: -0.01em; }
.card p { font-size: 14.5px; color: var(--text-dim); flex-grow: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  font-size: 12px; color: var(--text-dim);
  background: var(--accent-soft); color: var(--accent);
  padding: 3px 10px; border-radius: 999px;
}
.tags .tag-hot { background: var(--accent); color: #06121a; font-weight: 600; }

/* ---------- timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 8px; margin-bottom: 60px; }
.entry {
  display: grid; grid-template-columns: 180px 1fr; gap: 24px;
  padding: 26px 0; border-bottom: 1px dashed var(--border);
}
.entry:last-child { border-bottom: none; }
.entry-when { font-size: 13px; color: var(--text-dim); padding-top: 4px; }
.entry-body h3 { font-size: 17px; margin-bottom: 10px; letter-spacing: -0.01em; }
.entry-body ul { list-style: none; }
.entry-body li {
  position: relative; padding-left: 20px; margin-bottom: 8px;
  color: var(--text-dim); font-size: 14.5px;
}
.entry-body li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }

/* ---------- inventions ---------- */
.inventions { list-style: none; margin-bottom: 60px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inventions li {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; font-size: 14.5px; color: var(--text-dim);
  position: relative; padding-left: 44px;
}
.inventions li::before {
  content: "✦"; position: absolute; left: 18px; top: 15px; color: var(--accent);
}

/* ---------- skills ---------- */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 60px; }
.skill-group {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 22px;
}
.skill-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 12px; }

/* ---------- education ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 60px; }
.edu-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; }
.edu-card h3 { font-size: 15.5px; margin-bottom: 6px; }
.edu-card p { font-size: 14px; color: var(--text-dim); }

/* ---------- contact ---------- */
.contact { padding-bottom: 90px; text-align: center; }
.contact .section-title { margin-bottom: 18px; }
.contact-big { font-size: clamp(24px, 4vw, 36px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 10px; }
.contact .section-sub { margin: 0 auto 30px; }
.contact .hero-actions { justify-content: center; margin-bottom: 0; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); padding: 22px 0;
  font-size: 13px; color: var(--text-dim); background: var(--bg-soft);
}

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor { animation: none; }
  .btn:hover, .card:hover, .hero-links a:hover { transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero { padding: 64px 0 48px; }
  .cards { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  .inventions { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr; gap: 6px; }
  .site-nav { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero-actions .btn { width: 100%; text-align: center; }
}
