:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #181b20;
  --panel-strong: #20242b;
  --text: #f6f1e8;
  --muted: #b9b3a8;
  --line: rgba(246, 241, 232, 0.14);
  --accent: #5dd39e;
  --accent-strong: #30b47a;
  --amber: #f1b84b;
  --red: #e85d75;
  --blue: #70a7ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(93, 211, 158, 0.08), transparent 36%),
    linear-gradient(260deg, rgba(241, 184, 75, 0.08), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(246, 241, 232, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 241, 232, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

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

.site-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  background: rgba(16, 17, 20, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand,
.nav-links,
.hero-actions,
.metrics,
.profile-top,
.status-row,
.tag-list,
.contact-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(93, 211, 158, 0.5);
  background: rgba(93, 211, 158, 0.12);
  color: var(--accent);
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
}

.nav-links {
  gap: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav-links a,
.nav-cta {
  padding: 10px 12px;
  border-radius: 8px;
}

.nav-links a:hover,
.nav-cta:hover {
  background: rgba(246, 241, 232, 0.08);
  color: var(--text);
}

.nav-cta {
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 58px;
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: 72px 0 40px;
}

.hero-copy,
.hero-visual,
.project-card,
.skill-card,
.timeline-item {
  min-width: 0;
}

.eyebrow,
.section-kicker,
.project-type,
.timeline-item span {
  margin: 0;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 790px;
  margin-bottom: 22px;
  font-size: clamp(2.7rem, 6.3vw, 6.8rem);
  line-height: 0.96;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.hero-lead {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.75;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
  white-space: nowrap;
}

.btn.primary {
  background: var(--accent);
  color: #07130d;
  box-shadow: 0 14px 38px rgba(93, 211, 158, 0.24);
}

.btn.primary:hover {
  background: #7be2b3;
}

.btn.secondary {
  border-color: var(--line);
  background: rgba(246, 241, 232, 0.05);
  color: var(--text);
}

.btn.secondary:hover {
  border-color: rgba(246, 241, 232, 0.28);
}

.metrics {
  flex-wrap: wrap;
  gap: 12px;
}

.metrics div {
  min-width: 140px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(246, 241, 232, 0.04);
  border-radius: 8px;
}

.metrics strong {
  display: block;
  font-size: 1.4rem;
}

.metrics span {
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-visual {
  position: relative;
  min-height: 560px;
}

.profile-card,
.code-window,
.skill-card,
.project-card,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 27, 32, 0.9);
  box-shadow: var(--shadow);
}

.profile-card {
  position: absolute;
  top: 26px;
  right: 8px;
  left: 44px;
  padding: 22px;
}

.profile-top {
  gap: 14px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(93, 211, 158, 0.95), rgba(112, 167, 255, 0.75)),
    #243029;
  color: #07130d;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.25rem;
  font-weight: 800;
}

.profile-card h2 {
  margin-bottom: 5px;
  font-size: 1.35rem;
}

.profile-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.status-row {
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(93, 211, 158, 0.12);
}

.code-window {
  position: absolute;
  right: 30px;
  bottom: 36px;
  left: 0;
  overflow: hidden;
  background: #111419;
}

.window-bar {
  display: flex;
  gap: 7px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.window-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.window-bar span:nth-child(1) {
  background: var(--red);
}

.window-bar span:nth-child(2) {
  background: var(--amber);
}

.window-bar span:nth-child(3) {
  background: var(--accent);
}

pre {
  margin: 0;
  padding: 24px;
  overflow-x: auto;
  color: #d7f7e7;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.78rem, 1.7vw, 1rem);
  line-height: 1.8;
}

.section {
  padding: 84px 0;
}

.intro-strip {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.7fr);
  gap: 40px;
  align-items: end;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 680px;
  margin-bottom: 28px;
}

.section h2,
.contact-section h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.intro-strip p,
.project-body p,
.timeline-item p,
.contact-section p {
  color: var(--muted);
  line-height: 1.7;
}

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

.skill-card {
  padding: 22px;
}

.skill-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 38px;
  border: 1px solid rgba(93, 211, 158, 0.38);
  border-radius: 8px;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}

.skill-card h3,
.project-body h3,
.timeline-item h3 {
  margin-bottom: 10px;
}

.timeline-item h3 a {
  color: var(--accent);
}

.skill-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.project-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

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

.project-card {
  overflow: hidden;
}

.project-card.featured {
  grid-row: span 2;
}

.project-media {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  min-height: 230px;
  padding: 18px;
  border: 0;
  overflow: hidden;
  cursor: zoom-in;
  color: inherit;
  font: inherit;
  text-align: left;
  background-color: #23272f;
  background-image:
    linear-gradient(135deg, rgba(246, 241, 232, 0.12), transparent),
    repeating-linear-gradient(90deg, rgba(246, 241, 232, 0.08) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, rgba(246, 241, 232, 0.08) 0 1px, transparent 1px 34px);
}

.project-card.featured .project-media {
  min-height: 392px;
}

.project-grid-secondary .project-media {
  min-height: 300px;
}

.project-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(to top, rgba(16, 17, 20, 0.68), transparent 58%);
}

.project-media.analytics {
  background-color: #1c2f2a;
}

.project-media.api {
  background-color: #302a1e;
}

.project-media.mobile {
  background-color: #1e2934;
}

.project-media.cms {
  background-color: #173046;
}

.project-media.crc {
  background-color: #2f2a1c;
}

.project-media span {
  position: relative;
  z-index: 1;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(16, 17, 20, 0.8);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  font-weight: 700;
}

.project-media:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.project-body {
  padding: 22px;
}

.tag-list {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag-list span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.timeline-item {
  padding: 22px;
  box-shadow: none;
}

.timeline-item p {
  margin-bottom: 0;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin: 56px 0 40px;
  padding: 34px;
  border: 1px solid rgba(93, 211, 158, 0.34);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(93, 211, 158, 0.13), rgba(112, 167, 255, 0.09));
}

.contact-section p {
  max-width: 640px;
  margin: 14px 0 0;
}

.contact-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px;
  background: rgba(7, 9, 12, 0.86);
  backdrop-filter: blur(10px);
}

.gallery-modal.is-open {
  display: flex;
}

.gallery-frame {
  width: min(1120px, 100%);
  margin: 0;
}

.gallery-frame img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border: 1px solid rgba(246, 241, 232, 0.18);
  border-radius: 8px;
  background: #0a0c0f;
  box-shadow: var(--shadow);
}

.gallery-frame figcaption {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  color: var(--text);
  font-weight: 700;
}

.gallery-frame figcaption span:last-child {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.86rem;
}

.gallery-close,
.gallery-nav {
  border: 1px solid rgba(246, 241, 232, 0.22);
  border-radius: 8px;
  background: rgba(24, 27, 32, 0.92);
  color: var(--text);
  cursor: pointer;
}

.gallery-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  font-size: 1.7rem;
  line-height: 1;
}

.gallery-nav {
  flex: 0 0 auto;
  width: 48px;
  height: 72px;
  font-size: 2.5rem;
  line-height: 1;
}

.gallery-close:hover,
.gallery-nav:hover {
  border-color: rgba(93, 211, 158, 0.62);
  color: var(--accent);
}

.gallery-nav:disabled {
  opacity: 0.4;
  cursor: default;
}

[data-reveal] {
  transform: translateY(0);
  opacity: 1;
  transition: transform 650ms ease, opacity 650ms ease;
}

[data-reveal].is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 960px) {
  .topbar {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero,
  .intro-strip,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 28px;
    padding-top: 42px;
  }

  .hero-visual {
    min-height: 500px;
  }

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

  .project-card.featured {
    grid-row: auto;
  }

  .contact-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding: 0 11px;
  }

  .nav-cta {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: clamp(1.95rem, 9vw, 2.25rem);
    line-height: 1.02;
    overflow-wrap: normal;
  }

  .hero-actions,
  .contact-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

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

  .metrics div {
    min-width: 0;
  }

  .hero-visual {
    min-height: 460px;
  }

  .profile-card {
    right: 0;
    left: 0;
  }

  .code-window {
    right: 0;
    bottom: 12px;
  }

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

  .section {
    padding: 60px 0;
  }

  .project-card.featured .project-media,
  .project-media {
    min-height: 220px;
  }

  .gallery-modal {
    gap: 8px;
    padding: 16px 10px;
  }

  .gallery-nav {
    position: absolute;
    top: 50%;
    width: 40px;
    height: 58px;
    transform: translateY(-50%);
  }

  .gallery-prev {
    left: 10px;
  }

  .gallery-next {
    right: 10px;
  }

  .gallery-frame figcaption {
    flex-direction: column;
    gap: 4px;
  }

  .contact-section {
    padding: 24px;
  }
}
