/* 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;
}

: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;
}

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;
}

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;
}

@keyframes page-in {
  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;
}

.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: 120px;
  display: flex;
  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;
}

.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; align-items: 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; }
}

/* Design page: 2x2 grid of company cards */
body[data-page="design"] .page {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: 92px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Design page: statement centered in the space above the logo bar */
.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;
  }
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  width: 100%;
  max-width: 1040px;
}

.design-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  aspect-ratio: 506 / 379.5;
  padding: 37px;
  overflow: hidden;
  color: var(--text);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  isolation: isolate;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root[data-theme="dark"] .design-card {
  background: #0a0a0a;
  border-color: rgba(255, 255, 255, 0.08);
}

.design-card > *:not(.design-card-media) {
  position: relative;
  z-index: 1;
}

.design-card-media {
  position: absolute;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
  z-index: 0;
}

.design-card--resy .design-card-media {
  left: 34.68%;
  top: 6.45%;
  width: 65.39%;
  height: 103.4%;
}

.design-card--tock .design-card-media {
  left: 43.71%;
  top: 3.84%;
  width: 95.43%;
  height: 92.31%;
}

.design-card--postscript .design-card-media {
  left: 44.27%;
  top: 6.95%;
  width: 100.96%;
  height: 86.03%;
}

.design-card:hover,
.design-card:focus-visible {
  border-color: var(--nav-text-active);
  transform: translateY(-2px);
  outline: none;
}

.design-card-dates {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nav-text);
}

.design-card-name {
  margin-top: auto;
  font-size: 40px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.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="design"] .page {
    padding-top: 92px;
  }
  .design-grid { gap: 20px; max-width: 100%; }
  .design-card { padding: 28px; }
  .design-card-name { font-size: 32px; }
  .design-card--resy .design-card-media {
    left: 32%;
    width: 68%;
    height: 100%;
  }
  .design-card--tock .design-card-media {
    left: 38%;
    width: 100%;
    height: 88%;
  }
  .design-card--postscript .design-card-media {
    left: 38%;
    width: 105%;
    height: 82%;
  }
}

/* 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="design"] .page {
    padding-top: 84px;
  }
  /* 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; }
  .design-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 100%;
  }
  .design-card {
    padding: 24px;
  }
  .design-card-name { font-size: 30px; }
  .design-card--resy .design-card-media {
    left: 28%;
    top: 8%;
    width: 72%;
    height: 95%;
  }
  .design-card--tock .design-card-media {
    left: 32%;
    top: 6%;
    width: 105%;
    height: 85%;
  }
  .design-card--postscript .design-card-media {
    left: 32%;
    top: 8%;
    width: 110%;
    height: 80%;
  }
}
