/* ============================================================
   Michael Faber Portfolio — style.css v3
   Fonts: Space Grotesk (headings) + IBM Plex Sans (body)
   Major Third scale (1.25×): 13 · 16 · 20 · 25 · 31 · 39 · 49 · 61 · 76
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 400;
  background: var(--paper);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ---- Design Tokens ---- */
:root {
  /* Palette — light editorial */
  --ink:        #0F0F0A;
  --paper:      #FFFFFF;
  --surface:    #F0F3EC;
  --surface2:   #E6EAE2;
  --border:     #DDE1D8;
  --text:       #1A1A14;
  --text2:      #504F48;
  --text3:      #6B6A63;
  --accent:     #B55A28;
  --accent-bg:  #FDF1E8;
  --nav:        68px;
  --r:          10px;

  /* Major Third scale */
  --fs-xs:              13px;
  --fs-section-label-lg: 16px; /* Section Label lg — large section prefixes, prominent captions */
  --fs-sm:              16px;
  --fs-md:   20px;
  --fs-lg:   25px;
  --fs-xl:   31px;
  --fs-2xl:  39px;
  --fs-3xl:  49px;
  --fs-4xl:  61px;
  --fs-hero: 76px;

  /* 8px Spacing scale */
  --sp-1:   4px;   /* micro — dot gaps, badge padding */
  --sp-2:   8px;   /* tight — arrow gap, nav padding */
  --sp-3:  16px;   /* within-component — label→title, card inner */
  --sp-4:  24px;   /* between related — title→body, card title→desc */
  --sp-5:  32px;   /* between distinct — body→CTA, card desc→footer */
  --sp-6:  48px;   /* sub-section — section-label→first card */
  --sp-7:  64px;   /* component gap — card grid gap */
  --sp-8:  80px;   /* section padding compact */
  --sp-9:  96px;   /* section padding standard */
  --sp-10: 128px;  /* hero-level */

  /* Grid — Desktop 12 col */
  --cols:    12;
  --gutter:  24px;
  --margin:  48px;
  --max:     1160px;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, .logo, .stat-num, .card-num { font-family: 'Space Grotesk', sans-serif; }

/* Scale with gap rule: h1→49, h2→31 (skip 39), h3→20 (skip 25), body→16 */
h1 { font-size: clamp(36px, 6vw, var(--fs-3xl)); font-weight: 700; letter-spacing: -.04em; line-height: 1.05; }
h2 { font-size: clamp(24px, 4vw, var(--fs-xl));  font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
h3 { font-size: var(--fs-md); font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
h4 { font-size: var(--fs-sm); font-weight: 600; letter-spacing: -.01em; line-height: 1.4; }
p  { line-height: 1.7; font-size: var(--fs-sm); text-wrap: pretty; }
p + p { margin-top: 14px; }
ul li { padding-left: 20px; position: relative; line-height: 1.7; margin-bottom: 8px; font-size: var(--fs-sm); }
ul li::before { content: '—'; position: absolute; left: 0; color: var(--text3); }
/* Case study ordered lists match body text size */
.cs-sec ol { padding-left: 22px; margin: 20px 0 28px; }
.cs-sec ol li { font-size: 18px; line-height: 1.75; margin-bottom: 10px; }
/* Case study unordered lists — match ol size, exclude dd-list */
.cs-sec ul:not(.dd-list) { margin: 4px 0 24px; }
.cs-sec ul:not(.dd-list) li { font-size: 18px; line-height: 1.75; margin-bottom: 10px; }

/* ---- Layout ---- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--margin); }

/* 12-col grid utility */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gutter);
}

/* ---- SCROLL REVEAL ---- */
/* Default: slow ghost-in for text and sections */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  will-change: transform, opacity;
  transition: opacity 2s cubic-bezier(0,0,.2,1) var(--d,0s),
              transform 3s cubic-bezier(0,0,.2,1) var(--d,0s);
}

/* Cards: even more imperceptible — almost no movement, pure fade */
.card.reveal,
.research-card.reveal {
  transform: translateY(6px);
  transition: opacity 2.4s cubic-bezier(0,0,.15,1) var(--d,0s),
              transform 3.6s cubic-bezier(0,0,.15,1) var(--d,0s);
}
.revealed { opacity: 1; transform: translateY(0); }

/* Hero — h1 and subtitle both fade + drift up, h1 slightly slower */
.hero .reveal {
  transition: opacity 1.2s cubic-bezier(0,0,.2,1) var(--d,0s),
              transform 1.8s cubic-bezier(0,0,.2,1) var(--d,0s);
}


/* ---- NAV ---- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--nav);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-in {
  max-width: var(--max); margin: 0 auto; padding: 0 28px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: .01em;
  color: var(--ink); flex-shrink: 0; text-transform: uppercase;
}
.logo a {
  position: relative;
  transition: color .2s;
}
.logo a::after {
  content: 'YOU GOT IT.';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  text-transform: none;
  opacity: 0;
  transition: opacity .2s;
  white-space: nowrap;
  pointer-events: none;
}
.logo a:hover { color: transparent; }
.logo a:hover::after { opacity: 1; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nl {
  font-size: var(--fs-sm); font-weight: 500; color: var(--text2);
  padding: 7px 13px;
  transition: color .15s;
  white-space: nowrap;
}
.nl:hover { color: var(--accent); }
.nl.cta {
  background: var(--ink); color: #fff;
  padding: 9px 20px; border-radius: 100px 100px 100px 0;
  font-weight: 600; margin-left: 8px;
  font-size: var(--fs-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
/* Cut corner = bottom-left → lifts toward top-right */
.nl.cta:hover {
  transform: translate(4px, -4px);
  box-shadow: -4px 4px 0 0 rgba(0,0,0,.22);
}

/* Dropdown */
.drop { position: relative; }
.drop-menu {
  position: absolute; top: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.09); min-width: 240px;
  padding: 8px; opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.drop.is-open .drop-menu {
  opacity: 1; pointer-events: all;
  transform: translateX(-50%) translateY(0);
}
.drop-menu a, .drop-menu button {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 7px;
  font-size: var(--fs-xs); color: var(--text2); font-weight: 500;
  transition: background .12s, color .12s;
}
.drop-menu a:hover { background: none; color: var(--accent); }
.drop-menu a.active { color: var(--ink); font-weight: 600; }
.dlabel {
  display: block; padding: 4px 12px 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  color: var(--text3); text-transform: uppercase; margin-top: 4px;
  font-family: 'Space Grotesk', sans-serif;
}

/* Burger / Mobile */
.burger {
  display: none; width: 36px; height: 36px; align-items: center;
  justify-content: center; border-radius: 8px; transition: background .15s;
}
.burger:hover { background: var(--surface); }
.burger svg { width: 20px; height: 20px; color: var(--ink); }

.drawer {
  position: fixed; top: var(--nav); right: 0; bottom: 0;
  width: min(300px, 88vw); background: #fff; z-index: 800;
  padding: 20px 20px 32px;
  transform: translateX(100%); transition: transform .28s cubic-bezier(.16,1,.3,1);
  overflow-y: auto; border-left: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.drawer.open { transform: translateX(0); }
.drawer a, .drawer .dlabel {
  display: block; padding: 10px 12px; border-radius: 8px;
  font-size: var(--fs-sm); font-weight: 500; color: var(--text2);
}
.drawer a:hover { background: var(--surface); color: var(--ink); }
.drawer .dlabel {
  font-size: 10px; color: var(--text3);
  text-transform: uppercase; letter-spacing: .08em; margin-top: 12px;
}
.drawer-bottom {
  margin-top: auto; padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.drawer-bottom a { font-weight: 600; color: var(--ink); }

/* ---- HOMEPAGE HERO ---- */
.hero {
  background: #E0E4D8;
  padding: calc(var(--nav) + 80px) 0 72px;
  position: relative; overflow: hidden;
  min-height: 500px;
}
/* Grain texture via SVG feTurbulence */
.hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23g)' opacity='0.28'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-position: 0 var(--grain-y, 0px);
  mix-blend-mode: multiply;
  pointer-events: none;
  will-change: background-position;
}
/* Gentle grid lines */
.hero::after {
  content: '';
  position: absolute; inset: 0; z-index: 2;
  background-image:
    linear-gradient(rgba(0,0,0,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.055) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 var(--grid-y, 0px);
  pointer-events: none;
  will-change: background-position;
}

.hero-in { position: relative; z-index: 3; }
.hero h1 {
  color: var(--ink); max-width: 560px;
  font-size: clamp(44px, 9vw, var(--fs-hero));
  letter-spacing: -.05em; line-height: .98;
}
.hero h1 .dim { color: var(--accent); }
.hero-sub {
  font-size: clamp(18px, 2.2vw, 21px); line-height: 1.75;
  color: var(--text2); max-width: 520px;
  margin: 28px 0 0; font-weight: 300;
}

/* ---- SECTION LABEL ---- */
.section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text3); margin-bottom: 48px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}

/* ---- PROJECT CARDS — image thumbnail grid ---- */
.work-section { padding: 88px 0 72px; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: background .2s, border-color .2s;
  color: var(--ink);
  position: relative;
}
.card:hover { background: var(--surface); border-color: var(--ink); }

/* Thumbnail image */
.card-img-wrap {
  width: 100%; aspect-ratio: 16/9;
  overflow: hidden; background: var(--surface2);
  flex-shrink: 0;
}
.card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.16,1,.3,1);
  display: block;
}
.card:hover .card-img-wrap img { transform: scale(1.04); }

/* Text content below image */
.card-content { display: flex; flex-direction: column; padding: 28px 30px 26px; flex: 1; }
.card-meta {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 10px;
  font-family: 'Space Grotesk', sans-serif;
}
.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(16px, 1.8vw, var(--fs-md));
  font-weight: 700; letter-spacing: -.025em; line-height: 1.2;
  margin-bottom: 10px;
}
.card-desc {
  font-size: var(--fs-sm); line-height: 1.7;
  color: var(--text2); flex: 1; margin-bottom: 20px;
}
.card-foot {
  display: flex; align-items: center; justify-content: flex-start; gap: 6px;
  padding-top: 16px; border-top: 1px solid var(--border);
  margin-top: auto;
}
.card-role {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text3); transition: color .15s;
  letter-spacing: .01em;
}
.card-arrow {
  font-size: var(--fs-sm); color: var(--text3);
  transition: transform .2s, color .2s;
}
.card:hover .card-role  { color: var(--accent); }
.card:hover .card-arrow { transform: translateX(5px); color: var(--accent); }

/* ---- RESEARCH SECTION ---- */
.research-section { padding: 72px 0 88px; border-top: 1px solid var(--border); }
.research-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.research-card {
  background: var(--paper); padding: 0;
  display: flex; flex-direction: column; gap: 0;
  border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden;
  transition: background .2s, border-color .2s;
  color: var(--ink);
}
.research-card:hover { background: var(--surface); border-color: var(--ink); }
/* Image at top of research card — slightly taller crop, cinematic feel */
.research-card .card-img-wrap { aspect-ratio: 16/7; }
.research-card:hover .card-img-wrap img { transform: scale(1.04); }
/* Text body below image */
.research-body {
  padding: 28px 32px 28px; display: flex; flex-direction: column; gap: 10px; flex: 1;
}
.research-num {
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  color: var(--text3); text-transform: uppercase;
  font-family: 'Space Grotesk', sans-serif;
}
.research-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(16px, 1.8vw, var(--fs-md));
  font-weight: 700; letter-spacing: -.025em; line-height: 1.25;
  color: var(--ink);
}
.research-venue { font-size: var(--fs-xs); font-weight: 600; color: var(--text3); }
.research-finding {
  font-size: var(--fs-sm); color: var(--text2); line-height: 1.7; flex: 1;
}
.research-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; border-top: 1px solid var(--border); margin-top: auto;
}
.research-role {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text3);
  font-family: 'Space Grotesk', sans-serif; transition: color .15s;
}
.research-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 700; color: var(--text3);
  transition: color .15s;
  font-family: 'Space Grotesk', sans-serif;
}
.research-arrow { display: inline-block; transition: transform .2s; }
.research-card:hover .research-role { color: var(--accent); }
.research-card:hover .research-cta { color: var(--accent); }
.research-card:hover .research-arrow { transform: translateX(5px); }

/* ---- ABOUT TEASER ---- */
.about-section {
  padding: 80px 0 96px;
  background: var(--accent-bg);
}
.about-teaser { max-width: 760px; }
.about-claim {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: var(--fs-lg); color: var(--accent); font-weight: 500;
  letter-spacing: .02em; text-transform: uppercase;
  margin-bottom: 16px;
}
.about-spec {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(31px, 5vw, var(--fs-3xl)); font-weight: 700;
  letter-spacing: -.04em; line-height: 1.1; color: var(--ink);
  margin-bottom: 28px; text-wrap: balance;
}
.about-body {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: clamp(17px, 1.8vw, var(--fs-md)); color: var(--text2);
  line-height: 1.75; margin-bottom: 32px; font-weight: 300;
}
.about-link {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-xs); font-weight: 700; color: var(--ink);
  margin-top: var(--sp-5); text-decoration: none;
  transition: color .15s;
}
.about-link .about-arrow { display: inline-block; transition: transform .2s ease; }
.about-link:hover { color: var(--accent); }
.about-link:hover .about-arrow { transform: translateX(5px); }
.about-cards { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.about-card { background: var(--paper); padding: 22px 24px; }
.about-card:hover { background: var(--surface); }
.about-card h4 { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin-bottom: 8px; }
.about-card p  { font-size: var(--fs-sm); color: var(--text2); line-height: 1.65; margin: 0; }

/* ---- CONTACT SECTION ---- */
.contact-section { padding: 88px 0; background: var(--paper); }
.contact-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start;
}
/* Left column spacing — heading → description → buttons */
.contact-inner > div > h2 { font-size: clamp(28px, 4vw, var(--fs-2xl)); margin-bottom: 24px; }
.contact-inner > div > p  { font-size: var(--fs-sm); color: var(--text2); line-height: 1.75; margin-bottom: 40px; }
.contact-head-links { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-xs); font-weight: 700; color: var(--text2);
  padding: 10px 20px; border-radius: 100px;
  transition: border-color .15s, color .15s;
}
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }

/* Contact form — bottom-border-only, minimal */
.contact-form { display: flex; flex-direction: column; gap: 28px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label {
  font-size: var(--fs-xs); font-weight: 500; color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
}
.form-field input,
.form-field textarea {
  font-family: 'IBM Plex Sans', sans-serif; font-size: var(--fs-sm);
  color: var(--ink); background: transparent;
  border: none; border-bottom: 1px solid var(--border);
  border-radius: 0; padding: 10px 0;
  outline: none; width: 100%;
  transition: border-color .15s;
  resize: none;
}
.form-field textarea { min-height: 88px; }
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--text3); }
.form-field input:focus,
.form-field textarea:focus { border-bottom-color: var(--ink); }
.form-submit-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.btn-submit {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--ink);
  font-family: 'IBM Plex Sans', sans-serif; font-size: var(--fs-xs); font-weight: 500;
  padding: 11px 32px; border-radius: 0 100px 100px 100px;
  transition: background .15s, color .15s, transform .18s ease, box-shadow .18s ease, border-width .18s ease;
  cursor: pointer;
}
/* Cut corner = top-left → lifts toward bottom-right */
.btn-submit:hover {
  background: var(--ink); color: #fff;
  transform: translate(4px, 4px);
  border-width: 2px;
  box-shadow: -4px -4px 0 0 rgba(26,26,24,.28);
}

/* ---- FOOTER ---- */
footer {
  background: #263322;   /* deeper sage */
  border-top: 1px solid rgba(0,0,0,.20);
  padding: 24px 0;
}
.footer-in {
  max-width: var(--max); margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
footer p { font-size: var(--fs-xs); color: rgba(255,255,255,.72); }
.flinks { display: flex; gap: 20px; }
.flinks a { font-size: var(--fs-xs); color: rgba(255,255,255,.85); transition: color .15s; }
.flinks a:hover { color: rgba(255,255,255,1); }

/* ---- TAGS (keep for chip-free use in body) ---- */
.tag {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px;
}
.t-blue   { background: var(--accent-bg); color: var(--accent); }
.t-gray   { background: var(--surface2); color: var(--text2); }
.t-green  { background: #E3F2E9; color: #1A6438; }
.t-orange { background: #FFF0E5; color: #B83D00; }
.t-dark   { background: rgba(255,255,255,.12); color: rgba(255,255,255,.75); }

/* ---- ABOUT PAGE ---- */
.about-hero {
  padding: calc(var(--nav) + 64px) 0 16px;
}
.about-hero h1 { max-width: 720px; }
.about-hero .lead {
  font-size: clamp(18px, 2.2vw, 21px); line-height: 1.65;
  color: var(--text3); max-width: 600px; margin-top: 20px;
  font-style: italic; font-weight: 400;
}
.about-story h2 { font-size: clamp(30px, 5vw, 44px); margin-bottom: 20px; }
.about-story p + h2 { margin-top: 48px; }
.about-story p { color: var(--text2); margin-bottom: 24px; font-size: 18px; line-height: 1.75; }

/* ---- SKILLS TABLE (Who I Am page) ---- */
.skills-table { border-top: 1px solid var(--border); }
.skills-row {
  display: grid; grid-template-columns: 160px 1fr; gap: 40px;
  padding: 20px 0; border-bottom: 1px solid var(--accent); align-items: baseline;
}
.skills-row-cat {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-xs); font-weight: 700; color: var(--ink); letter-spacing: .02em;
}
.skills-row-items {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: var(--fs-sm); color: var(--text2); line-height: 1.7;
}

/* ---- CASE STUDY LAYOUT ---- */
.cs-hero {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: calc(var(--nav) + 56px) 0 56px;
}
.cs-hero .wrap { max-width: 820px; }
.cs-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text3);
  margin-bottom: 32px; transition: color .15s;
  font-family: 'Space Grotesk', sans-serif;
}
.cs-back:hover { color: var(--ink); }
.cs-title { font-size: clamp(26px, 4.5vw, var(--fs-3xl)); line-height: 1.05; margin-top: 0; }
.cs-lead {
  font-size: clamp(17px, 2vw, 20px); line-height: 1.75;
  color: var(--text2); margin-top: 20px; max-width: 660px; font-weight: 300;
}
.cs-meta {
  margin-top: 44px;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.meta-row {
  display: flex;
  align-items: baseline;
  padding: 8px 0;
}
.mlabel {
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text3); white-space: nowrap; flex-shrink: 0;
  width: 104px; /* widest label is METHODS — all values align to same column */
}
.mline {
  flex-shrink: 0;
  margin: 0 12px 0 0;
  color: var(--text3);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .05em;
}
.mline::before { content: '::'; }
.mval {
  font-size: var(--fs-sm); color: var(--text); line-height: 1.6; font-weight: 500;
}

/* Hero image banner */
.cs-hero-img { width: 100%; overflow: hidden; max-height: 500px; background: var(--surface2); }
.cs-hero-img img { width: 100%; height: 100%; object-fit: cover; }

/* Illustration hero — full natural proportions, no cropping */
.cs-hero-illus { width: 100%; overflow: hidden; background: var(--surface2); }
.cs-hero-illus img { width: 100%; height: auto; display: block; }

/* Case study body */
.cs-body { max-width: 780px; margin: 0 auto; padding: 64px 28px 96px; }
.cs-sec { margin-bottom: 72px; }
.cs-sec > h2 { margin-bottom: 28px; scroll-margin-top: calc(var(--nav) + 28px); font-size: clamp(30px, 5vw, 44px); }
.cs-sec > h3 { margin: 60px 0 22px; }
.img-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin: 28px 0; }
.img-grid .cs-img { margin: 0; }
.cs-sec > p:not(.cs-sub):not(.cs-sec-sub):not(.cs-hmw):not(.cs-label):not(.cs-note) { font-size: var(--fs-sm); }

/* Callout */
.callout {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px; margin: 40px 0;
}
.clabel {
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px; font-family: 'Space Grotesk', sans-serif;
}
.callout p {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(18px, 2.2vw, 22px); font-weight: 600;
  letter-spacing: -.02em; line-height: 1.35; color: var(--ink); margin: 0;
}

/* Pull quote */
.pullquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px; margin: 40px 0;
}
.pullquote p {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(20px, 2.5vw, var(--fs-lg)); font-weight: 600;
  letter-spacing: -.03em; line-height: 1.3; color: var(--ink); margin: 0;
}
.pullquote cite {
  display: block; font-size: 10px; font-weight: 700; color: var(--text3);
  letter-spacing: .1em; text-transform: uppercase; margin-top: 14px;
  font-style: normal; font-family: 'Space Grotesk', sans-serif;
}

/* Block quote — contextual, physician voice */
.quote {
  margin: 32px 0; font-style: italic; color: var(--accent);
  font-size: 28px; line-height: 1.45;
}
.quote p { margin: 0; font-size: 28px; line-height: 1.45; }

/* User research voice — speech bubble matching site button language */
.quote-user {
  display: inline-block; max-width: 88%;
  padding: 20px 26px; margin: 20px 0;
  border: 1.5px solid var(--ink);
  border-radius: 4px 28px 28px 28px;
  background: transparent;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: var(--fs-md); font-weight: 400; font-style: italic;
  color: var(--ink); line-height: 1.65;
}
.quote-user p { margin: 0; }

/* Process steps */
.steps { display: flex; flex-direction: column; margin: 24px 0; }
.step {
  display: flex; gap: 24px; padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.step:first-child { border-top: 1px solid var(--border); }
.step-n {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-xl); font-weight: 700; color: var(--border);
  letter-spacing: -.04em; min-width: 40px; padding-top: 2px; line-height: 1;
}
.step h4 { margin-bottom: 8px; font-size: 18px; }
.step p  { font-size: 15px; color: var(--text2); line-height: 1.65; margin: 0; }

/* Insight grid */
.insight-grid { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.insight-card { padding: 16px 20px; border-left: 3px solid var(--accent); background: rgba(181,90,40,.04); border-radius: 0 var(--r) var(--r) 0; }
.insight-card h4 { margin-bottom: 6px; font-size: 15px; color: var(--ink); }
.insight-card p { font-size: var(--fs-sm); color: var(--text2); line-height: 1.65; margin: 0; }

/* Key findings rows */
.findings { margin: 20px 0; }
.finding-row { display: flex; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.finding-row:last-child { border-bottom: none; }
.f-num { font-size: 11px; font-weight: 700; color: var(--text3); min-width: 22px; font-family: 'Space Grotesk', sans-serif; padding-top: 2px; flex-shrink: 0; }
.f-text { font-size: 17px; line-height: 1.65; color: var(--text); }
.f-text strong { font-weight: 600; color: var(--ink); }

/* Stat row */
.stat-row { display: flex; margin: 24px 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); }
.stat-item { flex: 1; padding: 28px 24px; background: var(--surface); }
.stat-item + .stat-item { border-left: 1px solid var(--border); }
.stat-num {
  font-size: clamp(28px, 4vw, var(--fs-3xl)); font-weight: 700;
  letter-spacing: -.04em; color: var(--ink); line-height: 1;
}
.stat-label { font-size: var(--fs-xs); color: var(--text3); margin-top: 6px; font-weight: 500; line-height: 1.4; }

/* Case study image */
.cs-img { margin: 32px 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); }
.cs-img img { width: 100%; }
.cs-img-cap { font-size: 12px; color: rgba(255,255,255,.78); padding: 10px 16px; background: var(--ink); line-height: 1.5; }

/* Image trio (phone screenshots) */
.img-trio { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin: 32px 0; }
.img-trio .cs-img { margin: 0; }
.img-trio .cs-img img { height: 240px; object-fit: cover; width: 100%; }

/* Pill row */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.pill {
  background: var(--surface2); color: var(--text2);
  font-size: var(--fs-xs); font-weight: 500; padding: 6px 14px; border-radius: 100px;
}

/* Citation box */
.cite-box {
  padding: 24px; background: var(--surface); border-radius: var(--r);
  border: 1px solid var(--border); margin-top: 24px;
}
.cite-box .cite-label {
  font-family: 'Space Grotesk', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text3); margin-bottom: 10px;
}
.cite-box p { font-size: var(--fs-sm); color: var(--text2); font-style: italic; line-height: 1.65; margin: 0; }

/* Experiment condition grid */
.condition-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin: 24px 0; }
.condition-card {
  border-radius: var(--r); padding: 22px;
  border: 1px solid var(--border); background: var(--surface);
}
.condition-card.highlight { background: var(--accent-bg); border-color: rgba(181,90,40,.22); }
.condition-card.highlight .condition-num { color: var(--accent); }
.condition-label {
  font-family: 'Space Grotesk', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text3); margin-bottom: 6px;
}
.condition-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-2xl); font-weight: 700;
  letter-spacing: -.04em; color: var(--ink); line-height: 1.1;
}
.condition-desc { font-size: var(--fs-sm); color: var(--text2); margin-top: 6px; line-height: 1.5; }

/* Video embed */
.video-wrap { margin: 32px 0; }
.video-label {
  font-family: 'Space Grotesk', sans-serif; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text3); margin-bottom: 12px;
}
.video-frame {
  border-radius: var(--r); overflow: hidden; background: #000;
  aspect-ratio: 16/9; border: 1px solid var(--border);
}
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: none; display: block; }

/* Project prev/next */
.cs-nav {
  display: flex; justify-content: space-between;
  padding-top: 40px; border-top: 1px solid var(--border);
  margin-top: 8px; flex-wrap: wrap; gap: 16px;
}
.cs-nav a { font-size: var(--fs-sm); color: var(--text2); font-weight: 500; transition: color .15s; }
.cs-nav a:hover { color: var(--ink); }

/* Mometo screenshot placeholder */
.screenshot-placeholder {
  background: var(--surface); border: 2px dashed var(--border);
  border-radius: var(--r); padding: 48px 24px; text-align: center;
  margin: 24px 0; color: var(--text3);
}
.screenshot-placeholder p { font-size: var(--fs-xs); margin: 0; }

/* Proxemics animation block */
.proxemics-block { position: relative; margin: 40px 0; }
.proxemics-img { border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); }
.proxemics-img img { width: 100%; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.proxemics-img:hover img { transform: scale(1.02); }

/* ---- CASE STUDY EDITORIAL TYPE ---- */
/* h3 subsections: large, regular weight — size does the work */
.cs-body h3 {
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.1;
  margin: 64px 0 6px;
}

/* Section italic subtitle / HMW — one unified style */
.cs-sub, .cs-sec-sub, .cs-hmw {
  font-family: 'IBM Plex Sans', sans-serif;
  font-style: italic;
  color: var(--text3);
  font-size: 20px;
  line-height: 1.55;
  margin: 0 0 28px;
}
/* Tight coupling when subtitle directly follows h2 (28px bottom margin → pull up) */
h2 + .cs-sub, h2 + .cs-sec-sub, h2 + .cs-hmw { margin-top: -20px; }
/* h3 already has only 14px bottom margin — just close the gap a little */
h3 + .cs-sub, h3 + .cs-sec-sub, h3 + .cs-hmw { margin-top: 2px; }

/* Small footnote / disclaimer */
.cs-note {
  font-family: 'IBM Plex Sans', sans-serif;
  font-style: italic;
  color: var(--text3);
  font-size: 14px;
  line-height: 1.55;
  margin: 24px 0 0;
}

/* Label replacing callout box — User Pain Point / UX Solution */
.cs-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-top: 32px;
  margin-bottom: 6px;
}

/* Case study main body: 18px — scoped to avoid affecting homepage */
.cs-sec > p:not(.cs-sub):not(.cs-sec-sub):not(.cs-hmw):not(.cs-label):not(.cs-note) {
  font-size: 18px;
  line-height: 1.75;
}

/* ---- CASE STUDY SIDE NAV ---- */
.cs-side-nav {
  display: none;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  left: calc((100vw - 1060px) / 2 - 160px);
  width: 140px;
  z-index: 20;
  /* reset global nav element styles */
  height: auto;
  background: transparent;
  border: none;
}
/* Wrapper for pages that need a PDF link below the nav */
.cs-side-block {
  display: none;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  left: calc((100vw - 1060px) / 2 - 180px);
  width: 168px;
  z-index: 20;
}
@media (min-width: 1400px) { .cs-side-block { display: block; } }
.cs-side-block .cs-side-nav {
  position: static;
  transform: none;
  display: block;
  top: auto; left: auto; width: auto; z-index: auto;
}
.cs-pdf-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  border-left: 2px solid var(--accent);
  padding: 7px 10px 7px 10px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em; line-height: 1.35;
  color: var(--accent);
  text-decoration: none;
  transition: color .2s, border-color .2s, opacity .2s;
}
.cs-pdf-btn:hover { opacity: .75; }
.cs-pdf-btn svg { flex-shrink: 0; }
.cs-side-nav ul { list-style: none; }
.cs-side-nav li {
  border-left: 2px solid var(--border);
  transition: border-color .2s;
}
.cs-side-nav li::before { display: none; } /* suppress global ul li::before em-dash */
.cs-side-nav li:has(a.active) { border-left-color: var(--accent); }
.cs-side-nav a {
  display: block;
  padding: 7px 0 7px 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px; font-weight: 500; line-height: 1.35;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text3); text-decoration: none;
  transition: color .2s;
}
.cs-side-nav a:hover { color: var(--text); }
.cs-side-nav a.active { color: var(--accent); font-weight: 700; }

@media (min-width: 1400px) { .cs-side-nav { display: block; } }

/* ---- RESPONSIVE ---- */

/* Tablet — 8 columns (768px–1023px) */
@media (max-width: 1023px) {
  :root {
    --cols:   8;
    --gutter: 20px;
    --margin: 32px;
  }
  .grid { grid-template-columns: repeat(8, 1fr); }
  .skills-grid { grid-template-columns: repeat(2,1fr); }
  .img-trio { grid-template-columns: 1fr; }
  .img-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

/* Mobile — 4 columns (<768px) */
@media (max-width: 767px) {
  :root {
    --cols:   4;
    --gutter: 16px;
    --margin: 16px;
    --nav:    58px;
  }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .research-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-inner { grid-template-columns: 1fr; gap: var(--sp-6); }
  .skills-grid { grid-template-columns: 1fr; }
  .insight-card { padding: 14px 16px; }
  .condition-grid { grid-template-columns: 1fr; }
  .img-trio { grid-template-columns: repeat(2,1fr); }
  .img-grid { grid-template-columns: repeat(2,1fr); }
  .nav-links { display: none; }
  .burger { display: flex; }
  .hero { padding: calc(var(--nav) + 52px) 0 var(--sp-8); }
  .cs-body { padding: var(--sp-6) var(--margin) var(--sp-9); }
  .meta-row { flex-wrap: wrap; gap: 2px; }
  .mline { display: none; }
  .mlabel { width: 100%; }
  .mval { max-width: 100%; }
  .stat-row { flex-direction: column; }
  .stat-item + .stat-item { border-left: none; border-top: 1px solid var(--border); }
  .footer-in { flex-direction: column; align-items: flex-start; }
  .card-content { padding: var(--sp-4) var(--sp-4) var(--sp-3); }
}

/* Small mobile (<480px) */
@media (max-width: 479px) {
  .img-trio { grid-template-columns: 1fr; }
  .img-grid { grid-template-columns: 1fr; }
}

/* ── Lightbox ── */
.zoom-trigger {
  position: relative;
  display: block;
  cursor: pointer;
  line-height: 0;
  font-size: 0;
}
.zoom-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  background: var(--ink);
  border-radius: 100px 100px 100px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
}
.zoom-trigger:hover .zoom-icon { opacity: 1; }
.zoom-icon svg { width: 15px; height: 15px; }

#lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lb-overlay.lb-active { display: flex; }
#lb-overlay.lb-white-bg #lb-img { background: #fff; padding: 24px; border-radius: 6px; }

#lb-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  cursor: default;
  border-radius: 3px;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
  display: block;
  transform-origin: center center;
  user-select: none;
}
#lb-overlay.lb-pan-zoom #lb-img {
  max-width: none;
  max-height: none;
  width: 90vw;
  cursor: grab;
}
#lb-reset {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.9);
  color: var(--ink);
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  z-index: 2001;
}
#lb-reset:hover { background: #fff; }

#lb-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 100px 100px 100px 0;
  border: none;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  z-index: 2001;
}
#lb-close:hover { background: rgba(255, 255, 255, .85); }
#lb-close svg { width: 20px; height: 20px; }
