/* ========== THEME TOKENS ========== */
:root {
  --bg: #0b1220;
  --bg-soft: #111a2e;
  --card: #131e34;
  --border: #22304d;
  --text: #e6edf7;
  --muted: #8b9ab5;
  --accent: #10b981;      /* emerald – matches hijab green */
  --accent-2: #f5a524;    /* amber – matches floral print */
  --glow: rgba(16, 185, 129, 0.25);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
[data-theme="light"] {
  --bg: #f7f8fb;
  --bg-soft: #eef1f6;
  --card: #ffffff;
  --border: #dde3ee;
  --text: #0f172a;
  --muted: #5b6b85;
  --accent: #059669;
  --accent-2: #d97706;
  --glow: rgba(5, 150, 105, 0.18);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* ========== BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: hidden; overflow-x: clip; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
  transition: background .4s ease, color .4s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
strong { color: var(--accent); font-weight: 600; }

.grid-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .35;
  mask-image: radial-gradient(ellipse at top, #000 20%, transparent 70%);
}

/* ========== NAV ========== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; width: 100%; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1rem, 5vw, 4rem);
  transition: background .3s, box-shadow .3s, padding .3s;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
  padding-block: .7rem;
}
.logo { font-family: var(--mono); font-weight: 600; font-size: 1.15rem; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { font-size: .95rem; color: var(--muted); position: relative; transition: color .2s; }
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0;
  background: var(--accent); transition: width .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-actions { display: flex; gap: .5rem; align-items: center; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  display: grid; place-items: center; cursor: pointer; transition: transform .2s, border-color .2s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
[data-theme="dark"] .sun { display: block; } [data-theme="dark"] .moon { display: none; }
[data-theme="light"] .sun { display: none; } [data-theme="light"] .moon { display: block; }
.menu-btn { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.menu-btn span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: .3s; }
.menu-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ========== HERO ========== */
.hero {
  min-height: 100vh;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center;
  padding: 7rem clamp(1rem, 5vw, 4rem) 3rem;
  max-width: 1200px; margin: 0 auto;
  overflow-x: clip;
}
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.8rem); line-height: 1.05; letter-spacing: -.02em;
  background: linear-gradient(90deg, var(--text), var(--accent) 70%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.typed-line { font-size: clamp(1.2rem, 3vw, 1.7rem); font-weight: 500; margin: .6rem 0 1.2rem; min-height: 2.2em; }
.cursor { color: var(--accent); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.lead { color: var(--muted); max-width: 560px; font-size: 1.08rem; }
.cta { display: flex; flex-wrap: wrap; gap: 1rem; margin: 2rem 0 1.6rem; }
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .85rem 1.5rem; border-radius: 12px; font-weight: 600; font-size: .98rem;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px var(--glow); }
.btn.primary:hover { transform: translateY(-3px); box-shadow: 0 12px 30px var(--glow); }
.btn.ghost { border: 1px solid var(--border); background: var(--card); }
.btn.ghost:hover { border-color: var(--accent); transform: translateY(-3px); }
.socials { display: flex; gap: 1.1rem; }
.socials a { color: var(--muted); transition: color .2s, transform .2s; }
.socials a:hover { color: var(--accent); transform: translateY(-3px); }

.hero-visual { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.avatar-wrap { position: relative; width: min(320px, 72vw); aspect-ratio: 1; }
.avatar {
  width: 100%; height: 100%; border-radius: 50%;
  box-shadow: 0 0 0 8px var(--bg-soft), 0 0 60px var(--glow);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-12px); } }
.orbit { position: absolute; inset: -22px; contain: layout paint; overflow: visible; border: 1px dashed var(--border); border-radius: 50%; animation: spin 24s linear infinite; }
.orbit span {
  position: absolute; font-family: var(--mono); font-weight: 600; font-size: .9rem;
  background: var(--card); border: 1px solid var(--border); color: var(--accent);
  padding: .3rem .55rem; border-radius: 10px; animation: spin 24s linear infinite reverse;
}
.orbit span:nth-child(1) { top: -14px; left: 50%; translate: -50% 0; }
.orbit span:nth-child(2) { bottom: 12%; left: -10px; color: var(--accent-2); }
.orbit span:nth-child(3) { bottom: 12%; right: -10px; }
@keyframes spin { to { rotate: 360deg; } }

.terminal {
  width: min(380px, 100%); background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.term-bar { display: flex; align-items: center; gap: 6px; padding: .6rem .9rem; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ef4444; }
.term-bar i:nth-child(2) { background: #f59e0b; } .term-bar i:nth-child(3) { background: #22c55e; }
.term-bar span { margin-left: auto; font-size: .75rem; color: var(--muted); }
.terminal pre { padding: 1rem 1.1rem; font-size: .8rem; overflow-x: auto; line-height: 1.7; }
.k { color: #c084fc; } .f { color: var(--accent); } .s { color: var(--accent-2); } .c { color: var(--muted); }

/* ========== SECTIONS ========== */
.section { max-width: 1100px; margin: 0 auto; padding: 5rem clamp(1rem, 5vw, 2rem); }
.section-title { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 2.5rem; display: flex; align-items: center; gap: .8rem; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); max-width: 300px; }
.sub-title { margin: 3.5rem 0 1.2rem; font-size: 1.3rem; }

.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem; align-items: center; }
.about-grid p { color: var(--muted); font-size: 1.05rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem .8rem; text-align: center; font-size: .82rem; color: var(--muted);
}
.stat .num { display: block; font-size: 2.2rem; font-weight: 700; color: var(--accent); font-family: var(--mono); }

.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.skill-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem; transition: transform .25s, border-color .25s, box-shadow .25s;
}
.skill-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 10px 30px var(--glow); }
.skill-card.wide { grid-column: 1 / -1; }
.skill-card h3 { font-family: var(--mono); font-size: 1rem; margin-bottom: 1rem; font-weight: 600; }
.chips, .tags { display: flex; flex-wrap: wrap; gap: .55rem; }
.chips span {
  padding: .4rem .85rem; border-radius: 999px; font-size: .88rem;
  background: var(--bg-soft); border: 1px solid var(--border); transition: .2s;
}
.chips span:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.timeline { list-style: none; position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), var(--border)); }
.timeline > li { position: relative; margin-bottom: 2.5rem; }
.timeline .dot { position: absolute; left: -2rem; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--glow); }
.timeline h3 { font-size: 1.15rem; margin: .2rem 0; }
.timeline ul { margin-top: .7rem; padding-left: 1.1rem; color: var(--muted); }
.timeline ul li { margin-bottom: .3rem; }
.timeline ul li::marker { color: var(--accent); }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.4rem; }
.project {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; display: flex; flex-direction: column; gap: .8rem;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.project:hover { transform: translateY(-8px); border-color: var(--accent); box-shadow: 0 16px 40px var(--glow); }
.project-top { display: flex; justify-content: space-between; align-items: center; color: var(--accent); }
.project h3 { font-size: 1.2rem; line-height: 1.3; }
.project h3 .muted { font-size: .9rem; font-weight: 400; }
.project p { color: var(--muted); font-size: .95rem; flex: 1; }
.tags span { font-family: var(--mono); font-size: .75rem; color: var(--accent-2); }

.certs { list-style: none; display: grid; gap: .8rem; }
.certs li { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1.1rem; }

.contact { text-align: center; }
.contact .section-title { justify-content: center; }
.contact .section-title::after { display: none; }
.contact .lead { margin: 0 auto 2rem; }
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2.2rem; }
.contact-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem; display: flex; flex-direction: column; gap: .3rem; word-break: break-word;
  transition: border-color .2s, transform .2s;
}
a.contact-card:hover { border-color: var(--accent); transform: translateY(-4px); }

.footer { text-align: center; padding: 2rem 1rem 3rem; border-top: 1px solid var(--border); }

.to-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem; width: 46px; height: 46px; border-radius: 50%;
  border: none; background: var(--accent); color: #fff; font-size: 1.2rem; cursor: pointer;
  box-shadow: 0 8px 20px var(--glow); opacity: 0; pointer-events: none; transform: translateY(20px);
  transition: .3s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ========== SCROLL REVEAL ========== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 6.5rem; gap: 2.5rem; }
  .hero-visual { order: -1; }
  .lead { margin-inline: auto; }
  .cta, .socials { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
  .terminal { display: none; }
}
@media (max-width: 760px) {
  .menu-btn { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(75vw, 300px);
    flex-direction: column; justify-content: center; gap: 2rem; padding: 2rem;
    background: var(--bg-soft); border-left: 1px solid var(--border);
    transform: translateX(100%); visibility: hidden;
    transition: transform .35s ease, visibility 0s linear .35s;
  }
  .nav-links.open { transform: none; visibility: visible; transition: transform .35s ease; }
  .avatar-wrap { width: min(260px, 64vw); }
  .orbit span:nth-child(2) { left: 0; }
  .orbit span:nth-child(3) { right: 0; }
  .nav-links a { font-size: 1.15rem; }
  .nav-actions { position: relative; z-index: 2; }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-cards { grid-template-columns: 1fr; }
  .section { padding-block: 3.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
