/* ================================================
   Brandon Jacobson — Portfolio Design System
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ================================================
   Design Tokens
   ================================================ */
:root {
  /* Colors */
  --bg:            #f8fafc;
  --surface:       #ffffff;
  --surface-alt:   #f1f5f9;
  --text:          #0f172a;
  --text-muted:    #374151;
  --accent:        #1d4ed8;
  --accent-hover:  #1e40af;
  --accent-subtle: #eff6ff;
  --border:        #e2e8f0;
  --border-hover:  #cbd5e1;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow:    0 4px 16px rgba(15,23,42,0.08);
  --shadow-lg: 0 10px 32px rgba(15,23,42,0.12);

  /* Spacing */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;

  /* Layout */
  --max-w: 1060px;
  --nav-h: 64px;

  /* Misc */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --transition: 0.18s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p { margin: 0; }
a { color: inherit; }
img, video { max-width: 100%; display: block; }
ul { padding-left: 1.25rem; margin: 0; }
li { margin-bottom: 0.4rem; }

/* ================================================
   Navigation
   ================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--sp-4);
}

.nav-logo {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

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

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  white-space: nowrap;
}

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

.nav-links .nav-resume {
  background: var(--text);
  color: #fff !important;
  padding: 0.38rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.nav-links .nav-resume:hover { background: #1e293b; }

/* Hamburger (mobile) */
.nav-toggle-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

/* ================================================
   Page Container
   ================================================ */
.page-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6) var(--sp-20);
}

/* ================================================
   Hero
   ================================================ */
.hero {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: var(--sp-12);
  align-items: center;
  padding: var(--sp-16) 0 var(--sp-12);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-12);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  margin-bottom: var(--sp-4);
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.hero-left {
  max-width: 540px;
}

.hero-title {
  font-size: clamp(2.1rem, 4.2vw, 3.1rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-6);
  line-height: 1.12;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: var(--sp-6);
}

.hero-tagline {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--sp-6);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

/* Status Card */
.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: var(--shadow);
}

.status-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4) 0;
}

.status-row:first-child { padding-top: 0; }
.status-row:last-child  { padding-bottom: 0; }

.status-row + .status-row {
  border-top: 1px solid var(--border);
}

.status-label {
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.status-value {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.5;
}

/* Bullet list inside status card */
.status-list {
  list-style: none;
  padding: 0;
  margin: var(--sp-1) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.status-list li {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  line-height: 1.4;
  margin: 0;
}

.status-list li::before {
  content: '·';
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ================================================
   Buttons
   ================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--text);
  color: #ffffff;
}
.btn-primary:hover {
  background: #1e293b;
  box-shadow: 0 4px 14px rgba(15,23,42,0.18);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  background: var(--surface-alt);
  border-color: var(--border-hover);
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
}
.btn-accent:hover { background: var(--accent-hover); }

/* ================================================
   Pills / Tags
   ================================================ */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.pill {
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* ================================================
   Section Layout
   ================================================ */
.section {
  margin-bottom: var(--sp-16);
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ================================================
   Project Cards
   ================================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-5);
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

.project-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.project-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

.project-card-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: auto;
  padding-top: var(--sp-2);
  transition: gap var(--transition);
}

.project-card-link:hover {
  gap: 0.45rem;
  text-decoration: underline;
}

/* ================================================
   Recent Work Card
   ================================================ */
.recent-work-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  transition: box-shadow var(--transition);
}

.recent-work-card:hover {
  box-shadow: var(--shadow-lg);
}

.recent-work-content {
  padding: var(--sp-6) var(--sp-7, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  justify-content: center;
}

.recent-work-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
}

.recent-work-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0;
}

.recent-work-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.72;
  margin: 0;
}

.recent-work-image {
  background: var(--surface-alt);
  border-left: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  min-height: 220px;
}

.recent-work-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

/* ================================================
   About Text
   ================================================ */
.about-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 680px;
}

.about-body p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ================================================
   CTA / Resume Box
   ================================================ */
.cta-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}

.cta-box-text h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

.cta-box-text p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ================================================
   Contact Links
   ================================================ */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.contact-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding: var(--sp-3) var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: all var(--transition);
}

.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ================================================
   Footer
   ================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-8) var(--sp-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}

.site-footer p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

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

/* ================================================
   Media Gallery (project pages)
   ================================================ */
.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 370px);
  gap: var(--sp-5);
  overflow-x: auto;
  padding-bottom: var(--sp-3);
  scroll-snap-type: x mandatory;
}

.gallery::-webkit-scrollbar { height: 6px; }
.gallery::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}

.media-card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  padding: var(--sp-4);
  transition: transform var(--transition), box-shadow var(--transition);
}

.media-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.media-card img,
.media-card video {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-3);
}

.media-card img + img { margin-top: var(--sp-3); }

.media-card figcaption {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  padding: 0 var(--sp-2) var(--sp-2);
  line-height: 1.45;
}

/* ================================================
   Project Detail Pages
   ================================================ */
.project-page-hero {
  padding: var(--sp-12) 0 var(--sp-8);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-8);
  text-align: center;
}

.project-page-title {
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-4);
}

.project-page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 620px;
  margin: 0 auto var(--sp-5);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
}

.badge {
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.two-column {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--sp-8);
  align-items: start;
}

.project-section {
  margin-bottom: var(--sp-10);
}

.project-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.project-section p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: var(--sp-3);
}

.project-section ul {
  color: var(--text-muted);
  line-height: 1.8;
}

.project-section ul li { margin-bottom: var(--sp-2); }

.project-section strong { color: var(--text); font-weight: 600; }

/* ================================================
   Breadcrumbs
   ================================================ */
.breadcrumbs {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

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

.breadcrumbs a:hover { text-decoration: underline; }

/* ================================================
   Projects Page — Card with Thumbnail
   ================================================ */
.project-grid-lg {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.project-card-lg {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.project-card-lg:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

.project-thumb {
  aspect-ratio: 16 / 9;
  background: var(--surface-alt);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card-body {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  flex: 1;
}

.project-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.project-card-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-2);
}

/* ================================================
   Simulation Section Blocks
   ================================================ */
.sim-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  margin-bottom: var(--sp-6);
}

.sim-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.sim-block-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0;
}

.sim-block-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sim-block-label.label-muted {
  color: var(--text-muted);
  background: var(--surface-alt);
}

@media (max-width: 480px) {
  .sim-block { padding: var(--sp-5); }
}

/* ================================================
   Simulation GIF + Plot Grid (KF pages)
   ================================================ */
.sim-gif-wrap {
  margin: 0 auto var(--sp-8);
  max-width: 920px;
}

.sim-gif-wrap img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: block;
}

.sim-gif-caption {
  margin-top: var(--sp-3);
  font-size: 0.83rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  font-style: italic;
}

.plot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5);
}

.plot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition);
}

.plot-card:hover { box-shadow: var(--shadow-lg); }

.plot-card-img {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3);
}

.plot-card-img img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

.plot-card-caption {
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.plot-card-caption strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.plot-card-caption p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Technical explanation box */
.tech-callout {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--sp-5) var(--sp-6);
}

.tech-callout p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin: 0;
}

.tech-callout p + p { margin-top: var(--sp-3); }

.tech-callout strong { color: var(--text); font-weight: 600; }

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

/* ================================================
   Animations
   ================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeInUp 0.5s ease forwards;
}

.delay-1 { animation-delay: 0.08s; opacity: 0; }
.delay-2 { animation-delay: 0.16s; opacity: 0; }
.delay-3 { animation-delay: 0.24s; opacity: 0; }
.delay-4 { animation-delay: 0.32s; opacity: 0; }

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
    padding: var(--sp-10) 0 var(--sp-8);
  }

  .hero-left { max-width: 100%; }

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

  .recent-work-image {
    border-left: none;
    border-top: 1px solid var(--border);
    min-height: 180px;
  }

  .two-column {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

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

  .nav-links .nav-desktop { display: none; }
  .nav-toggle-btn { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-2) 0;
    box-shadow: var(--shadow);
  }

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

  .nav-links a {
    padding: var(--sp-3) var(--sp-6);
    border-radius: 0;
  }

  .nav-links .nav-resume {
    margin: var(--sp-2) var(--sp-6);
    border-radius: var(--radius-sm);
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .page-container { padding: 0 var(--sp-4) var(--sp-16); }
  .hero-title { font-size: 1.75rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { justify-content: center; }
}
