/* ==========================================================================
   Bashar Bkaya — Portfolio
   Design system: CSS variables, light/dark themes, responsive, accessible.
   ========================================================================== */

:root {
  --bg-base: #f5f6fa;
  --bg-surface: #ffffff;
  --bg-muted: #eceef5;
  --bg-code: #1e2430;

  --border: #e2e5ee;
  --border-strong: #d3d7e3;

  --text: #1b2233;
  --text-muted: #596179;
  --text-faint: #8a92a8;
  --text-on-accent: #ffffff;

  --shadow-sm: 0 1px 2px rgba(23, 29, 49, 0.06), 0 2px 6px rgba(23, 29, 49, 0.05);
  --shadow-md: 0 8px 24px rgba(23, 29, 49, 0.08);
  --shadow-lg: 0 18px 50px rgba(23, 29, 49, 0.12);

  --radius: 14px;
  --radius-sm: 8px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;

  --header-h: 72px;
  --container: 1140px;
}

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

body.dark {
  --bg-base: #0b0f17;
  --bg-surface: #131a24;
  --bg-muted: #1a222f;
  --bg-code: #0b0f17;

  --border: #232c3a;
  --border-strong: #303b4c;

  --text: #e6ecf4;
  --text-muted: #a7b2c5;
  --text-faint: #74809a;
  --text-on-accent: #ffffff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
}

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

html:not(.js) [data-reveal] { opacity: 1 !important; transform: none !important; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg-base);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--skin-color);
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  color: inherit;
}

ul { list-style: none; }

h1, h2, h3 { line-height: 1.2; font-weight: 700; }

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

::selection { background-color: var(--skin-color); color: var(--text-on-accent); }

/* ---------- Accessibility helpers ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px; left: 12px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: top 0.2s ease;
}

.skip-link:focus { top: 12px; }

.mono { font-family: var(--font-mono); }
.accent { color: var(--skin-color); }

.svg-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

.contact-card .svg-icon { font-size: 20px; }
.footer-social .svg-icon { font-size: 18px; }

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Section scaffolding ---------- */
.section {
  padding: 96px 0;
}

.section-alt { background-color: var(--bg-surface); }

.section-head {
  margin-bottom: 48px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--skin-color);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 800;
  position: relative;
  padding-bottom: 14px;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 4px; width: 52px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--skin-color), transparent);
}

.section-lede {
  margin-top: 14px;
  max-width: 640px;
  color: var(--text-muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
  background: var(--skin-color);
  color: var(--text-on-accent);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--skin-color) 35%, transparent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--skin-color) 45%, transparent);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--skin-color);
  color: var(--skin-color);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border-color: var(--skin-color);
  color: var(--skin-color);
}

.btn-outline:hover {
  background: var(--skin-color);
  color: var(--text-on-accent);
  transform: translateY(-2px);
}

.btn-sm { padding: 9px 16px; font-size: 14px; }

/* ---------- Header / nav ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  background: var(--bg-base);
  background: color-mix(in srgb, var(--bg-base) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.01em;
  color: var(--text);
  margin-right: auto;
}

.logo-mark {
  font-family: var(--font-mono);
  color: var(--skin-color);
}

.logo-dot { color: var(--skin-color); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-list {
  display: flex;
  gap: 4px;
}

.nav-link {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--skin-color);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.nav-link:hover { color: var(--text); background: var(--bg-muted); }
.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); }

.nav-link.is-active { color: var(--skin-color); font-weight: 600; }

.theme-toggle {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text);
  font-size: 16px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover { color: var(--skin-color); border-color: var(--skin-color); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.nav-toggle-bar {
  height: 2px; width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  padding-top: var(--header-h);
  padding-bottom: 64px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-role {
  margin-top: 8px;
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.hero-role-prompt {
  color: var(--skin-color);
  margin-right: 10px;
}

.hero-subtitle {
  margin-top: 12px;
  font-size: clamp(1rem, 1.6vw, 1.13rem);
  color: var(--text-muted);
  max-width: 56ch;
}

.hero-chips-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-top: 22px;
  margin-bottom: 10px;
}

.hero-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.hero-keywords li {
  font-size: 12px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.hero-actions .btn {
  padding: 10px 18px;
  font-size: 14px;
  gap: 7px;
}

.hero-photo {
  position: relative;
  width: min(360px, 100%);
  margin-inline: auto;
  aspect-ratio: 1 / 1;
}

.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  overflow: hidden;
  border: 6px solid var(--bg-surface);
  box-shadow: var(--shadow-lg);
  background: var(--bg-muted);
}

.hero-photo::before {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 2px dashed var(--skin-color);
  opacity: 0.45;
  z-index: -1;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
}

.about-text p {
  margin-bottom: 16px;
  color: var(--text-muted);
}

.about-text strong { color: var(--text); }
.about-text em { color: var(--skin-color); font-style: normal; font-weight: 600; }

.about-facts {
  display: grid;
  gap: 14px;
}

.fact {
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.fact dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.fact dd { font-size: 15px; font-weight: 500; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ---------- Skills ---------- */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.skill-group {
  padding: 24px;
}

.skill-group h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  margin-bottom: 16px;
}

.skill-group h3 i { color: var(--skin-color); width: 20px; text-align: center; }

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list li {
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ---------- Timeline (Experience) ---------- */
.timeline {
  position: relative;
  margin-left: 12px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 8px; bottom: 8px; left: 0;
  width: 2px;
  background: linear-gradient(var(--skin-color), color-mix(in srgb, var(--skin-color) 25%, transparent));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding: 26px 28px 26px 34px;
  margin-bottom: 24px;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -7px; top: 34px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--skin-color);
  border: 3px solid var(--bg-base);
  box-shadow: 0 0 0 2px var(--skin-color);
}

.timeline-head h3 { font-size: 19px; }
.timeline-head .company { color: var(--skin-color); font-weight: 600; }

.timeline-date {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 6px;
}

.timeline-date i { margin-right: 6px; }

.timeline-bullets {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.timeline-bullets li {
  position: relative;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 15px;
}

.timeline-bullets li::before {
  content: "";
  position: absolute;
  left: 2px; top: 9px;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--skin-color);
  transform: rotate(45deg);
}

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

.project-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.3s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.project-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 8.2;
  background: var(--bg-muted);
}

.project-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-media:not(.project-gallery) img { transform: scale(1.02); }

/* Project gallery (multi-image slider) */
.project-gallery {
  position: relative;
  aspect-ratio: 4 / 3;
}

.project-gallery-track {
  display: flex;
  height: 100%;
}

.project-gallery-track .project-gallery-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg-base) 70%, transparent);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, color 0.2s ease;
}

.project-gallery-arrow:hover {
  background: var(--skin-color);
  color: var(--text-on-accent);
}

.project-gallery-arrow.is-prev { left: 10px; }
.project-gallery-arrow.is-next { right: 10px; }

.project-gallery-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.project-gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 35%, transparent);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.project-gallery-dot:hover { transform: scale(1.25); }

.project-gallery-dot.is-active { background: var(--skin-color); }

.project-media-code {
  display: flex;
  flex-direction: column;
  aspect-ratio: 16 / 8.2;
  background: var(--bg-code);
  padding: 18px 20px;
  overflow: hidden;
}

.term-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.term-dots span {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}

.term-dots span:nth-child(2) { background: #febc2e; }
.term-dots span:nth-child(3) { background: #28c840; }

.project-media-code pre {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #9ececa;
  white-space: pre-wrap;
  word-break: break-word;
}

.project-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.project-meta {
  font-size: 12px;
  color: var(--skin-color);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.project-body h3 { font-size: 19px; }

.project-desc { color: var(--text-muted); font-size: 15px; }

.project-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
}

.project-details summary {
  cursor: pointer;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

.project-details summary::-webkit-details-marker { display: none; }

.project-details summary::after {
  content: "+";
  float: right;
  font-family: var(--font-mono);
  color: var(--skin-color);
  transition: transform 0.2s ease;
}

.project-details[open] summary::after { transform: rotate(45deg); }

.project-details ul {
  padding: 0 14px 14px 30px;
  display: grid;
  gap: 6px;
}

.project-details li {
  list-style: disc;
  color: var(--text-muted);
  font-size: 14px;
}

.project-links {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.project-private {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: default;
  user-select: none;
}

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

.expertise-card {
  padding: 26px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.3s ease;
}

.expertise-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.expertise-card i {
  font-size: 22px;
  color: var(--skin-color);
  margin-bottom: 14px;
}

.expertise-card h3 { font-size: 17px; margin-bottom: 8px; }
.expertise-card p { font-size: 14.5px; color: var(--text-muted); }

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

.edu-card {
  padding: 26px;
}

.edu-card i {
  font-size: 22px;
  color: var(--skin-color);
  margin-bottom: 14px;
}

.edu-card h3 { font-size: 17px; margin-bottom: 4px; }

.edu-school {
  font-size: 13.5px;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.edu-card ul:not(.chip-list) {
  display: grid;
  gap: 6px;
}

.edu-card ul:not(.chip-list) li {
  color: var(--text-muted);
  font-size: 14.5px;
}

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

.contact-channels {
  display: grid;
  gap: 14px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-2px);
  border-color: var(--skin-color);
  box-shadow: var(--shadow-md);
}

.contact-card i {
  font-size: 20px;
  color: var(--skin-color);
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-muted);
  flex-shrink: 0;
}

.contact-card h3 { font-size: 15px; }
.contact-card p { font-size: 14px; color: var(--text-muted); word-break: break-word; }

.contact-form {
  padding: 28px;
}

.form-title { font-size: 18px; margin-bottom: 20px; }

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

.form-field { margin-bottom: 16px; }

.form-field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 7px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-base);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field textarea { resize: vertical; min-height: 130px; }

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--skin-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--skin-color) 18%, transparent);
}

.form-field.is-invalid input,
.form-field.is-invalid textarea {
  border-color: #ef4444;
}

.form-error {
  font-size: 13px;
  color: #ef4444;
  margin-top: 5px;
  min-height: 18px;
}

.form-status {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--skin-color);
  margin-bottom: 14px;
  min-height: 22px;
}

.form-status.is-error { color: #ef4444; }

.form-status:not(:empty) { animation: form-status-in 0.3s ease; }

@keyframes form-status-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 0;
  background: var(--bg-surface);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  gap: 36px;
  padding-bottom: 36px;
}

.footer-name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }

.footer-role { font-size: 13px; color: var(--skin-color); margin-top: 4px; }

.footer-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
  max-width: 44ch;
  line-height: 1.65;
}

.footer-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.footer-links ul,
.footer-contact ul:not(.footer-social) {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links a,
.footer-contact a {
  color: var(--text-muted);
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-contact a:hover { color: var(--skin-color); }

.footer-contact li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

.footer-contact li i {
  width: 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

.footer-contact ul.footer-social {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.footer-contact ul.footer-social li {
  display: inline-flex;
  font-size: inherit;
  color: inherit;
}

.footer-social a {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover {
  color: var(--skin-color);
  border-color: var(--skin-color);
  transform: translateY(-2px);
}

.footer-social .svg-icon { font-size: 16px; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding: 18px 0;
}

.footer-note { font-size: 13px; color: var(--text-faint); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 80;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, color 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover { color: var(--skin-color); border-color: var(--skin-color); }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  z-index: 120;
  background: var(--skin-color);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].reveal-up { transform: translateY(22px); }
[data-reveal].reveal-left { transform: translateX(-30px); }
[data-reveal].reveal-right { transform: translateX(30px); }
[data-reveal].reveal-scale { transform: scale(0.97); }

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Staggered reveal delays for repeated groups */
.skill-groups > *,
.projects-grid > *,
.expertise-grid > *,
.edu-grid > *,
.timeline > *,
.contact-channels > * { --reveal-delay: 0ms; }

.skill-groups > *:nth-child(2),
.projects-grid > *:nth-child(2),
.expertise-grid > *:nth-child(2),
.edu-grid > *:nth-child(2),
.timeline > *:nth-child(2),
.contact-channels > *:nth-child(2) { --reveal-delay: 60ms; }

.skill-groups > *:nth-child(3),
.projects-grid > *:nth-child(3),
.expertise-grid > *:nth-child(3),
.edu-grid > *:nth-child(3),
.timeline > *:nth-child(3),
.contact-channels > *:nth-child(3) { --reveal-delay: 120ms; }

.skill-groups > *:nth-child(4),
.projects-grid > *:nth-child(4),
.expertise-grid > *:nth-child(4),
.edu-grid > *:nth-child(4),
.contact-channels > *:nth-child(4) { --reveal-delay: 180ms; }

.skill-groups > *:nth-child(5),
.projects-grid > *:nth-child(5),
.expertise-grid > *:nth-child(5),
.edu-grid > *:nth-child(5),
.contact-channels > *:nth-child(5) { --reveal-delay: 240ms; }

.skill-groups > *:nth-child(6),
.projects-grid > *:nth-child(6),
.expertise-grid > *:nth-child(6),
.contact-channels > *:nth-child(6) { --reveal-delay: 300ms; }

.skill-groups > *:nth-child(7),
.contact-channels > *:nth-child(7) { --reveal-delay: 360ms; }

.skill-groups > *:nth-child(8) { --reveal-delay: 420ms; }

/* Hero entrance stagger */
.hero-visual { --reveal-delay: 200ms; }
.hero-text > *:nth-child(1) { --reveal-delay: 60ms; }
.hero-text > *:nth-child(2) { --reveal-delay: 150ms; }
.hero-text > *:nth-child(3) { --reveal-delay: 230ms; }
.hero-text > *:nth-child(4) { --reveal-delay: 300ms; }
.hero-text > *:nth-child(5) { --reveal-delay: 370ms; }
.hero-text > *:nth-child(6) { --reveal-delay: 430ms; }
.hero-text > *:nth-child(7) { --reveal-delay: 500ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
    transition-delay: 0s !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  .scroll-progress { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .hero-text { display: flex; flex-direction: column; align-items: center; }
  .hero-subtitle { margin-inline: auto; }
  .hero-keywords, .hero-actions { justify-content: center; }
  .hero-photo { order: -1; width: min(300px, 70%); }

  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .expertise-grid { grid-template-columns: repeat(2, 1fr); }
  .edu-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 18px 24px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-list { flex-direction: column; }
  .nav-cta { margin-top: 8px; }

  .nav-toggle { display: flex; }
}

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

  .skill-groups,
  .projects-grid,
  .expertise-grid,
  .edu-grid { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .hero-actions .btn { flex: 1 1 auto; }
  .hero-actions { gap: 8px; }

  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .nav-cta { display: none; }
  .hero-keywords li { font-size: 11px; }
}
