/* ============================================================
   Awsaf.me — Personal portfolio
   Plain CSS. Dark theme default, light theme via [data-theme].
   ============================================================ */

:root {
  --bg: #0b1120;
  --bg-alt: #0f172a;
  --surface: #131c31;
  --surface-2: #1a2440;
  --border: #253048;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --heading: #f8fafc;
  --accent: #34d399;
  --accent-strong: #10b981;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --nav-h: 68px;
  --transition: 220ms ease;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #334155;
  --text-muted: #64748b;
  --heading: #0f172a;
  --accent: #059669;
  --accent-strong: #047857;
  --accent-soft: rgba(5, 150, 105, 0.09);
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.accent { color: var(--accent); }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

img, svg { display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--heading); font-weight: 600; }

/* Accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #06281c;
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
  z-index: 200;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: #06281c; }

/* ============ NAV ============ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--heading);
}
.nav__logo:hover { text-decoration: none; }
.nav__logo-img {
  width: 30px;
  height: 30px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav__links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition);
}
.nav__links a:hover,
.nav__links a.active { color: var(--accent); text-decoration: none; }

.nav__cta {
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding: 7px 16px;
  border-radius: 8px;
  color: var(--accent) !important;
}
.nav__cta:hover { background: var(--accent-soft); }

.nav__actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle:active { transform: scale(0.94); }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.nav__burger span {
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 48px) 0 64px;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  top: -20%;
  right: -10%;
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 65%);
  pointer-events: none;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.hero__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero__title {
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin-bottom: 22px;
}

.hero__sub {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 32px;
}

.hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  min-height: 44px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn--primary {
  background: var(--accent);
  color: #04251a;
}
.btn--primary:hover {
  background: var(--accent-strong);
  color: #ffffff;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn--ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero__social { display: flex; gap: 8px; }
.hero__social a {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
}
.hero__social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
  text-decoration: none;
}

/* Photo + code window composition */
.hero__photo {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  pointer-events: none;
}
.hero__photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 861;
  object-fit: cover;
}

.code-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  z-index: 1;
  width: min(88%, 420px);
  margin: -64px 0 0 -18px;
  transform: rotate(-1.2deg);
  transition: transform 300ms ease;
}
.code-window:hover { transform: rotate(0deg) translateY(-4px); }

.code-window__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.code-window__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c);
}
.code-window__title {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.code-window__body {
  padding: 18px 20px;
  font-size: 0.78rem;
  line-height: 1.75;
  overflow-x: auto;
  color: var(--text);
}
.tok-kw { color: #c084fc; }
.tok-var { color: #7dd3fc; }
.tok-key { color: #f0abfc; }
.tok-str { color: #86efac; }
.tok-fn { color: #fbbf24; }
[data-theme="light"] .tok-kw { color: #7c3aed; }
[data-theme="light"] .tok-var { color: #0369a1; }
[data-theme="light"] .tok-key { color: #a21caf; }
[data-theme="light"] .tok-str { color: #047857; }
[data-theme="light"] .tok-fn { color: #b45309; }

/* ============ STATS ============ */
.stats { padding: 8px 0 24px; }
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  transition: border-color var(--transition), transform var(--transition);
}
.stat:hover { border-color: var(--accent); transform: translateY(-4px); }
.stat__num {
  display: block;
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  display: block;
  margin-top: 6px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* ============ SECTIONS ============ */
.section { padding: 96px 0; }
.section--alt { background: var(--bg-alt); }

.section__kicker {
  color: var(--accent);
  font-size: 0.88rem;
  margin-bottom: 10px;
}
.section__title {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
  display: block;
}

/* ============ ABOUT ============ */
.about__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  align-items: start;
}
.about__text p { margin-bottom: 18px; color: var(--text-muted); }
.about__text p:last-child { margin-bottom: 0; }

.fact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.fact-card__title {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 18px;
}
.fact-card__list { list-style: none; }
.fact-card__list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
}
.fact-card__list li:last-child { border-bottom: none; }
.fact-card__list svg { color: var(--accent); flex-shrink: 0; }

/* ============ TIMELINE ============ */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}

.timeline__item {
  position: relative;
  padding-bottom: 28px;
}
.timeline__item:last-child { padding-bottom: 0; }

.timeline__marker {
  position: absolute;
  left: -28px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 3px solid var(--accent);
  z-index: 1;
}

.timeline__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.timeline__card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

.timeline__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 10px;
}
.timeline__head h3 {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--heading);
}
.timeline__date {
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.timeline__card > p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 14px; }

/* Tags */
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags li {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  padding: 3px 10px;
  border-radius: 999px;
}
.tags--lg li { font-size: 0.8rem; padding: 5px 13px; }

/* ============ PROJECTS ============ */
.featured {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 40px;
  align-items: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 18px;
  padding: 44px;
  margin-bottom: 48px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.featured::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 10%, transparent) 0%, transparent 70%);
  pointer-events: none;
}

.featured__badge {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  padding: 5px 14px;
  border-radius: 999px;
  z-index: 1;
}

.featured__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 14px;
}
.featured__desc { color: var(--text-muted); margin-bottom: 20px; max-width: 60ch; }
.featured .tags { margin-bottom: 26px; }

.featured__visual { position: relative; z-index: 1; }
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 120px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 24px;
}
.waveform span {
  width: 5px;
  border-radius: 3px;
  background: var(--accent);
  height: 18%;
  animation: wave 1.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.09s);
}
.waveform span:nth-child(1) { --i: 0; } .waveform span:nth-child(2) { --i: 1; }
.waveform span:nth-child(3) { --i: 2; } .waveform span:nth-child(4) { --i: 3; }
.waveform span:nth-child(5) { --i: 4; } .waveform span:nth-child(6) { --i: 5; }
.waveform span:nth-child(7) { --i: 6; } .waveform span:nth-child(8) { --i: 7; }
.waveform span:nth-child(9) { --i: 8; } .waveform span:nth-child(10) { --i: 9; }
.waveform span:nth-child(11) { --i: 10; } .waveform span:nth-child(12) { --i: 11; }
.waveform span:nth-child(13) { --i: 12; } .waveform span:nth-child(14) { --i: 13; }
.waveform span:nth-child(15) { --i: 14; } .waveform span:nth-child(16) { --i: 15; }
@keyframes wave {
  0%, 100% { height: 18%; opacity: 0.55; }
  50% { height: 78%; opacity: 1; }
}
.waveform__caption {
  text-align: center;
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.project:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: var(--shadow);
}

.project__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}
.project__icon { color: var(--accent); }
.project__ext {
  color: var(--text-muted);
  padding: 6px;
  margin: -6px;
  border-radius: 8px;
  transition: color var(--transition);
}
.project__ext:hover { color: var(--accent); }

.project__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 8px;
}
.project__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  flex-grow: 1;
}

/* ============ STACK ============ */
.stack__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.stack__group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color var(--transition);
}
.stack__group:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.stack__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 18px;
}
.stack__heading svg { color: var(--accent); }

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chips li {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 8px;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
  cursor: default;
}
.chips li:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ============ CONTACT ============ */
.contact__inner { text-align: center; }
.contact .section__kicker { text-align: center; }
.contact__sub {
  color: var(--text-muted);
  max-width: 520px;
  margin: -16px auto 40px;
}
.contact__cards {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 34px;
  color: var(--text);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.contact-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.contact-card svg { color: var(--accent); }
.contact-card__label { font-weight: 700; color: var(--heading); }
.contact-card__value { font-size: 0.8rem; color: var(--text-muted); }

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer .mono { font-size: 0.8rem; }

/* ============ REVEAL ANIMATIONS ============ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .waveform span, .hero__dot { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero__card { max-width: 560px; }
  .code-window { margin: -56px 0 0 24px; }
  .projects__grid { grid-template-columns: repeat(2, 1fr); }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .featured { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .section { padding: 72px 0; }

  .nav__burger { display: flex; }
  .nav__links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 20px;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
  }
  .nav__links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav__links a { padding: 14px 4px; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
  .nav__links a:last-child { border-bottom: none; }
  .nav__cta { border: none; padding: 14px 4px; }

  .about__grid { grid-template-columns: 1fr; }
  .fact-card { position: static; }

  .featured { padding: 30px 24px; }
  .featured__badge { position: static; align-self: flex-start; margin-bottom: 14px; width: fit-content; }
  .featured__content { display: flex; flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .projects__grid { grid-template-columns: 1fr; }
  .stack__grid { grid-template-columns: 1fr; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat { padding: 20px 14px; }
  .stat__num { font-size: 1.7rem; }
  .hero__title { font-size: clamp(1.9rem, 8vw, 2.4rem); }
  .contact-card { flex: 1 1 100%; }
}
