:root {
  --bg: #f4f1e8;
  --ink: #111217;
  --muted: #5d625c;
  --panel: rgba(255, 255, 255, 0.76);
  --line: rgba(17, 18, 23, 0.1);
  --green: #123b21;
  --green-soft: #204f30;
  --gold: #d9b956;
  --sand: #ece4d0;
  --shadow: 0 20px 60px rgba(17, 18, 23, 0.12);
  --shadow-hover: 0 28px 80px rgba(17, 18, 23, 0.16);
  --accent-glow: rgba(18, 59, 33, 0.18);
}

html[data-theme="dark"] {
  --bg: #07100d;
  --ink: #f3f5ef;
  --muted: #a5b0a8;
  --panel: rgba(9, 16, 14, 0.74);
  --line: rgba(255, 255, 255, 0.08);
  --green: #67c58b;
  --green-soft: #8ad0a7;
  --gold: #d9b956;
  --sand: rgba(255, 255, 255, 0.06);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 32px 90px rgba(0, 0, 0, 0.52);
  --accent-glow: rgba(103, 197, 139, 0.22);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(
      circle at top left,
      rgba(103, 197, 139, 0.14),
      transparent 30%
    ),
    radial-gradient(
      circle at right center,
      rgba(217, 185, 86, 0.08),
      transparent 28%
    ),
    linear-gradient(180deg, #07100d 0%, #0b1512 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(
      circle at top left,
      rgba(217, 185, 86, 0.18),
      transparent 28%
    ),
    radial-gradient(
      circle at right center,
      rgba(18, 59, 33, 0.12),
      transparent 30%
    ),
    var(--bg);
  transition:
    background-color 0.35s ease,
    color 0.35s ease;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  z-index: -1;
  pointer-events: none;
  filter: blur(24px);
  opacity: 0.7;
  animation: drift 16s ease-in-out infinite alternate;
}

body::before {
  top: 6%;
  left: -4%;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 185, 86, 0.35), transparent 70%);
}

body::after {
  right: -3%;
  top: 36%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(18, 59, 33, 0.28), transparent 72%);
  animation-delay: -4s;
}

a {
  color: inherit;
}

.page-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.brand-copy {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}

.topnav {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.topnav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 10px 6px 8px;
  border: 1px solid rgba(17, 18, 23, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(18, 59, 33, 0.18), rgba(18, 59, 33, 0.06));
  border: 1px solid rgba(17, 18, 23, 0.08);
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #d9e0d2);
  box-shadow: 0 3px 10px rgba(17, 18, 23, 0.18);
  transition: transform 0.25s ease;
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(12, 20, 17, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

html[data-theme="dark"] .theme-toggle-track {
  background: linear-gradient(135deg, rgba(103, 197, 139, 0.34), rgba(255, 255, 255, 0.08));
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(20px);
  background: linear-gradient(180deg, #f5f8f2, #cdd9ca);
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 42px;
}

.hero-copy,
.hero-panel,
.project-feature,
.project-card,
.mini-card,
.skill-card,
.contact-card,
.skills-banner {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 42px;
  border-radius: 34px;
}

.hero-panel {
  padding: 24px;
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--green-soft);
  font-weight: 700;
  font-size: 0.78rem;
}

h1,
h2,
h3,
strong {
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 4.8vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 58ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions,
.project-actions,
.contact-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

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

.button-primary {
  background: var(--green);
  color: #fff;
}

.button-secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 0;
  margin: 28px 0 0;
  list-style: none;
  color: var(--muted);
}

.hero-points li::before {
  content: "*";
  color: var(--gold);
  margin-right: 8px;
}

.hero-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-stack span,
.skills-chip-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(17, 18, 23, 0.08);
  background: rgba(255, 255, 255, 0.68);
  color: var(--green);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
}

.panel-card {
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 18, 23, 0.08);
}

.panel-accent {
  background: linear-gradient(135deg, var(--green), #235234);
  color: #fff;
}

.panel-ghost {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.58));
}

.panel-label,
.mini-label,
.project-badge {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.panel-accent .panel-label,
.project-badge {
  color: #f8e7a4;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.metric {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 1.6rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: var(--green);
}

.section {
  margin-top: 42px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1.05;
}

.project-showcase {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
}

.project-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.project-feature {
  border-radius: 30px;
  padding: 30px;
}

.project-card {
  border-radius: 26px;
  padding: 24px;
}

.project-feature h3 {
  margin: 0 0 14px;
  font-size: 2rem;
}

.project-card h3 {
  margin: 0 0 14px;
  font-size: 1.45rem;
}

.project-feature > p,
.project-card p,
.mini-card p,
.skill-card p,
.about-copy p,
.timeline-item p,
.contact-card p {
  color: var(--muted);
  line-height: 1.7;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 22px;
}

.project-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 600;
}

.project-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.project-notes-stacked {
  grid-template-columns: 1fr;
  margin-bottom: 4px;
}

.project-feature-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.project-gallery-compact {
  margin-top: 18px;
}

.gallery-card {
  margin: 0;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(17, 18, 23, 0.08);
  box-shadow: 0 16px 32px rgba(17, 18, 23, 0.08);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.gallery-card-wide {
  grid-column: 1 / -1;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(18, 59, 33, 0.14);
}

.gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 340px;
  object-fit: cover;
  background: #d8dccf;
  transition: transform 0.4s ease;
}

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

.gallery-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-card figcaption {
  padding: 14px 16px 16px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.gallery-card-hidden {
  display: none;
}

.project-gallery.gallery-expanded .gallery-card-hidden {
  display: block;
}

.gallery-toggle {
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.gallery-toggle:hover {
  color: var(--green-soft);
  text-decoration: underline;
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 18, 23, 0.86);
  backdrop-filter: blur(6px);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

.lightbox-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 48px);
  object-fit: contain;
  background: #0c1210;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.project-side {
  display: grid;
  gap: 18px;
}

.mini-card,
.skill-card {
  border-radius: 24px;
  padding: 22px;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.mini-card:hover,
.skill-card:hover,
.project-card:hover,
.project-feature:hover,
.contact-card:hover,
.skills-banner:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(18, 59, 33, 0.12);
}

.mini-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.9;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}

.skills-intro {
  margin-bottom: 18px;
}

.skills-banner {
  border-radius: 30px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  background:
    linear-gradient(135deg, rgba(18, 59, 33, 0.06), transparent 52%),
    var(--panel);
}

html[data-theme="dark"] .skills-banner,
html[data-theme="dark"] .panel-card,
html[data-theme="dark"] .hero-copy,
html[data-theme="dark"] .hero-panel,
html[data-theme="dark"] .project-feature,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .mini-card,
html[data-theme="dark"] .skill-card,
html[data-theme="dark"] .contact-card,
html[data-theme="dark"] .timeline-item {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)),
    var(--panel);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .skill-card::before {
  background: linear-gradient(90deg, #67c58b, #d9b956);
}

html[data-theme="dark"] .gallery-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .gallery-card figcaption {
  color: #d2dbd4;
}

html[data-theme="dark"] .project-feature > p,
html[data-theme="dark"] .project-card p,
html[data-theme="dark"] .mini-card p,
html[data-theme="dark"] .skill-card p,
html[data-theme="dark"] .about-copy p,
html[data-theme="dark"] .timeline-item p,
html[data-theme="dark"] .contact-card p {
  color: #c0cac3;
}

html[data-theme="dark"] .project-feature-list,
html[data-theme="dark"] .mini-card ul,
html[data-theme="dark"] .hero-points,
html[data-theme="dark"] .footer {
  color: #a9b4ad;
}

html[data-theme="dark"] .gallery-toggle {
  color: #8fe0ac;
}

.skills-banner h3 {
  margin: 0 0 12px;
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.skills-banner p {
  color: var(--muted);
  line-height: 1.7;
}

.skills-chip-cloud {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 10px;
}

.skill-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.skill-card {
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.skill-meter {
  width: 100%;
  height: 10px;
  margin-top: 16px;
  border-radius: 999px;
  background: rgba(17, 18, 23, 0.08);
  overflow: hidden;
}

.skill-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #3b7a4d);
  box-shadow: 0 0 18px var(--accent-glow);
  transform-origin: left center;
  animation: meterFill 1.3s ease forwards;
}

.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.about-copy {
  padding: 12px 0 0;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(17, 18, 23, 0.08);
}

.timeline-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.contact-card {
  border-radius: 34px;
  padding: 32px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: start;
  gap: 28px;
}

.contact-copy h2 {
  margin-top: 0;
}

.contact-note {
  margin-top: 18px;
  font-size: 0.95rem;
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-field {
  display: grid;
  gap: 8px;
}

.contact-field span {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--green);
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  border: 1px solid rgba(17, 18, 23, 0.12);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

html[data-theme="dark"] .contact-field input,
html[data-theme="dark"] .contact-field textarea {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.contact-field input:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(18, 59, 33, 0.12);
}

.contact-status {
  min-height: 24px;
  margin: 0;
  color: var(--green-soft);
  font-size: 0.94rem;
}

.js-enabled .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js-enabled .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(18px, 18px, 0) scale(1.08);
  }
}

@keyframes meterFill {
  from {
    transform: scaleX(0.2);
    opacity: 0.65;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body::before,
  body::after {
    animation: none;
  }

  .js-enabled .reveal {
    opacity: 1;
    transform: none;
  }
}

.footer {
  padding: 32px 0 12px;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

@media (max-width: 1080px) {
  .hero,
  .project-showcase,
  .project-grid,
  .about-layout,
  .skills-grid,
  .skills-banner {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 720px) {
  .page-shell {
    padding: 18px;
  }

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

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

  .topnav {
    gap: 12px;
  }

  .hero-copy,
  .hero-panel,
  .project-feature,
  .project-card,
  .mini-card,
  .skill-card,
  .contact-card {
    border-radius: 22px;
  }

  .hero-copy,
  .project-feature,
  .project-card,
  .contact-card {
    padding: 24px;
  }

  .project-notes,
  .project-gallery,
  .panel-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .project-actions,
  .contact-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .theme-toggle {
    width: 100%;
    justify-content: center;
  }
}
