/* ============ Base ============ */
:root {
  --bg: #08080f;
  --bg-2: #0d0d18;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e7e9f0;
  --muted: #9aa3b5;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --grad: linear-gradient(120deg, #818cf8, #a78bfa 45%, #22d3ee);
  --radius: 16px;
  --max: 1160px;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-head: "Sora", "Inter", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

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

h1,
h2,
h3,
.brand,
.hero-kicker {
  font-family: var(--font-head);
}

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

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

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.accent {
  color: var(--accent);
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

section {
  padding: 96px 0;
}

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

.section-tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.06);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.2;
}

/* ============ Skip link ============ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* ============ Nav ============ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: rgba(8, 8, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
.nav.scrolled {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
}
.brand-dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 8px;
}
.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition:
    color 0.2s,
    background 0.2s;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--panel-2);
}

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

/* ============ Buttons ============ */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 12px;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    background 0.2s,
    border-color 0.2s;
  cursor: pointer;
}
.btn-primary {
  background: var(--grad);
  color: #0b0b14;
  box-shadow: 0 8px 28px rgba(139, 92, 246, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(139, 92, 246, 0.45);
}
.btn-ghost {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--panel-2);
  transform: translateY(-2px);
}

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 180px 0 96px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}
.orb-1 {
  width: 480px;
  height: 480px;
  top: -140px;
  left: -120px;
  background: #6366f1;
  animation: drift 14s ease-in-out infinite;
}
.orb-2 {
  width: 420px;
  height: 420px;
  bottom: -160px;
  right: -100px;
  background: #22d3ee;
  opacity: 0.28;
  animation: drift 18s ease-in-out infinite reverse;
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(
    ellipse 90% 70% at 50% 40%,
    #000 30%,
    transparent 75%
  );
  mask-image: radial-gradient(
    ellipse 90% 70% at 50% 40%,
    #000 30%,
    transparent 75%
  );
}
@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(40px, 30px) scale(1.08);
  }
}

.hero-inner {
  max-width: 860px;
}
.hero-kicker {
  color: var(--accent-2);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}
.hero-name {
  font-size: clamp(52px, 11vw, 96px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 20px;
}
.hero-role {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 500;
  max-width: 640px;
  margin-bottom: 16px;
}
.hero-sub {
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 32px;
  font-size: 16px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  backdrop-filter: blur(6px);
}
.stat strong {
  display: block;
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.stat span {
  color: var(--muted);
  font-size: 13px;
}

/* ============ About ============ */
.about {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: start;
}
.about-text p {
  color: var(--muted);
  margin-bottom: 16px;
}
.about-text p:first-child {
  color: var(--text);
  font-size: 17px;
}

.about-facts {
  display: grid;
  gap: 12px;
}
.fact {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.fact span {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.fact p {
  font-size: 14px;
  font-weight: 500;
  text-align: right;
}

/* ============ Case studies ============ */
.cases {
  display: grid;
  gap: 64px;
}

.case {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  align-items: center;
}
.case:nth-child(even) {
  grid-template-columns: 1fr 1.15fr;
}
.case:nth-child(even) .case-media {
  order: 2;
}

.case-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.case-media img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.case-media:hover img {
  transform: scale(1.04);
}

.case-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 10px;
}
.case h3 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  margin-bottom: 12px;
}
.case-desc {
  color: var(--muted);
  margin-bottom: 18px;
}
.case-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.case-metrics span {
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
  color: #c4b5fd;
  padding: 5px 11px;
  border-radius: 999px;
}
.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.case-tags span {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 8px;
}
.case-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============ Work gallery ============ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}
.filter {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter:hover {
  color: var(--text);
  background: var(--panel-2);
}
.filter.active {
  color: #0b0b14;
  background: var(--grad);
  border-color: transparent;
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-2);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.card:hover .card-media img {
  transform: scale(1.05);
}

.card-media.ph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.14),
    rgba(34, 211, 238, 0.08)
  );
}
.card-media.ph .monogram {
  font-family: var(--font-head);
  font-size: 44px;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: -1px;
}

.card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.card-title h3 {
  font-size: 17px;
  font-weight: 600;
}
.card-cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  white-space: nowrap;
}
.card-desc {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 14px;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.card-tags span {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
}
.card-links {
  margin-top: auto;
  display: flex;
  gap: 14px;
  font-size: 13.5px;
  font-weight: 600;
}
.card-links a {
  color: #c4b5fd;
  transition: color 0.2s;
}
.card-links a:hover {
  color: #fff;
}
.card-links a:not(:first-child) {
  color: var(--muted);
}
.card-links a:not(:first-child):hover {
  color: #fff;
}
.card-links .card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #0b0b14;
  background: var(--grad);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.card-links .card-btn:hover {
  color: #0b0b14;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.45);
}
.card-links a.card-btn-ghost {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: none;
}
.card-links a.card-btn-ghost:hover {
  color: var(--text);
  background: var(--panel-2);
  transform: translateY(-2px);
  box-shadow: none;
}

.grid-empty {
  display: none;
  color: var(--muted);
  text-align: center;
  padding: 40px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ============ Skills ============ */
.skills {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.skill-group {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.skill-group h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}
.tags {
  text-align: justify;
  text-align-last: left;
  word-spacing: 5px;
}
.tags span {
  display: inline-block;
  vertical-align: top;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text);
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.22);
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}
.tags span:hover {
  background: rgba(139, 92, 246, 0.2);
}

/* ============ Certifications ============ */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.cert {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
}
.cert:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.cert-media {
  display: block;
  aspect-ratio: 1000 / 647;
  overflow: hidden;
  background: var(--bg-2);
}
.cert-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.cert:hover .cert-media img {
  transform: scale(1.03);
}
.cert-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.cert-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.cert-title h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.cert-year {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  white-space: nowrap;
}
.cert-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}
.cert-verify {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #0b0b14;
  background: var(--grad);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.cert-verify:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.45);
}

/* ============ Contact ============ */
.contact-card {
  background: linear-gradient(
    160deg,
    rgba(139, 92, 246, 0.12),
    rgba(34, 211, 238, 0.06)
  );
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 24px;
  padding: 56px 48px;
  text-align: center;
}
.contact-card .section-head {
  margin: 0 auto 16px;
}
.contact-lead {
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 32px;
}
.contact-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  transition:
    transform 0.2s,
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s,
    color 0.2s;
}
.btn-icon svg {
  width: 24px;
  height: 24px;
}
.btn-icon:hover {
  transform: translateY(-3px);
  background: var(--panel-2);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  color: #fff;
}
.btn-icon.primary {
  background: var(--grad);
  color: #0b0b14;
  border-color: transparent;
  box-shadow: 0 8px 28px rgba(139, 92, 246, 0.35);
}
.btn-icon.primary:hover {
  box-shadow: 0 12px 34px rgba(139, 92, 246, 0.5);
  color: #0b0b14;
}
.icon-fill {
  fill: currentColor;
}

/* ============ Footer ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer p {
  color: var(--muted);
  font-size: 13.5px;
}
.to-top {
  color: var(--muted);
  font-size: 13.5px;
  transition: color 0.2s;
}
.to-top:hover {
  color: var(--accent-2);
}

/* ============ Reveal animation ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  section {
    padding: 72px 0;
  }
  .hero {
    padding: 140px 0 72px;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .case,
  .case:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .case:nth-child(even) .case-media {
    order: 0;
  }
  .case-media img {
    height: 260px;
  }
  .contact-card {
    padding: 40px 24px;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(8, 8, 15, 0.97);
    backdrop-filter: blur(14px);
    padding: 12px 24px 20px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 0.25s,
      transform 0.25s;
  }
  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

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