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

:root {
  --bg:          #000;
  --panel:       #050505;
  --panel-2:     #0b0b0b;
  --line:        rgba(255, 255, 255, 0.13);
  --line-bright: rgba(255, 255, 255, 0.42);
  --text:        #fff;
  --muted:       #8f8f8f;
  --soft:        #c8c8c8;
  --accent:      #c46a20;
  --accent-dim:  rgba(196, 106, 32, 0.22);
  --condensed:   "Barlow Condensed", Arial, sans-serif;
  --mono:        "IBM Plex Mono", Consolas, monospace;
  --sans:        "Inter", Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

/* ── Header / Nav ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(18px);
}

nav {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 4vw;
  gap: 36px;
}

.logo {
  font: 600 12px/1 var(--mono);
  letter-spacing: 3px;
  color: var(--text);
  text-transform: uppercase;
  flex-shrink: 0;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font: 500 10px/1 var(--mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  transition: color 0.2s;
}

nav a:hover,
nav a.active { color: var(--text); }

.nav-utility {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-left: auto;
}

.nav-util-link {
  font: 500 10px/1 var(--mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-util-link:hover { color: var(--text); }

/* ── Layout ── */
main { padding: 0; }

section {
  padding: 80px 4vw;
  border-bottom: 1px solid var(--line);
}

h2 {
  font: 500 14px/1 var(--mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 40px;
}

/* ── Intro (combined) ── */
#intro {
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.intro-quote-block {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 10vw;
  min-height: calc(100vh - 56px);
  border-bottom: 1px solid var(--line);
}

.hero-welcome {
  position: absolute;
  bottom: 28px;
  left: 4vw;
  font: 500 12px/1 var(--mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}

@keyframes hero-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}

.hero-scroll-btn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  text-decoration: none;
  animation: hero-bounce 2.2s ease-in-out infinite;
  transition: color 0.2s;
}

.hero-scroll-btn:hover {
  color: var(--text);
  animation-play-state: paused;
}

.intro-quote {
  font: 600 clamp(52px, 7.5vw, 108px) / .88 var(--condensed);
  text-transform: uppercase;
  letter-spacing: -1px;
  font-style: normal;
  color: var(--text);
  max-width: min(1120px, 80vw);
  margin: 0 auto 40px;
  text-wrap: balance;
}

.quote-accent {
  color: #c46a20;
}

.intro-attribution {
  font: 500 10px/1 var(--mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.intro-inner {
  display: grid;
  grid-template-columns: 11fr 9fr;
  align-items: start;
}

.intro-text {
  padding: 120px 5vw 80px 4vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.eyebrow {
  font: 500 10px/1 var(--mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

#intro h1 {
  font: 600 clamp(52px, 6vw, 96px) / .88 var(--condensed);
  letter-spacing: -1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.disciplines {
  font-size: 15px;
  font-weight: 500;
  color: var(--soft);
  margin-bottom: 36px;
}

.intro-bio { max-width: 660px; }

.intro-bio p {
  font-size: 15px;
  color: var(--soft);
  line-height: 1.8;
}

.intro-bio p + p { margin-top: 16px; }

.intro-photo {
  position: relative;
  background: var(--panel);
  padding: 56px 5vw 56px 28px;
  display: flex;
  align-items: flex-start;
}

.intro-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 82% center;
  border-radius: 4px;
  display: block;
}

.intro-photo.placeholder {
  align-items: center;
  justify-content: center;
}

.intro-photo.placeholder::after {
  content: 'Photo';
  font: 500 9px/1 var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.18);
}

.intro-photo.placeholder img { display: none; }

/* ── Experience section ── */
#experience {
  padding: 0;
}

#experience > h2 {
  padding: 72px 4vw 0;
  margin-bottom: 36px;
}

.exp-list {
  display: flex;
  flex-direction: column;
}

.exp-row {
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.18s;
  outline: none;
}

.exp-row:focus-visible {
  outline: 1px solid rgba(255,255,255,0.35);
  outline-offset: -2px;
}

.exp-row:hover {
  background: var(--panel);
}

.exp-row-main {
  display: grid;
  grid-template-columns: 11% 1fr 200px 40px;
  align-items: center;
  gap: 0 28px;
  padding: 52px 4vw;
  min-height: 170px;
}

.exp-number {
  font: 600 clamp(44px, 4.5vw, 72px) / 1 var(--condensed);
  letter-spacing: -1px;
  color: var(--accent-dim);
  align-self: center;
  transition: color 0.2s;
}

.exp-row:hover .exp-number {
  color: rgba(255, 255, 255, 0.36);
}

.exp-role {
  font: 500 11px/1 var(--mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 11px;
}

.exp-org {
  font: 600 clamp(28px, 3.2vw, 54px) / .92 var(--condensed);
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 14px;
  transition: transform 0.22s ease, color 0.18s;
  letter-spacing: -0.3px;
}

.exp-row:hover .exp-org {
  transform: translateX(5px);
}

.exp-summary {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 560px;
}

.exp-meta {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.exp-meta-label {
  display: block;
  font: 500 7.5px/1 var(--mono);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  margin-bottom: 5px;
}

.exp-meta-value {
  display: block;
  font: 500 11px/1.4 var(--mono);
  color: var(--soft);
}

.exp-toggle {
  align-self: center;
  text-align: center;
  color: var(--accent);
  font: 400 18px/1 var(--mono);
  user-select: none;
  transition: color 0.18s;
}

.exp-toggle::before { content: '+'; }
.exp-row[aria-expanded="true"] .exp-toggle::before { content: '−'; }

.exp-row:hover .exp-toggle {
  color: var(--soft);
}

/* Collapsible panel */
.exp-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.38s ease;
}

.exp-panel-inner {
  border-top: 1px solid var(--line);
  padding: 32px 4vw 52px;
  padding-left: calc(4vw + 11% + 28px);
}

.exp-panel-label {
  font: 500 11px/1 var(--mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  margin-bottom: 20px;
}

.exp-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
  max-width: 640px;
}

.exp-bullets li {
  font-size: 14px;
  color: var(--soft);
  line-height: 1.72;
  padding-left: 20px;
  position: relative;
}

.exp-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  top: 2px;
  color: rgba(255,255,255,0.2);
  font-size: 11px;
}

.exp-doi {
  margin-top: 24px;
}

.exp-doi a {
  font: 500 9px/1 var(--mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding-bottom: 2px;
  transition: color 0.18s, border-color 0.18s;
}

.exp-doi a:hover {
  color: var(--text);
  border-bottom-color: rgba(255,255,255,0.5);
}

/* ── Featured grid ── */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.featured-grid .card {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.featured-grid .card:nth-child(even) {
  border-right: none;
}

.featured-grid .card-img {
  aspect-ratio: 4 / 3;
}

/* ── Projects — sub-labels ── */
.projects-section-label {
  font: 500 10px/1 var(--mono);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 32px;
}

/* ── Projects — more subsection ── */
.projects-more {
  margin-top: 64px;
}

/* ── Secondary (horizontal compact) grid ── */
.secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.secondary-grid .card {
  display: grid;
  grid-template-columns: 180px 1fr;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 0;
}

.secondary-grid .card:nth-child(even) {
  border-right: none;
}

.secondary-grid .card-img {
  aspect-ratio: unset;
  border-right: 1px solid var(--line);
  min-height: 130px;
}

.secondary-grid .card-content {
  padding: 20px 22px;
}

.secondary-grid .card h3 {
  font: 600 clamp(15px, 1.6vw, 24px) / .95 var(--condensed);
}

.secondary-grid .card-summary {
  font-size: 12px;
}

.secondary-grid .tags span {
  font-size: 7.5px;
  padding: 4px 7px;
}

/* ── Cards (shared) ── */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  transition: background 0.2s;
}

.card:hover { background: var(--panel); }

.card-content {
  padding: 22px;
}

.card h3 {
  font: 600 clamp(20px, 2.2vw, 32px) / .95 var(--condensed);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1;
}

.featured-label {
  font: 500 9px/1 var(--mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.project-meta {
  font: 500 10px/1.4 var(--mono);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.card-summary {
  font-size: 13px;
  color: var(--soft);
  line-height: 1.7;
}

/* ── Card image area ── */
.card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--panel);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.card-img > img.tech-image {
  object-fit: contain;
  background: var(--panel-2);
}

/* ── Image placeholder ── */
.img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.1);
  user-select: none;
}

.img-placeholder span {
  font: 500 9px/1 var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── Paper / devpost link ── */
.paper-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  transition: border-color 0.2s;
}

.paper-link:hover { border-color: var(--text); }

/* ── Card title row (title + read-paper button) ── */
.card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}

.card-title-row h3 {
  margin-bottom: 0;
}

.read-paper-btn {
  flex-shrink: 0;
  margin-top: 5px;
  font: 500 8px/1 var(--mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(196, 106, 32, 0.35);
  padding: 5px 8px;
  white-space: nowrap;
  transition: color 0.18s, border-color 0.18s;
}

.read-paper-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.42);
}

/* ── Tags ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 16px;
}

.tags span {
  font: 500 8px/1 var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* ── Details toggle ── */
.details-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  background: none;
  border: 1px solid rgba(196, 106, 32, 0.35);
  border-radius: 0;
  color: var(--accent);
  font: 500 9px/1 var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 7px 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.details-btn:hover {
  color: var(--text);
  border-color: var(--line-bright);
}

.chevron {
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.details-btn[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

/* ── Expandable detail panel ── */
.card-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.detail-list {
  list-style: none;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-list li {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  padding-left: 16px;
  position: relative;
}

.detail-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 1px;
  background: var(--muted);
  opacity: 0.5;
}

/* ── Iteration strip ── */
.iteration-strip { display: none; }
.iteration-strip:not(:empty) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 4px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.iteration-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
}

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.skill-group {
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.skill-group h4 {
  font: 700 9px/1 var(--mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.skill-group ul { list-style: none; }

.skill-group li {
  font-size: 13px;
  color: var(--soft);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.skill-group li:last-child { border-bottom: none; }

/* ── Contact ── */
.contact-text {
  font-size: 15px;
  color: var(--soft);
  margin-bottom: 28px;
  max-width: 520px;
  line-height: 1.75;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-btn {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  font: 500 10px/1 var(--mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 12px 22px;
  border: 1px solid var(--line-bright);
  border-radius: 0;
  transition: background 0.2s, border-color 0.2s;
}

.contact-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--text);
}

/* ── Footer ── */
footer {
  padding: 28px 4vw;
  color: var(--muted);
  font: 500 10px/1 var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
}


/* ── Mobile ── */
@media (max-width: 680px) {
  section { padding: 60px 5vw; }

  .hero-welcome { display: none; }

  .intro-quote-block {
    padding: 0 7vw;
    min-height: 80vh;
  }

  .intro-inner {
    grid-template-columns: 1fr;
  }

  .intro-text {
    padding: 80px 5vw 48px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .intro-photo {
    padding: 32px 5vw 48px;
  }

  /* Experience — mobile */
  #experience > h2 {
    padding: 56px 5vw 0;
  }

  .exp-row-main {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "num    toggle"
      "body   body"
      "meta   meta";
    gap: 0;
    padding: 36px 5vw;
    min-height: auto;
  }

  .exp-number {
    grid-area: num;
    font-size: 32px;
    align-self: center;
  }

  .exp-body {
    grid-area: body;
    padding-top: 10px;
  }

  .exp-meta {
    grid-area: meta;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px 32px;
    margin-top: 16px;
  }

  .exp-toggle {
    grid-area: toggle;
    align-self: center;
  }

  .exp-panel-inner {
    padding: 24px 5vw 40px;
  }

  nav ul { display: none; }
  .nav-utility { margin-left: auto; }

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

  .featured-grid .card:nth-child(even) {
    border-right: 1px solid var(--line);
  }


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

  .secondary-grid .card {
    grid-template-columns: 1fr;
    border-right: 1px solid var(--line);
  }

  .secondary-grid .card-img {
    border-right: none;
    min-height: 160px;
  }

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