@font-face {
  font-family: 'PP Editorial New';
  src: url('PPEditorialNew-Italic-BF644b214fb0c0a.otf') format('opentype');
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: 'PP Eiko';
  src: url('PPEiko-Thin.otf') format('opentype');
  font-weight: 100;
  font-style: normal;
}

@font-face {
  font-family: 'Neue Haas Grotesk Display';
  src: url('neuehaasgrotdisp-45light-trial.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Neue Haas Grotesk Display';
  src: url('neuehaasgrotdisp-55roman-trial.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'TT Commons';
  src: url('TT Commons Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'TT Commons';
  src: url('TT Commons Italic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'TT Commons';
  src: url('TT Commons Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'TT Commons';
  src: url('TT Commons Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'TT Commons';
  src: url('TT Commons Medium Italic.otf') format('opentype');
  font-weight: 500;
  font-style: italic;
}

@font-face {
  font-family: 'TT Commons';
  src: url('TT Commons DemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'TT Commons';
  src: url('TT Commons Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
}

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

:root {
  --bg: #ffffff;
  --text: #0f0f0f;
  --text-muted: #a2a2a2;
  --text-secondary: #636363;
  --border: rgba(0, 0, 0, 0.1);
  --surface: #ebebeb;

  --transition: 0.2s cubic-bezier(0.63, -0.02, 0.2, 1);
  --transition-long: 0.35s cubic-bezier(0.63, -0.02, 0.2, 1);

  --pwx: 1.25rem;
  --header-height: 3rem;
  --footer-height: 2.5rem;
}

body.is-dark {
  --bg: #191919;
  --text: #ffffff;
  --text-muted: #c0c0c0;
  --text-secondary: #d0d0d0;
  --border: rgba(255, 255, 255, 0.08);
  --surface: #2a2a2a;
}

html, body {
  height: 100%;
  overflow: hidden;
  cursor: none;
}

*, a, button, .card-wrapper { cursor: none !important; }

/* ── Custom cursor ───────────────────────────────────── */
.cursor-ring {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--text);
  opacity: 0.5;
  transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease, border-color var(--transition-long);
}

body.cursor-hover .cursor-ring {
  opacity: 0;
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}

.cursor-dot {
  font-family: 'Neue Haas Grotesk Display', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  width: 6px;
  height: 6px;
  background: var(--text);
  transition: width 0.2s ease, height 0.2s ease, background var(--transition-long), border-radius 0.2s ease;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 0;
  color: transparent;
}

@keyframes pulse-arrow {
  0%, 100% { opacity: 1; transform: translateX(0); }
  50%       { opacity: 0.4; transform: translateX(3px); }
}

.cursor-arrow {
  display: inline-block;
  animation: pulse-arrow 0.9s ease-in-out infinite;
}

body.cursor-hover .cursor-dot {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: transparent;
  border: 1.5px solid var(--text);
  font-size: 0.45rem;
  color: var(--text);
  letter-spacing: 0.04em;
  font-weight: 500;
}


body {
  font-family: 'PP Eiko', 'Inter', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-weight: 100;
  font-size: 11px;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background-color var(--transition-long), color var(--transition-long);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Header ─────────────────────────────────────────── */
.site-header {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  height: var(--header-height);
  width: fit-content;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background-color: rgba(248, 248, 248, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  transition: background-color var(--transition-long), border-color var(--transition-long), box-shadow var(--transition-long);
}

body.is-dark .site-header {
  background-color: rgba(25, 25, 25, 0.75);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.site-nav {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0.25rem;
  padding: 0 0.5rem;
}

.site-nav a {
  font-size: 0.625rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.site-nav a {
  position: relative;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Site name ───────────────────────────────────────── */
.site-name {
  position: fixed;
  top: 1.75rem;
  left: 1.75rem;
  z-index: 200;
  font-style: normal;
  font-size: 1rem;
  font-weight: normal;
  color: var(--text);
  transition: color var(--transition-long);
}

/* ── Avatar button ───────────────────────────────────── */
.avatar-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  padding: 0;
  z-index: 300;
  transition: border-color var(--transition), transform var(--transition), background-color var(--transition-long);
}

.avatar-btn:hover { transform: scale(1.08); border-color: var(--text-muted); }

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

.avatar-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.35rem;
  font-weight: 600;
  color: #000;
  letter-spacing: 0.05em;
}

/* ── Projects overlay ────────────────────────────────── */
.projects-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.projects-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 501;
}

.projects-close:hover { background: rgba(255,255,255,0.25); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 300px);
  gap: 2rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease 0.05s, transform 0.3s ease 0.05s;
}

.projects-overlay.is-open .projects-grid {
  opacity: 1;
  transform: translateY(0);
}

.grid-card-wrapper {
  width: 420px;
}

.grid-card-wrapper:hover .project-card {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  transform: translateY(-2px);
}

/* ── Project detail modal ────────────────────────────── */
.project-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.project-detail-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

#projectDetailCustom {
  font-family: 'Neue Haas Grotesk Display', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

.project-detail-modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 92%;
  max-width: 1000px;
  height: 85vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s ease;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4);
  scrollbar-width: none;
}

.project-detail-modal::-webkit-scrollbar { display: none; }

.project-detail-overlay.is-open .project-detail-modal {
  transform: translateY(0) scale(1);
}

.project-detail-modal.is-expanded {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  border-radius: 0;
  border: none;
}

.project-detail-modal.is-expanded .project-detail-image {
  border-radius: 0;
}

.project-detail-modal.is-expanded .project-detail-body {
  padding: 2.5rem max(200px, calc(50% - 380px));
}

.project-detail-modal.is-expanded .cs-section--bg {
  margin-left: calc(-1 * max(24px, calc(50% - 350px)));
  margin-right: calc(-1 * max(24px, calc(50% - 350px)));
  padding-left: max(24px, calc(50% - 350px));
  padding-right: max(24px, calc(50% - 350px));
  border-radius: 0;
}

.project-detail-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background var(--transition);
}

.project-detail-close:hover { background: rgba(255, 255, 255, 0.2); }

.project-detail-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #2a2a2a;
  border-radius: 24px 24px 0 0;
}

.project-detail-body {
  padding: 2.5rem 1.75rem 3.5rem;
}

.project-detail-meta {
  margin-bottom: 0.75rem;
}

.project-detail-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.project-detail-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.project-detail-stats {
  display: flex;
  gap: 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.project-stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.project-stat-label {
  font-size: 0.45rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.project-stat-value {
  font-size: 0.625rem;
  color: var(--text);
}

.project-detail-impact {
  margin-bottom: 2rem;
}

.impact-metrics {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}

.impact-metric {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: 14px;
}

.impact-stat {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.impact-desc {
  font-size: 0.55rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.project-detail-hmw {
  margin-bottom: 2rem;
}

.project-hmw-text {
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--text);
  text-align: center;
  max-width: 680px;
}

.section-heading-large {
  font-style: italic;
  font-size: 1.5rem;
  font-weight: normal;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.subsection-title {
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.two-col-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.two-col-text { display: flex; flex-direction: column; }

.design-exp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
  align-items: start;
}

.design-exp-text {
  display: flex;
  flex-direction: column;
}

.design-exp-num {
  font-style: italic;
  font-size: 1.75rem;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.constraints-subheading {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

.constraints-versions {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.constraints-version {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.constraints-version-label {
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.two-col-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.section-image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface);
  border-radius: 14px;
  border: 1px dashed var(--border);
  margin-top: 1rem;
}

.research-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.research-col { display: flex; flex-direction: column; }

.research-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.research-list li {
  font-size: 0.625rem;
  color: var(--text);
  line-height: 1.6;
  padding-left: 1rem;
  position: relative;
}

.research-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.project-detail-initial-problem,
.project-detail-research {
  margin-bottom: 0;
}

.project-detail-initial-problem .two-col-section {
  margin-bottom: 0;
}

.project-detail-features {
  margin-bottom: 2rem;
}

.feature-block {
  margin-bottom: 3rem;
}

.feature-text {
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.feature-desc {
  font-size: 0.625rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.feature-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
}

.feature-video::after {
  content: 'Video walkthrough';
  font-size: 0.5rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.project-detail-section {
  margin-bottom: 2rem;
}

.project-detail-section-title {
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.project-detail-section-text {
  font-size: 0.65rem;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.project-detail-image--inline {
  border-radius: 16px;
  margin-bottom: 2rem;
  aspect-ratio: 16 / 9;
}

/* ── Case study template (IDEATE etc.) ───────────────── */
.cs-wrap {
  display: block;
}

.project-detail-modal.is-expanded .cs-wrap {
  display: grid;
  grid-template-columns: 0 1fr;
  align-items: start;
}

/* ── Scroll-spy sidenav ──────────────────────────────── */
.cs-sidenav {
  display: none;
}

.project-detail-modal.is-expanded .cs-sidenav {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: calc(50vh - 80px);
  width: 130px;
  transform: translateX(calc(-1 * max(200px, calc(50vw - 380px)) + 2rem));
  z-index: 10;
}

.cs-nav-item {
  font-size: 0.5625rem;
  color: var(--text-muted);
  line-height: 1;
  padding: 0.4rem 0 0.4rem 0.875rem;
  border-left: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.cs-nav-item:hover {
  color: var(--text);
}

.cs-nav-item.is-active {
  color: var(--text);
  font-weight: 600;
}

.cs-content {
  min-width: 0;
}

.cs-header {
  padding-top: 80px;
  padding-bottom: 120px;
  margin-bottom: 0;
}

.cs-header-row {
  display: flex;
  gap: 4rem;
  justify-content: flex-start;
  align-items: flex-start;
}

.cs-header-left {
  max-width: 580px;
  flex: 1;
}

.cs-product-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  display: block;
  margin-bottom: 2.5rem;
}

.cs-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.cs-subtitle {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.75;
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.cs-role-desc {
  font-size: 0.95rem;
  color: #000;
  line-height: 1.75;
  font-weight: 500;
}

.cs-header-meta {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 160px;
}

.cs-meta-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cs-meta-label {
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cs-meta-label--title {
  font-size: 1rem;
  font-weight: 600;
  color: #000;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0.4rem;
  display: block;
}

.cs-meta-value {
  font-size: 0.8125rem;
  color: #000;
  line-height: 1.75;
  font-weight: 500;
}

.cs-section {
  margin-bottom: 8rem;
}

.cs-section--tight {
  margin-bottom: 0.5rem;
}

.cs-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 8rem;
}

.cs-divider::before,
.cs-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.cs-divider span {
  font-size: 0.5625rem;
  color: #aaa;
  font-weight: 400;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.cs-divider-plain {
  height: 1px;
  background: #e0e0e0;
  margin: 4rem 0;
}

/* Keep spacing above a plain divider equal to the spacing below it */
.cs-solution:has(+ .cs-divider-plain) {
  margin-bottom: 0;
}

.cs-solution:has(+ .cs-divider-plain) .cs-two-col .cs-body:last-child {
  margin-bottom: 0;
}

.cs-section--bg {
  background: var(--surface);
  border-radius: 14px;
  padding: 1.5rem;
}

.cs-label {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #666;
  margin-bottom: 1rem;
}

.cs-impact-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cs-impact-item {
  font-size: 0.95rem;
  color: #000;
  line-height: 1.8;
  font-weight: 500;
}

.cs-impact-item strong {
  font-weight: 700;
}

.cs-statement {
  font-size: 1.25rem;
  font-weight: 500;
  color: #000;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.cs-body {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.8;
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.cs-bullet-list {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.8;
  font-weight: 400;
  margin: 0;
  padding-left: 1.25rem;
}

.cs-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.cs-insight-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: #000;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.cs-chapter {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0;
  text-align: center;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.cs-chapter-sub {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.75;
  text-align: center;
  max-width: 800px;
  margin: 0.5rem auto 10rem;
  font-weight: 400;
}

.cs-solution {
  margin-bottom: 7rem;
}

.cs-stat {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}

.cs-solution-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.cs-carousel {
  width: 100%;
  background: #f8f8f8;
  border-radius: 14px;
  margin-top: 1.25rem;
  overflow: hidden;
  position: relative;
}

.cs-carousel-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.63, -0.02, 0.2, 1);
}

.cs-carousel-slide {
  width: 100%;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.cs-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.875rem 0;
}

.cs-carousel-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  transition: color var(--transition);
  cursor: pointer !important;
}

.cs-carousel-btn:hover { color: var(--text); }

.cs-carousel-dots {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.cs-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.3;
  transition: opacity var(--transition), background var(--transition);
}

.cs-carousel-dot.is-active {
  background: var(--text);
  opacity: 1;
}

.cs-video-wrap {
  width: 100%;
  background: #f8f8f8;
  border-radius: 14px;
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: calc(2rem - 6px);
  box-sizing: border-box;
  position: relative;
}

.cs-video-wrap:hover .cs-video-toggle,
.cs-video-wrap:hover .cs-video-expand {
  opacity: 1;
}

.cs-video-toggle,
.cs-video-expand {
  position: absolute;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
  padding: 0;
}

.cs-video-toggle { right: 12px; }
.cs-video-expand { left: 12px; }

/* Video lightbox */
.cs-video-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.cs-video-lightbox-block {
  background: #f8f8f8;
  border-radius: 14px;
  padding: calc(2rem - 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90vw;
  max-width: 1200px;
}

.cs-video-lightbox-block video,
.cs-video-lightbox-block img {
  width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  clip-path: inset(4px round 8px);
}

.cs-img-placeholder {
  position: relative;
}

.cs-img-placeholder:hover .cs-img-expand {
  opacity: 1;
}

.cs-img-expand {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
  padding: 0;
}

.cs-video-lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.cs-video-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.cs-video-wrap video {
  width: 100%;
  max-height: 680px;
  border-radius: 8px;
  display: block;
  object-fit: contain;
  clip-path: inset(4px);
}

.cs-video-wrap--sm video {
  width: 40%;
}

.cs-compare-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.cs-compare-col {
  padding: 1.5rem;
}

.cs-compare-col + .cs-compare-col {
  border-left: 1px solid #e0e0e0;
}

.cs-compare-col-header {
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: #888;
}

.cs-compare-col--no .cs-compare-col-header { color: #000; }
.cs-compare-col--yes .cs-compare-col-header { color: #000; }

.cs-compare-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.7rem;
  color: #000;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.cs-compare-item:last-child { margin-bottom: 0; }

.cs-compare-item::before {
  content: '✕';
  font-size: 0.5rem;
  color: #000;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.cs-compare-col--yes .cs-compare-item::before {
  content: '✓';
  color: #000;
}

.cs-img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f8f8f8;
  border-radius: 14px;
  border: 1px dashed var(--border);
  margin-top: 1.25rem;
}

.cs-img-placeholder + .cs-img-placeholder {
  margin-top: 0.75rem;
}

.cs-img-placeholder + .cs-solution-title {
  margin-top: 2rem;
}

.cs-img-placeholder + .cs-body {
  margin-top: 2rem;
}

.cs-design-decision {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.8;
  padding: 0 0 0 1rem;
  border-left: 3px solid var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 400;
}

.cs-decision-label {
  font-weight: 500;
  color: var(--text);
}

.cs-reflections {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-top: 1.5rem;
}

.cs-reflection-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.cs-closing {
  border-top: 1px solid var(--border);
  padding-top: 4rem;
}

.cs-next-card {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f8f8f8;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  margin-top: 1rem;
  transition: transform 0.3s ease;
}

.cs-next-card:hover {
  transform: scale(1.02);
}

.cs-next-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
  color: #fff;
}

.cs-next-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.cs-next-desc {
  font-size: 0.8125rem;
  line-height: 1.2;
  opacity: 0.85;
  font-weight: 400;
}

/* ── Atlas case study — custom typographic system ─────────
   Scoped entirely under .atlas-v2 so no other case study
   (Sage/Achilles/Ampcontrol/Synthesis) is affected. ──── */

.atlas-v2 .cs-header {
  padding-top: 24px;
  padding-bottom: 4rem;
}

/* Nav restructure: <nav> stays the sole grid child (untouched
   .cs-wrap grid, still exactly 2 top-level children), but stops
   being sticky itself so the back link (its first, normal-flow
   child) scrolls away naturally. Stretching <nav> to the full
   grid-row height gives the nested .atlas-nav-items wrapper a
   full-page-tall containing block to stick within — preserving
   the nav list's existing full-scroll sticky behavior. */
.project-detail-modal.is-expanded .atlas-v2 .cs-sidenav {
  position: static;
  align-self: stretch;
  padding-top: 24px;
}

.atlas-nav-items {
  position: sticky;
  top: 60px;
  display: flex;
  flex-direction: column;
}

.atlas-breadcrumb-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Back link intentionally carries no typography of its own —
   it shares .atlas-eyebrow's font/size/weight/color/letter-spacing
   directly so the two stay in sync. Only hover behavior and its
   own spacing (stacked above the nav list, not in a flex row) live here. */
.atlas-back-link {
  position: sticky;
  top: 24px;
  display: block;
  margin-bottom: 1rem;
  transition: color var(--transition);
}

.atlas-back-link:hover {
  color: var(--text);
}

.atlas-eyebrow {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
}

.atlas-hero-title {
  font-family: 'PP Eiko', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-style: normal;
  font-weight: 100;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.4;
  color: #000;
  max-width: 34ch;
  margin-bottom: 2.5rem;
}

.atlas-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5rem;
  padding: 1.5rem 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 2.5rem;
}

/* Spread fields across the full width with equal space between them */
.atlas-meta-bar--spread {
  justify-content: space-between;
  gap: 2rem;
}

.atlas-meta-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.atlas-meta-field .atlas-eyebrow {
  margin-bottom: 0.1rem;
}

.atlas-meta-value {
  font-size: 0.875rem;
  color: #000;
  font-weight: 400;
  line-height: 1.5;
}

.atlas-body-lead {
  font-size: 0.95rem;
  color: #000;
  line-height: 1.75;
  font-weight: 500;
  max-width: 560px;
}

.atlas-v2 .cs-nav-item {
  font-size: 0.8125rem;
  line-height: 1.2;
  padding: 0.15rem 0 0.15rem 0.875rem;
  color: #666;
}

.atlas-v2 .cs-nav-item.is-active {
  color: var(--text);
}

/* Section eyebrow + serif heading pairing, replacing the old
   plain .cs-label and divider-based section breaks */
.atlas-v2 .cs-label {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 1rem;
}

.atlas-v2 .cs-solution-title,
.atlas-section-title {
  font-family: 'PP Eiko', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-style: normal;
  font-weight: 100;
}

.atlas-v2 .cs-solution-title {
  font-size: 1.75rem;
  line-height: 1.4;
  color: #000;
  margin-bottom: 1.25rem;
}

.atlas-section-title {
  display: block;
  font-size: 1.75rem;
  line-height: 1.4;
  color: #000;
  margin-bottom: 1.25rem;
}

/* Impact stats as standalone number blocks */
.atlas-stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
}

.atlas-stat-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.atlas-stat-number {
  font-family: 'PP Eiko', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-style: normal;
  font-weight: 100;
  font-size: 3rem;
  line-height: 1;
  color: #000;
}

.atlas-stat-label {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  max-width: 22ch;
  line-height: 1.5;
}

/* Normalize all non-eyebrow sans-serif text on the page to one
   dark grey — eyebrows keep their own small/uppercase/letter-spaced
   treatment, untouched. */
.atlas-v2 .cs-body,
.atlas-v2 .cs-statement,
.atlas-body-lead,
.atlas-meta-value,
.atlas-stat-label,
.atlas-v2 .cs-bullet-list {
  color: #666;
}

/* Body/paragraph copy specifically — smaller than the general
   sans-serif size used for labels and short values. */
.atlas-v2 .cs-body,
.atlas-v2 .cs-statement,
.atlas-body-lead,
.atlas-v2 .cs-bullet-list {
  font-size: 0.85rem;
}

.atlas-meta-value {
  font-size: 0.85rem;
}

.atlas-stat-label {
  font-size: 0.95rem;
}

/* ── About modal ─────────────────────────────────────── */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.about-modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s ease, background-color var(--transition-long);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12);
}

.about-overlay.is-open .about-modal {
  transform: translateY(0) scale(1);
}

.about-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--surface);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 0.45rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.about-close:hover { background: var(--border); color: var(--text); }

.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.about-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface);
  overflow: hidden;
  position: relative;
  border: 2px solid var(--border);
}

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

.about-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: #000;
}

.about-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.about-bio {
  font-size: 0.625rem;
  color: #000;
  line-height: 1.65;
  max-width: 320px;
}

.about-links {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.25rem;
}

.about-links a {
  font-size: 0.55rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.about-links a:hover { color: var(--text); }

/* ── Envelope Homepage ───────────────────────────────── */
body {
  overflow: auto;
}

body.modal-open {
  overflow: hidden;
}

.env-page {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: url('new home page background.jpg') center center / cover no-repeat fixed;
  padding-top: 4rem;
}

/* ── Corner avatar ───────────────────────────────────── */
.corner-avatar {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: none;
  cursor: pointer !important;
  padding: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}
.corner-avatar:hover { opacity: 0.8; transform: scale(1.06); }
.corner-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Headline ─────────────────────────────────────────── */
.env-headline {
  font-size: 24px;
  font-weight: 400;
  color: #3a3530;
  letter-spacing: 0.02em;
  margin-bottom: 5rem;
  text-align: center;
  line-height: 1.4;
  opacity: 1;
  clip-path: inset(0 100% 0 0);
  animation: headlineReveal 1.2s ease forwards;
  animation-delay: 0.3s;
}

@keyframes headlineReveal {
  to { clip-path: inset(0 0% 0 0); }
}

/* ── Stage ───────────────────────────────────────────── */
.env-stage {
  position: relative;
  width: 65vw;
  height: 1100px;
  flex-shrink: 0;
}

/* ── Postcard (landscape) ─────────────────────────────── */
.postcard {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(800px) rotate(-6deg);
  width: 58vw;
  height: auto;
  z-index: 3;
  background: transparent;
  overflow: visible;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  perspective: 1400px;
}

.postcard.revealed {
  transform: translateX(-50%) translateY(176px) rotate(-6deg);
}

/* ── Flipper ──────────────────────────────────────────── */
.postcard-flipper {
  position: relative;
  width: 100%;
  height: auto;
}

/* ── Front face ───────────────────────────────────────── */
.postcard-front {
  position: relative;
}

.postcard-front::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e0dbd2;
  box-shadow: 0 2px 12px rgba(60,40,20,0.10);
  filter: url(#torn-edge);
  z-index: -1;
}

/* Top bar */
.postcard-topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid #ede8e0;
}

.postcard-topbar-label {
  font-size: 0.25rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #c8c0b4;
}

/* Card body — two columns */
.postcard-body {
  display: flex;
  height: 100%;
  padding: 48px 48px 32px 48px;
  gap: 0;
}

/* Left column: photo + address + message — exactly 1/3 */
.postcard-left {
  width: 33.333%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding-right: 1rem;
  padding-top: 0;
  min-width: 0;
}

.pc-photo {
  width: 92%;
  aspect-ratio: 1 / 1;
  height: auto;
  background: #d4cfc8;
  position: relative;
  overflow: visible;
  flex-shrink: 0;
}

.pc-photo-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

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

/* Tape pieces */
.pc-photo::before,
.pc-photo::after {
  content: '';
  position: absolute;
  width: 70px;
  height: 20px;
  background: rgba(215, 200, 170, 0.65);
  border-left: 1px solid rgba(180,160,120,0.25);
  border-right: 1px solid rgba(180,160,120,0.25);
  z-index: 5;
  backdrop-filter: blur(1px);
}
.pc-photo::before {
  top: -8px;
  left: -10px;
  transform: rotate(-8deg);
  transform-origin: center center;
}
.pc-photo::after {
  bottom: -8px;
  right: -10px;
  transform: rotate(-8deg);
  transform-origin: center center;
}

.pc-address-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 75%;
  margin-top: 16px;
}

.pc-address-line {
  font-size: 15px;
  color: #888;
}

.pc-address-label {
  font-size: 11px;
}

.pc-message {
  font-size: 14px;
  color: #555;
  line-height: 1.55;
  width: 92%;
  margin-top: 20px;
}

/* Center vertical divider */
.postcard-divider-v {
  width: 1px;
  background: #ede8e0;
  flex-shrink: 0;
  align-self: stretch;
}

/* Right column: name + stamp + work list — exactly 2/3 */
.postcard-right {
  flex: 1;
  min-width: 0;
  padding-top: 0;
  display: flex;
  flex-direction: column;
}

.profile-content {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
}

.pc-name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0;
}

.postcard-name {
  font-family: 'Neue Haas Grotesk Display', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #1a1a1a;
  display: block;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

/* Intro column: shares the work list's left edge, capped for readable lines */
.pc-intro {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 660px;
  text-align: left;
}

.postcard-intro {
  font-family: 'Neue Haas Grotesk Display', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: #888;
  line-height: 1.6;
  font-weight: 400;
  margin-bottom: 4px;
}

.postcard-footer {
  font-family: 'Neue Haas Grotesk Display', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: #888;
  line-height: 1.6;
  font-weight: 400;
  text-align: center;
  margin-top: 5rem;
}

.postcard-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.25);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.postcard-link:hover {
  text-decoration-color: currentColor;
}

.postcard-divider {
  height: 1px;
  background: #ede8e0;
  margin-bottom: 0.4rem;
}

.work-label {
  font-family: 'Neue Haas Grotesk Display', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9a9a9a;
  margin-top: 1rem;
  margin-bottom: 0.2rem;
  display: block;
}

.work-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.work-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.75rem 0.35rem;
  line-height: 1.2;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 4px;
  cursor: pointer !important;
  transition: background 0.15s;
  margin: 0 -0.35rem;
}

.work-row:last-child { border-bottom: none; }

.work-row:hover { background: #f6f2ec; }

.experiment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 32px;
  padding: 0.75rem 0.35rem;
  line-height: 1.2;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 4px;
  cursor: pointer !important;
  transition: background 0.15s;
  margin: 0 -0.35rem;
}

.experiment-row:hover { background: #f6f2ec; }

.experiment-placeholder {
  font-size: 13px;
  font-style: italic;
  color: #b8b2a8;
}

.about-me-text {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  font-weight: 400;
  margin-bottom: 0.6em;
}

.about-me-text:last-child {
  margin-bottom: 0;
}

.work-icon-box {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-icon {
  max-width: 20px;
  max-height: 20px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.work-icon--svg {
  color: #1a1a1a;
  width: 16px;
  height: auto;
  max-height: 18px;
}

.work-icon--atlas {
  max-width: 16px;
  max-height: 16px;
}

.work-name-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.work-title {
  font-size: 15px;
  color: #000;
  font-weight: 500;
}

.work-year {
  font-size: 15px;
  color: #c0b8ae;
}

.work-role {
  font-size: 15px;
  color: #aaa49e;
  text-align: right;
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
}

.stamp-box {
  width: 90px;
  height: 64px;
  margin-bottom: 1rem;
  flex-shrink: 0;
  transform: rotate(4deg);
}

.stamp-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.address-lines {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.address-line {
  height: 1px;
  background: #ddd7ce;
  width: 100%;
}

/* ── Postcard backdrop ───────────────────────────────── */
.postcard-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.postcard-backdrop.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Postcard compress button (shown only when expanded) ── */
.postcard-compress {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  color: #999;
  cursor: pointer !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, color 0.15s ease;
}

.postcard-compress:hover {
  color: #555;
}

.postcard-compress.is-visible {
  opacity: 1;
  pointer-events: all;
}


/* ── Postcard expanded state (full screen) ────────────── */
@keyframes postcardEmerge {
  from { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}

@keyframes postcardRecede {
  from { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
  to   { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
}

.postcard.is-expanded {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 102 !important;
  transition: none !important;
  animation: postcardEmerge 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  cursor: default !important;
  overflow-y: auto !important;
}

/* Full-screen: solid white edge to edge — drop the torn-paper edge, border and shadow */
.postcard.is-expanded {
  background: #fff !important;
  scrollbar-width: none; /* hide scrollbar, keep scrolling */
}

.postcard.is-expanded::-webkit-scrollbar {
  display: none;
}

.postcard.is-expanded .postcard-front::before {
  border-radius: 0;
  border: none;
  box-shadow: none;
  filter: none;
}

.postcard.is-expanded .work-label {
  margin-top: 3rem;
}

.postcard.is-expanded .pc-name-row {
  margin-bottom: 0.5rem;
}

/* Extra bio, only shown once the postcard is expanded */
.postcard-bio {
  font-family: 'Neue Haas Grotesk Display', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  display: none;
  margin-top: 1rem;
  font-size: 14px;
  color: #888;
  line-height: 1.6;
  font-weight: 400;
}

.postcard-bio p + p {
  margin-top: 1rem;
}

.postcard.is-expanded .postcard-bio {
  display: block;
  opacity: 0;
  animation: postcardBioIn 0.4s ease 0.3s forwards;
}

@media (max-width: 640px) {
  .postcard.is-expanded .postcard-body {
    padding: 32px 20px 24px;
  }
}

@keyframes postcardBioIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.postcard.is-collapsing {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 102 !important;
  transition: none !important;
  animation: postcardRecede 0.35s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.postcard.is-collapsing .postcard-front::before {
  border-radius: 0;
}

/* ── Work row hover preview ──────────────────────────── */
.work-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 360px;
  height: 240px;
  border-radius: 8px;
  background-color: #f0ece4;
  background-size: cover;
  background-position: center;
  box-shadow: 0 8px 28px rgba(60,40,20,0.22);
  border: 1px solid rgba(224,219,210,0.8);
  z-index: 150;
  pointer-events: none;
  opacity: 0;
  transform-origin: top left;
  transform: scale(0.94);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.work-preview.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* ── Envelope gussets (side panels, in front of card) ── */
.env-gusset {
  position: absolute;
  top: 400px;
  width: 50%;
  height: 875px;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px);
  animation: envelopePartFadeIn 0.7s ease forwards;
  animation-delay: 1.5s;
}
.env-gusset--left  { left: 0; }
.env-gusset--right { right: 0; }
.env-gusset svg { width: 100%; height: 100%; display: block; }

/* ── Open flap (behind card, above envelope body) ────── */
.env-flap {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  height: 350px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px);
  animation: envelopePartFadeIn 0.7s ease forwards;
  animation-delay: 1.5s;
}

.env-flap svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(80,60,30,0.20));
}

/* ── Envelope body (in front of card bottom) ─────────── */
.envelope {
  position: absolute;
  top: 400px;
  left: 0;
  right: 0;
  height: 875px;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 8px 32px rgba(80,60,30,0.22));
  opacity: 0;
  transform: translateY(16px);
  animation: envelopePartFadeIn 0.7s ease forwards;
  animation-delay: 1.5s;
}

@keyframes envelopePartFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.env-body-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Theme toggle ────────────────────────────────────── */
.theme-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.toggle-track {
  display: block;
  width: 36px;
  height: 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  position: relative;
  transition: background var(--transition-long), border-color var(--transition-long);
}

.toggle-thumb {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  transition: left var(--transition-long), background var(--transition-long);
}

body.is-dark .toggle-track {
  background: var(--text-muted);
  border-color: var(--text-muted);
}

body.is-dark .toggle-thumb {
  left: 19px;
  background: var(--bg);
}

/* ── Canvas ──────────────────────────────────────────── */
.canvas-viewport {
  position: fixed;
  top: 0;
  left: 0;
  background-image: radial-gradient(circle, rgba(0,0,0,0.1) 1px, transparent 1px);
  background-size: 24px 24px;
  right: 0;
  bottom: var(--footer-height);
  overflow: hidden;
  cursor: grab;

}

.canvas-viewport.is-panning {
  cursor: grabbing;
}

body.is-dark .canvas-viewport {
  background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
}

.canvas-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 3200px;
  height: 2400px;
  will-change: transform;
  transform-origin: 0 0;
}

/* ── Canvas tagline ──────────────────────────────────── */
.canvas-tagline {
  position: absolute;
  left: 650px;
  top: 390px;
  transform: translate(-50%, -50%);
  font-style: italic;
  font-size: 44px;
  font-weight: normal;
  color: var(--text);
  line-height: 1.15;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}

/* ── Project cards ───────────────────────────────────── */
.card-wrapper {
  position: absolute;
  width: 420px;
  cursor: grab;
}

.card-wrapper:active { cursor: grabbing; }

.card-wrapper.is-small { width: 320px; }

.project-card {
  width: 100%;
  background: #e8e8e8;
  border-radius: 20px;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

body.is-dark .project-card {
  background: #2a2a2a;
}

.card-wrapper:hover .project-card {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  transform: translateY(-2px);
}

body.is-dark .card-wrapper:hover .project-card {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}


.card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  background: #e0e0e0;
}

body.is-dark .card-image { background: #333; }

/* ── Card metadata (below card) ─────────────────────── */
.card-meta {
  padding: 0.75rem 0.25rem 0;
}


.card-title {
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.card-desc {
  font-size: 0.5rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tag {
  font-size: 0.4rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  background: var(--surface);
  color: #000;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

/* ── Social nav ──────────────────────────────────────── */
.social-nav {
  position: fixed;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem 0.5rem;
  background-color: rgba(248, 248, 248, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  transition: background-color var(--transition-long), border-color var(--transition-long);
}

body.is-dark .social-nav {
  background-color: rgba(25, 25, 25, 0.75);
}

.social-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}

.social-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}
