/* =============================================================
   SHARED.CSS — styles for every page.
   Fonts, colors, and spacing are at the top (DESIGN TOKENS).
   Change them there and the whole site updates.
   ============================================================= */

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Color */
  --color-bg: #faf9f7;
  --color-ink: #1c1c1c;
  --color-panel: #ececea;          /* work card text panel */
  --color-logo-bar: #e8e8e7;
  --color-deep: #3b3957;           /* dark purple band */
  --color-footer: #1c1c1c;
  --color-on-dark: #ffffff;
  --color-accent: #5a35d6;         /* tags, links, quotes */
  --color-accent-soft: #8b7be8;    /* outlined buttons, accent on dark */
  --color-headshot-circle: #f3e6b8; /* yellow circle behind the Home headshot */
  --photo-circle: 340px;            /* diameter of the circular photos in the Home purple band and on About (desktop) */
  --color-highlight: #8b7be8;      /* light purple accent on dark backgrounds (case study role eyebrow) */
  --color-focus: #7a5f08;          /* deep mustard: project 'Focus' labels on Home cards */
  --color-caption: #5c5c5a;
  --hero-overlay: rgba(0, 0, 0, 0.80);   /* darkness over case study top photo */

  /* Type */
  --font-display: Georgia, 'Times New Roman', serif;                /* titles */
  --font-body: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;   /* reading */
  --font-label: 'Poppins', 'Avenir Next', 'Century Gothic', sans-serif;          /* name, nav, labels, buttons */

  --step--1: 0.8125rem;   /* small labels */
  --step-0: 1rem;         /* body small */
  --step-1: 1.0625rem;    /* body large (17px) */
  --step-2: 1.3125rem;    /* card titles, statements (21px) */
  --step-3: 2rem;         /* section titles */
  --step-4: clamp(2.25rem, 1.4rem + 3vw, 3.5rem);   /* hero */

  /* Space + layout */
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: clamp(3rem, 2rem + 4vw, 6rem);
  --space-2xl: clamp(4rem, 2.5rem + 6vw, 9rem);
  --page-max: 1200px;      /* outer edge: header, section titles, images, cards */
  --inner-max: 60rem;       /* inner edge: centered groups of text columns (quotes, footer, How I lead…) */
  --measure: 34em;          /* max line length for running text (~65 characters) */
  --measure-narrow: 26em;   /* short blurbs: cards, footer */
  --gutter: clamp(1.25rem, 0.5rem + 3vw, 3rem);
}

/* ---------- BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  padding-top: env(safe-area-inset-top, 0px);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
/* Circular photos are smaller on phones, all the same size */
@media (max-width: 760px) { :root { --photo-circle: 240px; } }
/* Line breaks that apply on desktop only */
@media (max-width: 560px) { br.desktop-only { display: none; } }
h1, h2, h3, p, blockquote, figure { margin: 0; }
/* Rebalances the last lines of paragraphs so a single word doesn't sit alone (Chrome, Edge, Safari) */
p, li, blockquote { text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--color-accent-soft); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.button {
  font-family: var(--font-label);
  font-weight: 500;
  display: inline-block;
  padding: 0.7em 1.1em;
  border: 3px solid var(--color-accent-soft);
  color: var(--color-accent-soft);
  font-size: var(--step-0);
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.button:hover { background: var(--color-accent-soft); color: var(--color-on-dark); }

.text-link {
  font-family: var(--font-label);
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* ---------- LABELS (small uppercase, Poppins) ----------
   Used for hero tags, case study tags, card metadata, table headers. */
.label, .cs-tags, .card .meta, .card .card-category {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ---------- HEADER ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding-block: var(--space-m);
}
.site-name {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.site-header ul {
  display: flex;
  gap: clamp(1rem, 3vw, 3.5rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-header nav a {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-decoration: none;
  padding-bottom: 0.3em;
  border-bottom: 2px solid transparent;
}
.site-header nav a:hover,
.site-header nav a[aria-current='page'] { border-bottom-color: currentColor; }

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--color-footer);
  color: var(--color-on-dark);
  padding-block: var(--space-xl) calc(var(--space-l) + env(safe-area-inset-bottom, 0px));
}
.footer-cta {
  max-width: var(--inner-max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: var(--space-xl) var(--space-l);
  margin-bottom: var(--space-xl);
}
.footer-cta h2 { font-size: 1.1875rem; font-weight: 700; margin-bottom: var(--space-xs); }
.footer-cta p { font-size: var(--step-0); line-height: 1.6; max-width: var(--measure-narrow); margin-bottom: var(--space-m); }
/* Footer bottom row (same on every page): email starts on the content edge,
   the JB mark sits centered in the left margin, copyright ends on the right content edge. */
.footer-base {
  --edge: max(var(--gutter), calc((100% - var(--page-max)) / 2 + var(--gutter)));
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-m);
  padding-inline: var(--edge);
  min-height: 64px;
}
.footer-mark {
  position: absolute;
  left: calc(var(--edge) / 2);
  top: 50%;
  translate: -50% -50%;
  width: 64px;
  height: 64px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: var(--step--1);   /* same size as the copyright */
  gap: var(--space-s) var(--space-m);
}
.footer-divider { color: #6e6e6b; }
.footer-copyright { margin-left: auto; font-size: var(--step--1); color: #a3a3a0; }
/* Below ~1260px the side margin is narrower than the mark, so it sits in line before the email */
@media (max-width: 1260px) {
  .footer-mark { position: static; translate: none; }
}
/* Phones: stack */
@media (max-width: 560px) {
  .footer-base { flex-direction: column; align-items: flex-start; gap: var(--space-s); padding-inline: var(--gutter); }
  .footer-mark { margin-bottom: var(--space-s); }   /* a little more room between the mark and the links */
  .footer-copyright { margin-left: 0; }
  .footer-cta { row-gap: 4.5rem; margin-bottom: 4.5rem; }   /* more room below each button */
}
.monogram { width: 48px; height: 48px; border-radius: 50%; }
.footer-links a { color: #a3a3a0; text-decoration: none; }   /* light/medium gray */
.footer-links a:hover { color: var(--color-on-dark); }

/* Single call-to-action line (case studies) */
.footer-cta-single {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-m) var(--space-l);
  margin-bottom: var(--space-xl);
}
.footer-cta-single h2 { font-size: var(--step-2); font-weight: 700; font-style: italic; }

/* ---------- LOGO BAR (scrolls left on a loop) ---------- */
.logo-bar {
  background: var(--color-logo-bar);
  overflow: hidden;
  padding-block: var(--space-m);
}
.logo-track {
  display: flex;
  width: max-content;
  animation: logo-scroll 45s linear infinite;
}
.logo-bar:hover .logo-track { animation-play-state: paused; }
.logo-set {
  display: flex;
  align-items: center;
  gap: clamp(3.5rem, 7vw, 6.5rem);
  padding: 0 clamp(1.75rem, 3.5vw, 3.25rem);
  margin: 0;
  list-style: none;
}
.logo-set img { height: var(--h, 32px); width: auto; translate: 0 var(--y, 0); }   /* --y: optical centering nudge */
.logo-set li { display: flex; align-items: center; height: 40px; }
@keyframes logo-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .logo-track { animation: none; width: auto; }
  .logo-set { flex-wrap: wrap; justify-content: center; row-gap: var(--space-m); }
  .logo-set[aria-hidden='true'] { display: none; }
}

/* ---------- SECTION TITLE (serif with rule) ---------- */
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-3);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--color-ink);
  margin-bottom: var(--space-m);
}

/* ---------- WORK CARDS ---------- */
.cards { display: grid; gap: var(--space-l); }
.card {
  position: relative;
  display: grid;
  grid-template-columns: 5fr 3fr;   /* image : text panel — same panel width on every card */
  background: var(--color-panel);
}
.card.image-right { grid-template-columns: 3fr 5fr; }
.card.image-right .card-media { order: 2; }
/* Fixed image shape so every card is the same height; if a card's text runs taller,
   the image stretches to fill the full height instead of leaving a gap */
.card-media img { width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-text {
  align-self: center;
  /* extra space below lifts the text slightly above true center (optical centering) */
  padding: var(--space-l) clamp(1.25rem, 3vw, 2.25rem) calc(var(--space-l) + 3.5rem);
}
.card h3 { font-size: var(--step-2); font-weight: 600; line-height: 1.25; margin-bottom: var(--space-s); }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ''; position: absolute; inset: 0; }   /* whole card clickable */
.card:hover h3 a { text-decoration: underline; text-underline-offset: 0.2em; }
.card h3 a:focus-visible { outline: none; }
.card:has(a:focus-visible) { outline: 3px solid var(--color-accent-soft); outline-offset: 4px; }
.card p { font-size: var(--step-0); line-height: 1.55; max-width: var(--measure-narrow); }
.card .card-category { color: var(--color-focus); margin-bottom: var(--space-xs); }
.card .meta { margin-top: var(--space-l); color: var(--color-accent); }
/* "View case study →" cue; the whole card is the link, so this is styling only */
.card .card-cta {
  margin-top: var(--space-m);
  font-family: var(--font-label);
  font-weight: 500;
  font-size: var(--step-0);
  color: var(--color-accent);
}
.card:hover .card-cta { text-decoration: underline; text-underline-offset: 0.2em; }

@media (max-width: 760px) {
  .card-text { padding-block: var(--space-l); }   /* even top/bottom on phones */
  .card, .card.image-right { grid-template-columns: 1fr; }
  .card.image-right .card-media { order: 0; }
}
/* Menu button: hidden on desktop, a two-line icon on phones and small tablets */
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .site-header { position: relative; z-index: 5; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    padding: 10px;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; width: 100%; background: currentColor; transition: transform 0.2s; }
  .nav-open .nav-toggle span:first-child { transform: translateY(4.5px) rotate(45deg); }
  .nav-open .nav-toggle span:last-child { transform: translateY(-4.5px) rotate(-45deg); }
  .site-header nav {
    display: none;
    position: absolute;
    top: calc(100% - var(--space-xs));
    right: var(--gutter);
    padding: var(--space-m) var(--space-l);
    background: var(--color-bg);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  }
  .case-study .site-header nav, .dark-top .site-header nav { background: var(--color-footer); }
  .nav-open nav { display: block; }
  .site-header nav ul { flex-direction: column; gap: var(--space-m); }
}

/* =============================================================
   CASE STUDY PAGES
   ============================================================= */

/* Header sits on top of the dark hero photo */
.case-study .site-header,
.dark-top .site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  color: var(--color-on-dark);
}

/* ---------- Hero: photo + black overlay ---------- */
.cs-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(85svh, 820px);   /* leaves a sliver of the next section visible as a scroll hint */
  background: var(--color-footer);
  color: var(--color-on-dark);
  overflow: hidden;
}
.cs-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cs-hero::after {                 /* the black overlay */
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
}
.cs-hero-content {
  position: relative;
  z-index: 1;
  padding-top: 9rem;
  padding-bottom: var(--space-xl);
}
.cs-tags {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0 0 var(--space-m);
  padding: 0;
  color: var(--color-highlight);
}
.cs-tags li:not(:last-child)::after { content: '·'; margin-inline: 0.6em; }
.cs-hero h1 {
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--space-m);
}
.cs-lede {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.5;
  max-width: var(--measure);
}
.cs-credits {
  margin-top: var(--space-xl);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.875rem;
}
/* Credit lines: short ones stay on one line; long ones wrap at a comfortable width */
.cs-credits p { max-width: 60em; }
.cs-credits p + p { margin-top: 0.25em; }
.cs-credits strong { color: rgba(255, 255, 255, 0.9); }

/* ---------- Text sections: label + statement left, body right ---------- */
.cs-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--space-m) var(--space-xl);
  padding-block: var(--space-xl);
}
.cs-label {
  font-size: var(--step--1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-caption);
  margin-bottom: var(--space-s);
}
.cs-statement {
  text-wrap: balance;   /* evens out line lengths so the statement isn't jagged */
  font-size: var(--step-2);
  font-weight: 700;   /* whole statement bold italic */
  font-style: italic;
  line-height: 1.35;
  max-width: 20em;
}
.cs-statement strong { font-weight: 700; }
.cs-body { font-size: var(--step-0); line-height: 1.65; max-width: var(--measure); }
.cs-body > * + * { margin-top: 1.1em; }
.cs-body h3 { font-size: var(--step-0); font-weight: 700; margin-top: 1.6em; }
.cs-body h3 + p { margin-top: 0.15em; }
/* Lists read as paragraphs: no bullets, same spacing */
.cs-body ul { list-style: none; padding-left: 0; margin-block: 0; }
.cs-body li + li { margin-top: 1.1em; }
.cs-body .note { font-style: italic; margin-top: 2.2em; }   /* an extra line of space above the note */

@media (max-width: 760px) {
  .cs-section { grid-template-columns: 1fr; }
}

/* ---------- Image carousel with captions ---------- */
.carousel {
  position: relative;
  max-width: 1440px;
  margin-inline: auto;
  container-type: inline-size;
}
.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track > figure {
  flex: 0 0 100%;
  scroll-snap-align: start;
}
.carousel-track img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.carousel-track figcaption {
  /* lines captions up with the page's text column */
  padding: var(--space-s) max(var(--gutter), calc((100cqw - var(--page-max)) / 2 + var(--gutter))) 0;
  font-size: var(--step--1);
  line-height: 1.5;
  font-style: italic;
  color: var(--color-caption);
}
.carousel-prev, .carousel-next {
  position: absolute;
  /* vertically centered on the 16:9 image, not the caption */
  top: calc(100cqw * 9 / 32);
  translate: 0 -50%;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.15s;
}
.carousel-prev { left: var(--space-s); }
.carousel-next { right: var(--space-s); }
.carousel-prev:disabled, .carousel-next:disabled { opacity: 0; pointer-events: none; }
.carousel.single .carousel-prev, .carousel.single .carousel-next { display: none; }
@media (prefers-reduced-motion: reduce) { .carousel-track { scroll-behavior: auto; } }

/* ---------- Previous / next case study links (above footer) ---------- */
.case-nav-inner {
  display: flex;
  justify-content: space-between;
  gap: var(--space-m);
  padding-block: var(--space-l);
  border-top: 2px solid var(--color-ink);   /* same rule as "Selected work" on Home */
}
.case-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  text-decoration: none;
}
.case-nav a:hover span { text-decoration: underline; text-underline-offset: 0.2em; }
.case-nav svg { flex-shrink: 0; }
.case-nav-next { text-align: right; }
@media (max-width: 560px) {
  .case-nav a { font-size: var(--step-1); }
}

/* Carousel variant that fills its box (used inside cards, e.g. About › Beyond work) */
/* fills the card's full height, matching the other cards */
.carousel--fill,
.carousel--fill .carousel-track,
.carousel--fill .carousel-track > figure { height: 100%; }
.carousel--fill .carousel-track img { height: 100%; aspect-ratio: 16 / 10; }
.carousel--fill .carousel-prev,
.carousel--fill .carousel-next { top: 50%; }


/* =============================================================
   IMAGE + TEXT PAIRS, IMAGE GRID, LIGHTBOX (case studies)
   ============================================================= */
/* Grid spans the full content width, matching the image + text pairs above */
/* same columns as the text sections above, so pair text lines up with the right column */
.pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--space-m) var(--space-xl);
  align-items: center;
  padding-block: var(--space-l);
}
.pair p { font-size: var(--step-0); line-height: 1.65; max-width: var(--measure); }
.pair-media img,
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  cursor: zoom-in;
}
.gallery img { aspect-ratio: 16 / 10; }   /* wider, same height as before */
/* Product shots on white: show the whole image on a white box instead of cropping it */
.gallery .on-white img { object-fit: contain; background: #fff; }
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-m);
  padding-block: var(--space-l) var(--space-2xl);
}
[data-zoom] img:focus-visible { outline: 3px solid var(--color-accent-soft); outline-offset: 3px; }

.lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background: transparent;
  color: var(--color-on-dark);
}
.lightbox::backdrop { background: rgba(18, 18, 18, 0.92); }
.lightbox figure {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  padding: var(--space-xl) var(--space-2xl);
}
.lightbox img { max-width: 100%; max-height: 80vh; object-fit: contain; }
.lightbox img.on-white { background: #fff; padding: var(--space-m); box-sizing: border-box; }
.lightbox figcaption { font-size: var(--step--1); font-style: italic; color: rgba(255, 255, 255, 0.75); text-align: center; max-width: 60em; }
.lightbox button {
  position: absolute;
  width: 3rem; height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.lb-close { top: var(--space-m); right: var(--space-m); }
.lb-prev { left: var(--space-m); top: 50%; translate: 0 -50%; }
.lb-next { right: var(--space-m); top: 50%; translate: 0 -50%; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }

@media (max-width: 760px) {
  .pair { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .lightbox figure { padding: var(--space-xl) var(--space-s); }
  .lb-prev, .lb-next { top: auto; bottom: var(--space-m); translate: none; }
}
