/* ==========================================================================
   Abdul Basit — Portfolio
   Dark, restrained, senior-engineer aesthetic.
   ========================================================================== */

:root {
  --primary: #3b82f6;
  --primary-strong: #2563eb;
  --secondary: #6366f1;
  --accent: #60a5fa;
  --bg: #070b12;
  --bg-elevated: #0a101a;
  --surface: #0e1624;
  --surface-2: #121c2c;
  --border: #1e2b3d;
  --border-strong: #2a3c55;
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --success: #34d399;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  --ring: 0 0 0 1px rgba(59, 130, 246, 0.35), 0 18px 50px rgba(59, 130, 246, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1160px;
  --header-h: 76px;
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  overflow-x: clip;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  max-width: 100%;
  min-width: 0;
}

body {
  overflow-x: clip;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.portrait-image,
.project-media img,
.modal-media img {
  max-width: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
}

h1, h2, h3, p, ul {
  margin: 0;
}

ul {
  list-style: none;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: rgba(59, 130, 246, 0.28);
  color: var(--text);
}

.visually-hidden {
  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;
  left: 16px;
  top: 12px;
  z-index: 80;
  padding: 10px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: none;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 20px;
  box-sizing: border-box;
  min-width: 0;
}

/* -------------------------------------------------------------------------- */
/* Header / Nav
/* -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  overflow: visible;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(7, 11, 18, 0.72);
  border-bottom-color: rgba(30, 43, 61, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-inner,
.header-container {
  height: 100%;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  min-width: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.03em;
  min-width: 0;
  flex: 0 1 auto;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(160deg, rgba(59, 130, 246, 0.22), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: var(--accent);
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

.logo-text,
.logo-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.nav-link.is-active {
  background: rgba(59, 130, 246, 0.08);
}

.nav {
  margin-left: auto;
}

.header-cta {
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin-left: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  place-items: center;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  position: relative;
  transition: transform 0.25s var(--ease), opacity 0.2s ease;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.nav-toggle.is-open .nav-toggle-bars { background: transparent; }
.nav-toggle.is-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

.nav-overlay {
  display: none;
}

.nav-cta-mobile {
  display: none;
}

/* -------------------------------------------------------------------------- */
/* Buttons
/* -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-sm {
  min-height: 40px;
  padding: 0 14px;
  font-size: 13.5px;
}

.btn-primary {
  background: linear-gradient(180deg, #4f8df7 0%, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.38);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}

.btn.is-disabled,
a.is-disabled {
  opacity: 0.42;
  pointer-events: none;
  cursor: not-allowed;
}

/* -------------------------------------------------------------------------- */
/* Hero
/* -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  align-items: center;
  padding: 48px 0 88px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 43, 61, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 43, 61, 0.55) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 65% at 70% 40%, black 20%, transparent 72%);
  opacity: 0.45;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  animation: orbDrift 18s ease-in-out infinite alternate;
}

.hero-orb-a {
  width: 420px;
  height: 420px;
  right: 8%;
  top: 8%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.22), transparent 68%);
}

.hero-orb-b {
  width: 280px;
  height: 280px;
  left: 6%;
  bottom: 10%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.16), transparent 68%);
  animation-delay: -6s;
}

.hero-grid-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: 56px;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(14, 22, 36, 0.8);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  animation: pulse 2.4s ease-out infinite;
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(2.35rem, 4.6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.hero-role {
  margin-top: 12px;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  margin-top: 18px;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.hero-stack span {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(14, 22, 36, 0.6);
}

.hero-copy > * {
  animation: fadeUp 0.85s var(--ease) both;
}

.hero-copy > :nth-child(1) { animation-delay: 0.05s; }
.hero-copy > :nth-child(2) { animation-delay: 0.14s; }
.hero-copy > :nth-child(3) { animation-delay: 0.22s; }
.hero-copy > :nth-child(4) { animation-delay: 0.3s; }
.hero-copy > :nth-child(5) { animation-delay: 0.38s; }
.hero-copy > :nth-child(6) { animation-delay: 0.48s; }

.hero-copy {
  min-width: 0;
}

.hero-portrait {
  display: flex;
  justify-content: center;
  animation: fadeScale 1s var(--ease) both 0.18s;
  min-width: 0;
  width: 100%;
}

.portrait-stage {
  position: relative;
  width: min(100%, 400px);
  max-width: 100%;
}

.portrait-ring {
  padding: 3px;
  border-radius: 32px;
  background: linear-gradient(145deg, #60a5fa, #3b82f6 38%, #6366f1 72%, rgba(14, 22, 36, 0.2));
  box-shadow: var(--ring), var(--shadow);
  max-width: 100%;
}

.portrait-frame,
.profile-frame {
  position: relative;
  overflow: hidden;
  border-radius: 29px;
  background: var(--surface);
  aspect-ratio: 4 / 5;
  width: 100%;
  max-width: 100%;
}

.portrait-image {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 18%;
  opacity: 1;
  transition: opacity 0.45s var(--ease);
}

.portrait-image.is-loaded {
  opacity: 1;
}

.portrait-image.is-hidden {
  display: none;
}

.portrait-frame:has(.portrait-image.is-loaded) .portrait-fallback {
  visibility: hidden;
}

.portrait-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.18), transparent 40%),
    linear-gradient(180deg, #121c2c, #0a101a);
}

.portrait-initials {
  font-size: 4.4rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  background: linear-gradient(180deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.portrait-caption {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.tech-chip {
  position: absolute;
  z-index: 2;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(14, 22, 36, 0.88);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: floatY 6.5s ease-in-out infinite;
}

.chip-a { left: 8px; top: 18%; animation-delay: 0s; }
.chip-b { right: 8px; top: 46%; animation-delay: -2s; }
.chip-c { left: 12%; bottom: 10%; animation-delay: -3.5s; }

.portrait-bracket {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 1.5px solid rgba(96, 165, 250, 0.55);
  pointer-events: none;
}

.portrait-bracket-tl {
  top: -10px;
  left: -10px;
  border-right: 0;
  border-bottom: 0;
}

.portrait-bracket-br {
  right: -10px;
  bottom: -10px;
  border-left: 0;
  border-top: 0;
}

/* -------------------------------------------------------------------------- */
/* Sections
/* -------------------------------------------------------------------------- */

.section {
  padding: 104px 0;
  content-visibility: auto;
  contain-intrinsic-size: 1px 800px;
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-index {
  color: var(--accent);
}

.section-heading {
  margin-bottom: 36px;
  max-width: 42rem;
}

.section-heading h2,
.about-copy h2,
.contact-panel h2 {
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.18;
  letter-spacing: -0.038em;
  font-weight: 750;
  font-weight: 700;
}

.section-sub,
.muted {
  margin-top: 12px;
  color: var(--muted);
}

/* About */

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 40px;
  align-items: start;
}

.about-copy p {
  margin-top: 16px;
  color: var(--muted);
  max-width: 40rem;
}

.about-copy p:first-of-type {
  color: #cbd5e1;
}

.focus-card {
  padding: 28px 26px;
  background: linear-gradient(180deg, rgba(18, 28, 44, 0.95), rgba(14, 22, 36, 0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.05);
}

.focus-card h3 {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 500;
}

.focus-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.focus-list li {
  position: relative;
  padding-left: 22px;
  color: #dbe4f0;
  font-size: 0.95rem;
}

.focus-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--secondary));
}

/* Skills */

.skill-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.skill-group {
  grid-column: span 2;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease), border-color 0.25s ease;
}

.skill-group:nth-child(4),
.skill-group:nth-child(5) {
  grid-column: span 3;
}

.skill-group:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.skill-group h3 {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 500;
  margin-bottom: 16px;
}

.skill-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-group li {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: #e2e8f0;
}

/* Experience */

.experience-timeline {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 8px 0 0;
  padding: 0;
}

.experience-timeline li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  padding: 0 10px;
}

.experience-timeline h3 {
  min-height: 2.6em;
  margin: 0;
  font-size: clamp(0.92rem, 1.4vw, 1.08rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.3;
  color: var(--text);
}

.experience-marker {
  position: relative;
  width: calc(100% + 20px);
  height: 28px;
  margin: 14px 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.experience-marker::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #7d8ea3;
}

.experience-timeline li:first-child .experience-marker::before {
  left: 50%;
}

.experience-timeline li:last-child .experience-marker::before {
  right: 50%;
}

.experience-marker::after {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #5eead4;
  box-shadow: 0 0 0 5px var(--bg);
  z-index: 1;
}

.experience-years {
  margin: 0;
  font-size: 0.92rem;
  color: #cbd5e1;
  white-space: nowrap;
}

.experience-company {
  margin: 6px 0 0;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--muted);
  line-height: 1.4;
  max-width: 16rem;
}

/* Projects */

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.filter-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-btn:hover,
.filter-btn.is-active {
  color: var(--text);
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(59, 130, 246, 0.12);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s ease, box-shadow 0.3s ease;
}

.project-card.is-featured {
  grid-column: auto;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.project-card.is-hidden {
  display: none;
}

.project-card.is-filtering-out {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  pointer-events: none;
}

.project-media {
  position: relative;
  overflow: hidden;
  background: #0a121e;
  min-height: 220px;
}

.project-card.is-featured .project-media {
  min-height: 220px;
}

.project-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 240px;
  transition: transform 0.6s var(--ease), opacity 0.4s ease;
}

.project-card:hover .project-media img {
  transform: scale(1.045);
}

.project-fallback-ui {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(18, 28, 44, 0.2), rgba(7, 11, 18, 0.55)),
    repeating-linear-gradient(90deg, transparent, transparent 22px, rgba(59, 130, 246, 0.05) 23px),
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.2), transparent 40%);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
  z-index: 0;
}

.project-media img.is-hidden,
.modal-media img.is-hidden {
  display: none;
}

.project-media img:not(.is-hidden) ~ .project-fallback-ui,
.modal-media img:not(.is-hidden) ~ .project-fallback-ui {
  visibility: hidden;
}

.project-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 24px 26px;
}

.project-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.project-body h3 {
  font-size: 1.28rem;
  letter-spacing: -0.03em;
}

.project-body p {
  color: var(--muted);
  font-size: 0.95rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tech-tags li {
  font-family: var(--mono);
  font-size: 11px;
  color: #cbd5e1;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(30, 43, 61, 0.7);
  border: 1px solid var(--border);
}

.feature-list {
  display: grid;
  gap: 6px;
}

.feature-list li {
  position: relative;
  padding-left: 16px;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  width: 100%;
}

.project-actions .btn {
  min-width: 0;
}

.project-card .project-actions .btn {
  opacity: 0.92;
}

.project-card:hover .project-actions .btn {
  opacity: 1;
}

/* Services / Why / Domains */

.service-grid,
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.why-grid {
  grid-template-columns: repeat(4, 1fr);
}

.service-card,
.why-card {
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 100%;
  transition: transform 0.25s var(--ease), border-color 0.25s ease;
}

.service-card:hover,
.why-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
}

.service-num {
  display: block;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.12em;
}

.service-card h3,
.why-card h3 {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.service-card p,
.why-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.domain-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.domain-list li {
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 0.95rem;
}

/* Contact */

.contact-panel {
  padding: clamp(36px, 6vw, 64px);
  border-radius: 28px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 90% 10%, rgba(59, 130, 246, 0.12), transparent 32%),
    linear-gradient(180deg, #101a2a, #0c1422);
}

.contact-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 32px;
}

.contact-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(7, 11, 18, 0.45);
  transition: transform 0.2s var(--ease), border-color 0.2s ease, background 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: rgba(59, 130, 246, 0.08);
}

.contact-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
  flex-shrink: 0;
}

.contact-card strong {
  display: block;
  font-size: 0.98rem;
}

.contact-card span span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 42px 0 28px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 0.8fr;
  gap: 24px;
  align-items: start;
}

.footer-name {
  font-weight: 700;
  letter-spacing: -0.03em;
}

.footer-brand p:last-child,
.footer-copy p {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-nav,
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.footer-nav a,
.footer-social a {
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-nav a:hover,
.footer-social a:hover {
  color: var(--text);
}

.footer-copy {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* -------------------------------------------------------------------------- */
/* Modal
/* -------------------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  place-items: center;
  padding: 24px 16px;
}

.modal.is-open,
.modal:not([hidden]) {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  max-width: 100%;
  max-height: min(88vh, 920px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: var(--shadow);
  animation: modalIn 0.32s var(--ease);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(7, 11, 18, 0.75);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

.modal-media {
  position: relative;
  background: #081018;
  min-height: 180px;
}

.modal-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
}

.modal-body {
  padding: 28px 28px 32px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.modal-body h2 {
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

.modal-body h3 {
  margin-top: 18px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 500;
}

.modal-body p,
.modal-body li {
  color: var(--muted);
}

.modal-body ul:not(.tech-tags) {
  display: grid;
  gap: 6px;
}

.modal-body ul:not(.tech-tags) li {
  padding-left: 14px;
  position: relative;
}

.modal-body ul:not(.tech-tags) li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  left: 0;
  top: 0.55em;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

body.modal-open,
body.nav-open {
  overflow: hidden;
}

.credentials-project {
  margin-top: -8px;
  margin-bottom: 18px;
  color: var(--muted);
}

.credentials-empty {
  color: var(--muted);
}

.credential-card {
  padding: 18px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.credential-card h3 {
  margin: 0 0 12px;
  text-transform: none;
  letter-spacing: -0.02em;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
}

.credential-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.credential-row span:first-child {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 3px;
}

.credential-value,
.credential-field {
  min-width: 0;
  width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.45;
  user-select: text;
  -webkit-user-select: text;
}

.credential-field {
  display: block;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(7, 11, 18, 0.55);
  color: var(--text);
  caret-color: transparent;
}

.credential-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.credentials-status {
  min-height: 1.4em;
  margin-top: 8px;
  color: var(--success);
  font-size: 0.9rem;
}

/* Back to top */

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: rgba(14, 22, 36, 0.9);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.back-to-top[hidden] {
  display: none;
}

.back-to-top:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* Scroll reveal */

.reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* -------------------------------------------------------------------------- */
/* Motion
/* -------------------------------------------------------------------------- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

@keyframes fadeScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes orbDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-18px, 14px, 0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------------------- */
/* Responsive
/* -------------------------------------------------------------------------- */

@media (max-width: 1199px) {
  .why-grid,
  .domain-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skill-group,
  .skill-group:nth-child(4),
  .skill-group:nth-child(5) {
    grid-column: auto;
  }

  .nav-link {
    padding: 8px 10px;
  }

  .header-inner,
  .header-container {
    gap: 12px;
  }
}

@media (max-width: 1023px) {
  .header-cta {
    display: none;
  }

  .header-inner,
  .header-container {
    justify-content: space-between;
  }

  .nav-toggle {
    display: grid;
  }

  .site-header {
    overflow: visible;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    height: auto;
    max-height: min(70vh, calc(100dvh - var(--header-h)));
    overflow-y: auto;
    margin: 0;
    padding: 12px 16px 20px;
    background: rgba(10, 16, 26, 0.97);
    border-left: 0;
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.28s var(--ease), opacity 0.28s var(--ease), visibility 0.28s var(--ease);
    backdrop-filter: blur(16px);
    z-index: 46;
  }

  .nav.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nav-link {
    padding: 14px 14px;
    font-size: 1.05rem;
    min-height: 48px;
    align-items: center;
  }

  .nav-cta-mobile {
    display: block;
    margin-top: 12px;
  }

  .nav-cta-mobile .btn {
    width: 100%;
    max-width: 100%;
    min-height: 52px;
  }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(3, 6, 12, 0.55);
    z-index: 40;
  }

  .nav-overlay[hidden] {
    display: none;
  }

  .hero-grid-layout,
  .about-layout,
  .service-grid,
  .contact-methods,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    overflow: visible;
    padding-top: 40px;
    padding-bottom: 64px;
  }

  .hero-grid-layout {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  .hero-portrait {
    order: -1;
    display: flex;
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
  }

  .portrait-stage {
    width: min(260px, 70vw);
    max-width: 100%;
    margin-inline: auto;
  }

  .profile-frame {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1.15;
  }

  .tech-chip {
    font-size: 11px;
    padding: 6px 10px;
    opacity: 0.85;
  }

  .chip-a { left: 4px; top: 12%; }
  .chip-b { right: 4px; top: 48%; }
  .chip-c { left: 10%; bottom: 8%; }

  .modal {
    padding: 12px;
    align-items: center;
  }

  .modal-panel {
    width: calc(100% - 24px);
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
  }

  .modal-close {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 767px) {
  .container,
  .header-container {
    width: 100%;
    max-width: 100%;
    padding-inline: 16px;
  }

  .section {
    padding: 72px 0;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .experience-timeline {
    grid-template-columns: 1fr;
    gap: 0;
    padding-left: 8px;
  }

  .experience-timeline li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 16px;
    align-items: start;
    text-align: left;
    padding: 0 0 28px;
  }

  .experience-timeline li:last-child {
    padding-bottom: 0;
  }

  .experience-timeline h3 {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
  }

  .experience-marker {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 22px;
    height: 100%;
    margin: 6px 0 0;
    align-items: flex-start;
    justify-content: center;
  }

  .experience-marker::before {
    left: 50%;
    right: auto;
    top: 6px;
    bottom: -28px;
    width: 1px;
    height: auto;
  }

  .experience-timeline li:last-child .experience-marker::before {
    display: none;
  }

  .experience-timeline li:first-child .experience-marker::before,
  .experience-timeline li:last-child .experience-marker::before {
    left: 50%;
    right: auto;
  }

  .experience-marker::after {
    margin-top: 2px;
  }

  .experience-years {
    grid-column: 2;
    grid-row: 2;
    margin-top: 6px;
  }

  .experience-company {
    grid-column: 2;
    grid-row: 3;
  }

  .hero {
    padding-top: 50px;
    padding-bottom: 70px;
  }

  .hero-copy {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 8vw, 2.15rem);
    margin-top: 18px;
  }

  .hero-role,
  .hero-lead,
  .hero-actions,
  .hero-stack {
    margin-top: 14px;
  }

  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
  }

  .project-media img {
    min-height: 200px;
  }

  .contact-panel {
    padding: 28px 18px;
  }

  .credential-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 480px) {
  .skill-grid,
  .why-grid,
  .domain-list {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 100%;
    min-height: 52px;
    box-sizing: border-box;
  }

  .project-actions,
  .modal-actions,
  .credential-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .project-actions .btn,
  .project-actions a,
  .modal-actions .btn,
  .credential-actions .btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .tech-chip {
    display: none;
  }

  .portrait-bracket {
    display: none;
  }

  .hero-orb-a,
  .hero-orb-b {
    opacity: 0.45;
    width: 180px;
    height: 180px;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .project-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1400px) {
  .hero-grid-layout {
    gap: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
