/* ===== Foundation ===== */
:root {
  --bg: #0A0A0A;
  --card-bg: #111214;
  --card-bg-alt: #16171A;
  --border: #232427;
  --border-alt: #2c2c30;
  --text-primary: #FFFFFF;
  --text-secondary: #9C9CA1;
  --text-muted: #8A8A8E;
  --accent-start: #FF7A2E;
  --accent-end: #FF4517;
  --accent-gradient: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  --header-height: 76px;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  margin: 0;
}

p { margin: 0; }

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

ul { margin: 0; padding: 0; list-style: none; }

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

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

section {
  scroll-margin-top: var(--header-height);
}

/* ===== Skip link ===== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent-gradient);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 8px 0;
  z-index: 200;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* ===== Focus states ===== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-start);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 24px rgba(255, 90, 30, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 90, 30, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-alt);
}
.btn-secondary:hover {
  border-color: var(--accent-start);
  transform: translateY(-2px);
}

.btn-nav-cta {
  background: var(--card-bg-alt);
  border: 1px solid var(--border-alt);
  padding: 0.6rem 1.3rem;
  font-size: 0.875rem;
}
.btn-nav-cta:hover {
  border-color: var(--accent-start);
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 10, 10, 0.9);
}

.navbar {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-size: 1.05rem;
  font-weight: 700;
  margin-right: auto;
}

.nav-links {
  display: flex;
  gap: 2rem;
}
.nav-links a {
  font-size: 0.925rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}
.nav-links a:hover {
  color: var(--text-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border-alt);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 18px;
  margin-inline: auto;
  background: var(--text-primary);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: clamp(3.5rem, 10vw, 7rem) 1.5rem 4rem;
  max-width: var(--max-width);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: visible;
}

.hero-glow {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 140vw);
  height: min(900px, 140vw);
  background: radial-gradient(circle at center,
    rgba(255, 122, 46, 0.32) 0%,
    rgba(255, 69, 23, 0.14) 35%,
    transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-start);
  margin-bottom: 1.25rem;
}
.eyebrow .dot {
  font-size: 0.55rem;
}

.hero-content h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.hero-sub {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin-inline: auto;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  margin-bottom: 2.25rem;
}

.hero-ctas {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 3.5rem;
}

/* ===== Hub graphic ===== */
.hub-graphic {
  position: relative;
  z-index: 1;
  width: min(90vw, 420px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
}

.connector-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hub-node {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border-alt);
  color: var(--text-secondary);
  animation: float 4s ease-in-out infinite;
}
.hub-node svg {
  width: 45%;
  height: 45%;
}

.hub-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22%;
  aspect-ratio: 1 / 1;
  color: #fff;
  box-shadow: 0 0 50px rgba(255, 90, 30, 0.55), 0 0 0 1px rgba(255, 122, 46, 0.3) inset;
  animation: none;
}

.node-top {
  top: 5%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14%;
  aspect-ratio: 1 / 1;
  animation-delay: 0s;
}
.node-right {
  top: 50%;
  left: 95%;
  transform: translate(-50%, -50%);
  width: 14%;
  aspect-ratio: 1 / 1;
  animation-delay: 0.6s;
}
.node-bottom {
  top: 95%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14%;
  aspect-ratio: 1 / 1;
  animation-delay: 1.2s;
}
.node-left {
  top: 50%;
  left: 5%;
  transform: translate(-50%, -50%);
  width: 14%;
  aspect-ratio: 1 / 1;
  animation-delay: 1.8s;
}

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

/* ===== Particles ===== */
.particle-field {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  z-index: 0;
}
.site-particle-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.5;
}
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent-start);
  box-shadow: 0 0 6px 1.5px rgba(255, 122, 46, 0.8);
  opacity: 0;
  animation: drift var(--duration, 8s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes drift {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: 0.9; }
  50% { transform: translate(var(--dx, 10px), var(--dy, -14px)); opacity: 0.5; }
  85% { opacity: 0.9; }
  100% { transform: translate(0, 0); opacity: 0; }
}

/* ===== Section shared ===== */
main section:not(.hero) {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 5rem 1.5rem;
}

main section h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  max-width: 720px;
  margin-bottom: 2.5rem;
  letter-spacing: -0.01em;
}

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

/* ===== Cards (shared look) ===== */
.feature-card,
.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.feature-card:hover,
.skill-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 122, 46, 0.4);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 90, 30, 0.15);
}

/* Problem */
.problem-narrative {
  max-width: 640px;
}
.problem-narrative h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}
.problem-narrative p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Bridge */
.section-bridge {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  text-align: center;
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 500;
}

/* Work section */
.project-title {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}
.project-result {
  max-width: 640px;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
}
.feature-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}
.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.feature-cards .feature-card:nth-child(2) { transition-delay: 0.08s; }
.feature-cards .feature-card:nth-child(3) { transition-delay: 0.16s; }
.feature-cards .feature-card:nth-child(4) { transition-delay: 0.24s; }

/* Workflow diagram */
.workflow-diagram {
  margin: 0 0 3rem;
}
.workflow-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
  width: 100px;
}
.workflow-node {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border-alt);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}
.workflow-node svg {
  width: 46%;
  height: 46%;
}
.workflow-node.active {
  transform: scale(1.15);
  border-color: var(--accent-start);
  color: #fff;
  box-shadow: 0 0 30px rgba(255, 90, 30, 0.5), 0 0 0 1px rgba(255, 122, 46, 0.3) inset;
}
.workflow-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.3;
}
.workflow-connector {
  flex: 1 1 auto;
  height: 2px;
  min-width: 20px;
  background: var(--border-alt);
  margin-top: 29px;
  position: relative;
  overflow: hidden;
}
.workflow-connector-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--accent-gradient);
  box-shadow: 0 0 8px rgba(255, 122, 46, 0.6);
  transition: width 0.6s ease;
}
.workflow-connector.filled .workflow-connector-fill {
  width: 100%;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.tag {
  background: var(--card-bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  transition-delay: 0s;
}
.tag:hover {
  border-color: var(--accent-start);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 90, 30, 0.25);
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.skill-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}
.skill-card p {
  color: var(--text-secondary);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}
.skills-grid .skill-card:nth-child(2) { transition-delay: 0.06s; }
.skills-grid .skill-card:nth-child(3) { transition-delay: 0.12s; }
.skills-grid .skill-card:nth-child(4) { transition-delay: 0.18s; }
.skills-grid .skill-card:nth-child(5) { transition-delay: 0.24s; }
.skills-grid .skill-card:nth-child(6) { transition-delay: 0.3s; }
.skills-grid .skill-card:nth-child(7) { transition-delay: 0.36s; }
.skills-grid .skill-card:nth-child(8) { transition-delay: 0.42s; }
.skills-grid .skill-card:nth-child(9) { transition-delay: 0.48s; }
.skills-grid .skill-card:nth-child(10) { transition-delay: 0.54s; }
.skills-grid .skill-card:nth-child(11) { transition-delay: 0.6s; }
.skills-grid .skill-card:nth-child(12) { transition-delay: 0.66s; }

/* About */
.about {
  text-align: center;
}
.about h2 {
  margin-inline: auto;
}
.about-body {
  max-width: 640px;
  margin-inline: auto;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.about-photos {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2.5rem;
  margin-top: 3.5rem;
  flex-wrap: wrap;
  transform: translateX(56px);
}

.about-photo-wrap {
  opacity: 0;
  transform: translateY(36px) scale(0.92);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.about-photo-wrap.pop {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.about-photos .about-photo-wrap:nth-child(2) { transition-delay: 0.12s; }
.about-photos .about-photo-wrap:nth-child(3) { transition-delay: 0.24s; }

.about-photo {
  display: block;
  height: 260px;
  width: auto;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.5));
}
/* small per-image nudges to align feet/ground-contact across different poses */
.about-photo-1 { transform: translateY(0); }
.about-photo-2 { transform: translateY(0); }
.about-photo-3 { transform: translateY(0); }

/* Contact */
.contact {
  position: relative;
  text-align: center;
}
.contact-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 500px;
  background: radial-gradient(circle at center,
    rgba(255, 122, 46, 0.18) 0%,
    rgba(255, 69, 23, 0.08) 40%,
    transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
.contact h2 {
  position: relative;
  z-index: 1;
  margin-inline: auto;
}
.contact-links {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}
.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.75rem;
  border: 1px solid var(--border-alt);
  border-radius: 999px;
  background: var(--card-bg);
  font-weight: 500;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.contact-item svg {
  width: 18px;
  height: 18px;
  color: var(--accent-start);
}
.contact-item:hover {
  border-color: var(--accent-start);
  transform: translateY(-2px);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 10, 10, 0.97);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-links.open {
    max-height: 320px;
  }
  .nav-links li {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
  }
  .btn-nav-cta {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }

  .feature-cards {
    grid-template-columns: 1fr;
  }

  .about-photos {
    gap: 1.5rem;
  }
  .about-photo {
    height: 190px;
  }

  .hero-ctas {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
  }
  .hero-ctas .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .workflow-row {
    flex-direction: column;
    align-items: center;
  }
  .workflow-connector {
    width: 2px;
    height: 32px;
    min-width: 0;
    margin: 0;
  }
  .workflow-connector-fill {
    width: 100%;
    height: 0%;
  }
  .workflow-connector.filled .workflow-connector-fill {
    height: 100%;
  }
}

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
  main section:not(.hero) {
    padding: 3.5rem 1.25rem;
  }

  .about-photos {
    flex-direction: column;
    align-items: center;
  }
  .about-photo {
    height: 220px;
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .particle,
  .hub-node,
  .reveal,
  .btn,
  .feature-card,
  .skill-card,
  .contact-item,
  .tag,
  .workflow-node,
  .workflow-connector-fill,
  .about-photo-wrap {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .about-photo-wrap {
    opacity: 1 !important;
    transform: none !important;
  }
  .workflow-node {
    border-color: var(--accent-start);
    color: #fff;
    box-shadow: 0 0 30px rgba(255, 90, 30, 0.5), 0 0 0 1px rgba(255, 122, 46, 0.3) inset;
  }
  .workflow-connector-fill {
    width: 100% !important;
    height: 100% !important;
  }
}
