/* =============================================
   DESIGN TOKENS
   ============================================= */
:root {
  --font: "Switzer", "Switzer Placeholder", sans-serif;
  --bg: #fafaf9;
  --surface: #f3f2f0;
  --text: #111111;
  --muted: #6b6b6b;
  --border: #e4e4e4;
  --max-w: 680px;
  --max-w-wide: 960px;
  --nav-h: 64px;
}

/* =============================================
   RESET
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, figure { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; background: none; border: none; cursor: pointer; }

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.375rem, 2.5vw, 1.75rem); }
h3 { font-size: 1.125rem; }
p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }

/* =============================================
   LAYOUT
   ============================================= */
.container {
  width: 100%;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 24px;
}
.prose {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
section { padding: 80px 0; }

/* =============================================
   NAV
   ============================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  transition: border-bottom 0.2s ease;
}
.nav.scrolled { border-bottom: 1px solid var(--border); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w-wide);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
}
.nav-logo img {
  height: 32px;
  width: auto;
  display: block;
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 0.9375rem;
  color: var(--muted);
  transition: color 0.15s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-toggle span {
  display: block; width: 22px; height: 1.5px;
  background: var(--text); transition: all 0.2s ease;
}
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 24px;
  z-index: 99;
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: block;
  font-size: 1.125rem;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  transition: color 0.15s ease;
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover { color: var(--text); }

/* =============================================
   HERO
   ============================================= */
.hero {
  padding-top: calc(var(--nav-h) + 64px);
  padding-bottom: 80px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-eyebrow {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
  font-weight: 500;
}
.hero h1 { margin-bottom: 24px; line-height: 1.1; }
.hero-sub {
  font-size: 1.0625rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 40px;
  max-width: 420px;
}
.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  border-bottom: 1px solid var(--text);
  padding-bottom: 3px;
  transition: opacity 0.15s ease;
  align-self: flex-start;
}
.cta-link:hover { opacity: 0.5; }
.hero-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 12px;
}

/* =============================================
   SECTION LABEL
   ============================================= */
.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 40px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* =============================================
   WORK CARDS (home)
   ============================================= */
.work-grid { display: flex; flex-direction: column; }
.work-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s ease;
}
.work-card:first-child { border-top: 1px solid var(--border); }
.work-card:hover { opacity: 0.55; }
.work-card-index { font-size: 0.8125rem; color: var(--muted); font-weight: 500; }
.work-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}
.work-card-desc { font-size: 0.9375rem; color: var(--muted); }
.work-card-meta { text-align: right; }
.work-card-company { font-size: 0.8125rem; color: var(--muted); display: block; }
.work-card-year { font-size: 0.8125rem; color: var(--muted); display: block; }

/* =============================================
   WRITING ROWS (home)
   ============================================= */
.writing-list { display: flex; flex-direction: column; }
.writing-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s ease;
}
.writing-row:first-child { border-top: 1px solid var(--border); }
.writing-row:hover { opacity: 0.55; }
.writing-row-title { font-size: 0.9375rem; font-weight: 500; }
.writing-row-date { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }

/* =============================================
   VIEW TOGGLE
   ============================================= */
.projects-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}
.projects-controls .section-label {
  margin-bottom: 0;
  flex: 1;
}
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.view-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.view-btn:hover { color: var(--text); }
.view-btn.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* =============================================
   GRID VIEW
   ============================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
}
.project-card:hover { opacity: 0.75; }
.project-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.project-card:hover .project-card-thumb img { transform: scale(1.03); }
.project-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.project-card-tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.project-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  line-height: 1.3;
}
.project-card-desc {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.55;
}

/* view hidden state */
.view-hidden { display: none !important; }

/* =============================================
   WORK LISTING PAGE
   ============================================= */
.work-listing { display: flex; flex-direction: column; }
.work-listing-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s ease;
}
.work-listing-item:first-child { border-top: 1px solid var(--border); }
.work-listing-item:hover { opacity: 0.55; }
.work-listing-index { font-size: 0.8125rem; color: var(--muted); font-weight: 500; }
.work-listing-title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.work-listing-sub { font-size: 0.9375rem; color: var(--muted); }
.work-listing-tag {
  font-size: 0.75rem; font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  padding: 5px 12px;
  border-radius: 100px;
  white-space: nowrap;
  border: 1px solid var(--border);
}

/* =============================================
   CASE STUDY PAGE
   ============================================= */
.cs-header {
  padding-top: calc(var(--nav-h) + 56px);
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 64px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 32px;
  transition: color 0.15s ease;
}
.back-link:hover { color: var(--text); }
.cs-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 20px;
}
.cs-meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.cs-meta-item { font-size: 0.875rem; }
.cs-meta-label { color: var(--muted); margin-right: 6px; }
.cs-body { margin-bottom: 96px; }
.cs-body h2 { font-size: 1.25rem; margin-top: 48px; margin-bottom: 14px; }
.cs-body p { font-size: 1rem; line-height: 1.75; }
.cs-body ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 1.25rem;
}
.cs-body li { margin-bottom: 6px; font-size: 1rem; line-height: 1.7; }
.cs-body blockquote {
  border-left: 2px solid var(--text);
  padding: 2px 0 2px 24px;
  margin: 36px 0;
  font-size: 1.0625rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.65;
}
.cs-figure {
  margin: 40px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.875rem;
}
.cs-figure figcaption {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}
.cs-img {
  display: block;
  width: min(1080px, calc(100vw - 48px));
  max-width: unset;
  border-radius: 10px;
  margin: 36px 0;
  margin-left: calc((100% - min(1080px, 100vw - 48px)) / 2);
  border: 1px solid var(--border);
}
.cs-img-caption {
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  margin-top: -24px;
  margin-bottom: 36px;
}
.cs-outcomes {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px;
  margin: 48px 0;
}
.cs-outcomes-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}
.cs-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 28px;
}
.cs-stat-number {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}
.cs-stat-label { font-size: 0.875rem; color: var(--muted); line-height: 1.4; }

/* =============================================
   ABOUT PAGE
   ============================================= */
.page-header {
  padding-top: calc(var(--nav-h) + 56px);
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 56px;
}
.page-header h1 { margin-bottom: 16px; }
.page-header p { font-size: 1.0625rem; color: var(--muted); max-width: 520px; }
.timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:first-child { border-top: 1px solid var(--border); }
.timeline-years { font-size: 0.8125rem; color: var(--muted); padding-top: 3px; white-space: nowrap; }
.timeline-company { font-weight: 600; font-size: 0.9375rem; margin-bottom: 3px; }
.timeline-role { font-size: 0.9375rem; color: var(--muted); }
.open-to {
  margin-top: 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}
.open-to h3 { font-size: 1rem; margin-bottom: 10px; }
.open-to p { font-size: 0.9375rem; color: var(--muted); }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  background: var(--text);
  color: var(--bg);
  padding: 11px 22px;
  border-radius: 8px;
  margin-top: 20px;
  transition: opacity 0.15s ease;
}
.btn:hover { opacity: 0.75; }

/* =============================================
   WRITING LISTING PAGE
   ============================================= */
.article-list { display: flex; flex-direction: column; }
.article-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s ease;
}
.article-item:first-child { border-top: 1px solid var(--border); }
.article-item:hover { opacity: 0.55; }
.article-title { font-size: 1.0625rem; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.article-excerpt { font-size: 0.9375rem; color: var(--muted); line-height: 1.6; }
.article-meta { text-align: right; }
.article-date { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; display: block; }
.article-read { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; display: block; margin-top: 4px; }

/* =============================================
   ARTICLE PAGE
   ============================================= */
.article-header {
  padding-top: calc(var(--nav-h) + 56px);
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.article-header h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin-bottom: 20px; }
.article-header-meta { display: flex; gap: 20px; font-size: 0.875rem; color: var(--muted); }
.article-body { margin-bottom: 96px; }
.article-body h2 { font-size: 1.375rem; margin-top: 48px; margin-bottom: 14px; }
.article-body h3 { font-size: 1.125rem; margin-top: 32px; margin-bottom: 10px; }
.article-body p { font-size: 1rem; line-height: 1.75; }
.article-body ul, .article-body ol { padding-left: 20px; margin-bottom: 1.25rem; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 6px; line-height: 1.7; }
.article-body blockquote {
  border-left: 2px solid var(--text);
  padding: 2px 0 2px 24px;
  margin: 32px 0;
  font-size: 1.0625rem;
  color: var(--muted);
  font-style: italic;
}

/* =============================================
   CONTACT PAGE
   ============================================= */
.contact-links { display: flex; flex-direction: column; margin-top: 40px; }
.contact-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s ease;
}
.contact-link-row:first-child { border-top: 1px solid var(--border); }
.contact-link-row:hover { opacity: 0.55; }
.contact-link-label { font-weight: 500; font-size: 0.9375rem; }
.contact-link-value { font-size: 0.9375rem; color: var(--muted); }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 24px;
}
.footer-copy { font-size: 0.875rem; color: var(--muted); }
.footer-links { display: flex; gap: 24px; }
.footer-links a {
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.15s ease;
}
.footer-links a:hover { color: var(--text); }

/* =============================================
   SCROLL ANIMATIONS
   ============================================= */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .hero { padding-top: calc(var(--nav-h) + 40px); padding-bottom: 56px; }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-photo { order: -1; }
  .hero-photo img { aspect-ratio: 3 / 2; object-position: center 20%; }

  .work-card { grid-template-columns: 36px 1fr; }
  .work-card-meta { display: none; }

  .work-listing-item { grid-template-columns: 36px 1fr; }
  .work-listing-tag { display: none; }

  .projects-grid { grid-template-columns: 1fr; gap: 20px; }

  .cs-meta { gap: 14px; }

  .timeline-item { grid-template-columns: 80px 1fr; gap: 16px; }

  .article-item { grid-template-columns: 1fr; }
  .article-meta { display: none; }

  .footer-inner { flex-direction: column; align-items: flex-start; }

  section { padding: 56px 0; }

  .cs-stat-grid { grid-template-columns: 1fr 1fr; }
}
