:root {
  --bg: #f2f0ea;
  --card: rgba(255, 255, 255, 0.8);
  --text: #1c1b19;
  --muted: #5f5a53;
  --line: #d7d1c6;
  --accent: #14532d;
  --accent-soft: #d5f3df;
  --accent-2: #c2410c;
  --shadow: 0 14px 40px rgba(16, 24, 40, 0.1);
}

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-500.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-500.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 8% 0%, #fff8dc 0%, transparent 50%),
    radial-gradient(circle at 90% 30%, #dff0ff 0%, transparent 38%),
    linear-gradient(150deg, #f4f1e8 0%, #ece7dd 100%);
  min-height: 100vh;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.1;
  background-image: radial-gradient(#000 0.45px, transparent 0.45px);
  background-size: 3px 3px;
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 1rem max(0.85rem, env(safe-area-inset-right))
    1rem max(0.85rem, env(safe-area-inset-left));
  backdrop-filter: blur(8px);
}

.layout {
  position: relative;
  z-index: 1;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: rgba(255, 255, 255, 0.5);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.layout {
  width: min(1080px, 100%);
  margin: 0 auto 3rem;
  padding-inline: 0.5rem;
  display: grid;
  gap: 1rem;
}

.card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 20px;
  padding: 1.15rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.hero {
  padding-top: 1.7rem;
}

.hero-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.hero-avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.18);
}

.kicker {
  margin: 0 0 0.8rem;
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
}

h1 {
  margin: 0;
  line-height: 0.95;
  font-size: clamp(2.15rem, 7vw, 4.7rem);
}

h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.2rem, 3vw, 2rem);
}

h3 {
  margin: 0.2rem 0;
  font-size: 1.08rem;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.lead {
  margin-top: 0.9rem;
  max-width: 70ch;
}

.role-fit {
  margin-top: 0.7rem;
  max-width: 72ch;
  font-size: 0.95rem;
  color: #3f4a40;
}

.hero-meta {
  margin-top: 1rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.hero-meta span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.8);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn,
.chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.52rem 0.9rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.65);
}

.primary-btn:hover,
.ghost-btn:hover,
.chip:hover {
  transform: translateY(-1px);
}

.split {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-grid span {
  border-radius: 12px;
  padding: 0.45rem 0.65rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.timeline {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.6rem;
}

.timeline article {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.8);
}

.time {
  color: var(--accent-2);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  background: #fff;
}

.chip.active {
  background: var(--accent-soft);
  border-color: #8cd6a5;
}

.project-grid {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr;
}

.projects-intro {
  margin-top: 0.5rem;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  background: #fff;
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.project-card > * {
  min-width: 0;
}

.project-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  display: block;
}

.media-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.media-track::-webkit-scrollbar {
  display: none;
}

.media-track.single {
  grid-auto-flow: row;
  grid-auto-columns: auto;
  overflow: hidden;
  min-width: 0;
}

.media-item {
  scroll-snap-align: start;
  aspect-ratio: 16 / 9;
  width: 100%;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #0f172a;
  position: relative;
  z-index: 2;
}

.media-zoom {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}

.media-item video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
  display: block;
  pointer-events: auto;
}

.media-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.4rem;
}

.carousel-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #1c1b19;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
}

.carousel-bars {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(var(--bar-count, 1), minmax(0, 1fr));
  gap: 0.25rem;
  margin-top: 0.15rem;
  max-width: 100%;
  overflow: hidden;
}

.carousel-bar {
  width: 100%;
  min-width: 0;
  height: 4px;
  border-radius: 999px;
  border: none;
  background: #d9dee6;
  cursor: pointer;
}

.carousel-bar.active {
  background: #2563eb;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  width: 6.9rem;
  height: 2rem;
  border-radius: 999px;
  padding: 0 0.68rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  font-family: "IBM Plex Mono", monospace;
  background: #fff4ec;
  color: #9a3412;
  border: 1px solid #fdba74;
}

.project-tag.it {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.project-list {
  margin: 0;
  color: var(--muted);
  padding-left: 1.2rem;
}

.project-list li {
  margin-bottom: 0.25rem;
}

.outcome {
  font-size: 0.92rem;
}

.mini-title {
  margin: 0;
  font-size: 0.75rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  color: var(--accent);
}

.evidence-links {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.evidence-links a {
  color: #0f4c81;
  text-decoration: none;
  border: 1px solid #bfd3e8;
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  background: #f4f9ff;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.value {
  background: linear-gradient(120deg, #f0fde8 0%, #fdf6e8 100%);
}

.archive {
  background: linear-gradient(120deg, #f8fdf0 0%, #eef7ff 100%);
}

.archive-list {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.archive-list li {
  margin-bottom: 0.35rem;
}

.archive-list a {
  color: #0f4c81;
  text-decoration: none;
}

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

.contact-links {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.contact-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: #fff;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.contact-note {
  margin-top: 0.7rem;
  font-size: 0.9rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(12, 14, 20, 0.88);
  backdrop-filter: blur(8px);
}

.lightbox.open {
  display: grid;
}

.lightbox-stage {
  width: min(1100px, 100%);
  max-height: calc(100vh - 2rem);
  display: grid;
  place-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 2rem);
  width: auto;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

@media (min-width: 800px) {
  .split {
    grid-template-columns: 1.1fr 1fr;
  }

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

  .card {
    padding: 1.4rem;
  }
}

@media (max-width: 799px) {
  .media-carousel {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.5rem;
  }

  .media-track {
    grid-auto-columns: 100%;
  }

  .carousel-btn {
    width: 44px;
    height: 44px;
  }

  .media-carousel .prev,
  .media-carousel .next {
    justify-self: center;
    align-self: center;
  }

  .hero-avatar {
    width: 74px;
    height: 74px;
  }

  .carousel-bars {
    grid-column: 1 / -1;
    gap: 0.18rem;
  }
}
