/* ===================================================================
   MOHAMED RAGHEB — PORTFOLIO STYLESHEET
   Contents:
   1. Variables        7. About
   2. Reset             8. Skills
   3. Global            9. Projects
   4. Accessibility    10. Timeline
   5. Navigation       11. Contact
   6. Hero             12. Footer
                        13. Responsive
                        14. Animations
                        15. Themes
   =================================================================== */

/* ===================================================================
   1. VARIABLES
   =================================================================== */
:root {
  /* Palette — dark (default) */
  --bg: #05060a;
  --bg-alt: #090b12;
  --surface: #10131e;
  --surface-hover: #161a29;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #edeff8;
  --text-secondary: #8b90a6;
  --text-tertiary: #5c6178;

  --accent-violet: #7c6eff;
  --accent-violet-rgb: 124, 110, 255;
  --accent-cyan: #2fe0c9;
  --accent-cyan-rgb: 47, 224, 201;

  --gradient-primary: linear-gradient(
    135deg,
    var(--accent-violet),
    var(--accent-cyan)
  );
  --shadow-color: 250, 30%, 3%;
  --shadow-sm: 0 2px 10px hsla(var(--shadow-color), 0.35);
  --shadow-md: 0 12px 32px hsla(var(--shadow-color), 0.45);
  --shadow-lg: 0 24px 60px hsla(var(--shadow-color), 0.55);

  /* Type */
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  /* Layout */
  --container-w: 1200px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --section-pad: clamp(4.5rem, 8vw, 7.5rem);
  --header-h: 76px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.2s;
  --dur-med: 0.4s;
  --dur-slow: 0.8s;

  color-scheme: dark;
}

/* ===================================================================
   2. RESET
   =================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  scrollbar-color: #4deeea transparent;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

input,
textarea {
  font: inherit;
  color: inherit;
}

.visually-hidden {
  visibility: hidden;
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ===================================================================
   3. GLOBAL
   =================================================================== */
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition:
    background-color var(--dur-med) var(--ease),
    color var(--dur-med) var(--ease);
}

.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.section {
  padding-block: var(--section-pad);
}

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

.section-head {
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.section-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.9rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3vw + 1rem, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 20ch;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-gradient-soft {
  background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-full);
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
  transition: transform var(--dur-fast) var(--ease);
}

.btn-primary {
  background: var(--gradient-primary);
  color: #05060a;
  box-shadow: 0 8px 24px rgba(var(--accent-violet-rgb), 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(var(--accent-violet-rgb), 0.45);
}

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent-cyan);
  background: rgba(var(--accent-cyan-rgb), 0.08);
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ===================================================================
   4. ACCESSIBILITY
   =================================================================== */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 999;
  background: var(--accent-violet);
  color: #05060a;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ===================================================================
   5. NAVIGATION
   =================================================================== */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  padding-block: 1.1rem;
  transition:
    padding var(--dur-med) var(--ease),
    background var(--dur-med) var(--ease),
    border-color var(--dur-med) var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  padding-block: 0.7rem;
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--border);
}

.navbar {
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.nav-logo-dot {
  color: var(--accent-cyan);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.1rem;
}

.nav-link {
  position: relative;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding-block: 0.3rem;
  transition: color var(--dur-fast) var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-med) var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-menu-mobile-only {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-primary);
  transition:
    border-color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

.theme-toggle:hover {
  border-color: var(--accent-violet);
  background: rgba(var(--accent-violet-rgb), 0.1);
}

.theme-toggle svg {
  width: 19px;
  height: 19px;
  position: absolute;
  transition:
    transform var(--dur-med) var(--ease),
    opacity var(--dur-med) var(--ease);
}

.icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.icon-sun {
  opacity: 0;
  transform: scale(0.4) rotate(-60deg);
}

[data-theme="light"] .icon-moon {
  opacity: 0;
  transform: scale(0.4) rotate(60deg);
}

[data-theme="light"] .icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle-bar {
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition:
    transform var(--dur-med) var(--ease),
    opacity var(--dur-fast) var(--ease);
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease);
  z-index: 90;
}

/* ===================================================================
   6. HERO
   =================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-h) + 1.5rem);
  padding-bottom: 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(
    ellipse 70% 60% at 50% 30%,
    black 10%,
    transparent 75%
  );
  opacity: 0.5;
}

.hero-glow {
  position: absolute;
  width: 46vw;
  height: 46vw;
  max-width: 620px;
  max-height: 620px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.35;
}

.hero-glow-violet {
  background: var(--accent-violet);
  top: -10%;
  left: -8%;
  animation: drift-a 22s ease-in-out infinite;
}

.hero-glow-cyan {
  background: var(--accent-cyan);
  bottom: -18%;
  right: -10%;
  animation: drift-b 26s ease-in-out infinite;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 0 0 rgba(var(--accent-cyan-rgb), 0.6);
  animation: pulse-dot 2.2s ease-out infinite;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 5vw + 1rem, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 1.5vw + 0.6rem, 1.6rem);
  color: var(--text-secondary);
  line-height: 1.4;
  max-width: 34ch;
  margin-bottom: 1.4rem;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 1.02rem;
  max-width: 46ch;
  margin-bottom: 2.2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.4rem;
}

.hero-social {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.social-link:hover {
  color: var(--accent-cyan);
  transform: translateY(-2px);
}

/* --- Hero visual: layered architecture system --- */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}

.arch-system {
  position: relative;
  width: min(420px, 82vw);
  aspect-ratio: 1 / 1;
}

.arch-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed var(--border-strong);
}

.arch-ring-presentation {
  animation: spin-slow 60s linear infinite;
}

.arch-ring-infrastructure {
  inset: 10.5%;
  animation: spin-slow-rev 46s linear infinite;
}

.arch-ring-application {
  inset: 22%;
  border-style: solid;
  border-color: rgba(var(--accent-violet-rgb), 0.35);
  animation: spin-slow 38s linear infinite;
}

.arch-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--bg);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.arch-label-top {
  top: -0.7em;
  left: 50%;
  transform: translateX(-50%);
}

.arch-label-right {
  top: 50%;
  right: -0.6em;
  transform: translate(50%, -50%);
}

.arch-label-left {
  top: 50%;
  left: -0.6em;
  transform: translate(-50%, -50%);
}

.arch-core {
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 32% 28%,
      rgba(255, 255, 255, 0.14),
      transparent 60%
    ),
    var(--gradient-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  box-shadow:
    0 0 60px rgba(var(--accent-violet-rgb), 0.45),
    inset 0 0 30px rgba(255, 255, 255, 0.12);
  animation: core-pulse 4.5s ease-in-out infinite;
}

.arch-core-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: rgba(5, 6, 10, 0.65);
  font-weight: 600;
}

.arch-core-code {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #05060a;
}

.arch-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  animation: float-badge 5s ease-in-out infinite;
}

.arch-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.arch-badge-backend {
  border-color: rgba(var(--accent-violet-rgb), 0.4);
}

.arch-badge-backend::before {
  background: var(--accent-violet);
}

.arch-badge-frontend {
  border-color: rgba(var(--accent-cyan-rgb), 0.4);
}

.arch-badge-frontend::before {
  background: var(--accent-cyan);
}

.arch-badge-1 {
  bottom: -15%;
  left: 60%;
  animation-delay: 0s;
}
.arch-badge-2 {
  bottom: 0%;
  right: -4%;
  animation-delay: 1.1s;
}
.arch-badge-3 {
  top: -10%;
  left: 40%;
  animation-delay: 2.2s;
}
.arch-badge-4 {
  top: 14%;
  left: -6%;
  animation-delay: 3.1s;
}

.hero-code-card {
  position: absolute;
  bottom: -6%;
  left: -10%;
  width: 252px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: float-card 6s ease-in-out infinite;
}

.code-card-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.code-dot-red {
  background: #ff6b6b;
}
.code-dot-yellow {
  background: #ffd166;
}
.code-dot-green {
  background: #57e39c;
}

.code-card-title {
  margin-left: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.code-card-body {
  padding: 0.75rem 0.85rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  line-height: 1.65;
  color: var(--text-secondary);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-violet) transparent;
}

.code-card-body::-webkit-scrollbar {
  height: 5px;
}

.code-card-body::-webkit-scrollbar-track {
  background: transparent;
}

.code-card-body::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-violet-rgb), 0.5);
  border-radius: var(--radius-full);
}

/* --- Frontend counterpart card: mirrors .hero-code-card so the hero
   visually reads as "backend logic + frontend UI", not backend-only --- */
.hero-ui-card {
  position: absolute;
  top: -7%;
  right: -4%;
  width: 190px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: float-card 6.5s ease-in-out infinite;
  animation-delay: 1.4s;
}

.ui-card-body {
  padding: 0.8rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ui-mock-topbar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ui-mock-topbar span {
  display: block;
  width: 16px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
}

.ui-mock-topbar span:first-child {
  width: 26px;
  background: var(--gradient-primary);
}

.ui-mock-hero {
  height: 46px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(
    135deg,
    rgba(var(--accent-violet-rgb), 0.28),
    rgba(var(--accent-cyan-rgb), 0.22)
  );
}

.ui-mock-actions {
  display: flex;
  gap: 0.4rem;
}

.ui-mock-btn {
  display: block;
  height: 14px;
  border-radius: var(--radius-full);
}

.ui-mock-btn-primary {
  width: 46px;
  background: var(--gradient-primary);
}

.ui-mock-btn-ghost {
  width: 34px;
  border: 1px solid var(--border-strong);
}

.ui-mock-lines {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ui-mock-lines span {
  display: block;
  height: 5px;
  width: var(--w, 60%);
  border-radius: var(--radius-full);
  background: var(--border-strong);
}

.code-kw {
  color: var(--accent-violet);
}
.code-type {
  color: var(--accent-cyan);
}

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  justify-content: center;
}

.scroll-cue-track {
  width: 22px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.scroll-cue-dot {
  width: 4px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent-cyan);
  animation: scroll-cue 1.8s ease-in-out infinite;
}

/* ===================================================================
   7. ABOUT
   =================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1.1rem;
  max-width: 58ch;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.stat-card {
  padding: 1.25rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition:
    transform var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-violet);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.terminal-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.terminal-body {
  padding: 1.1rem 1.2rem 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
}

.terminal-prompt {
  color: var(--accent-cyan);
  margin-right: 0.5rem;
}

.terminal-out {
  color: var(--text-secondary);
  padding-left: 1.35rem;
  margin-bottom: 0.3rem;
}

.terminal-accent {
  color: var(--accent-violet);
}

.blink {
  color: var(--accent-cyan);
  animation: blink 1s step-end infinite;
}

/* ===================================================================
   8. SKILLS
   =================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.skill-group-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1rem 0.6rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition:
    transform var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

.skill-badge:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  background: rgba(var(--accent-cyan-rgb), 0.06);
}

.skill-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding-inline: 0.25rem;
  border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  color: #05060a;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
}

/* ===================================================================
   9. PROJECTS
   =================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  transition:
    transform var(--dur-med) var(--ease),
    border-color var(--dur-med) var(--ease),
    box-shadow var(--dur-med) var(--ease);
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--accent-violet-rgb), 0.5);
  box-shadow: var(--shadow-lg);
}

.project-preview {
  position: relative;
  padding: 0;
  background: linear-gradient(
    155deg,
    rgba(var(--accent-violet-rgb), 0.16),
    rgba(var(--accent-cyan-rgb), 0.08)
  );
  border-bottom: 1px solid var(--border);
}

.preview-dental {
  background: linear-gradient(
    155deg,
    rgba(var(--accent-violet-rgb), 0.22),
    rgba(var(--accent-cyan-rgb), 0.06)
  );
}

.preview-market {
  background: linear-gradient(
    155deg,
    rgba(var(--accent-cyan-rgb), 0.2),
    rgba(var(--accent-violet-rgb), 0.08)
  );
}

.preview-dvld {
  background: linear-gradient(
    155deg,
    rgba(var(--accent-violet-rgb), 0.14),
    rgba(var(--accent-cyan-rgb), 0.14)
  );
}

.preview-placeholder {
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.02)
  );
}

.preview-placeholder .preview-title-row {
  color: var(--text-tertiary);
}

.preview-chrome {
  display: flex;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
}

.preview-body {
  padding: 0 1.3rem 1.5rem;
}

.preview-title-row {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.preview-stats {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.preview-stat {
  flex: 1;
  background: rgba(5, 6, 10, 0.28);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.4rem;
  text-align: center;
}

.preview-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-primary);
}

.preview-stat span {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preview-row {
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(5, 6, 10, 0.28);
  overflow: hidden;
}

.row-bar {
  display: block;
  width: var(--w, 50%);
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
}

.preview-id-card {
  background: rgba(5, 6, 10, 0.28);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
}

.id-card-strip {
  width: 46px;
  height: 32px;
  border-radius: 5px;
  background: var(--gradient-primary);
  margin-bottom: 0.7rem;
}

.id-card-line {
  height: 6px;
  width: var(--w, 60%);
  border-radius: var(--radius-full);
  background: var(--border-strong);
  margin-bottom: 0.5rem;
}

.project-body {
  padding: 1.6rem 1.3rem 1.5rem;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 1.1rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}

.tech-tags li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: var(--accent-cyan);
  border: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-full);
}

.project-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition:
    color var(--dur-fast) var(--ease),
    gap var(--dur-fast) var(--ease);
}

.project-link svg {
  width: 16px;
  height: 16px;
}

.project-link:hover {
  color: var(--text-primary);
}

.project-link-arrow:hover svg {
  transform: translate(2px, -2px);
}

.project-link-arrow svg {
  transition: transform var(--dur-fast) var(--ease);
}

/* ===================================================================
   10. TIMELINE
   =================================================================== */
.timeline {
  position: relative;
  max-width: 720px;
  margin-inline: auto;
  padding-left: 2rem;
  border-left: 1px solid var(--border-strong);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.75rem;
}

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

.timeline-marker {
  position: absolute;
  left: -2.42rem;
  top: 0.3rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 0 4px var(--bg-alt);
}

.timeline-year {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-violet);
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.timeline-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 52ch;
}

/* ===================================================================
   11. CONTACT
   =================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

.contact-copy {
  color: var(--text-secondary);
  max-width: 46ch;
  margin: 1.1rem 0 2rem;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
}

.contact-list svg {
  width: 19px;
  height: 19px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.contact-list a:hover {
  color: var(--text-primary);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.form-field input,
.form-field textarea {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  transition: border-color var(--dur-fast) var(--ease);
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--accent-violet);
}

.form-note {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  min-height: 1.2em;
}

/* ===================================================================
   12. FOOTER
   =================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease);
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

/* Scroll to top button */
.scroll-top-btn {
  position: fixed;
  right: clamp(1.1rem, 4vw, 2rem);
  bottom: clamp(1.1rem, 4vw, 2rem);
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #05060a;
  box-shadow: 0 8px 24px rgba(var(--accent-violet-rgb), 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    visibility 0s linear var(--dur-fast);
  z-index: 85;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.scroll-top-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(var(--accent-violet-rgb), 0.45);
}

.scroll-top-btn:focus-visible {
  border-radius: 50%;
}

.scroll-top-btn svg {
  width: 19px;
  height: 19px;
  transition: transform var(--dur-fast) var(--ease);
}

.scroll-top-btn:hover svg {
  transform: translateY(-2px);
}

/* Hide the native cursor on desktop/fine-pointer devices so only the
   custom dot shows. Scoped to (hover: hover) and (pointer: fine) so
   touch devices keep their normal behavior (see media query below too). */
@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }

  a,
  button,
  input,
  textarea,
  .skill-badge,
  .stat-card,
  .project-card {
    cursor: none;
  }
}

/* Custom cursor (desktop, fine pointer only) */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition:
    width var(--dur-fast) var(--ease),
    height var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    opacity var(--dur-fast) var(--ease);
  mix-blend-mode: difference;
}

.cursor-dot.is-visible {
  opacity: 1;
}

.cursor-dot.is-hovering {
  width: 30px;
  height: 30px;
  background: var(--accent-violet);
}

.cursor-dot.is-hidden {
  opacity: 0;
}

/* ===================================================================
   13. RESPONSIVE
   =================================================================== */
@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }

  .hero-inner {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .contact-form {
    padding: 2.2rem;
  }
}

@media (min-width: 1280px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .container {
    padding-inline: 2rem;
  }
}

@media (min-width: 1440px) {
  :root {
    --container-w: 1280px;
  }
}

/* Mobile nav (below 1024px) */
@media (max-width: 1023.98px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(320px, 82vw);
    background: var(--bg-alt);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 2.5rem;
    transform: translateX(100%);
    transition: transform var(--dur-med) var(--ease);
    z-index: 95;
  }

  .nav-menu.is-open {
    transform: translateX(0);
  }

  .nav-menu-mobile-only {
    display: block;
    margin-top: 1rem;
  }

  .nav-mobile-cv {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    color: #05060a;
    font-weight: 600;
    padding: 0.7rem 1.3rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
  }

  .nav-link {
    font-size: 1.05rem;
  }

  .nav-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .hero-ui-card {
    right: -6px;
  }

  .hero-code-card {
    left: -2%;
  }
}

@media (max-width: 520px) {
  .hero-code-card,
  .hero-ui-card {
    display: none;
  }

  .about-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-links {
    flex-wrap: wrap;
  }
}

@media (max-width: 730px) {
  .hero-code-card {
    width: 218px;
  }
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot {
    display: none;
  }

  body,
  a,
  button,
  input,
  textarea {
    cursor: auto;
  }
}

/* ===================================================================
   14. ANIMATIONS
   =================================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal-delay="1"] {
  transition-delay: 0.08s;
}
[data-reveal-delay="2"] {
  transition-delay: 0.16s;
}
[data-reveal-delay="3"] {
  transition-delay: 0.24s;
}
[data-reveal-delay="4"] {
  transition-delay: 0.32s;
}
[data-reveal-delay="5"] {
  transition-delay: 0.4s;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--accent-cyan-rgb), 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(var(--accent-cyan-rgb), 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--accent-cyan-rgb), 0);
  }
}

@keyframes drift-a {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(4%, 6%);
  }
}

@keyframes drift-b {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-5%, -4%);
  }
}

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-slow-rev {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

@keyframes core-pulse {
  0%,
  100% {
    box-shadow:
      0 0 60px rgba(var(--accent-violet-rgb), 0.45),
      inset 0 0 30px rgba(255, 255, 255, 0.12);
  }
  50% {
    box-shadow:
      0 0 84px rgba(var(--accent-violet-rgb), 0.6),
      inset 0 0 34px rgba(255, 255, 255, 0.18);
  }
}

@keyframes float-badge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes float-card {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes scroll-cue {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(14px);
    opacity: 0;
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

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

  html {
    scroll-behavior: auto;
  }
}

/* ===================================================================
   15. THEMES
   =================================================================== */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7fb;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f1f1f7;
  --border: rgba(10, 12, 24, 0.09);
  --border-strong: rgba(10, 12, 24, 0.16);
  --text-primary: #12141f;
  --text-secondary: #565b73;
  --text-tertiary: #8a8fa6;

  --accent-violet: #6552f0;
  --accent-cyan: #0ea996;

  --shadow-color: 235, 30%, 78%;
  --shadow-sm: 0 2px 10px hsla(var(--shadow-color), 0.35);
  --shadow-md: 0 12px 32px hsla(var(--shadow-color), 0.4);
  --shadow-lg: 0 24px 56px hsla(var(--shadow-color), 0.45);
}

[data-theme="light"] .site-header.scrolled {
  background: rgba(247, 247, 251, 0.78);
}

[data-theme="light"] .hero-grid {
  opacity: 0.35;
}

[data-theme="light"] .hero-glow {
  opacity: 0.22;
}

[data-theme="light"] .btn-primary,
[data-theme="light"] .arch-core-code,
[data-theme="light"] .skill-glyph,
[data-theme="light"] .nav-mobile-cv {
  color: #ffffff;
}

[data-theme="light"] .scroll-top-btn {
  color: #ffffff;
}

[data-theme="light"] .arch-core-tag {
  color: rgba(255, 255, 255, 0.75);
}

[data-theme="light"] .stat-number {
  -webkit-text-fill-color: transparent;
}
