:root {
  --bg: #3e833ca4;
  --bg-spot1: rgba(108, 229, 232, 0.08);
  --bg-spot2: rgba(122, 245, 201, 0.08);
  --glass: rgba(255, 255, 255, 0.06);
  --text: #f5f7fb;
  --muted: rgba(245, 247, 251, 0.68);
  --accent: #6ce5e8;
  --accent-2: #7af5c9;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --code-bg: rgba(0, 0, 0, 0.25);
  --code-text: #c8e1ff;
}

body[data-theme="light"] {
  --bg: #f7f9fc;
  --bg-spot1: rgba(108, 229, 232, 0.12);
  --bg-spot2: rgba(122, 179, 245, 0.12);
  --glass: rgba(255, 255, 255, 0.85);
  --border: rgba(0, 0, 0, 0.08);
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.65);
  --accent: #0ea5e9;
  --accent-2: #22d3ee;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  --code-bg: rgba(15, 23, 42, 0.08);
  --code-text: #0f172a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 20%, var(--bg-spot1), transparent 30%),
    radial-gradient(circle at 80% 0%, var(--bg-spot2), transparent 30%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.bg-shapes {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.shape {
  position: absolute;
  filter: blur(80px);
  opacity: 0.6;
}

.shape-1 {
  width: 520px;
  height: 520px;
  background: linear-gradient(135deg, rgba(108, 229, 232, 0.38), rgba(10, 132, 255, 0.12));
  top: -120px;
  left: -80px;
}

.shape-2 {
  width: 420px;
  height: 420px;
  background: linear-gradient(135deg, rgba(122, 245, 201, 0.28), rgba(84, 130, 255, 0.22));
  bottom: -160px;
  right: -40px;
}

.shape-3 {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), rgba(108, 229, 232, 0.18));
  top: 30%;
  right: 25%;
}

.topbar {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 999px;
  background: rgba(10, 12, 20, 0.144);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: var(--shadow);
  z-index: 20;
  gap: 12px;
}

body[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.205);
}

.logo {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 14px;
  text-transform: uppercase;
}

.logo .dot {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: var(--muted);
}

.theme-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  min-width: 44px;
  font-size: 18px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

body[data-theme="light"] .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  padding: 8px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav a {
  padding: 8px 12px;
  border-radius: 30px;
  transition: all 0.2s ease;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

body[data-theme="light"] .nav a:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.chip {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--muted);
}

main {
  position: relative;
  z-index: 1;
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding-top: 120px;
  padding-bottom: 120px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  align-items: center;
  padding: 32px 0 12px;
}

.hero-text h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  margin: 12px 0;
}

.lede {
  color: var(--muted);
  max-width: 640px;
}

.cta-row {
  display: flex;
  gap: 12px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  align-items: center;
  padding: 32px 0 12px;
}

.hero-text h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  margin: 12px 0;
}

.meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 30px;
  font-size: 13px;
  color: var(--muted);
}

.hero-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.code-card {
  padding: 14px;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.code-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.code-header .red { background: #ff6b6b; }
.code-header .yellow { background: #ffd166; }
.code-header .green { background: #06d6a0; }

pre {
  margin: 0;
  padding: 12px;
  background: var(--code-bg);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  overflow: auto;
  color: var(--code-text);
  font-family: "JetBrains Mono", "Space Grotesk", monospace;
  font-size: 13px;
}

.photo-card {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.photo-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.photo-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.45));
}

.section {
  margin-top: 68px;
}

.section-head {
  margin-bottom: 18px;
}

.section h2 {
  margin: 6px 0 0;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.grid .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  padding: 18px;
  position: relative;
  overflow: hidden;
  text-align: left;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  display: block;
  transition: all 0.2s ease;
}

.project-card:hover {
  border-color: rgba(108, 229, 232, 0.6);
  box-shadow: 0 16px 40px rgba(108, 229, 232, 0.18);
}


.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--muted);
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tags span {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
}

.gallery .masonry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.tile {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  min-height: 180px;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile.large { grid-row: span 2; min-height: 380px; }
.tile.wide { grid-column: span 2; min-height: 220px; }

.tile-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-list {
  display: grid;
  gap: 14px;
  position: relative;
  padding-left: 10px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(108, 229, 232, 0.32), rgba(122, 245, 201, 0.12));
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  position: relative;
}

.timeline-item .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(108, 229, 232, 0.15);
  margin-top: 8px;
}

.timeline-item .content {
  padding: 16px;
  width: 100%;
}

.timeline-card {
  text-align: left;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
}

.timeline-card .year {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.timeline-card h4 {
  margin: 6px 0 4px;
}

.timeline-card p {
  margin: 0;
  color: var(--muted);
}

.timeline-card:hover {
  border-color: rgba(108, 229, 232, 0.6);
  box-shadow: 0 16px 40px rgba(108, 229, 232, 0.18);
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  flex-wrap: wrap;
}

.contact-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 30px;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041024;
  border: none;
  box-shadow: 0 10px 30px rgba(108, 229, 232, 0.35);
}

.btn.primary:hover { filter: brightness(1.05); }

.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 32px 0 12px;
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal.open .modal-dialog {
  animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(30px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal.open .modal-backdrop {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-dialog {
  position: relative;
  width: min(520px, 92vw);
  padding: 18px;
  z-index: 1;
  animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(30px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body[data-theme="light"] .btn.ghost {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

body[data-theme="light"] .btn.ghost:hover {
  background: rgba(0, 0, 0, 0.1);
}

.modal-dialog {
  position: relative;
  width: min(520px, 92vw);
  padding: 18px;
  z-index: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.modal-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 4px;
}

.modal-title {
  margin: 0;
}

.modal-year {
  margin: 6px 0 0;
  color: var(--muted);
}

.modal-body {
  margin-top: 12px;
  color: var(--text);
}

.modal-close {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.modal-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 12px;
  margin: 12px 0;
  border: 1px solid var(--border);
}


@media (max-width: 720px) {
  .topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 28px;
  }

  .nav {
    width: 100%;
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    justify-items: center;
    padding-top: 4px;
  }

  .nav.open {
    display: grid;
  }

  .nav a {
    width: 100%;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
  }

  .logo {
    font-size: 12px;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }

  .chip {
    display: none;
  }

  .theme-toggle {
    font-size: 18px;
    padding: 8px 10px;
    flex-shrink: 0;
  }

  .menu-toggle {
    display: inline-flex;
    flex-shrink: 0;
  }

  main {
    padding-top: 110px;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-card {
    grid-template-columns: 1fr;
  }

  .grid .cards {
    grid-template-columns: 1fr;
  }

  .gallery .masonry {
    grid-template-columns: 1fr;
  }

  .tile.wide,
  .tile.large {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 220px;
  }

  .timeline-list {
    padding-left: 0;
  }

  .timeline-list::before {
    left: 0;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-item .dot {
    margin: 0 0 6px 0;
  }

  .contact-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-actions {
    width: 100%;
    justify-content: flex-start;
  }
}