:root {
  --bg: #050712;
  --bg-elevated: #0b0f1f;
  --bg-elevated-soft: #101426;
  --border-subtle: rgba(148, 163, 184, 0.25);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --accent-strong: #0ea5e9;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;
  --danger: #f97373;
  --shadow-soft: 0 22px 45px rgba(15, 23, 42, 0.78);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --header-height: 70px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
  color: var(--text-main);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
      rgba(148, 163, 184, 0.08) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(148, 163, 184, 0.06) 1px,
      transparent 1px
    );
  background-size: 50px 50px;
  opacity: 0.45;
  mix-blend-mode: soft-light;
  z-index: -2;
}

/* Animated background gears */
.bg-gears {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
  opacity: 0.15;
}

.bg-gears .gear {
  position: absolute;
  color: var(--accent);
  filter: blur(0.5px);
  transform-origin: center center;
  will-change: transform;
  display: block;
}

/* Gear 1 - Top left area */
.bg-gears .gear-1 {
  width: 180px;
  height: 180px;
  top: 8%;
  left: 5%;
  animation: rotate-gear-1 20s linear infinite;
}

/* Gear 2 - Top right area, meshed with gear 1 */
.bg-gears .gear-2 {
  width: 220px;
  height: 220px;
  top: 12%;
  left: 18%;
  animation: rotate-gear-2 25s linear infinite reverse;
}

/* Gear 3 - Bottom left area */
.bg-gears .gear-3 {
  width: 140px;
  height: 140px;
  bottom: 15%;
  left: 8%;
  animation: rotate-gear-3 18s linear infinite;
}

/* Gear 4 - Bottom right area */
.bg-gears .gear-4 {
  width: 160px;
  height: 160px;
  bottom: 10%;
  right: 12%;
  animation: rotate-gear-4 22s linear infinite reverse;
}

@keyframes rotate-gear-1 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes rotate-gear-2 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes rotate-gear-3 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes rotate-gear-4 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Reduce gear visibility on smaller screens */
@media (max-width: 768px) {
  .bg-gears {
    opacity: 0.08;
  }
  
  .bg-gears .gear-1,
  .bg-gears .gear-2,
  .bg-gears .gear-3,
  .bg-gears .gear-4 {
    width: 120px;
    height: 120px;
  }
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section:nth-of-type(odd) {
  background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
}

.section:nth-of-type(even) {
  background: radial-gradient(circle at top, #020617 0, #020617 35%, #020617 100%);
}

.section-title {
  font-size: 1.9rem;
  margin: 0 0 0.75rem;
  letter-spacing: 0.03em;
}

.section-subtitle {
  margin: 0;
  color: var(--text-muted);
  max-width: 38rem;
}

.section-header {
  margin-bottom: 2.5rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(
      to bottom,
      rgba(15, 23, 42, 0.9),
      rgba(15, 23, 42, 0.75),
      transparent
    );
  border-bottom: 1px solid rgba(15, 23, 42, 0.7);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.98rem;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--accent);
  font-size: 0.9rem;
}

.logo-text {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

.nav-list a {
  color: var(--text-soft);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent), var(--accent-strong));
  transition: width 0.2s ease-out;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--text-main);
}

.nav-list a:hover::after,
.nav-list a:focus-visible::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.7);
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  width: 1.2rem;
  height: 2px;
  background: var(--text-main);
  border-radius: 999px;
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle span + span {
  margin-top: 0.23rem;
}

.hero {
  padding-top: 4.5rem;
}

/* .hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.1fr);
  gap: 3rem;
  align-items: start;
} */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.1fr);
  gap: 3rem;
  /* Change from start to center to align them vertically in the middle */
  align-items: center; 
}

.hero-kicker {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

.hero h1 {
  font-size: clamp(2.35rem, 4vw, 2.9rem);
  line-height: 1.12;
  margin: 0 0 1rem;
}

.hero-subtitle {
  margin: 0 0 1.8rem;
  color: var(--text-muted);
  max-width: 34rem;
  font-size: 0.98rem;
}

.highlight {
  color: var(--accent-strong);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.3rem;
  margin-bottom: 1.8rem;
}

.meta-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.25rem;
}

.meta-value {
  font-size: 0.95rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.35rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.18s ease,
    background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b1120;
  box-shadow: 0 18px 35px rgba(56, 189, 248, 0.4);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 50px rgba(56, 189, 248, 0.5);
}

.btn.ghost {
  border-color: var(--border-subtle);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-main);
}

.btn.ghost:hover {
  border-color: var(--accent-soft);
  background: rgba(15, 23, 42, 0.94);
}

.btn.full-width {
  width: 100%;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.hero-links a {
  color: inherit;
  text-decoration: none;
}

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

.hero-panel {
  position: relative;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
}

.hero-photo-wrap {
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-elevated-soft);
}

/* Photo inside hero card: flush to card top */
.hero-card .hero-photo-wrap {
  margin: -1.4rem -1.3rem 1.25rem -1.3rem;
  width: calc(100% + 2.6rem);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* .hero-card {
  position: sticky;
  top: calc(var(--header-height) + 2.5rem);
} */
.hero-card {
  /* Remove or comment out sticky if you want them strictly side-by-side */
  position: relative; 
  top: 0;
}

.card {
  background: radial-gradient(circle at top left, #1f2937 0, #020617 55%);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.3rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(
    circle at top left,
    rgba(56, 189, 248, 0.2),
    transparent 60%
  );
  opacity: 0.35;
  pointer-events: none;
}

.card > * {
  position: relative;
}

.card.mini {
  padding: 1.1rem 1.1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--accent-soft);
  font-size: 0.76rem;
  color: #e5e7eb;
  margin-bottom: 1.2rem;
}

.status-pill .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.16);
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.3rem;
}

.stat-label {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 0.2rem;
}

.stat-value {
  font-size: 0.9rem;
  margin: 0;
}

.hero-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.8rem;
  font-size: 0.78rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.45);
  white-space: nowrap;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.2fr);
  gap: 2.2rem;
  align-items: start;
}

.about-grid {
  display: grid;
  gap: 1.05rem;
}

.mini-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-soft);
  margin: 0 0 0.65rem;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.checklist li::before {
  content: "▹";
  color: var(--accent);
  margin-right: 0.4rem;
}

.timeline {
  display: grid;
  gap: 1.6rem;
}

.timeline-item {
  position: relative;
  padding-left: 1.2rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 0.3rem;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: #020617;
}

.timeline-item::after {
  content: "";
  position: absolute;
  top: 1.1rem;
  bottom: -1.6rem;
  left: 3px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    rgba(148, 163, 184, 0.4),
    transparent
  );
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.timeline-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.timeline-company {
  margin: 0.15rem 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.timeline-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-soft);
  white-space: nowrap;
}

.timeline-summary {
  margin: 0 0 0.55rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.timeline-points {
  margin: 0;
  padding-left: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.timeline-points li + li {
  margin-top: 0.3rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.tag {
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
}

.skills-grid .card h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.pill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-list li {
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.35rem;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  margin-bottom: 1.7rem;
}

.filter-btn {
  border-radius: var(--radius-pill);
  border: none;
  padding: 0.28rem 0.9rem;
  font-size: 0.82rem;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.filter-btn.active {
  background: rgba(15, 23, 42, 0.98);
  color: var(--accent-strong);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.7);
}

.filter-btn:hover {
  transform: translateY(-0.5px);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}

.project-card {
  min-height: 230px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.card-header h3 {
  margin: 0;
  font-size: 1.02rem;
}

.badge {
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border: 1px solid var(--accent-soft);
  color: var(--accent-strong);
  background: rgba(8, 47, 73, 0.7);
}

.card p {
  margin: 0.1rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card-list {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.87rem;
  color: var(--text-muted);
}

.card-list li + li {
  margin-top: 0.3rem;
}

.card-footer {
  margin-top: 0.75rem;
  font-size: 0.86rem;
}

.text-link {
  color: var(--accent-strong);
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.2fr);
  gap: 2.2rem;
  align-items: start;
}

.contact-list {
  list-style: none;
  margin: 1.2rem 0 1.1rem;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  font-size: 0.94rem;
}

.contact-list li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.contact-list span:first-child {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-soft);
}

.contact-list a {
  color: var(--text-main);
  text-decoration: none;
}

.contact-list a:hover {
  color: var(--accent-strong);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-size: 0.86rem;
}

.contact-links a {
  color: var(--text-soft);
  text-decoration: none;
}

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

.contact-form {
  max-width: 420px;
}

.contact-form h3 {
  margin: 0 0 0.5rem;
}

.form-caption {
  margin: 0 0 1.1rem;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
  font-size: 0.86rem;
}

.field span {
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}

input,
textarea {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 0.6rem 0.7rem;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  font: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-soft);
}

input:focus-visible,
textarea:focus-visible {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.9);
  background: rgba(15, 23, 42, 0.98);
}

.form-output {
  min-height: 1.1rem;
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.form-output.error {
  color: var(--danger);
}

.site-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  background: radial-gradient(circle at top, #020617, #020617 55%, #020617);
  padding: 1.5rem 0 2.2rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.footer-secondary {
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card {
    position: static;
  }

  .two-col,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

@media (max-width: 768px) {
  .section {
    padding: 3.5rem 0;
  }

  .header-inner {
    height: 64px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-list {
    position: fixed;
    inset: var(--header-height) 1rem auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.7rem;
    background: rgba(15, 23, 42, 0.99);
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.9);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75);
    transform-origin: top right;
    transform: scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
  }

  .nav-list.open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
  }

  .nav-list a {
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
  }

  .nav-list a::after {
    display: none;
  }

  .hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .skills-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .timeline-meta {
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .hero-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .filters {
    width: 100%;
    justify-content: space-between;
  }
}

