/* ==========================================================================
   Abdullah Hanif — Portfolio Design System
   Pure CSS · No frameworks · No AI libraries
   ========================================================================== */

:root {
  --bg: #FAFAF8;
  --bg-alt: #F2F1ED;
  --surface: #FFFFFF;
  --text: #1A1A2E;
  --text-muted: #5C5C72;
  --accent: #0D7377;
  --accent-dark: #095456;
  --accent-soft: rgba(13, 115, 119, 0.08);
  --gold: #C4A35A;
  --gold-soft: rgba(196, 163, 90, 0.12);
  --border: #E4E2DC;
  --shadow: 0 4px 24px rgba(26, 26, 46, 0.06);
  --shadow-lg: 0 12px 48px rgba(26, 26, 46, 0.1);
  --radius: 12px;
  --radius-lg: 20px;
  --max-width: 1100px;
  --nav-height: 72px;
  --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, sans-serif;
  --transition: 0.25s ease;
}

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

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

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  color: var(--accent-dark);
}

ul {
  list-style: none;
}

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

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

/* Container */
.container {
  width: min(100% - 2.5rem, var(--max-width));
  margin-inline: auto;
}

.section {
  padding: 5rem 0;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1rem;
}

.section-intro {
  color: var(--text-muted);
  max-width: 62ch;
  font-size: 1.125rem;
}

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

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text);
}

.nav-logo:hover {
  color: var(--text);
}

.nav-logo-mark {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--accent);
  color: #fff !important;
  padding: 0.5rem 1.125rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background var(--transition);
}

.nav-cta:hover {
  background: var(--accent-dark);
  color: #fff !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

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

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: calc(var(--nav-height) + 4rem) 0 5rem;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 600;
  line-height: 1.12;
  margin-bottom: 0.5rem;
}

.hero-role {
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.hero-tagline {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 52ch;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-photo-wrap {
  position: relative;
  justify-self: center;
  width: min(100%, 340px);
}

.hero-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.hero-photo-accent {
  position: absolute;
  bottom: -12px;
  right: -12px;
  width: 100%;
  height: 100%;
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0.35;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-weight: 500;
}

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

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

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

.about-text p:last-child {
  margin-bottom: 0;
}

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

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.highlight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.highlight-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--accent-soft);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--accent);
}

.highlight-card h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.highlight-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Journey Timeline
   ========================================================================== */

.timeline {
  position: relative;
  margin-top: 3rem;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

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

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

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  z-index: 1;
}

.timeline-date {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.375rem;
}

.timeline-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-desc {
  color: var(--text-muted);
  max-width: 65ch;
  font-size: 0.975rem;
}

/* ==========================================================================
   Work / Project
   ========================================================================== */

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 2.5rem;
}

.project-header {
  padding: 2rem 2.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
}

.project-badge {
  display: inline-block;
  background: var(--gold-soft);
  color: #8B6914;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
}

.project-name {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.project-tagline {
  color: var(--text-muted);
  font-size: 1.0625rem;
  max-width: 70ch;
}

.live-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.25rem 2.5rem;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
}

.live-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.4rem 0.875rem;
  border-radius: 100px;
  transition: all var(--transition);
}

.live-link:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.project-body {
  padding: 2.5rem;
}

.case-study-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.case-block h3 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.case-block p {
  color: var(--text-muted);
  font-size: 0.975rem;
}

/* Module grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.module-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.module-tag svg {
  flex-shrink: 0;
  color: var(--accent);
}

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-caption {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.project-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 2.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.project-footer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.project-footer-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.project-footer-text strong {
  color: var(--text);
}

/* ==========================================================================
   Skills
   ========================================================================== */

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

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.skill-group h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.375rem 0.875rem;
  border-radius: 100px;
}

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

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

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  margin-top: 2.5rem;
}

.contact-info h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.contact-info p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

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

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
  transition: all var(--transition);
}

.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.contact-link svg {
  flex-shrink: 0;
  color: var(--accent);
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.form-success {
  display: none;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 1rem;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 1rem;
  text-align: center;
}

.form-success.show {
  display: block;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

.footer-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

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

.footer-note {
  width: 100%;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

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

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-tagline {
    margin-inline: auto;
  }

  .btn-group {
    justify-content: center;
  }

  .hero-photo-wrap,
  .hero-visual {
    order: -1;
    width: min(100%, 300px);
    margin-inline: auto;
  }

  .hero-thumb-stack {
    display: none;
  }

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

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

  .case-study-grid {
    grid-template-columns: 1fr;
  }

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

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

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

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

  .about-product-shot {
    right: 0;
    bottom: -1rem;
  }

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

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
    gap: 1.25rem;
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .section {
    padding: 3.5rem 0;
  }

  .hero {
    padding-top: calc(var(--nav-height) + 2.5rem);
  }

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

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

  .project-header,
  .project-body,
  .live-links,
  .project-footer {
    padding-inline: 1.5rem;
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-item::before {
    left: -1.5rem;
  }
}

@media (max-width: 480px) {
  .btn-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

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

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

/* ==========================================================================
   PRELOADER — ECG Heartbeat
   ========================================================================== */

body.loading {
  overflow: hidden;
}

.site-wrap {
  opacity: 0;
  transition: opacity 0.5s ease 0.1s;
}

body.loaded .site-wrap {
  opacity: 1;
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: #0a1628;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.preloader-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  filter: blur(20px) grayscale(40%);
}

.preloader-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,22,40,0.7), rgba(10,22,40,0.95));
}

.preloader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  width: min(90vw, 380px);
  text-align: center;
  position: relative;
  z-index: 1;
}

.preloader-brand {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: #f0f4f8;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.preloader-sub {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(13, 180, 185, 0.85);
  margin-bottom: 2rem;
}

.ecg-monitor {
  position: relative;
  height: 72px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(13, 180, 185, 0.25);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.ecg-svg {
  width: 100%;
  height: 100%;
}

.ecg-baseline {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

.ecg-trace {
  fill: none;
  stroke: #14d4d9;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: ecgDraw 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(20, 212, 217, 0.6));
}

.ecg-scanline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(20, 212, 217, 0.8), transparent);
  animation: ecgScan 1.8s linear infinite;
}

@keyframes ecgDraw {
  0% { stroke-dashoffset: 800; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -800; }
}

@keyframes ecgScan {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.beat-panel {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.beat-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(20, 212, 217, 0.7);
}

.beat-count {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: #14d4d9;
  min-width: 2.5ch;
  animation: beatPulse 0.85s ease-in-out infinite;
}

.beat-unit {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

@keyframes beatPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  15% { transform: scale(1.08); opacity: 1; }
  30% { transform: scale(1); opacity: 0.85; }
  45% { transform: scale(1.05); opacity: 1; }
  60% { transform: scale(1); opacity: 0.9; }
}

.preloader-bar {
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.preloader-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0D7377, #14d4d9);
  border-radius: 2px;
  transition: width 0.15s ease;
}

/* Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #14d4d9);
  z-index: 1001;
  transition: width 0.08s linear;
}

/* ==========================================================================
   ENHANCED NAV
   ========================================================================== */

.nav {
  transition: height 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
  --nav-height: 60px;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 30px rgba(26, 26, 46, 0.08);
  border-bottom-color: transparent;
}

.nav-logo-text {
  transition: font-size 0.3s ease;
}

.nav.scrolled .nav-logo-text {
  font-size: 1rem;
}

.nav-link {
  position: relative;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  padding-bottom: 4px;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

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

.nav-cta {
  position: relative;
  overflow: hidden;
}

.nav-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.nav-cta:hover::before {
  transform: translateX(100%);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

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

/* ==========================================================================
   HERO ENHANCEMENTS
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
}

.hero-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  opacity: 0.04;
  filter: grayscale(30%);
  pointer-events: none;
}

.hero-bg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(13, 115, 119, 0.12), transparent),
    radial-gradient(ellipse 40% 40% at 10% 80%, rgba(196, 163, 90, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

/* Section background images */
.section-has-bg {
  position: relative;
  overflow: hidden;
}

.section-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.035;
  filter: grayscale(50%) blur(1px);
  pointer-events: none;
}

.section-has-bg > .container {
  position: relative;
  z-index: 1;
}

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

/* ==========================================================================
   PERFORMANCE REPORT
   ========================================================================== */

.img-loader.about-portrait-wrap {
  max-width: 280px;
  border-radius: var(--radius-lg);
}

.about-portrait-wrap .about-portrait {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.perf-urdu {
  background: linear-gradient(135deg, rgba(13, 115, 119, 0.04), rgba(196, 163, 90, 0.06));
}

/* Image loading skeleton */
.img-loader {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bg-alt);
  border-radius: inherit;
}

.img-loader .img-loader-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg-alt) 0%, #eceae4 50%, var(--bg-alt) 100%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease infinite;
  z-index: 1;
  border-radius: inherit;
  transition: opacity 0.4s ease;
}

.img-loader.is-loaded .img-loader-shimmer {
  opacity: 0;
  pointer-events: none;
}

.img-loader img {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.img-loader.is-loaded img {
  opacity: 1;
}

.about-product-loader {
  position: absolute;
  bottom: -1.5rem;
  right: -1rem;
  width: 55%;
  border-radius: var(--radius);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-lg);
  animation: floatCard 5s ease-in-out infinite;
}

.about-product-loader .about-product-shot {
  width: 100%;
  border: none;
  box-shadow: none;
  animation: none;
}

@keyframes imgShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.gallery-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.gallery-img-wrap .img-loader-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg-alt) 0%, #eceae4 50%, var(--bg-alt) 100%);
  background-size: 200% 100%;
  animation: imgShimmer 1.4s ease infinite;
  z-index: 1;
}

.gallery-img-wrap.is-loaded .img-loader-shimmer {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-img-wrap img {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.gallery-img-wrap.is-loaded img {
  opacity: 1;
}

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

.perf-report {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-top: 2rem;
}

.perf-header {
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, #0a1628 0%, #0D7377 100%);
  color: #fff;
}

.perf-verdict {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.perf-verdict-badge {
  background: #22c55e;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.875rem;
  border-radius: 6px;
  animation: pulseRing 2s ease infinite;
}

.perf-verdict-text {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
}

.perf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-size: 0.8125rem;
  opacity: 0.85;
}

.perf-question,
.perf-table-wrap,
.perf-cards,
.perf-limits {
  padding: 1.75rem 2rem;
  border-bottom: 1px solid var(--border);
}

.perf-question h3,
.perf-table-wrap h3,
.perf-limits h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.perf-question p {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.perf-answer {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 0.875rem 1rem;
  border-radius: 0 8px 8px 0;
  margin-top: 0.75rem;
}

.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.perf-table th,
.perf-table td {
  padding: 0.625rem 0.875rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.perf-table th {
  background: var(--bg);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.perf-table tbody tr:hover {
  background: var(--bg);
}

.perf-table-aggregate {
  background: var(--accent-soft);
}

.perf-table code {
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8125rem;
}

.perf-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-style: italic;
}

.perf-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.perf-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.perf-card h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.perf-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.perf-card ul {
  list-style: none;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.perf-card li {
  padding: 0.25rem 0;
  padding-left: 1rem;
  position: relative;
}

.perf-card li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.perf-limits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.perf-limit-col {
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.perf-limit-yes {
  background: rgba(34, 197, 94, 0.06);
  border-color: rgba(34, 197, 94, 0.2);
}

.perf-limit-no {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.15);
}

.perf-limit-col h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.perf-limit-yes h4 { color: #16a34a; }
.perf-limit-no h4 { color: #dc2626; }

.perf-limit-col ul {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-left: 1.125rem;
}

.perf-limit-col li {
  margin-bottom: 0.375rem;
}

.perf-footer {
  padding: 1.25rem 2rem;
  background: var(--bg);
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

.metrics-cta {
  text-align: center;
  margin-top: 1.25rem;
}

.metric-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}

.metric-card-link:hover {
  border-color: var(--accent);
  color: inherit;
}

@media (max-width: 768px) {
  .perf-cards,
  .perf-limits-grid {
    grid-template-columns: 1fr;
  }

  .perf-header,
  .perf-question,
  .perf-table-wrap,
  .perf-cards,
  .perf-limits {
    padding-inline: 1.25rem;
  }

  .perf-table {
    font-size: 0.75rem;
  }

  .perf-table th,
  .perf-table td {
    padding: 0.5rem;
  }
}

/* ==========================================================================
   SKILLS OVER DEGREES / PATH
   ========================================================================== */

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

.path-callout {
  background: linear-gradient(135deg, rgba(13, 115, 119, 0.08), rgba(196, 163, 90, 0.1));
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.path-callout p {
  color: var(--text-muted);
  margin: 0;
  font-size: 1.0625rem;
}

.path-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.path-region-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.path-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.path-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.path-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.path-quote {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.path-policy {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.path-card-highlight {
  background: var(--accent-soft);
  border-color: rgba(13, 115, 119, 0.25);
}

.path-card-compact {
  padding: 1rem 1.25rem;
}

/* Site body hydration loading */
.site-body-loading {
  text-align: center;
  padding: 4rem 0;
}

.site-body-spinner {
  width: 40px;
  height: 40px;
  margin: 1.5rem auto 0;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: siteSpin 0.8s linear infinite;
}

@keyframes siteSpin {
  to { transform: rotate(360deg); }
}

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


.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: pulseRing 2s ease infinite;
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero-title {
  animation: fadeUp 0.8s ease 0.1s both;
}

.hero-role {
  animation: fadeUp 0.8s ease 0.2s both;
}

.hero-tagline {
  animation: fadeUp 0.8s ease 0.3s both;
}

.btn-group {
  animation: fadeUp 0.8s ease 0.4s both;
}

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

.hero-visual {
  position: relative;
}

.hero-status-badge {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  padding: 0.4rem 0.875rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.hero-thumb-stack {
  position: absolute;
  right: -1rem;
  bottom: -1.5rem;
  width: 180px;
  height: 140px;
}

.hero-thumb {
  position: absolute;
  border-radius: 10px;
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-lg);
  object-fit: cover;
  object-position: top;
  transition: transform 0.4s ease;
}

.hero-thumb-1 {
  width: 150px;
  height: 94px;
  top: 0;
  left: 0;
  z-index: 3;
  animation: floatCard 4s ease-in-out infinite;
}

.hero-thumb-2 {
  width: 130px;
  height: 82px;
  top: 28px;
  left: 40px;
  z-index: 2;
  animation: floatCard 4s ease-in-out 0.6s infinite;
}

.hero-thumb-3 {
  width: 120px;
  height: 75px;
  top: 55px;
  left: 15px;
  z-index: 1;
  animation: floatCard 4s ease-in-out 1.2s infinite;
}

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

.stat-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(13, 115, 119, 0.25);
}

/* ==========================================================================
   ABOUT VISUAL
   ========================================================================== */

.about-grid {
  grid-template-columns: 0.85fr 1.15fr;
  gap: 3rem;
  align-items: start;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-image-stack {
  position: relative;
}

.about-portrait {
  width: 100%;
  max-width: 280px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.about-product-shot {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  object-position: top;
}

/* removed duplicate absolute positioning — now on .about-product-loader */

/* ==========================================================================
   PROTECTED ASSETS
   ========================================================================== */

.protected-img,
.protected-visual img,
.gallery-img-wrap img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
}

.gallery-img-wrap {
  overflow: hidden;
  border-radius: var(--radius);
}

.gallery-img-wrap img {
  transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img-wrap img {
  transform: scale(1.04);
}

/* ==========================================================================
   MICRO ANIMATIONS
   ========================================================================== */

.highlight-card,
.skill-group,
.module-tag,
.metric-card,
.contact-link,
.live-link {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.highlight-card:hover,
.skill-group:hover,
.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.module-tag:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.live-link:hover {
  transform: translateY(-2px);
}

.contact-link:hover {
  transform: translateX(4px);
}

.timeline-item {
  transition: transform 0.3s ease;
}

.timeline-item:hover {
  transform: translateX(6px);
}

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn-primary:hover::after {
  transform: translateX(100%);
}

.project-card {
  transition: box-shadow 0.4s ease;
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
}

.reveal.visible:nth-child(2) { transition-delay: 0.05s; }
.reveal.visible:nth-child(3) { transition-delay: 0.1s; }
.reveal.visible:nth-child(4) { transition-delay: 0.15s; }

@media (prefers-reduced-motion: reduce) {
  .preloader { display: none; }
  .site-wrap { opacity: 1; }
  body.loading { overflow: auto; }

  .ecg-trace,
  .ecg-scanline,
  .beat-count,
  .hero-thumb,
  .about-product-shot,
  .pulse-dot {
    animation: none !important;
  }

  .hero-title,
  .hero-role,
  .hero-tagline,
  .btn-group {
    animation: none !important;
  }
}

