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

:root,
:root[data-theme="light"] {
  --bg: #ffffff;
  --text: #0a0a0a;
  --nav-bg: rgba(0, 0, 0, 0.04);
  --nav-bg-border: rgba(0, 0, 0, 0.08);
  --nav-text: rgba(0, 0, 0, 0.55);
  --nav-text-active: #0a0a0a;
  --scroll-thumb: rgba(0, 0, 0, 0.14);
  --scroll-thumb-hover: rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] {
  --bg: #000000;
  --text: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.08);
  --nav-bg-border: rgba(255, 255, 255, 0.06);
  --nav-text: rgba(255, 255, 255, 0.75);
  --nav-text-active: #ffffff;
  --scroll-thumb: rgba(255, 255, 255, 0.16);
  --scroll-thumb-hover: rgba(255, 255, 255, 0.32);
}

html, body {
  height: 100%;
}


body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "SF Pro", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* The native scrollbar is hidden and replaced by the overlay indicator built in
   js/main.js. An overlay costs no layout width, so pages no longer widen and
   narrow as they gain and lose a scrollbar — which is what shifted the centred
   layout sideways on every navigation. */
html,
body {
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Overlay scroll indicator, iOS style: appears while the page is scrolling and
   fades out once it stops. Indicator only — pointer-events stay off so it can
   never swallow a click near the right edge. Sized and positioned in main.js. */
.scroll-indicator {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 10px;
  z-index: 250;
  pointer-events: none;
  opacity: 0;
  /* Slow, unobtrusive fade out; the fade in is quickened by .is-visible. */
  transition: opacity 0.45s ease 0.15s;
}

.scroll-indicator.is-visible {
  opacity: 1;
  transition: opacity 0.12s ease;
}

.scroll-indicator-thumb {
  position: absolute;
  top: 0;
  right: 3px;
  width: 4px;
  border-radius: 2px;
  background: var(--scroll-thumb-hover);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-indicator,
  .scroll-indicator.is-visible {
    transition: none;
  }
}

ul { list-style: none; }
a { color: inherit; text-decoration: none; }

/* External links */
a[target="_blank"] {
  text-decoration: underline;
  text-underline-offset: 0.12em;
  text-decoration-thickness: 0.05em;
  transition: opacity 0.2s ease;
}

a[target="_blank"]:hover,
a[target="_blank"]:focus-visible {
  opacity: 0.78;
}

/* Brand wordmark — top-left, links home */
.brand {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  height: 32px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--nav-text-active);
  transition: opacity 0.2s ease;
}

.brand:hover,
.brand:focus-visible {
  opacity: 0.65;
  outline: none;
}

/* Nav */
.nav {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  height: 32px; /* match brand + theme-toggle so all three center on one line */
}

/* Full-width header bar: a solid background + slight drop shadow fades in once
   the page is scrolled, sitting behind the brand, nav, and theme toggle. */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px; /* 2 × the 40px content center line, so the row sits centered */
  z-index: 40;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 6px 20px rgba(0, 0, 0, 0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.is-scrolled::before {
  opacity: 1;
}

.nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  line-height: 1;
}

.nav-list li {
  display: flex;
  align-items: center;
}

.nav-link {
  display: inline-grid;
  grid-template-areas: "stack";
  place-items: center;
  line-height: 1;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nav-text);
  transition: color 0.2s ease;
}

.nav-link::after {
  content: attr(data-text);
  grid-area: stack;
  height: 0; /* reserve bold width only — no extra row height */
  overflow: hidden;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  font-weight: 900;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--nav-text-active);
  font-weight: 900;
}

.nav-link.is-active {
  color: var(--nav-text-active);
  text-decoration: underline;
  text-underline-offset: 0.54em;
  text-decoration-thickness: 0.10em;
}

.nav-toggle {
  display: none;
}

/* Theme toggle — sliding pill switch */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  width: 60px;
  height: 32px;
  padding: 0;
  margin: 0;
  background: var(--nav-bg);
  border: 1px solid var(--nav-bg-border);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--nav-text-active);
  outline-offset: 3px;
}

/* Sun icon pinned to the left side of the track, moon to the right */
.theme-toggle-icon {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  z-index: 2;
  color: var(--nav-text);
  pointer-events: none;
  transition: color 0.3s ease;
}

.theme-toggle-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.theme-toggle-icon--sun { left: 8px; }
.theme-toggle-icon--moon { right: 8px; }

/* The icon currently under the thumb gets the explicit inverted color so it reads on the thumb fill */
:root[data-theme="light"] .theme-toggle-icon--sun { color: #ffffff; }
:root[data-theme="dark"] .theme-toggle-icon--moon { color: #000000; }

/* The thumb: solid contrasting circle that slides between the two icons */
.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--nav-text-active);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  transition:
    transform 0.4s cubic-bezier(0.65, 0.05, 0.2, 1),
    background-color 0.35s ease;
}

:root[data-theme="light"] .theme-toggle-thumb { transform: translateX(0); }
:root[data-theme="dark"]  .theme-toggle-thumb { transform: translateX(28px); }

/* Page / hero */
.page {
  min-height: 100vh;
  padding: 200px 64px 64px;
  opacity: 0;
  transform: translateY(-10px);
  animation: page-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) 0.05s forwards;
}

body.is-leaving .page {
  animation: page-out 0.28s ease forwards;
}

/* Settles down into place rather than up. A .page is exactly 100vh, so starting
   it 10px *below* its resting spot pushed the document 10px past the viewport
   and flashed a scrollbar on every load; overflow above the top edge isn't
   scrollable, so coming from -10px costs nothing. */
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes page-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.hero {
  width: 100%;
  max-width: none;
}

.hero-text {
  font-size: clamp(40px, 7.2vw, 140px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text);
}

.hero-text a {
  transition: color 0.2s ease;
}

.hero-text a:hover,
.hero-text a:focus-visible {
  color: #4634F1;
}

/* Home: hero centered between nav and previous work, both above the fold. */
body[data-page="home"] .page {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: 72px;
  padding-bottom: 64px;
  display: flex;
  flex-direction: column;
}

body[data-page="home"] .hero {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body[data-page="home"] .hero-text {
  text-align: left;
}

/* Home backdrop — the generative contour field drawn in js/main.js.
   Fixed and pointer-events:none so it costs no layout width and can never
   swallow a click; a .page is exactly 100vh, and anything that adds height
   flashes the scroll indicator for a frame. The canvas paints at z-index 0,
   which is below every piece of fixed chrome (nav 100, brand 50, toggle 250),
   but a static .page would still paint underneath it — hence the explicit
   stacking context on the content. */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

body[data-page="home"] .page {
  position: relative;
  z-index: 1;
}

.previous-work {
  flex-shrink: 0;
  max-width: none;
}

.previous-work-heading {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nav-text);
  margin-bottom: 12px;
}

.previous-work-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.previous-work-link {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text);
  transition: color 0.2s ease;
}

.previous-work-link:hover,
.previous-work-link:focus-visible {
  color: var(--nav-text);
}

/* About page: intro + chat assistant, centered on the page */
body[data-page="about"] .page {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: 120px;
  padding-bottom: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.about {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Circular avatar above the chat; dissolves once a conversation starts */
.about-avatar {
  width: 120px;
  height: 120px;
  margin-bottom: 28px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--nav-bg-border), 0 6px 20px rgba(0, 0, 0, 0.08);
  transition:
    opacity 0.45s ease,
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.45s ease;
}

.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body[data-page="about"].chat-active .about-avatar {
  opacity: 0;
  transform: scale(0.82) translateY(-18px);
  filter: blur(6px);
  pointer-events: none;
}

.about-heading {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text);
}

.about-sub {
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--nav-text);
  max-width: none;
}

.chat {
  width: 100%;
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 46vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  /* Minimalistic, breathable scrollbar — Firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

/* Minimalistic, breathable scrollbar — WebKit (Chrome/Safari/Edge).
   A transparent track plus a transparent border on the thumb (with
   background-clip) leaves padding around a thin, pill-shaped thumb. */
.chat-log::-webkit-scrollbar {
  width: 10px;
}

.chat-log::-webkit-scrollbar-track {
  background: transparent;
}

.chat-log::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.chat-log::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  background-clip: padding-box;
}

.chat-log:empty {
  display: none;
}

.chat-msg {
  display: flex;
  max-width: 85%;
  animation: chat-msg-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes chat-msg-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg--user {
  align-self: flex-end;
}

.chat-msg--assistant {
  align-self: flex-start;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg--user .chat-bubble {
  background: var(--nav-text-active);
  color: var(--bg);
  border-bottom-right-radius: 6px;
}

.chat-msg--assistant .chat-bubble {
  background: var(--nav-bg);
  border: 1px solid var(--nav-bg-border);
  color: var(--text);
  border-bottom-left-radius: 6px;
  white-space: normal; /* markdown produces block elements, not raw newlines */
}

/* Markdown formatting inside assistant replies */
.chat-bubble > :first-child { margin-top: 0; }
.chat-bubble > :last-child { margin-bottom: 0; }
.chat-bubble p { margin: 0.5em 0; }
.chat-bubble ul,
.chat-bubble ol { margin: 0.5em 0; padding-left: 1.25em; }
.chat-bubble li { margin: 0.2em 0; }
.chat-bubble li::marker { color: var(--nav-text); }
.chat-bubble strong { font-weight: 600; }
.chat-bubble em { font-style: italic; }
.chat-bubble a {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.chat-bubble h4 {
  font-size: 1em;
  font-weight: 600;
  margin: 0.7em 0 0.3em;
}
.chat-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(127, 127, 127, 0.18);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

/* Typing indicator while the assistant bubble is still empty */
.chat-msg.is-typing .chat-bubble::after {
  content: "";
  display: inline-block;
  width: 3em;
  height: 0.6em;
  background:
    radial-gradient(circle 3px at 6px center, currentColor 90%, transparent),
    radial-gradient(circle 3px at 18px center, currentColor 90%, transparent),
    radial-gradient(circle 3px at 30px center, currentColor 90%, transparent);
  opacity: 0.5;
  animation: chat-typing 1.1s ease-in-out infinite;
}

@keyframes chat-typing {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.65; }
}

.chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 6px 6px 6px 18px;
  background: var(--nav-bg);
  border: 1px solid var(--nav-bg-border);
  border-radius: 999px;
  transition: border-color 0.2s ease;
}

.chat-form:focus-within {
  border-color: var(--nav-text-active);
}

.chat-input {
  flex: 1;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
  padding: 8px 0;
}

.chat-input::placeholder {
  color: var(--nav-text);
  opacity: 1;
  transition: opacity 0.35s ease;
}

/* Cycling suggested-question placeholder fades out before each swap */
.chat-input.ph-hide::placeholder {
  opacity: 0;
}

.chat-input:focus {
  outline: none;
}

.chat-send {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 999px;
  background: var(--nav-text-active);
  color: var(--bg);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-send svg {
  width: 18px;
  height: 18px;
}

.chat-send:hover,
.chat-send:focus-visible {
  transform: scale(1.05);
  outline: none;
}

.chat-form.is-busy .chat-send,
.chat-send:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

/* Once a conversation starts: hide the heading, anchor to the top, and let the
   whole page scroll (instead of the chat-log scrolling internally). */
/* The heading is dissolved + hidden by js/chat.js (so it can animate out).
   The reduced-motion path sets display:none inline instead. */

/* Active conversation: the chat becomes a full-height panel — messages stack
   in a scrollable area at the top, and the input is pinned to the bottom. */
body[data-page="about"].chat-active .chat {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 96px 24px 24px;
}

body[data-page="about"].chat-active .chat-log {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

body[data-page="about"].chat-active .chat-form {
  flex: 0 0 auto;
  margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .chat-msg.is-typing .chat-bubble::after { animation: none; }
  .chat-msg { animation: none; }
  .chat-log { scroll-behavior: auto; }
  .chat-input::placeholder { transition: none; }
}

@media (max-width: 560px) {
  body[data-page="about"] .page { padding-top: 96px; justify-content: flex-start; }
  .chat-log { max-height: 50vh; }
  .chat-msg { max-width: 92%; }
}

/* Photography page: minimal stacked column of photos */
body[data-page="photography"] .page {
  padding-top: 120px;
  padding-bottom: 120px;
  display: flex;
  justify-content: center;
}

.photos {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.photo {
  margin: 0;
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  body[data-page="photography"] .page { padding-top: 96px; }
  .photos { gap: 40px; }
}

@media (max-width: 560px) {
  body[data-page="photography"] .page {
    padding-left: 16px;
    padding-right: 16px;
  }
  .photos { gap: 28px; }
}

/* Contact page: the statement, centered on its own screen */
body[data-page="contact"] .page {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: 92px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Design page: the password prompt sits centered in the viewport; once
   unlocked the case study index anchors to the top. */
body[data-page="design"] .page {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: 132px;
  padding-bottom: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Statement block, centered in the available space */
.statement {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 30px;
}

/* Company logo grid, pinned at the bottom (3 columns) */
.logos {
  flex-shrink: 0;
  width: 100%;
  max-width: 880px;
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px 64px;
  place-items: center;
}

.logo {
  display: block;
  width: auto;
}

.logo--stripe { height: 66px; }
.logo--resy { height: 47px; }
.logo--amex { height: 68px; }
.logo--tock { height: 33px; }
.logo--squarespace { height: 33px; }
.logo--postscript { height: 37px; }

/* The amex/postscript knockout panels recolor with the theme via var(--bg).
   Drive the fill from CSS (not just the presentation attribute) so the change
   blends over the same duration as the site's background transition. */
.logo--amex path[fill="var(--bg)"],
.logo--postscript path[fill="var(--bg)"] {
  fill: var(--bg);
  transition: fill 0.35s ease;
}

.statement-lead {
  font-size: clamp(28px, 4.2vw, 56px);
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text);
}

.statement-lead em {
  font-style: normal;
  font-weight: 700;
}

.statement-body {
  max-width: 60ch;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--nav-text);
}

.statement-contact {
  max-width: 60ch;
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: break-word;
}

/* Email address + copy-to-clipboard button */
.email {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  vertical-align: baseline;
}

.email-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--nav-text);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.email-copy:hover,
.email-copy:focus-visible {
  color: var(--text);
  background: var(--nav-bg);
  outline: none;
}

.email-copy svg {
  width: 15px;
  height: 15px;
  display: block;
}

.email-copy .icon-check { display: none; }
.email-copy.is-copied .icon-clipboard { display: none; }
.email-copy.is-copied .icon-check { display: block; color: #1a9d5a; }

/* Copy-confirmation toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(8px);
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--nav-text-active);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-visible {
    transform: translateX(-50%);
    transition: opacity 0.25s ease;
  }
}

.hero-text::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 0.85em;
  margin-left: 0.08em;
  vertical-align: -0.08em;
  background: currentColor;
  animation: cursor-blink 1.05s steps(2, jump-none) infinite;
}

@keyframes cursor-blink {
  0%, 49.99% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .page,
  body.is-leaving .page {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .hero-text::after { animation: none; }
  .nav-menu,
  .nav-toggle-bar { transition: none; }
}

/* Tablet */
@media (max-width: 900px) {
  .page { padding: 110px 48px 48px; }
  body[data-page="home"] .page {
    padding-top: 72px;
    padding-bottom: 48px;
  }
  body[data-page="contact"] .page {
    padding-top: 92px;
  }
  body[data-page="design"] .page {
    padding-top: 104px;
  }
}

/* Narrow — hamburger menu */
@media (max-width: 640px) {
  body.nav-open {
    overflow: hidden;
  }

  .nav {
    top: 16px;
    left: 16px;
    transform: none;
  }

  /* Shorter header bar on mobile, where the row sits at top:16 (center 32). */
  body::before {
    height: 64px;
  }

  .nav-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 101;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 32px;
    padding: 0;
    background: var(--nav-bg);
    border: 1px solid var(--nav-bg-border);
    border-radius: 999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    color: var(--nav-text-active);
    transition: background-color 0.35s ease, border-color 0.35s ease;
  }

  .nav-toggle:focus-visible {
    outline: 2px solid var(--nav-text-active);
    outline-offset: 3px;
  }

  .nav-toggle-bar {
    display: block;
    width: 16px;
    height: 1.5px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  body.nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

  body.nav-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  body.nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  .nav-menu {
    display: none;
  }

  body.nav-open .nav-menu {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 90;
    align-items: center;
    justify-content: center;
    background: var(--bg);
  }

  body.nav-open .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 28px;
  }

  .nav-link {
    font-size: 13px;
  }

  .theme-toggle {
    top: 16px;
    right: 16px;
  }

  /* The hamburger occupies the top-left on mobile, so drop the wordmark. */
  .brand {
    display: none;
  }
}

/* Mobile */
@media (max-width: 560px) {
  .page { padding: 120px 24px 32px; }
  .hero-text { line-height: 1.2; }
  body[data-page="home"] .page {
    padding-top: 56px;
    padding-bottom: 32px;
  }
  body[data-page="contact"] .page {
    padding-top: 84px;
  }
  body[data-page="design"] .page {
    padding-top: 92px;
  }
  /* Logo grid drops to 2 columns on small screens, with smaller logos */
  .logos {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 32px;
  }
  .logo--stripe { height: 46px; }
  .logo--resy { height: 33px; }
  .logo--amex { height: 48px; }
  .logo--tock { height: 23px; }
  .logo--squarespace { height: 23px; }
  .logo--postscript { height: 26px; }
}

/* ─────────────────────────────────────────────────────────────
   Case study pages (body[data-page="case"])
   ───────────────────────────────────────────────────────────── */

:root,
:root[data-theme="light"] {
  --cs-accent: #1C1BE0;
  --cs-muted: rgba(0, 0, 0, 0.58);
  --cs-rule: rgba(0, 0, 0, 0.10);
  --cs-surface: rgba(0, 0, 0, 0.025);
}

:root[data-theme="dark"] {
  --cs-accent: #6462FF;
  --cs-muted: rgba(255, 255, 255, 0.62);
  --cs-rule: rgba(255, 255, 255, 0.14);
  --cs-surface: rgba(255, 255, 255, 0.04);
}

body[data-page="case"] .page {
  padding: 0 0 120px;
  max-width: none;
}

/* Every direct child is centered on one measure; figures opt out via modifiers. */
.cs > * {
  width: min(880px, 100% - 96px);
  margin-inline: auto;
}

/* Hero */
.cs-hero {
  padding: 190px 0 64px;
}

.cs-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cs-muted);
  margin-bottom: 22px;
}

.cs-title {
  font-size: clamp(44px, 8vw, 104px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.cs-tagline {
  margin-top: 20px;
  font-size: clamp(19px, 2.2vw, 26px);
  line-height: 1.42;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--cs-muted);
  max-width: 30ch;
}

.cs-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 28px 32px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--cs-rule);
}

.cs-meta dt {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cs-muted);
  margin-bottom: 8px;
}

.cs-meta dd {
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

/* Sections */
.cs-section {
  padding: 108px 0 0;
}

.cs-section--tight {
  padding-top: 56px;
}

.cs-h2 {
  font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
  max-width: 20ch;
}

.cs-h3 {
  font-size: clamp(21px, 2.4vw, 28px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin-bottom: 32px;
}

.cs-prose {
  margin-top: 32px;
  max-width: 62ch;
}

.cs-prose p {
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.008em;
  color: var(--cs-muted);
}

.cs-prose p + p {
  margin-top: 20px;
}

.cs-prose em { font-style: italic; }

.cs-lead {
  font-size: 21px !important;
  line-height: 1.5 !important;
  color: var(--text) !important;
  letter-spacing: -0.018em !important;
}

/* Inline link inside case-study prose — underline only, so it doesn't
   compete with the accent used by .cs-note and the numbered list */
.cs-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--cs-rule);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.cs-link:hover,
.cs-link:focus-visible {
  text-decoration-color: var(--cs-accent);
}

.cs-note {
  margin-top: 36px;
  padding-left: 20px;
  border-left: 2px solid var(--cs-accent);
  font-size: 15px;
  line-height: 1.6;
  color: var(--cs-muted);
  max-width: 60ch;
}

/* Pull quote */
.cs-quote {
  margin-top: 0;
  padding: 56px 0;
  border-top: 1px solid var(--cs-rule);
  border-bottom: 1px solid var(--cs-rule);
}

.cs-quote p {
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.cs-quote cite {
  display: block;
  margin-top: 26px;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cs-muted);
}

/* Lists */
.cs-list {
  display: grid;
  gap: 36px 40px;
  margin-top: 8px;
  list-style: none;
}

.cs-list--cols {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-top: 40px;
}

.cs-list h4 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 9px;
}

.cs-list p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--cs-muted);
}

.cs-list--numbered {
  counter-reset: cs-num;
}

.cs-list--numbered li {
  counter-increment: cs-num;
  padding-left: 46px;
  position: relative;
}

.cs-list--numbered li::before {
  content: counter(cs-num, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--cs-muted);
  font-variant-numeric: tabular-nums;
}

.cs-list--numbered li.is-highlighted::before {
  color: var(--cs-accent);
}

.cs-list--numbered li.is-highlighted h4 {
  color: var(--cs-accent);
}

.cs-list--numbered li.is-highlighted strong {
  font-weight: 600;
  color: var(--text);
}

.cs-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 56px 48px;
}

.cs-list--plain {
  gap: 28px;
}

/* Stats */
.cs-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 56px;
  margin-top: 40px;
  padding: 28px 0;
  border-top: 1px solid var(--cs-rule);
  border-bottom: 1px solid var(--cs-rule);
}

.cs-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs-stat-num {
  font-size: clamp(30px, 3.4vw, 40px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.cs-stat-label {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--cs-muted);
}

/* Figures */
.cs-figure {
  margin-top: 64px;
}

.cs-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.cs-figure figcaption {
  margin-top: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--cs-muted);
  max-width: 62ch;
}

.cs-figure figcaption strong {
  font-weight: 600;
  color: var(--text);
}

/* Wide, beyond the text measure */
.cs-figure--bleed {
  width: min(1440px, 100% - 96px);
}

/* Screenshots that need an edge to sit against the page background */
.cs-figure--framed {
  width: min(1240px, 100% - 96px);
}

.cs-figure--framed img {
  border: 1px solid var(--cs-rule);
}

/* Diagrams rendered on white slides — inverted in dark mode so they don't glare */
.cs-figure--diagram {
  width: min(1100px, 100% - 96px);
}

.cs-figure--diagram img {
  border: 1px solid var(--cs-rule);
}

:root[data-theme="dark"] .cs-figure--diagram img {
  filter: invert(1) hue-rotate(180deg);
}

/* Two photos side by side */
.cs-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.cs-figure--inline {
  margin-top: 0;
}

/* Three competitor shots on a shared baseline */
.cs-figure--trio {
  width: min(1240px, 100% - 96px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 20px;
}

.cs-figure--trio img {
  border: 1px solid var(--cs-rule);
  max-height: 460px;
  width: auto;
  margin-inline: auto;
}

.cs-figure--trio figcaption {
  grid-column: 1 / -1;
}

/* Footer nav */
.cs-footer {
  margin-top: 120px;
  padding-top: 40px;
  border-top: 1px solid var(--cs-rule);
}

.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--cs-muted);
  transition: color 0.2s ease, gap 0.2s ease;
}

.cs-back:hover,
.cs-back:focus-visible {
  color: var(--text);
  gap: 14px;
}

/* Scroll reveal */
.cs-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cs-reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .cs-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 900px) {
  .cs > * { width: calc(100% - 64px); }
  .cs-figure--bleed,
  .cs-figure--framed,
  .cs-figure--diagram,
  .cs-figure--trio { width: calc(100% - 64px); }
  .cs-hero { padding-top: 150px; }
  .cs-section { padding-top: 84px; }
}

@media (max-width: 640px) {
  .cs > * { width: calc(100% - 40px); }
  .cs-figure--bleed,
  .cs-figure--framed,
  .cs-figure--diagram,
  .cs-figure--trio { width: calc(100% - 40px); }
  .cs-hero { padding: 128px 0 48px; }
  .cs-section { padding-top: 68px; }
  .cs-figure { margin-top: 44px; }
  .cs-meta { margin-top: 40px; gap: 24px; }
  .cs-quote { padding: 40px 0; }
  .cs-figure--trio {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 24px;
  }
  .cs-figure--trio img {
    max-height: 58vh;
    max-width: 100%;
  }
  .cs-stats { gap: 20px 32px; }
}

/* ─────────────────────────────────────────────────────────────
   Design page: gated case studies
   ───────────────────────────────────────────────────────────── */

/* Locked, the prompt is the entire page, so it centers in the viewport.
   Unlocked, the card list reads better anchored top-left.

   The unlocked/locked switch keys off data-gate on <html>, not a class on
   .work, so the inline bootstrap in design.html can set it before the body is
   parsed. js/gate.js writes the same attribute once /api/unlock answers. */
.work {
  flex: 1 1 auto;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

:root[data-gate="unlocked"] .work {
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
}

.work-heading {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.work-intro {
  margin-top: 18px;
  max-width: 58ch;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.008em;
  color: var(--cs-muted);
}

/* Was display:inline back when this was plain text. Now that it carries the
   copy button it wants the global .email inline-flex, to align the two. */
.work-intro .email-addr {
  color: var(--text);
}

/* Password form */
.gate-form {
  margin-top: 36px;
  width: 100%;
  max-width: 460px;
}

.gate-row {
  display: flex;
  gap: 10px;
}

.gate-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--cs-surface);
  border: 1px solid var(--cs-rule);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.gate-input::placeholder {
  color: var(--cs-muted);
}

.gate-input:focus {
  border-color: var(--cs-accent);
  background: transparent;
}

.gate-submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--bg);
  background: var(--text);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.gate-submit:hover,
.gate-submit:focus-visible {
  opacity: 0.82;
  outline: none;
}

.gate-submit-icon {
  width: 15px;
  height: 15px;
}

.gate-form.is-busy .gate-submit {
  opacity: 0.5;
  pointer-events: none;
}

.gate-status {
  margin-top: 12px;
  min-height: 1.2em;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cs-muted);
}

.gate-status.is-error {
  color: #d1344b;
}

:root[data-theme="dark"] .gate-status.is-error {
  color: #ff7085;
}

/* Locked visitors see the form and nothing else; unlocked visitors see the
   work and no longer need the form. Exactly one of each pair is ever shown. */
.work-intro--unlocked,
:root[data-gate="unlocked"] .work-intro--locked,
:root[data-gate="unlocked"] .gate-form {
  display: none;
}

:root[data-gate="unlocked"] .work-intro--unlocked {
  display: block;
}

/* Case study cards */
.work-list {
  margin-top: 48px;
  display: grid;
  gap: 14px;
}

.work-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 26px 28px;
  border: 1px solid var(--cs-rule);
  border-radius: 14px;
  color: var(--text);
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
}

.work-card:hover,
.work-card:focus-visible {
  border-color: var(--cs-accent);
  background: var(--cs-surface);
  transform: translateY(-2px);
  outline: none;
}

.work-card-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.work-card-meta {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cs-muted);
}

.work-card-name {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.2;
}

.work-card-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--cs-muted);
}

.work-card-arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--cs-muted);
  transform: translateX(-4px);
  transition: transform 0.25s ease, color 0.25s ease;
}

.work-card-arrow svg {
  width: 100%;
  height: 100%;
}

.work-card:hover .work-card-arrow,
.work-card:focus-visible .work-card-arrow {
  color: var(--cs-accent);
  transform: none;
}

@media (max-width: 640px) {
  .work-card {
    padding: 20px;
    gap: 16px;
    align-items: flex-start;
  }
  .work-card-arrow { display: none; }
  .gate-row { flex-wrap: wrap; }
  .gate-submit { width: 100%; justify-content: center; }
}

/* ─────────────────────────────────────────────────────────────
   Design page: company logos along the bottom
   ───────────────────────────────────────────────────────────── */

/* Sits below .work in the page's flex column, so it stays at the bottom of the
   viewport whether the page is showing the password prompt or the case studies. */
.design-logos {
  flex: 0 0 auto;
  margin-top: 88px;
  max-width: 660px;
  gap: 36px 56px;
}

/* Sized by optical area, not by height. These marks run from a 1:1 square
   badge to a 4.2:1 wordmark, so matching their heights would make the wide
   ones read as enormous. Each height is instead derived from a shared target
   size: height = target / sqrt(aspectRatio), which holds sqrt(width x height)
   roughly constant across the row.

   Two targets, because a solid filled badge carries more visual weight than
   an outlined wordmark at the same area:
     wordmarks (stripe, tock, squarespace) -> 75
     filled badges (resy, amex, postscript) -> 63

   Then nudged by eye, because stroke weight reads as size too: Tock's
   letterforms are much heavier than Stripe's, so equal area made it look
   bigger; Amex is a solid square and dominates at its computed size. */
.design-logos .logo--stripe { height: 55px; }        /* 200x95,  ratio 2.11 */
.design-logos .logo--resy { height: 42px; }          /* 153x68,  ratio 2.25 */
.design-logos .logo--amex { height: 57px; }          /* 100x100, ratio 1.00 */
.design-logos .logo--tock { height: 36px; }          /* 158x44,  ratio 3.59 */
.design-logos .logo--squarespace { height: 38px; }   /* 195x46,  ratio 4.24 */
.design-logos .logo--postscript { height: 35px; }    /* 156x49,  ratio 3.18 */

@media (max-width: 900px) {
  .design-logos { margin-top: 64px; gap: 30px 44px; }
}

/* Below 560px the page padding drops to 24px, which leaves a 3-up grid about
   80px per column — narrower than most of these wordmarks, so they spilled
   into their neighbours. Two columns and a proportional step-down (0.75x, so
   the size relationships above are preserved) keeps every mark inside its
   cell down to a 320px viewport. */
@media (max-width: 560px) {
  .design-logos {
    margin-top: 48px;
    grid-template-columns: repeat(2, 1fr);
    max-width: 340px;
    gap: 28px 28px;
  }
  .design-logos .logo--stripe { height: 41px; }
  .design-logos .logo--resy { height: 32px; }
  .design-logos .logo--amex { height: 43px; }
  .design-logos .logo--tock { height: 27px; }
  .design-logos .logo--squarespace { height: 28px; }
  .design-logos .logo--postscript { height: 26px; }
}
