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

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

:root {
  --bg: #f5f4f0;
  --surface: #eceae4;
  --border: #ccc9c0;
  --muted: #999690;
  --text: #1a1917;
  --primary: #0055A4;

  /* fluid horizontal padding — 32px at narrow, grows to 8vw, caps at 160px */
  --pad-x: clamp(16px, 3vw, 40px);

  /* fluid grid gap — tight at narrow, breathes at wide */
  --gap:   clamp(10px, 1.5vw, 24px);

  /* section rhythm */
  --section-gap: clamp(40px, 6vw, 96px);

  /* nav height stays fixed — avoids layout jank on scroll */
  --nav-h: 56px;

  /* ── fluid type scale ──────────────────────────────────────────
     formula: clamp(min, calc(base + slope * 1vw), max)
     min/max chosen so text grows smoothly 320px → 1920px
  ────────────────────────────────────────────────────────────── */
  --fs-2xs: clamp(10px, calc(9.5px  + 0.15vw), 12px);  /* tiny badge labels   */
  --fs-xs:  clamp(11px, calc(10px   + 0.2vw),  14px);  /* meta, dates         */
  --fs-sm:  clamp(12px, calc(11px   + 0.3vw),  15px);  /* captions, secondary */
  --fs-base:clamp(15px, calc(12px   + 0.45vw), 18px);  /* body                */
  --fs-md:  clamp(16px, calc(12.5px + 0.55vw), 20px);  /* slightly lifted     */
  --fs-lg:  clamp(18px, calc(13px   + 0.7vw),  24px);  /* post titles         */
  --fs-xl:  clamp(22px, calc(14px   + 1.1vw),  38px);  /* product / section h */
  --fs-2xl: clamp(30px, calc(16px   + 2vw),    66px);  /* hero / about name   */

  /* large pull-quote/callout text between case-study photos —
     modeled on Pentagram's project pages: 24px on mobile, 32px on desktop */
  --fs-callout: clamp(24px, calc(19px + 1.1vw), 32px);
}

/* ── COPY STYLE ── */
.copy-md {
  font-weight: 600;
  line-height: 1.5; /* 33px at 22px font size */
}

body {
  font-family: 'Lexend', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--fs-base);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

a {
  color: var(--primary);
  text-decoration: none;
  background-image: linear-gradient(var(--primary), var(--primary));
  background-size: 0% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  /* extends the inline box so the underline can sit a few pixels below the text */
  padding-bottom: 3px;
  transition: background-size 0.35s ease;
}

a:hover,
a:focus-visible {
  background-size: 100% 2px;
}

/* Wrapper / structural links — card/row-like links whose text should
   keep its natural color instead of turning primary-blue, and skip the
   animated underline entirely (it doesn't read well on a whole block). */
.btn,
.footer-btn,
.logo,
.card,
.home-photo,
.home-illo,
.post-item,
.cs-nav a {
  color: inherit;
  background-image: none;
  padding-bottom: 0;
}

/* Images stay proportional by default — opt out per-case if needed */
img { max-width: 100%; height: auto; }

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  transition: transform 0.3s ease;
}

nav.nav--hidden {
  transform: translateY(-100%);
}

nav .logo {
  font-weight: 700;
  font-size: var(--fs-md);
  letter-spacing: -0.02em;
}

nav ul {
  list-style: none;
  display: flex;
  gap: clamp(16px, 2.5vw, 36px);
}

nav ul a {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
}

nav ul a:hover {
  color: var(--primary);
}

body > nav ul a.active {
  color: var(--primary);
}

/* Transparent nav for case study pages — overlays full-screen hero */
.case-study nav {
  background: transparent;
  border-bottom-color: transparent;
  transition: transform 0.3s ease, background 0.25s ease, border-color 0.25s ease;
}

.case-study nav .logo,
.case-study nav ul a {
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.25s ease;
}

/* Solid nav once content is in view */
.case-study nav.nav--solid {
  background: var(--bg);
  border-bottom-color: var(--border);
}

.case-study nav.nav--solid .logo,
.case-study nav.nav--solid ul a {
  color: var(--muted);
}

/* ── LAYOUT ── */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

main {
  /* no max-width — full bleed, padding does the breathing */
  flex: 1 0 auto;
  padding: clamp(32px, 5vw, 72px) var(--pad-x) clamp(64px, 8vw, 128px);
  /* backwards (not both/forwards): the "to" keyframe is identical to the
     resting state, so nothing looks different once the animation ends —
     but "forwards" would leave a permanent non-none `transform` on this
     element, which makes it a new containing block for any position:fixed
     descendant (the lightbox), breaking its viewport-relative centering. */
  animation: slideInUp 0.5s ease backwards;
}

.page-title {
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(20px, 3vw, 40px);
}

/* ── SECTION ── */
section { margin-bottom: var(--section-gap); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: clamp(14px, 2vw, 24px);
}

.section-header h2 {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-header a {
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ── PLACEHOLDER BOX ── */
/* ── ASPECT RATIO UTILITIES ── */
.ar-sq   { aspect-ratio: 1; }
.ar-wide { aspect-ratio: 16 / 9; }
.ar-film { aspect-ratio: 16 / 7; }
.ar-4-3  { aspect-ratio: 4 / 3; }
.ar-3-4  { aspect-ratio: 3 / 4; }
.ar-2-1  { aspect-ratio: 2 / 1; }

.ph {
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: var(--fs-2xs);
  letter-spacing: 0.06em;
}

/* ── GRIDS ── */
.company-header {
  max-width: 640px;
  margin-bottom: clamp(32px, 5vw, 64px);
}

.company-logo {
  width: 96px;
  height: auto;
  border-radius: 8px;
  margin-bottom: 20px;
  display: block;
}

.company-header h1 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.company-header p {
  font-size: var(--fs-md);
  color: var(--muted);
}

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }

/* collapse grids gracefully — no breakpoint jumps, just floor at 2 cols */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.8vw, 12px);
  transition: transform 0.3s ease, opacity 0.5s ease, translate 0.6s ease;
}

#work-grid .card {
  opacity: 0;
  translate: 0 48px;
}

#work-grid .card.card--in {
  opacity: 1;
  translate: 0 0;
}

a.card:hover {
  transform: translateY(-8px);
  text-decoration: none;
}

.card .thumb      { aspect-ratio: 1;   overflow: hidden; }
.card .thumb-wide { aspect-ratio: 4/3; overflow: hidden; }
.card .thumb-tall { aspect-ratio: 3/4; overflow: hidden; }

.card .thumb img,
.card .thumb-wide img,
.card .thumb-tall img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-label { font-size: var(--fs-sm); }
.card-label .title { font-weight: 500; }
.card-label .sub { color: var(--muted); }

/* ── HERO ── */
.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  /* height scales with viewport — 40vw feels proportional on any screen */
  height: clamp(260px, 40vw, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--section-gap);
  color: var(--muted);
  font-size: var(--fs-2xs);
  letter-spacing: 0.06em;
}

/* ── SHOP ITEM PAGE ── */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

@media (max-width: 700px) {
  .product-layout { grid-template-columns: 1fr; }
}

.product-image { aspect-ratio: 1; }

.product-info { display: flex; flex-direction: column; gap: clamp(12px, 1.5vw, 20px); }

.product-info h1 { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.02em; }
.product-info .price { font-size: var(--fs-lg); color: var(--muted); }
.product-info .desc { font-size: var(--fs-base); line-height: 1.7; color: #555; }

.btn {
  display: inline-block;
  padding: clamp(10px, 1.2vw, 14px) clamp(18px, 2.5vw, 32px);
  background: var(--text);
  color: var(--bg);
  font-size: var(--fs-sm);
  font-weight: 600;
  border: 1.5px solid transparent;
  border-radius: 99px;
  cursor: pointer;
  width: fit-content;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn:hover,
.btn:focus {
  background: #2559F6;
  color: #fff;
  transform: scale(1.04);
  text-decoration: none;
}

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

.btn-outline:hover {
  background: transparent;
  color: #2559F6;
  border-color: #2559F6;
  text-decoration: none;
}

/* ── BLOG LAYOUT ── */
.blog-layout {
  display: grid;
  grid-template-columns: clamp(160px, 14vw, 220px) 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

@media (max-width: 640px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; }
}

.blog-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.blog-sidebar nav {
  position: static;
  height: auto;
  background: none;
  border: none;
  display: block;
  padding: 0;
}

.blog-sidebar ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.blog-sidebar ul a {
  display: block;
  font-size: var(--fs-sm);
  padding: 4px 8px;
  border-radius: 3px;
  color: var(--text);
}

.blog-sidebar ul a:hover,
.blog-sidebar ul a.active {
  background: var(--surface);
  text-decoration: none;
}

/* ── HOME PHOTO STRIP ── */
.home-photo,
.home-illo {
  display: block;
  overflow: hidden;
}

.home-photo { aspect-ratio: 4/3; }
.home-illo  { aspect-ratio: 1; }

.home-photo img,
.home-illo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.home-photo:hover img,
.home-illo:hover img {
  transform: scale(1.04);
}

/* ── SNIPPETS / NOTES ── */
.snippet-feed-home {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.snippet-home {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  align-items: baseline;
}

.snippet-home-date {
  font-size: var(--fs-xs);
  color: var(--muted);
  white-space: nowrap;
  padding-top: 1px;
}

a.snippet-home p {
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
}

/* ── PHOTO GRID ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

.photo-thumb {
  aspect-ratio: 1;
  display: block;
  overflow: hidden;
  background-image: none;
  padding-bottom: 0;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.photo-thumb:hover img {
  transform: scale(1.04);
}

@media (max-width: 900px) {
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 500px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── POST LIST ── */
.post-list { display: flex; flex-direction: column; gap: 0; }

.post-item {
  display: grid;
  grid-template-columns: clamp(60px, 6vw, 100px) 1fr;
  gap: clamp(14px, 2vw, 28px);
  padding: clamp(14px, 2vw, 24px) 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.post-item:first-child { border-top: 1px solid var(--border); }

.post-thumb { aspect-ratio: 1; overflow: hidden; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-meta { display: flex; flex-direction: column; gap: 4px; }
.post-meta .post-title   { font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.01em; }
.post-meta .post-date    { font-size: var(--fs-xs); color: var(--muted); }
.post-meta .post-excerpt { font-size: var(--fs-sm); color: #666; margin-top: 4px; }

/* ── ABOUT ── */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

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

.about-photo { display: block; }

.about-text h1  { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.03em; margin-bottom: clamp(14px, 2vw, 24px); }
.about-text p   { font-size: 22px; color: #444; margin-bottom: clamp(10px, 1.2vw, 18px); }

.about-section { margin-top: clamp(32px, 4vw, 56px); }

.about-section .label {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(10px, 1.2vw, 16px);
}

.about-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.about-section li {
  font-size: 18px;
  color: #444;
  padding: 6px 0;
  line-height: 1.5;
}

.about-clients {
  display: flex;
  flex-wrap: wrap;
  font-size: 18px;
  color: #444;
  line-height: 1.5;
}

.about-clients .name + .name::before {
  content: '·';
  color: var(--muted);
  margin: 0 12px;
}

.company-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 3vw, 32px);
}

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

.company-card-logo {
  width: 56px;
  height: auto;
  border-radius: 6px;
  margin-bottom: 12px;
  display: block;
}

.company-card-name {
  font-weight: 700;
  margin-bottom: 6px;
}

.company-card p {
  font-size: 16px;
  color: #444;
  line-height: 1.5;
  margin-bottom: 10px;
}

.company-card a {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.about-availability {
  margin-top: clamp(24px, 3vw, 40px);
  font-size: 18px;
  color: var(--muted);
  font-style: italic;
}

.about-ctas {
  margin-top: clamp(24px, 3vw, 40px);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── CASE STUDY PAGE ─────────────────────────────────────────────
   main becomes a 3-column grid: [pad-x] [content] [pad-x]
   Text sections sit in column 2. Images span all 3 = true full-bleed.
   No cascade fights, no negative margins — grid placement handles it.
────────────────────────────────────────────────────────────────── */
.case-study main {
  padding: 0;
  display: block;
  margin-top: calc(-1 * var(--nav-h));
}

/* ── FULLSCREEN STICKY HERO ── */
.cs-hero-full {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  z-index: 0;
}

.cs-hero-full img,
.cs-hero-full video {
  width: 100%;
  height: 130%; /* extra height for parallax travel */
  object-fit: cover;
  object-position: center top;
  will-change: transform;
}

/* Salesforce Events is the only case study using a <video> hero (everyone
   else uses <img>) — its logo lockup sits low in the source footage.
   object-position can't fix this: the video is 16:9 inside a box far
   taller than it is wide, so object-fit:cover scales to match height with
   zero vertical crop room left over — the vertical clipping actually
   happens at the parent's overflow:hidden edge, cutting off the bottom of
   the oversized (height:130%) video element. Shift the element itself up
   by half the 30% overflow via `top` (not `transform` — project.js's
   scroll handler overwrites .style.transform wholesale, so anything set
   there would vanish on the first scroll event). `top`'s percentage
   resolves against .cs-hero-full's height since that's the nearest
   positioned ancestor (position: sticky). Safe to scope to <video> only
   since no other hero uses one. */
.cs-hero-full video {
  position: relative;
  top: -15%;
}

.cs-hero-full .ph {
  width: 100%;
  height: 100%;
}

/* gradient at bottom of hero for text legibility */
.cs-hero-full::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 220px;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
  pointer-events: none;
}

/* ── CONTENT BODY — scrolls over the sticky hero ── */
.cs-body {
  position: relative;
  z-index: 1;
  background: transparent;
}

/* Client/year overlay on hero — visible on load, covered as content scrolls over */
.cs-hero-intro {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 var(--pad-x) 36px;
  pointer-events: none;
  z-index: 2;
}

.cs-hero-client,
.cs-hero-year {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

/* Actual content with background — slides over hero.
   No padding-bottom: cs-nav is always the last element here, and it should
   run flush into the footer (whose own border-top then reads as the closing
   rule for this block, instead of leaving a boxed-in gap). */
.cs-content-wrap {
  background: var(--bg);
  display: grid;
  grid-template-columns: var(--pad-x) 1fr var(--pad-x);
}

/* text sections — sit in the padded middle column */
.cs-header,
.cs-text,
.cs-details {
  grid-column: 2;
}

/* all other image blocks — sit in the middle column, margins match text */
.cs-full,
.cs-2up,
.cs-gap,
.cs-callout {
  grid-column: 2;
}

/* nav spans full width; internal padding aligns content with the grid */
.cs-nav {
  grid-column: 1 / -1;
}

/* project header — matches the photo/text blocks' max-width/centering so edges line up.
   width:100% is required alongside margin:auto — otherwise this grid item shrinks
   to fit its (narrow) content instead of filling the column. */
.cs-header {
  padding: clamp(32px, 4vw, 64px) 0 clamp(24px, 3vw, 48px);
  border-bottom: 1px solid var(--border);
  width: 100%;
  max-width: 1728px;
  margin: 0 auto;
}

.cs-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: clamp(12px, 1.5vw, 20px);
}

.cs-tag {
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cs-tag + .cs-tag::before {
  content: '·';
  margin-right: 8px;
}

.cs-header h1 {
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 14ch;
  margin-bottom: clamp(10px, 1.2vw, 18px);
}

.cs-meta {
  font-size: var(--fs-sm);
  color: var(--muted);
  display: flex;
  gap: 20px;
}

/* text column — matches the photo blocks' max-width/centering so edges line up.
   width:100% guards against short paragraphs shrink-wrapping instead of filling
   the column (see .cs-header). */
.cs-text {
  padding: clamp(40px, 5vw, 80px) 0;
  width: 100%;
  max-width: 1728px;
  margin: 0 auto;
}

.cs-text .label {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(10px, 1.2vw, 16px);
}

.cs-text p {
  font-size: var(--fs-md);
  line-height: 1.75;
  color: #333;
  margin-bottom: 1em;
}

.cs-text p:last-child { margin-bottom: 0; }

/* callout — large pull-statement between photos, modeled on Pentagram's
   case-study pages. Sits in the same 1728px column as everything else;
   the text itself runs 50% width, right-aligned, on wide screens and
   widens to 100% on narrow ones. */
.cs-callout {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  max-width: 1728px;
  margin: var(--gap) auto;
  padding: clamp(24px, 3vw, 48px) 0;
}

.cs-callout p {
  width: 50%;
  font-size: var(--fs-callout);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

@media (max-width: 640px) {
  .cs-callout p { width: 100%; }
}

/* full-bleed single image */
.cs-full {
  margin: var(--gap) auto;
  max-width: 1728px;
  width: 100%;
}

.cs-full > figure {
  width: 100%;
  display: block;
  margin: 0;
}

.cs-full .ph,
.cs-full > img,
.cs-full > video,
.cs-full > figure img {
  width: 100%;
  height: auto;
  display: block;
}

/* gap between stacked image blocks — same rhythm as grid gutter */
.cs-gap {
  height: var(--gap);
  background: var(--bg);
}

/* 2-up — always 50/50, gap matches site grid gutter */
.cs-2up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin: var(--gap) auto;
  max-width: 1728px;
  width: 100%;
  align-items: start;
}

/* images keep their natural aspect — no cropping */
.cs-2up .ph,
.cs-2up > img,
.cs-2up > video,
.cs-2up > figure img {
  width: 100%;
  height: auto;
  display: block;
}

.cs-2up > figure { margin: 0; }

/* shared caption style */
.cs-full figcaption,
.cs-2up figcaption,
.post-body figcaption {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}

/* ── BLOG POST DETAIL ── */
.post-detail {
  max-width: 700px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--pad-x) clamp(64px, 8vw, 128px);
}

.post-detail-back {
  font-size: var(--fs-xs);
  color: var(--muted);
  display: inline-block;
  margin-bottom: clamp(24px, 3vw, 40px);
}

.post-detail header h1 {
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: clamp(10px, 1.2vw, 16px) 0 8px;
}

.post-detail-date {
  font-size: var(--fs-sm);
  color: var(--muted);
}

.post-body {
  margin-top: clamp(32px, 4vw, 56px);
}

.post-body p {
  font-size: var(--fs-md);
  line-height: 1.75;
  color: #333;
  margin-bottom: 1em;
}

.post-body .intro {
  font-size: var(--fs-lg);
  font-weight: 500;
  color: var(--text);
}

.post-body figure {
  margin: clamp(24px, 3vw, 40px) 0;
}

.post-body figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* detail strip — swatches, type specimens */
.cs-details {
  padding: clamp(32px, 4vw, 64px) 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(120px, 14vw, 200px), 1fr));
  gap: clamp(16px, 2vw, 32px);
  border-top: 1px solid var(--border);
}

.cs-swatch {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-swatch-color {
  aspect-ratio: 2/1;
  border: 1px solid var(--border);
}

.cs-swatch span {
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* project navigation — prev / next */
.cs-nav {
  /* reset sticky nav styles that would otherwise bleed in */
  position: static;
  height: auto;
  background: none;
  border-bottom: none;
  padding: 0;

  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  margin-top: clamp(64px, 8vw, 128px);
}

.cs-nav a {
  padding: clamp(64px, 9vw, 140px) var(--pad-x);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.15s;
}

/* hover background/border stay full-bleed; only the outer-edge inset grows to
   match the 1728px content column on wide screens. Each link is exactly half
   of .cs-nav's width, so 100% here means half — subtract 864px (half of 1728)
   to land on the same inset the column uses. */
.cs-nav a:first-child {
  padding-left: max(var(--pad-x), calc(100% - 864px));
}

.cs-nav a:last-child {
  padding-right: max(var(--pad-x), calc(100% - 864px));
}

.cs-nav a:hover {
  background: var(--surface);
  text-decoration: none;
}

.cs-nav a + a {
  border-left: 1px solid var(--border);
  align-items: flex-end;
  text-align: right;
}

.cs-nav .nav-dir {
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.cs-nav .nav-title {
  font-size: var(--fs-base);
  font-weight: 500;
}

@media (max-width: 640px) {
  .case-study main { grid-template-columns: 20px 1fr 20px; }
  .cs-2up { grid-template-columns: 1fr; }
}

/* ── LIGHTBOX ── */
.lb-img[hidden],
.lb-placeholder[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.lb-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-media img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.lb-placeholder {
  width: clamp(260px, 70vw, 900px);
  aspect-ratio: 3/2;
  background: #2a2a2a;
  border: 1px solid #444;
  color: #555;
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.lb-close:hover { opacity: 1; }

.lb-prev,
.lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 80px;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  transition: opacity 0.15s;
}

.lb-prev:hover,
.lb-next:hover { opacity: 1; }

.lb-prev { left: 8px; }
.lb-next { right: 8px; }

.lb-counter {
  position: fixed;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.lb-caption {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--fs-xs);
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* ── LAZY REVEAL ── */
[data-lazy] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

[data-lazy].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── PORTFOLIO TITLE ── */
.work-header {
  position: relative;
  z-index: 1;
  will-change: transform;
  padding-top: clamp(24px, 4vw, 48px);
}

.work-title {
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: clamp(24px, 4vw, 48px);
}

/* Reuses .work-title's text styling for the "Sidequests" section headline
   on blog/interests pages, deliberately WITHOUT .work-header's will-change:
   transform — that would make this a new containing block for any
   position:fixed descendant (the lightbox on Sketchbook/Photography),
   breaking its viewport-centering the same way main's lingering animation
   transform did (see the "main" rule near the top of this file). */
.sidequests-header {
  padding-top: clamp(24px, 4vw, 48px);
}

/* Real link now (back to All Posts), but keeps its plain muted look —
   opts out of the sitewide link color/underline treatment entirely,
   on hover included. */
.sidequests-crumb {
  color: var(--muted);
  background-image: none;
  padding-bottom: 0;
}

.sidequests-crumb:hover {
  color: var(--muted);
}

/* On All Posts there's no second title to contrast against, so this is
   the whole headline — keep it full-black like every other page's
   category name instead of the muted breadcrumb-prefix treatment. */
.sidequests-crumb--solo,
.sidequests-crumb--solo:hover {
  color: inherit;
}

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: clamp(20px, 3vw, 40px);
  flex-wrap: wrap;
}

.work-see-more {
  text-align: center;
  margin-top: clamp(32px, 4vw, 56px);
}

#work-grid {
  position: relative;
  z-index: 2;
  background: var(--bg);
}

.filter-btn {
  font-size: var(--fs-sm);
  font-family: inherit;
  padding: 6px 16px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.filter-btn.active,
.filter-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ── SERVICES ── */
.svc-intro {
  max-width: 700px;
  margin-bottom: var(--section-gap);
}

.svc-headline {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: clamp(10px, 1.5vw, 20px) 0 clamp(14px, 2vw, 24px);
}

.svc-sub {
  font-size: var(--fs-md);
  color: #555;
  line-height: 1.7;
}

.svc-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: clamp(32px, 5vw, 80px);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--section-gap);
}

.svc-item {
  border-top: 1px solid var(--border);
  padding: clamp(24px, 4vw, 56px) 0;
}

@media (max-width: 700px) {
  .svc-list { grid-template-columns: 1fr; }
  .svc-item:last-child { border-bottom: 1px solid var(--border); }
}

.svc-item-inner {
  display: grid;
  grid-template-columns: clamp(80px, 10vw, 160px) 1fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}

@media (max-width: 600px) {
  .svc-item-inner { grid-template-columns: 1fr; }
}

.svc-ph {
  aspect-ratio: 1;
}

.svc-body h2 {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: clamp(10px, 1.2vw, 16px);
}

.svc-body p {
  font-size: var(--fs-base);
  line-height: 1.75;
  color: #444;
  margin-bottom: clamp(12px, 1.5vw, 20px);
  max-width: 560px;
}

.svc-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.svc-tags li {
  font-size: var(--fs-xs);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
}

/* Process section */
.svc-process {
  margin-bottom: var(--section-gap);
}

.svc-process-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: clamp(8px, 1vw, 14px);
}

.svc-process-sub {
  font-size: var(--fs-base);
  color: #555;
  margin-bottom: clamp(24px, 4vw, 48px);
}

.svc-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

@media (max-width: 800px) {
  .svc-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .svc-steps { grid-template-columns: 1fr; }
}

.svc-step {
  border-top: 2px solid var(--text);
  padding-top: clamp(14px, 2vw, 24px);
}

.svc-step-num {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: clamp(10px, 1.2vw, 16px);
}

.svc-step-body h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  margin-bottom: 8px;
}

.svc-step-body p {
  font-size: var(--fs-sm);
  color: #555;
  line-height: 1.7;
}

/* CTA / contact form */
.svc-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: clamp(32px, 5vw, 72px) clamp(24px, 5vw, 72px);
}

.svc-cta-inner {
  max-width: 640px;
}

.svc-cta h2 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: clamp(8px, 1vw, 14px);
}

.svc-cta > .svc-cta-inner > p {
  font-size: var(--fs-base);
  color: #555;
  margin-bottom: clamp(24px, 3vw, 40px);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vw, 22px);
}

.form-row {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
}

.form-row-2 {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 520px) {
  .form-row-2 { grid-template-columns: 1fr; }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  font-family: inherit;
  font-size: var(--fs-base);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: clamp(8px, 1vw, 12px) clamp(10px, 1.2vw, 14px);
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
  appearance: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--text);
}

.form-field textarea {
  resize: vertical;
  line-height: 1.6;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  margin-top: clamp(24px, 3vw, 48px);
}

/* On case-study pages, cs-nav should run flush into the footer — its
   border-top becomes the closing rule for the prev/next block. */
.case-study footer {
  margin-top: 0;
}

.footer-directory {
  padding: clamp(40px, 6vw, 80px) var(--pad-x);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: clamp(48px, 8vw, 120px);
  flex-wrap: wrap;
}

.footer-about {
  max-width: 360px;
}

.footer-about h2 {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.footer-about p {
  font-size: var(--fs-base);
  color: var(--muted);
  margin-bottom: 20px;
}

.footer-cols {
  display: flex;
  gap: clamp(32px, 5vw, 64px);
  flex-wrap: wrap;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 120px;
}

.footer-col a {
  color: inherit;
  background-image: none;
  padding-bottom: 0;
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-now {
  color: var(--primary);
}

.footer-bar {
  padding: clamp(14px, 2vw, 24px) var(--pad-x);
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ── TUMBLING LETTERS ── */
.nameplate-wrap {
  padding: clamp(40px, 7vw, 100px) 0;
  text-align: center;
  overflow: hidden;
  position: relative;
  z-index: 1;
  will-change: transform;
}

.home-content {
  position: relative;
  z-index: 2;
  background: var(--bg);
}

.nameplate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.5vw, 16px);
}

.tumble-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.tumble-letter {
  display: inline-block;
  font-family: 'Passion One', sans-serif;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  transform-origin: center bottom;
}

/* Responsive font size — overrides JS inline style */
#name-line {
  max-width: 100vw;
  padding: 0 24px;
}

#name-line .tumble-letter {
  font-size: clamp(40px, 12vw, 120px) !important;
}

#subtitle-line .tumble-letter {
  font-size: clamp(14px, 3vw, 42px) !important;
}

/* Tablet — bump up subtitle */
@media (min-width: 600px) and (max-width: 1024px) {
  #subtitle-line .tumble-letter {
    font-size: clamp(20px, 4.5vw, 40px) !important;
  }
}

/* Mobile — scale down subtitle (split into two rows) */
@media (max-width: 599px) {
  #subtitle-line .tumble-letter {
    font-size: clamp(14px, 5.5vw, 22px) !important;
  }
}

@keyframes rock-right {
  0%, 100% { transform: rotate(var(--rot-a)); }
  50%       { transform: rotate(var(--rot-b)); }
}

@keyframes rock-left {
  0%, 100% { transform: rotate(var(--rot-b)); }
  50%       { transform: rotate(var(--rot-a)); }
}
