:root {
  --bg: #F5F3EE;
  --surface: #FBFAF7;
  --ink: #221F1C;
  --ink-hover: #3A352F;
  --ink-muted: rgba(34, 31, 28, 0.66);
  --ink-quiet: rgba(34, 31, 28, 0.72);
  --paper: #F7F4F2;
  --accent: #1A6B5D;
  --rule: rgba(34, 31, 28, 0.14);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --gutter: 48px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }

@media (pointer: fine) {
  body, body a, body button, body [role="button"] { cursor: none; }
}

.page { min-height: 100vh; background: var(--bg); }

.muted {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 56px var(--gutter) 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.hero__bg { position: absolute; pointer-events: none; }

.hero__bg--glow {
  inset: -8%;
  background: radial-gradient(115% 92% at 50% 24%, #2ADFBE 0%, #6FEDD8 30%, #B6F3E7 52%, rgba(245, 243, 238, 0) 82%);
}

.hero__bg--corner {
  inset: -8%;
  background: radial-gradient(70% 62% at 6% 14%, rgba(30, 122, 106, 0.5) 0%, rgba(30, 122, 106, 0) 70%);
}

.hero__grain {
  inset: -40px;
  mix-blend-mode: hard-light;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyMDAnIGhlaWdodD0nMjAwJz48ZmlsdGVyIGlkPSduJz48ZmVUdXJidWxlbmNlIHR5cGU9J2ZyYWN0YWxOb2lzZScgYmFzZUZyZXF1ZW5jeT0nMC41JyBudW1PY3RhdmVzPSc2JyBzdGl0Y2hUaWxlcz0nc3RpdGNoJy8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9JzIwMCcgaGVpZ2h0PScyMDAnIGZpbHRlcj0ndXJsKCNuKScgb3BhY2l0eT0nMC45NScvPjwvc3ZnPg==");
  background-size: 200px 200px;
  -webkit-mask-image: radial-gradient(115% 92% at 50% 24%, #000 0%, rgba(0, 0, 0, 0.9) 40%, rgba(0, 0, 0, 0) 82%);
  mask-image: radial-gradient(115% 92% at 50% 24%, #000 0%, rgba(0, 0, 0, 0.9) 40%, rgba(0, 0, 0, 0) 82%);
}

.topbar {
  position: relative;
  width: 100%;
  /* The header's own padding sits outside this box, so subtract the gutters to line up with the content below. */
  max-width: calc(1520px - 2 * var(--gutter));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo { display: block; line-height: 0; transition: opacity 240ms ease; }
.logo:hover { opacity: 0.6; }
.logo img { display: block; width: 40px; height: 40px; }

.pill-nav { display: flex; gap: 8px; }

.pill {
  padding: 8px 24px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  transition: background 200ms ease;
}
.pill:hover { background: rgba(34, 31, 28, 0.08); color: var(--ink); }

.pill--active { background: var(--ink); color: var(--paper); }
.pill--active:hover { background: var(--ink-hover); color: var(--paper); }

.hero__intro {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 80px;
  text-align: center;
}

.hero__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 70px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.hero__roles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 8px 0 16px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.hero__dot { color: var(--ink-muted); }

/* ---------- Work ---------- */

.work {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 var(--gutter) 40px;
}

.work__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 72px;
  align-items: start;
}

.project {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--ink);
}
.project:hover { color: var(--ink); }

.project__media {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1224 / 800;
  background: var(--surface);
}

.project__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Shown only when the project image is missing. */
.project__placeholder {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background-image: repeating-linear-gradient(135deg, rgba(34, 31, 28, 0.055) 0 1px, rgba(34, 31, 28, 0) 1px 9px);
}
.project__placeholder span {
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  background: rgba(245, 243, 238, 0.75);
  padding: 8px 16px;
  border-radius: 4px;
  text-align: center;
}

.project__media.is-missing { background: #E4DFD5; box-shadow: 0 1px 0 rgba(34, 31, 28, 0.08); }
.project__media.is-missing img { display: none; }
.project__media.is-missing .project__placeholder { display: flex; }

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

/* Unlinked work-in-progress card */
.project__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project__text h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.32;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

/* ---------- Footer ---------- */

.footer {
  max-width: 1520px;
  margin: 0 auto;
  padding: 96px var(--gutter) 72px;
}

.footer__inner {
  border-top: 1px solid var(--rule);
  padding-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-start;
  justify-content: space-between;
}

.footer__col { display: flex; flex-direction: column; gap: 16px; }

.footer h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.footer__links { display: flex; gap: 24px; font-size: 14px; }
.footer__copy { margin-top: 24px; font-size: 14px; letter-spacing: 0; }
.footer__updated { font-size: 14px; letter-spacing: 0; }

.footer__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-size: 14px;
}
.footer__label { font-size: 13px; letter-spacing: 0.08em; }

.quiet-link { color: var(--ink-quiet); transition: color 200ms ease; }
.quiet-link:hover { color: var(--accent); }

.quiet-link.is-current { color: var(--ink); }

/* ---------- Inner pages (About, case studies) ---------- */

.site-header { padding: 56px var(--gutter) 0; }
.site-header .topbar { position: static; }

.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
}

.btn {
  padding: 16px 32px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  transition: background 200ms ease;
}
.btn:hover { background: var(--ink-hover); color: var(--paper); }

/* About */

.page--stack { display: flex; flex-direction: column; }
.page--stack .about { flex: 1; }
/* Auto margins on a flex item cancel stretching, so give the footer its width back. */
.page--stack .footer { width: 100%; }

.about {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 120px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 56px;
}

.about__copy {
  flex: 1 1 400px;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.about__copy h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(40px, 5.4vw, 64px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.about__copy p {
  margin: 0;
  font-size: 18px;
  line-height: 1.75;
  text-wrap: pretty;
}

/* Short headed sections break the story into scannable parts */
.about__section { display: flex; flex-direction: column; gap: 16px; }
.about__section h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.about__cta { margin-top: 16px; display: flex; }

.about__aside {
  flex: 1 1 240px;
  max-width: 440px;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  padding-top: 24px;
}

.polaroid {
  margin: 0;
  width: 88%;
  align-self: flex-end;
  animation: aboutFloat 7s ease-in-out infinite;
}

.polaroid__frame {
  transform: rotate(3deg);
  background: var(--surface);
  padding: 8px;
  border-radius: 6px;
  box-shadow: 0 18px 40px -18px rgba(34, 31, 28, 0.35), 0 2px 6px rgba(34, 31, 28, 0.06);
}

.polaroid .shot { aspect-ratio: 4 / 5; border-radius: 3px; }
.polaroid .shot img { height: 100%; object-fit: cover; border-radius: 3px; }

@keyframes aboutFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
}

@media (prefers-reduced-motion: reduce) { .polaroid { animation: none; } }

/* Case studies */

.case {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 var(--gutter) 40px;
}

.case__title {
  padding: 72px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case__title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.case__title p {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.01em;
  color: var(--ink-quiet);
}

.case__overview {
  padding-top: 88px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.case__overview h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px;
  row-gap: 8px;
  font-size: 16px;
}
.facts dt { color: var(--ink-muted); }
.facts dd { margin: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.card {
  background: var(--surface);
  border-radius: 8px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
}

.card p,
.story p,
.story ul {
  margin: 0;
  font-size: 18px;
  line-height: 1.7;
  color: rgba(34, 31, 28, 0.75);
  text-wrap: pretty;
}
.card p { line-height: 1.6; }

.story {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 120px;
  display: flex;
  flex-direction: column;
  gap: 88px;
}

.story section { display: flex; flex-direction: column; gap: 16px; }
.story section:last-child { padding-bottom: 24px; }

.story h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.story strong { font-weight: 600; color: var(--ink); }
.story .story__spaced { margin-top: 24px; }
.story ul { padding-left: 24px; display: flex; flex-direction: column; gap: 8px; }
.story a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.takeaways { margin-top: 8px; display: flex; flex-direction: column; gap: 16px; }
.takeaways > span { font-size: 16px; font-weight: 600; }

/* Image with a placeholder fallback when the file is missing */
.shot { position: relative; margin: 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: 8px; }
.story .shot { margin-top: 24px; }

.shot__placeholder {
  display: none;
  aspect-ratio: 16 / 9;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background-color: #E4DFD5;
  background-image: repeating-linear-gradient(135deg, rgba(34, 31, 28, 0.055) 0 1px, rgba(34, 31, 28, 0) 1px 9px);
}
.shot__placeholder span {
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  background: rgba(245, 243, 238, 0.75);
  padding: 8px 16px;
  border-radius: 4px;
  text-align: center;
}
.shot.is-missing img { display: none; }
.shot.is-missing .shot__placeholder { display: flex; }
.polaroid .shot__placeholder { aspect-ratio: auto; height: 100%; border-radius: 3px; }

/* ---------- Case study components shared by all case studies ---------- */

/* Title thesis + inline meta row */
.case__title .case__thesis {
  max-width: 760px;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

/* Project facts: one equal column per fact under a full-width rule, so the gaps stay even
   however many facts a case study lists. */
.meta-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 24px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 15px;
}
@media (max-width: 760px) {
  .meta-row { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.meta-row div { display: flex; flex-direction: column; gap: 8px; }
.meta-row dt { font-size: 13px; letter-spacing: 0.08em; color: var(--ink-muted); }
.meta-row dd { margin: 0; }
.meta-row dl { margin: 0; display: contents; }

/* Hero: transparent mockup on a CSS panel, so the color can change in one place */
.shot--hero {
  background: #E8E3D9;
  border-radius: 8px;
  overflow: hidden;
}
.shot--hero img { border-radius: 0; }

/* Centered story: everything stays in the 720px reading column from styles.css.
   The section wrappers are layout-neutral, so their children stack like direct children. */
.sec-head,
.sec-body { display: contents; }

/* Overview: three quick cards for skimmers */
.tldr {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.tldr > div {
  background: var(--surface);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tldr h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.story .tldr p { font-size: 16px; line-height: 1.6; color: var(--ink); }

@media (max-width: 760px) {
  .tldr { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .case__title .case__thesis { font-size: 21px; }
}

/* Section nav for case studies: sits in the left margin beside the centered story */

.story section { scroll-margin-top: 48px; }

.toc { display: none; }

@media (min-width: 1200px) {
  /* Nav column | 720px story | matching empty column, so the story stays centered.
     The nav starts level with the first section and sticks only while the story scrolls by. */
  .case__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 720px) minmax(0, 1fr);
    align-items: start;
  }
  /* Move the story's top spacing onto the wrapper so the nav starts level with the first section. */
  .case__body { padding-top: 120px; }
  .case__body > .story { grid-column: 2; grid-row: 1; width: 100%; padding-top: 0; }
  .toc {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 48px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 180px;
  }
}

.toc__label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--rule);
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 8px 0 8px 16px;
  border-left: 2px solid transparent;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink-muted);
  transition: color 200ms ease, border-color 200ms ease;
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--accent); }

/* Footer variants */

.footer--case { padding-top: 64px; }
.footer--case .footer__inner { margin-top: 72px; }
.footer--about { padding-top: 0; }

.next { display: flex; flex-direction: column; gap: 8px; }
.next > span { font-size: 14px; letter-spacing: 0.04em; color: var(--ink-muted); }
.next a {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 200ms ease;
}
.next a:hover { color: var(--accent); }

/* ---------- Intro overlay ---------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  will-change: transform;
}
.no-intro .intro { display: none; }

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

.intro__mark {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -52px 0 0 -52px;
  opacity: 0;
}

.intro__name {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(30px, 5.4vw, 64px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
  clip-path: inset(0 50% 0 50%);
}

/* ---------- Custom cursor ---------- */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 260ms ease;
  will-change: transform;
}

.cursor__dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid rgba(34, 31, 28, 0);
  transition:
    width 260ms var(--ease-out),
    height 260ms var(--ease-out),
    margin 260ms var(--ease-out),
    background 260ms ease,
    border-color 260ms ease,
    opacity 200ms ease;
}

.cursor__label {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: opacity 240ms ease, transform 320ms var(--ease-out);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  :root { --gutter: 24px; }
  .project { grid-column: span 12; }
  .work__grid { row-gap: 56px; }
  .hero__name { font-size: 52px; }
  .about { padding-top: 72px; padding-bottom: 72px; }
  .about__aside { margin: 0 auto; }
  .case__title h1 { font-size: 44px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .story { padding-top: 88px; gap: 64px; }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .hero { padding-top: 32px; padding-bottom: 48px; }
  .hero__intro { padding-top: 56px; }
  .hero__name { font-size: 40px; }
  .hero__roles { font-size: 16px; gap: 8px; }
  .pill { padding: 8px 16px; }
  .footer { padding-top: 64px; padding-bottom: 48px; }
  .footer h2 { font-size: 32px; }
  .footer--about { padding-top: 0; }
  .site-header { padding-top: 32px; }
  .case__title { padding-top: 48px; }
  .case__title h1 { font-size: 36px; }
  .case__overview { padding-top: 64px; }
  .card { padding: 24px; }
  .story h2 { font-size: 26px; }
  .next a { font-size: 22px; }
}
