/* ============================================================
   Ahmed Hassan Mohamed - Portfolio
   Modern dark theme (default) with light mode toggle
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --accent-grad: linear-gradient(120deg, #6366f1 0%, #22d3ee 100%);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --radius: 14px;
  --nav-h: 68px;
  --trans: 0.25s ease;
}

html[data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-soft: #0f1526;
  --bg-card: rgba(255, 255, 255, 0.035);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e6e9f2;
  --text-soft: #9aa3b8;
  --text-faint: #6b7385;
  --nav-bg: rgba(10, 14, 26, 0.78);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --code-bg: #0d1322;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f5f7fc;
  --bg-soft: #eef1f9;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --text: #131a2c;
  --text-soft: #4c566e;
  --text-faint: #8a92a6;
  --nav-bg: rgba(245, 247, 252, 0.82);
  --shadow: 0 10px 30px rgba(30, 41, 82, 0.12);
  --code-bg: #0d1322;
  color-scheme: light;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background var(--trans), color var(--trans);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(560px 380px at 85% -5%, rgba(99, 102, 241, 0.16), transparent 70%),
    radial-gradient(520px 360px at 0% 30%, rgba(34, 211, 238, 0.10), transparent 70%);
}

img, svg { display: inline-block; vertical-align: middle; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  width: min(1140px, 92%);
  margin-inline: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--trans), box-shadow var(--trans), background var(--trans), border-color var(--trans);
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(99, 102, 241, 0.5); }

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--bg-card);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.logo span {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-soft);
  position: relative;
  padding: 6px 0;
  transition: color var(--trans);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--trans);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after, .nav-links a:hover::after { transform: scaleX(1); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-soft);
  cursor: pointer;
  transition: color var(--trans), border-color var(--trans), transform var(--trans);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: rotate(15deg); }

html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: block; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  width: 22px; height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section.alt { background: var(--bg-soft); transition: background var(--trans); }

.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
  margin-bottom: 14px;
}
.section-title::after {
  content: "";
  display: block;
  width: 52px; height: 4px;
  margin-top: 10px;
  border-radius: 4px;
  background: var(--accent-grad);
}
.section-sub {
  color: var(--text-soft);
  max-width: 560px;
  margin-bottom: 48px;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: var(--nav-h);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-tagline {
  font-family: var(--mono);
  color: var(--accent-2);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.hero-name {
  font-size: clamp(2.4rem, 5.4vw, 3.8rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.hero-name span.gradient,
.hero-name.gradient {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-title {
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  font-weight: 600;
  color: var(--text-soft);
  margin: 12px 0 20px;
  font-family: var(--mono);
}

.hero-desc {
  color: var(--text-soft);
  max-width: 520px;
  margin-bottom: 30px;
}
.hero-desc strong { color: var(--text); font-weight: 600; }

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }

.hero-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 0.83rem;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.meta-chip svg { color: var(--accent); }

/* Code window */
.code-window {
  background: var(--code-bg);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--trans);
}
.code-window:hover { transform: translateY(-6px) rotate(0.4deg); }

.code-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.code-title { margin-left: 8px; font-family: var(--mono); font-size: 0.75rem; color: #6b7385; }

.code-body {
  padding: 20px 22px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.75;
  color: #c8d0e0;
  overflow-x: auto;
}
.code-body .cm { color: #5b647a; }
.code-body .kw { color: #c792ea; }
.code-body .ty { color: #82aaff; }
.code-body .st { color: #c3e88d; }
.code-body .fn { color: #ffcb6b; }
.code-body .lt { color: #89ddff; }

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-faint);
  animation: bob 2.2s ease-in-out infinite;
}
.scroll-hint:hover { color: var(--accent); }
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: start;
}

.about-text p {
  color: var(--text-soft);
  margin-bottom: 18px;
}
.about-text strong { color: var(--text); font-weight: 600; }

.about-cards { display: grid; gap: 18px; }

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: transform var(--trans), border-color var(--trans), background var(--trans);
}
.info-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.5);
  background: var(--bg-card-hover);
}
.info-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-card h3::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-grad);
}
.info-card p { color: var(--text-soft); font-size: 0.92rem; margin-bottom: 5px; }
.info-card p strong { color: var(--text); }

.lang-list li {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-soft);
  margin-bottom: 12px;
}
.lang-list em { font-style: normal; font-size: 0.78rem; color: var(--text-faint); }

.bar-wrap {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.bar {
  display: block;
  height: 100%;
  width: var(--w, 50%);
  border-radius: 999px;
  background: var(--accent-grad);
}

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list li {
  font-size: 0.82rem;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
  transition: color var(--trans), border-color var(--trans), transform var(--trans);
}
.info-card .chip-list li:hover,
.skill-card .chip-list li:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}
html[data-theme="dark"] .info-card .chip-list li,
html[data-theme="dark"] .skill-card .chip-list li { background: rgba(255, 255, 255, 0.03); }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  overflow: hidden;
  transition: transform var(--trans), border-color var(--trans), background var(--trans), box-shadow var(--trans);
}
.skill-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.skill-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: var(--shadow);
  background: var(--bg-card-hover);
}
.skill-card:hover::before { transform: scaleX(1); }

.skill-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(34, 211, 238, 0.14));
  color: var(--accent);
  margin-bottom: 16px;
}
.skill-card h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 14px; }

/* ---------- Experience timeline ---------- */
.timeline {
  position: relative;
  max-width: 780px;
  margin-inline: auto;
  padding-left: 34px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}

.t-item { position: relative; margin-bottom: 34px; }
.t-item:last-child { margin-bottom: 0; }

.t-dot {
  position: absolute;
  left: -32px;
  top: 24px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}
.t-item:first-child .t-dot {
  background: var(--accent-grad);
  border-color: transparent;
}

.t-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  transition: transform var(--trans), border-color var(--trans), background var(--trans), box-shadow var(--trans);
}
.t-card:hover {
  transform: translateX(6px);
  border-color: rgba(99, 102, 241, 0.5);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow);
}

.t-dates {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-2);
}
.t-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 10px;
}
.t-badge.present {
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.22), rgba(34, 211, 238, 0.18));
  color: var(--accent-2);
  border: 1px solid rgba(34, 211, 238, 0.4);
}

.t-card h3 { font-size: 1.15rem; font-weight: 700; margin: 8px 0 3px; }
.t-card h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--mono);
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--trans), border-color var(--trans), box-shadow var(--trans), background var(--trans);
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--shadow);
  background: var(--bg-card-hover);
}

.project-thumb {
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(220px 120px at 50% 120%, rgba(255, 255, 255, 0.22), transparent 70%);
}
.project-thumb svg { filter: drop-shadow(0 4px 14px rgba(0,0,0,0.3)); }

.thumb-1 { background: linear-gradient(135deg, #4f46e5, #06b6d4); }
.thumb-2 { background: linear-gradient(135deg, #0ea5e9, #22c55e); }
.thumb-3 { background: linear-gradient(135deg, #10b981, #0891b2); }
.thumb-4 { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.thumb-5 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.thumb-6 { background: linear-gradient(135deg, #ef4444, #f59e0b); }

.project-cat {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 4px 12px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.project-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.project-body h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.project-body p { color: var(--text-soft); font-size: 0.9rem; flex: 1; }

.tech-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tech-list li {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 4px 11px;
  border-radius: 7px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent);
  border: 1px solid rgba(99, 102, 241, 0.28);
}
html[data-theme="light"] .tech-list li { color: #4338ca; border-color: rgba(99, 102, 241, 0.35); }
.tech-list li.suggested {
  background: var(--bg-soft);
  color: var(--text-faint);
  border-color: var(--border);
}
.tech-list li em { font-size: 0.62rem; }

/* ---------- Education ---------- */
.edu-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 34px;
  transition: transform var(--trans), border-color var(--trans), box-shadow var(--trans), background var(--trans);
}
.edu-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--shadow);
  background: var(--bg-card-hover);
}

.edu-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(34, 211, 238, 0.14));
}

.edu-main h3 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; }
.edu-deg { color: var(--text-soft); margin-top: 4px; }

.edu-stats { display: flex; flex-direction: column; gap: 6px; }
.edu-stats span {
  font-size: 0.82rem;
  font-family: var(--mono);
  color: var(--accent-2);
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 36px;
  align-items: start;
}

.contact-lead { color: var(--text-soft); margin-bottom: 28px; max-width: 440px; }

.contact-list { display: grid; gap: 18px; }
.contact-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform var(--trans), border-color var(--trans), background var(--trans);
}
.contact-list li:hover {
  transform: translateX(6px);
  border-color: rgba(99, 102, 241, 0.5);
  background: var(--bg-card-hover);
}

.c-icon {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(34, 211, 238, 0.14));
}
.contact-list h4 { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint); margin-bottom: 2px; }
.contact-list a, .contact-list p { color: var(--text); font-size: 0.92rem; }
.contact-list a:hover { color: var(--accent); }

/* Contact form */
.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text-soft);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color var(--trans), box-shadow var(--trans), background var(--trans);
  resize: vertical;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-faint); }
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
  background: var(--bg-card);
}
.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

.btn-block { width: 100%; }

.form-status {
  margin-top: 12px;
  font-size: 0.85rem;
  min-height: 1.2em;
  text-align: center;
}
.form-status.ok { color: #22c55e; }
.form-status.err { color: #ef4444; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  background: var(--bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.footer p { color: var(--text-faint); font-size: 0.84rem; }
.footer-note { font-family: var(--mono); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 90;
  width: 46px; height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity var(--trans), transform var(--trans), border-color var(--trans), color var(--trans);
  box-shadow: var(--shadow);
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { color: #fff; background: var(--accent-grad); border-color: transparent; }

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .skills-grid, .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-desc { margin-inline: auto; }
  .hero-cta, .hero-meta { justify-content: center; }
  .hero-visual { max-width: 520px; margin-inline: auto; width: 100%; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .edu-card { grid-template-columns: auto 1fr; }
  .edu-stats { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 10px 22px; }
}

@media (max-width: 680px) {
  .section { padding: 70px 0; }
  .skills-grid, .projects-grid, .form-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr 1fr; }

  /* Mobile nav */
  .hamburger { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 14px 6% 22px;
    transform: translateY(-130%);
    transition: transform 0.35s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { width: 100%; padding: 10px 6px; font-size: 1rem; }
  .nav-links .theme-toggle { margin-top: 10px; }

  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 40px); padding-bottom: 60px; }
  .scroll-hint { display: none; }
  .code-body { font-size: 0.72rem; padding: 14px 16px; }

  .timeline { padding-left: 26px; }
  .t-dot { left: -24px; }
  .t-card { padding: 18px 18px; }

  .edu-card { padding: 22px; text-align: left; }
  .contact-grid { gap: 26px; }
  .contact-list li:hover, .t-card:hover, .skill-card:hover, .project-card:hover, .info-card:hover { transform: none; }
  .back-to-top { right: 18px; bottom: 18px; width: 42px; height: 42px; }
}

@media (max-width: 420px) {
  .form-row { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
}
