/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: subpixel-antialiased;
}

/* Dark surface override */
.surface-dark {
  background-color: var(--color-dark);
  color: var(--color-text-inverse);
  -webkit-font-smoothing: antialiased;
}

img, video {
  display: block;
  width: 100%;
  object-fit: cover;
}

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

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-3xl); margin-bottom: 1rem; }
h2 { font-size: var(--text-2xl); margin-bottom: 1.25rem; }
h3 { font-size: var(--text-xl); margin-bottom: 1rem; }
h4 { font-size: var(--text-base); margin-bottom: 0.75rem; }
h5 { font-size: var(--text-sm); }

.surface-dark h1,
.surface-dark h2,
.surface-dark h3 {
  color: var(--color-text-inverse);
}


.label,
.resume-section h2 {
  font-size: var(--text-xs);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.surface-dark .label {
  color: var(--color-text-inverse-secondary);
}

/* ============================================
   Layout & Sections
   ============================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(2rem, 6vw, 4rem);
}

.section-lg {
  padding-block: var(--space-24);
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.02em;
  transition: color var(--transition);
}

.nav-logo:hover {
  color: var(--color-orange);
}

.nav-logo span {
  color: var(--color-orange);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-links a:not(.btn) {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-secondary);
  transition: color var(--transition);
}

.nav-links a:not(.btn):hover {
  color: var(--color-orange);
}

.nav-links a.active {
  color: var(--color-orange);
  font-weight: 400;
}

.nav-links button.theme-toggle {
  color: var(--color-text-secondary);
  transition: color var(--transition);
}

.nav-links button.theme-toggle:hover {
  color: var(--color-orange);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-orange);
  color: #ffffff;
  border: 1.5px solid var(--color-orange);
}

.btn-primary:hover {
  background: var(--color-orange-hover);
  border-color: var(--color-orange-hover);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-orange);
}

.btn-outline:hover {
  background: #ede5db;
  border-color: #ede5db;
  color: var(--color-text);
}

[data-theme="dark"] .btn-outline:hover {
  background: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-bg);
}


/* ============================================
   Grids (Thesis & Work)
   ============================================ */
.skill-cell {
  background: transparent;
  padding: 1rem;
  border-right: 1px solid var(--color-border);
}

.skill-cell:last-child {
  border-right: none;
  padding-right: 0;
}

.skill-cell-thumb {
  aspect-ratio: 4/3;
  margin-bottom: 1rem;
}

.skill-cell .thesis-number {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-orange);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.work-grid-2 {
  border-top: 2px solid var(--color-border);
  border-left: 2px solid var(--color-border);
}

.work-tile {
  display: block;
  width: 100%;
  background: var(--color-bg);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/3;
  border-right: 2px solid var(--color-border);
  border-bottom: 2px solid var(--color-border);
}

.work-tile img {
  height: 100%;
}

.work-tile-overlay {
  position: absolute;
  inset: 0;
  background: rgba(59, 42, 26, 0.08);
  opacity: 0;
  transition: opacity var(--transition);
}

.work-tile:hover .work-tile-overlay {
  opacity: 1;
}

.work-tile-caption {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 55%);
  display: flex;
  align-items: flex-end;
  padding: 2rem;
}

p + p {
  margin-top: 1rem;
}

.surface-section {
  background: var(--color-surface);
}

[data-theme="dark"] .surface-section,
[data-theme="dark"] .surface-section * {
  color: var(--color-text-inverse);
  font-weight: 500;
}


.skill-cell li,
.skill-cell p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: 0.35rem 0;
}

.resume-dates {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ============================================
   Footer
   ============================================ */
body.page-portfolio {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.page-portfolio .footer {
  margin-top: auto;
}

body.page-portfolio .intro-sub {
  color: var(--color-orange);
}

.footer {
  background: var(--color-dark);
  color: var(--color-text-inverse);
  -webkit-font-smoothing: antialiased;
  padding-block: var(--space-6);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-name {
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--color-text-inverse);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--color-text-inverse);
}

.footer-copy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: rgba(240, 232, 221, 0.55);
}

.footer-nav {
  display: flex;
  gap: var(--space-6);
}

.footer-nav a {
  font-size: var(--text-xs);
  color: var(--color-text-inverse);
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--color-orange-hover);
}

[data-theme="dark"] .footer-copy {
  color: rgba(240, 232, 221, 0.55);
}

[data-theme="dark"] .footer-nav a {
  color: #f0e8dd;
}

[data-theme="dark"] .footer-nav a:hover {
  color: var(--color-orange-hover);
}

/* ============================================
   Page Intro (compact header — replaces hero)
   ============================================ */
.intro {
  padding-top: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--color-border);
}

.intro-headline {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.intro-title {
  align-self: center;
}

.intro-brace {
  font-family: Didot, 'Didot LT STD', 'GFS Didot', serif;
  font-size: 6rem;
  line-height: 1;
  font-weight: 300;
  color: var(--color-orange);
  margin-top: -0.1em;
}

/* ============================================
   Strengths (What I do)
   ============================================ */
.strength-item h4 {
  font-size: var(--text-base);
  font-weight: 400;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.strength-item p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.75;
}


/* ============================================
   Work Intro
   ============================================ */
.work-intro {
  background: var(--color-surface);
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

.work-section {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}


.work-intro-heading {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

/* ============================================
   Work Tile Dark Backgrounds
   ============================================ */
.work-tile-bg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.work-tile-text {
  padding: var(--space-8);
}

.tile-label {
  font-size: var(--text-xs);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.4rem;
}

.work-tile-text h3 {
  font-size: var(--text-lg);
  font-weight: 300;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.work-tile-text p {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.65);
}

/* ============================================
   Resume Page
   ============================================ */
.resume-contact {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

.resume-section {
  margin-top: clamp(2.5rem, 4vw, 3.5rem);
  padding-top: clamp(2rem, 3vw, 2.5rem);
}

.resume-section h2 {
  margin-bottom: 1.5rem;
}

.resume-employer {
  margin-bottom: 2.5rem;
}

.resume-employer:last-child {
  margin-bottom: 0;
}

.resume-employer-header,
.resume-role-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.resume-employer-header { margin-bottom: 1.25rem; }

.resume-employer-name {
  letter-spacing: -0.01em;
}


.resume-role {
  margin-bottom: 1.75rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--color-border);
}

.resume-role:last-child {
  margin-bottom: 0;
}

.resume-role-header { margin-bottom: 0.75rem; }

.resume-role h4 {
  font-weight: 400;
}


.resume-role-intro {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.resume-role ul li {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.75;
  padding: 0.3rem 0 0.3rem 1.25rem;
  position: relative;
}

.resume-role ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--color-text-muted);
}

.resume-skills-list {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 2;
}

/* ============================================
   Case Studies — Shared
   ============================================ */
.intro--lg {
  padding-top: clamp(4rem, 8vw, 7rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.intro .label {
  margin-bottom: 1.25rem;
}

.intro h1 {
  margin-bottom: 1.5rem;
}

.intro--dark {
  -webkit-font-smoothing: antialiased;
}


.case-grid {
  display: grid;
  gap: 1px;
  background: var(--color-border);
  margin: 2rem 0;
}

.detail-cell,
.arc-step {
  background: var(--color-surface);
  padding: 1.5rem;
}

.detail-cell h4 {
  font-size: var(--text-xs);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-orange);
  margin-bottom: 0.75rem;
}

.detail-cell p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 0;
}

.intro--dark .label {
  color: rgba(255, 255, 255, 0.45);
}

.intro--dark h1 {
  color: #ffffff;
}

.intro--dark .intro-sub {
  color: rgba(255, 255, 255, 0.75);
}

.intro--dark .case-meta-row {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.intro--dark .case-meta-row .label {
  color: rgba(255, 255, 255, 0.4);
}

.intro--dark .case-meta-value {
  color: rgba(255, 255, 255, 0.85);
}

.case-meta-row {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.case-meta-row .label {
  margin-bottom: 0.35rem;
}

.case-meta-value {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}


.case-section {
  padding-top: clamp(3rem, 5vw, 4rem);
  padding-bottom: clamp(3rem, 5vw, 4rem);
}


.callout {
  background: var(--color-surface-alt);
  border-left: 3px solid var(--color-orange);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
}

.callout p {
  font-size: var(--text-lg);
  color: var(--color-text);
  line-height: 1.65;
  font-weight: 400;
  margin-bottom: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition);
}

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

.back-link::before {
  content: '←';
}

.back-link--top {
  margin-bottom: 3rem;
  display: block;
}



/* ============================================
   Case Study — Story Arc (boeing-uxe)
   ============================================ */

.arc-step .arc-num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-orange);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

.arc-step h4 {
  font-size: var(--text-sm);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.arc-step p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 0;
}

/* ============================================
   Case Study — Flow Steps (collective-goods)
   ============================================ */

.flow-step {
  background: var(--color-surface);
  padding: 1.25rem 1.5rem;
}

.flow-step .step-num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-orange);
  margin-bottom: 0.4rem;
}

.flow-step p {
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: 0;
  font-weight: 400;
}

/* ============================================
   Case Study — Case Image (collective-goods)
   ============================================ */
.case-image {
  background: var(--color-surface-alt);
  overflow: hidden;
}

.case-image-caption,
.image-caption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.case-image-caption { padding: 0.75rem 0 0; }

.image-caption { margin-top: 0.75rem; }

/* ============================================
   Widow Prevention (1200px+)
   ============================================ */
@media (min-width: 1200px) {

  p {
    text-wrap: pretty;
  }
}

/* ============================================
   Responsive Queries (Consolidated)
   ============================================ */
/* ============================================
   Mobile Nav Toggle
   ============================================ */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    padding: var(--space-4) var(--gutter);
    z-index: 99;
  }

  .nav.is-open .nav-links {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a,
  .nav-links button.theme-toggle {
    display: block;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
    width: 100%;
    font-size: var(--text-sm);
    text-align: left;
    transition: color var(--transition);
  }

  .nav-links a.btn {
    display: inline-block;
    width: auto;
    padding: 0.625rem 1.25rem;
    border-bottom: none;
    margin-block: var(--space-3);
  }

  .nav-links li:has(.btn) {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-1);
  }

  .nav-links li:last-child > * {
    border-bottom: none;
  }

  .nav-links a:active,
  .nav-links button.theme-toggle:active {
    color: var(--color-orange);
  }

  .nav.is-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav.is-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .skill-cell {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .skill-cell:last-child {
    border-bottom: none;
  }

  .intro-headline {
    flex-direction: column;
    gap: 0.5rem;
  }
  .intro-brace {
    display: none;
  }
  .intro-title {
    align-self: auto;
  }
}

@media (max-width: 640px) {
  .case-grid {
    grid-template-columns: 1fr;
  }
}