/* ==========================================================================
   Abhishek Kumar — Personal Portfolio
   Single stylesheet. No frameworks, no external icon fonts.
   ========================================================================== */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/montserrat-latin-variable.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --primary-color: #0ea5e9;
  --accent: #38bdf8;
  --accent-soft: #7dd3fc;
  --secondary-color: #8b5cf6;
  --dark-bg: #030712;
  --dark-bg-alt: #071120;
  --surface: rgba(15, 23, 42, 0.72);
  --surface-solid: #0f172a;
  --light-text: #f8fafc;
  --muted-text: #cbd5e1;
  --muted-text-2: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(125, 211, 252, 0.35);
  --gradient-primary: linear-gradient(135deg, #38bdf8, #a78bfa);
  --shadow-primary: 0 12px 32px rgba(14, 165, 233, 0.22);
  --shadow-card: 0 18px 45px rgba(2, 6, 23, 0.45);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --container-width: 1120px;
  --transition: 220ms cubic-bezier(0.16, 1, 0.3, 1);
  --font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

* {
  margin: 0;
  padding: 0;
  font-family: inherit;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--dark-bg);
  color: var(--light-text);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

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

img {
  height: auto;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

ul,
ol {
  list-style: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(56, 189, 248, 0.32);
  color: #ffffff;
}

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

main:focus,
main:focus-visible {
  outline: none;
}

.container {
  width: min(100% - 40px, var(--container-width));
  margin-inline: auto;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-solid {
  fill: currentColor;
  stroke: none;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--light-text);
  color: #04121f;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ==========================================================================
   Header and navigation
   ========================================================================== */

#header {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background-color: var(--dark-bg);
  background-image:
    linear-gradient(
      90deg,
      #030712 0%,
      rgba(3, 7, 18, 0.97) 34%,
      rgba(3, 7, 18, 0.72) 52%,
      rgba(3, 7, 18, 0.14) 76%,
      rgba(3, 7, 18, 0.18) 100%
    ),
    url("images/background.webp?v=6");
  background-position: center, right center;
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
}

#header::before {
  content: "";
  position: absolute;
  inset: auto -12% -22% 34%;
  height: 62%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.18), transparent 68%);
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}

#header > .container {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  width: min(100% - 40px, var(--container-width));
  margin-inline: auto;
}

nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
}

.logo-link {
  display: inline-flex;
  flex: 0 0 auto;
  border-radius: 8px;
}

.logo {
  width: 170px;
  height: auto;
  border-radius: 8px;
  transition: transform var(--transition);
}

.logo-link:hover .logo {
  transform: scale(1.04);
}

#sidemenu {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  margin-left: auto;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 7px 1px;
  color: #e2e8f0;
  font-size: 0.98rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}

.nav-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active,
.nav-link[aria-current="page"] {
  color: var(--accent-soft);
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link.active::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.menu-toggle,
.menu-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--light-text);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.menu-toggle:hover,
.menu-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-strong);
}

.menu-toggle .icon,
.menu-close .icon {
  width: 22px;
  height: 22px;
}

.menu-overlay {
  display: none;
}

.header-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  align-items: center;
  gap: 40px;
  padding: clamp(36px, 6vh, 72px) 0 clamp(64px, 9vh, 100px);
}

.header-text {
  position: relative;
  z-index: 2;
  max-width: 660px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  color: var(--accent-soft);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.12);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(74, 222, 128, 0.55);
  border-radius: inherit;
  animation: ping 2.2s ease-out infinite;
}

@keyframes ping {
  0% {
    opacity: 0.9;
    transform: scale(0.6);
  }
  75%,
  100% {
    opacity: 0;
    transform: scale(1.65);
  }
}

.header-text h1 {
  margin: 20px 0 14px;
  color: var(--light-text);
  font-size: clamp(2.5rem, 5.4vw, 4.3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.highlight-text {
  position: relative;
  display: inline-block;
  color: var(--accent);
}

.highlight-text::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0.04em;
  left: 0;
  z-index: -1;
  height: 0.24em;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.32), rgba(139, 92, 246, 0.22));
}

.header-subtitle {
  min-height: 1.7em;
  margin-bottom: 28px;
  color: #dbeafe;
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  font-weight: 500;
  line-height: 1.5;
}

.typed-text {
  color: var(--accent-soft);
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: var(--accent);
  animation: blink 1s step-end infinite;
}

.cursor.typing {
  animation: none;
}

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

.header-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--transition),
    background-color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    color var(--transition);
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-primary,
.btn2 {
  background: var(--gradient-primary);
  color: #04121f;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover,
.btn2:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(14, 165, 233, 0.3);
}

.btn-secondary {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
  color: var(--light-text);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.btn-ghost {
  padding-inline: 12px;
  color: #e2e8f0;
}

.btn-ghost:hover {
  color: var(--accent-soft);
}

.btn-hacker {
  border-color: rgba(0, 255, 156, 0.42);
  background: rgba(0, 255, 156, 0.08);
  color: #7dffc9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.btn-hacker .icon {
  color: #00ff9c;
}

.btn-hacker:hover,
.btn-hacker:focus-visible {
  border-color: #00ff9c;
  background: rgba(0, 255, 156, 0.14);
  color: #d8fff0;
  box-shadow: 0 12px 30px rgba(0, 255, 156, 0.14);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  max-width: 610px;
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-stats li {
  padding: 0 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-stats li:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-stats strong {
  display: block;
  color: var(--light-text);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero-stats span {
  display: block;
  margin-top: 4px;
  color: var(--muted-text-2);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.header-shape {
  position: absolute;
  top: 50%;
  right: 1%;
  z-index: 1;
  width: min(42vw, 520px);
  aspect-ratio: 1;
  pointer-events: none;
  transform: translateY(-50%);
}

.shape-bg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(56, 189, 248, 0.2) 0%,
    rgba(139, 92, 246, 0.1) 36%,
    transparent 68%
  );
  filter: blur(8px);
  animation: pulse 7s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.scroll-down {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 18px;
  transform: translateX(-50%);
}

.scroll-down span {
  display: block;
  width: 11px;
  height: 11px;
  margin: -5px 0 0;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  animation: scrollDown 2s infinite;
}

.scroll-down span:nth-child(2) {
  animation-delay: 0.18s;
}

.scroll-down span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes scrollDown {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(-8px, -8px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translate(8px, 8px);
  }
}

/* ==========================================================================
   Shared section styles
   ========================================================================== */

main > section {
  position: relative;
  padding: clamp(64px, 8vw, 104px) 0;
}

main > section:last-of-type,
#contact {
  padding-bottom: 0;
}

#about {
  background: linear-gradient(180deg, var(--dark-bg) 0%, var(--dark-bg-alt) 55%, var(--dark-bg) 100%);
}

#experience {
  background:
    radial-gradient(circle at 85% 12%, rgba(139, 92, 246, 0.08), transparent 34%),
    var(--dark-bg);
}

#projects {
  background: linear-gradient(180deg, var(--dark-bg), #0a1324 55%, var(--dark-bg));
}

#contact {
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 5%, rgba(56, 189, 248, 0.08), transparent 38%),
    linear-gradient(180deg, var(--dark-bg), #050b16);
}

.sub-title {
  position: relative;
  margin-bottom: 38px;
  padding-bottom: 14px;
  color: var(--light-text);
  font-size: clamp(2rem, 3.6vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.sub-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 88px;
  height: 4px;
  border-radius: 999px;
  background: var(--gradient-primary);
}

.sub-title span {
  color: var(--accent);
}

/* ==========================================================================
   About
   ========================================================================== */

.about-header {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 30px;
}

.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.about-badge {
  padding: 7px 13px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.07);
  color: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.about-content {
  width: 100%;
  max-width: 1000px;
}

.about-description {
  max-width: 78ch;
  margin-bottom: 36px;
  color: var(--muted-text);
  font-size: clamp(1rem, 1.3vw, 1.08rem);
  line-height: 1.85;
}

.tab-titles {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tab-links {
  position: relative;
  padding: 9px 2px 14px;
  border: 0;
  background: none;
  color: var(--muted-text-2);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition);
}

.tab-links::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.tab-links:hover {
  color: var(--muted-text);
}

.tab-links.active-link {
  color: var(--accent-soft);
}

.tab-links.active-link::after {
  transform: scaleX(1);
}

.tab-contents {
  animation: fadeIn 320ms ease both;
}

/* Without JavaScript, expose both panels and hide the unusable tab controls. */
html:not(.js) .tab-titles {
  display: none;
}

html:not(.js) .tab-contents,
html:not(.js) .tab-contents[hidden] {
  display: block !important;
  animation: none;
}

html:not(.js) #education {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.tab-contents:focus-visible {
  outline-offset: 8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.skills-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.skill-category {
  padding: 19px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(56, 189, 248, 0.06), rgba(15, 23, 42, 0.56)),
    var(--dark-bg-alt);
  transition: border-color var(--transition), transform var(--transition);
}

.skill-category:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.skill-category h3 {
  margin-bottom: 12px;
  color: var(--light-text);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.07);
  color: #bae6fd;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.4;
}

/* ==========================================================================
   Timeline (education and experience)
   ========================================================================== */

.timeline {
  position: relative;
  max-width: 860px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 17px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.55), rgba(139, 92, 246, 0.2));
}

.timeline-item {
  position: relative;
  padding: 0 0 22px 60px;
}

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

.timeline-dot {
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 50%;
  background: #082f49;
  color: var(--accent-soft);
  place-items: center;
  box-shadow: 0 0 0 5px var(--dark-bg);
  transition: transform var(--transition), box-shadow var(--transition);
}

.timeline-dot .icon {
  width: 17px;
  height: 17px;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.08);
  box-shadow: 0 0 0 5px var(--dark-bg), 0 0 18px rgba(56, 189, 248, 0.25);
}

.timeline-content {
  padding: 19px 22px;
  border: 1px solid var(--border);
  border-left: 2px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.62);
  transition: border-color var(--transition), transform var(--transition);
}

.timeline-item:hover .timeline-content {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateX(3px);
}

.timeline-date {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.timeline-title {
  margin-bottom: 4px;
  color: var(--light-text);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.35;
}

.timeline-company {
  margin-bottom: 9px;
  color: var(--muted-text);
  font-size: 0.88rem;
  font-weight: 500;
}

.timeline-description {
  color: var(--muted-text-2);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ==========================================================================
   Projects
   ========================================================================== */

.projects-filter-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 24px;
}

.filter-pills {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-pill span {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted-text-2);
  font-size: 0.72rem;
  font-weight: 600;
}

.filter-pill:hover {
  color: var(--light-text);
  background: rgba(56, 189, 248, 0.08);
}

.filter-pill.is-active {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.filter-pill.is-active span {
  background: rgba(56, 189, 248, 0.25);
  color: #e0f2fe;
}

.project-card.is-hidden {
  display: none !important;
}

/* Toast notification */
.toast-notice {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 2100;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.94);
  color: #e0f2fe;
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 18px rgba(56, 189, 248, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast-notice.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-notice svg {
  width: 15px;
  height: 15px;
  color: #38bdf8;
}

.services-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 38px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 430px;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(56, 189, 248, 0.06), transparent 42%),
    rgba(15, 23, 42, 0.72);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.22);
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    background-color var(--transition);
}

.project-card:hover,
.project-card:focus-within,
.project-card:focus-visible {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
  transform: translateY(-6px);
}

.project-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.09);
  color: var(--accent-soft);
  place-items: center;
}

.project-icon .icon {
  width: 24px;
  height: 24px;
}

.project-card h3 {
  display: flex;
  align-items: flex-start;
  min-height: 2.7em;
  margin-bottom: 12px;
  color: var(--light-text);
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.project-card > p {
  min-height: 96px;
  margin-bottom: 18px;
  color: var(--muted-text);
  font-size: 0.9rem;
  line-height: 1.7;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  padding-top: 12px;
}

.tech-stack span {
  padding: 4px 9px;
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.06);
  color: #bae6fd;
  font-size: 0.69rem;
  font-weight: 500;
  line-height: 1.4;
}

.project-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 26px;
  background: linear-gradient(180deg, #0a1324, #030712);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.project-card:hover .project-overlay,
.project-card:focus-within .project-overlay,
.project-card:focus-visible .project-overlay {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.project-overlay-title {
  margin-bottom: 18px;
  color: var(--light-text);
  font-size: 1.04rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.project-details h4 {
  margin-bottom: 14px;
  color: var(--accent-soft);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-details ul {
  margin-bottom: 20px;
}

.project-details li {
  position: relative;
  margin-bottom: 9px;
  padding-left: 18px;
  color: var(--muted-text);
  font-size: 0.85rem;
  line-height: 1.55;
}

.project-details li::before {
  content: "";
  position: absolute;
  top: 0.58em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-soft);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.project-link .icon {
  width: 15px;
  height: 15px;
}

.project-link:hover {
  color: #e0f2fe;
}

.projects-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin-top: 30px;
  padding: 26px 28px;
  border: 1px solid rgba(139, 92, 246, 0.26);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 0%, rgba(139, 92, 246, 0.18), transparent 42%),
    rgba(15, 23, 42, 0.62);
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent-soft);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.projects-cta h3 {
  margin-bottom: 6px;
  color: var(--light-text);
  font-size: 1.16rem;
  font-weight: 600;
}

.projects-cta p:last-child {
  max-width: 62ch;
  color: var(--muted-text-2);
  font-size: 0.88rem;
  line-height: 1.65;
}

.projects-cta .btn {
  flex: 0 0 auto;
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-desc {
  max-width: 66ch;
  margin-bottom: 40px;
  color: var(--muted-text);
  font-size: clamp(1rem, 1.3vw, 1.06rem);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 34px;
  align-items: start;
}

.contact-left,
.contact-right {
  min-width: 0;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.55);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--transition), transform var(--transition), background-color var(--transition);
}

a.contact-item:hover {
  border-color: var(--border-strong);
  background: rgba(15, 23, 42, 0.82);
  transform: translateY(-2px);
}

.contact-item > .icon {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  color: var(--accent-soft);
}

.contact-item h3 {
  margin-bottom: 2px;
  color: var(--muted-text-2);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.contact-item p {
  overflow-wrap: anywhere;
  color: var(--light-text);
  font-size: 0.88rem;
  font-weight: 500;
}

.social-icon {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.social-icon a {
  display: grid;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--light-text);
  text-decoration: none;
  place-items: center;
  transition: color var(--transition), border-color var(--transition), background-color var(--transition), transform var(--transition);
}

.social-icon a:hover {
  border-color: var(--border-strong);
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-soft);
  transform: translateY(-2px);
}

.social-icon .icon {
  width: 20px;
  height: 20px;
}

.btn.btn2 {
  margin-top: 4px;
  padding-inline: 24px;
}

#contact-form {
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.62);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.2);
}

.input-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.form-field label {
  color: var(--muted-text);
  font-size: 0.77rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.form-field input,
.form-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: #071120;
  color: var(--light-text);
  font-size: 0.92rem;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

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

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  background: #081728;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note {
  margin: 2px 0 18px;
  color: var(--muted-text-2);
  font-size: 0.75rem;
  line-height: 1.55;
}

.form-note a {
  color: var(--accent-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-note-warning {
  padding: 10px 12px;
  border: 1px solid rgba(252, 211, 77, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(252, 211, 77, 0.08);
  color: #fde68a;
}

#contact-form .btn2 {
  width: 100%;
  margin-top: 0;
}

.form-status {
  min-height: 26px;
  margin-top: 12px;
  color: var(--muted-text-2);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.5;
}

.form-status.is-success {
  color: #4ade80;
}

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

.copyright {
  width: 100%;
  margin-top: clamp(56px, 8vw, 80px);
  padding: 24px 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(0, 0, 0, 0.22);
  text-align: center;
}

.copyright p {
  color: var(--muted-text-2);
  font-size: 0.78rem;
  line-height: 1.6;
}

.copyright .footer-mode {
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.footer-mode a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid transparent;
  color: var(--accent-soft);
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition);
}

.footer-mode a:hover,
.footer-mode a:focus-visible {
  border-color: currentColor;
  color: #7dffc9;
}

/* ==========================================================================
   Scroll reveal (progressive enhancement)
   ========================================================================== */

.reveal-ready [data-aos] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 600ms ease, transform 600ms ease;
  transition-delay: var(--aos-delay, 0ms);
}

.reveal-ready [data-aos="fade-right"] {
  transform: translateX(-26px);
}

.reveal-ready [data-aos="fade-left"] {
  transform: translateX(26px);
}

.reveal-ready [data-aos].aos-in {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .services-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-shape {
    right: -8%;
    width: min(48vw, 460px);
  }
}

@media (max-width: 900px) {
  .row {
    grid-template-columns: 1fr;
  }

  .contact-left {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 24px;
    align-items: start;
  }

  .contact-info {
    grid-column: 1 / -1;
  }

  .social-icon {
    grid-column: 1;
    margin-bottom: 0;
  }

  .contact-left .btn.btn2 {
    grid-column: 2;
    grid-row: 2;
    margin-top: 24px;
  }
}

@media (max-width: 820px) {
  .container,
  #header > .container {
    width: min(100% - 32px, var(--container-width));
  }

  #header {
    min-height: auto;
    background-image:
      linear-gradient(
        180deg,
        rgba(3, 7, 18, 0.68) 0%,
        rgba(3, 7, 18, 0.08) 12%,
        rgba(3, 7, 18, 0.16) 32%,
        rgba(3, 7, 18, 0.82) 43%,
        #030712 54%,
        #030712 100%
      ),
      url("images/mobile-bg.webp?v=6");
    background-position: center, center 62px;
    background-size: cover, min(100%, 440px) auto;
    background-repeat: no-repeat, no-repeat;
  }

  #header::before {
    inset: auto -30% 22% 42%;
    height: 44%;
  }

  .header-shape {
    top: 32%;
    right: -22%;
    width: min(82vw, 440px);
    opacity: 0.7;
  }

  .header-content {
    align-items: flex-start;
    padding: clamp(245px, 68vw, 320px) 0 32px;
  }

  .header-text {
    max-width: 100%;
  }

  .header-text h1 {
    font-size: clamp(2.3rem, 8vw, 3.1rem);
  }

  .header-subtitle {
    font-size: clamp(1.05rem, 4vw, 1.28rem);
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: none;
    padding-top: 20px;
  }

  .hero-stats li,
  .hero-stats li:first-child {
    padding: 0 0 0 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
  }

  .hero-stats li:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .hero-stats strong {
    font-size: 1.2rem;
  }

  .hero-stats span {
    font-size: 0.62rem;
    letter-spacing: 0.035em;
  }

  .scroll-down {
    display: none;
  }

  nav {
    flex-wrap: wrap;
    padding: 16px 0;
  }

  .menu-toggle,
  .menu-close {
    display: none;
  }

  /* No-JS fallback: keep navigation links visible and wrapped below the logo. */
  #sidemenu {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 8px 20px;
    margin-left: 0;
    padding-bottom: 4px;
  }

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

  /* With JavaScript, turn the same list into an accessible off-canvas drawer. */
  .js .menu-toggle {
    display: inline-flex;
  }

  .js #sidemenu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    width: min(84vw, 336px);
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 88px 28px 32px;
    overflow-y: auto;
    border-left: 1px solid rgba(125, 211, 252, 0.18);
    background:
      radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.12), transparent 45%),
      #071120;
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
    transform: translateX(105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), visibility 320ms;
  }

  .js #sidemenu.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .js #sidemenu li {
    width: 100%;
  }

  .js #sidemenu .nav-link {
    display: block;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    font-size: 1.05rem;
  }

  .js #sidemenu .nav-link::after {
    display: none;
  }

  .js .menu-close {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 1003;
  }

  .js body.menu-open .menu-close {
    display: inline-flex;
  }

  .menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: block;
    background: rgba(2, 6, 23, 0.66);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
  }

  body.menu-open .menu-overlay {
    opacity: 1;
    visibility: visible;
  }

  .about-header {
    margin-bottom: 24px;
  }

  .skills-container {
    grid-template-columns: 1fr;
  }

  .timeline {
    max-width: none;
  }

  .timeline-item {
    padding-left: 54px;
  }

  .timeline-dot {
    width: 32px;
    height: 32px;
  }

  .timeline::before {
    left: 15px;
  }

  .services-list {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 0;
  }

  /* Features must remain readable on touch screens where hover does not exist. */
  .project-overlay {
    position: static;
    margin-top: 18px;
    padding: 18px 0 0;
    border-top: 1px solid var(--border);
    background: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  /* The card heading is already visible above the static overlay. */
  .project-card .project-overlay-title {
    display: none;
  }

  .project-card:hover,
  .project-card:focus-within,
  .project-card:focus-visible {
    transform: none;
  }

  .project-details h4 {
    margin-top: 0;
  }

  .projects-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px;
  }

  .contact-left {
    display: block;
  }

  .social-icon {
    margin-bottom: 24px;
  }

  .contact-left .btn.btn2 {
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .projects-filter-bar {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .filter-pills {
    border-radius: 12px;
    flex-wrap: nowrap;
  }

  .filter-pill {
    padding: 6px 12px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  main > section {
    padding: 48px 0;
  }

  .header-content {
    padding: clamp(235px, 66vw, 300px) 0 24px;
  }

  main > section:last-of-type,
  #contact {
    padding-bottom: 0;
  }

  .header-btns {
    width: 100%;
    gap: 10px;
  }

  .header-btns .btn {
    flex: 1 1 calc(50% - 10px);
    padding-inline: 14px;
    font-size: 0.86rem;
  }

  .header-btns .btn-primary {
    flex-basis: 100%;
  }

  .header-badge {
    font-size: 0.72rem;
  }

  .about-badge {
    font-size: 0.72rem;
  }

  .tab-titles {
    gap: 22px;
  }

  .timeline-content {
    padding: 16px 17px;
  }

  .timeline-title {
    font-size: 1rem;
  }

  .input-group {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .contact-item p {
    font-size: 0.84rem;
  }

  .copyright {
    padding-inline: 16px;
  }
}

@media (max-width: 380px) {
  .logo {
    width: 140px;
  }

  .header-text h1 {
    font-size: 2.15rem;
  }

  .hero-stats {
    gap: 10px;
  }

  .hero-stats li,
  .hero-stats li:first-child {
    padding-left: 10px;
  }

  .hero-stats li:first-child {
    padding-left: 0;
  }

  .hero-stats strong {
    font-size: 1.05rem;
  }

  .hero-stats span {
    font-size: 0.56rem;
  }

  .header-btns .btn {
    flex-basis: 100%;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

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

  .scroll-down {
    display: none;
  }
}
