* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #5c5c5c;
  --text-body: #444444;
  --accent: #000000;
  --f-serif: 'Playfair Display', serif;
  --f-sans: 'Libre Franklin', sans-serif;
  --border-color: #dcdcdc;
  --gutter: clamp(20px, 5.56vw, 80px);
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--f-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background-color: var(--accent);
  color: var(--bg);
}

/* Layout Containers */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px var(--gutter) 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}

.nav-brand {
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--f-serif);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: opacity 0.2s;
}

.nav-brand:hover {
  opacity: 0.5;
}

.nav-brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-primary);
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: opacity 0.2s;
}

.nav-links a:hover {
  opacity: 0.5;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: block;
  }
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 32px;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.nav-links li {
  list-style: none;
}

.mobile-menu a {
  font-family: var(--f-serif);
  font-size: 32px;
  font-style: italic;
  text-decoration: none;
  color: var(--text-primary);
}

.menu-toggle, .menu-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-close {
  position: absolute;
  top: 20px;
  right: var(--gutter);
}

/* Shared section grid: one margin, one label column */
.section {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 56px 0;
  border-top: 1px solid var(--border-color);
}

.section-label {
  flex: 0 0 193px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 28px;
}

.section-body {
  flex: 999 1 560px;
  min-width: 0;
}

/* Feature flags (set in zazen.json > settings.universalTags) */
.case-studies-off .flag-case-studies {
  display: none !important;
}

.hero-buttons-off .flag-hero-buttons {
  display: none !important;
}

/* Hero Section */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px 48px;
  padding: 40px 0 72px;
}

.hero-copy {
  flex: 1 1 440px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.hero-title {
  font-family: var(--f-serif);
  font-size: clamp(38px, 4.6vw, 64px);
  font-weight: 900;
  line-height: 1.08;
  text-wrap: balance;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-body);
  max-width: 520px;
  text-wrap: pretty;
}

.hero-mesh {
  flex: 1 1 480px;
  min-width: 0;
  height: 580px;
}

.cta-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: all 0.3s;
}

.btn:hover,
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  opacity: 0.75;
}

@media (max-width: 768px) {
  .hero {
    padding: 24px 0 48px;
  }
  .hero-mesh {
    height: 400px;
  }
}

/* About Section */
.about-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 40px;
}

.image-wrapper {
  flex: 0 0 160px;
  width: 160px;
  height: 200px;
  overflow: hidden;
  background: #f5f5f5;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: filter 1s;
}

.image-wrapper:hover img {
  filter: grayscale(0%);
}

.about-content {
  flex: 1 1 400px;
  min-width: 0;
  max-width: 680px;
}

.about-lead {
  font-family: var(--f-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 16px;
  text-wrap: pretty;
}

.section-text {
  font-size: 16px;
  color: var(--text-body);
}

.about-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
}

.meta-col {
  flex: 1 1 240px;
  min-width: 0;
}

.meta-col h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.meta-col ul {
  list-style: none;
}

.meta-col li {
  margin-bottom: 6px;
}

/* Experience Section */
.exp-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 28px 0;
  border-bottom: 1px solid #e6e6e6;
}

.exp-item:first-child {
  padding-top: 0;
}

.exp-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.exp-year {
  flex: 0 0 120px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 28px;
}

.exp-body {
  flex: 1 1 360px;
  min-width: 0;
}

.exp-role {
  font-size: 19px;
  font-weight: 600;
  line-height: 28px;
}

.exp-company {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin: 2px 0 10px;
}

.exp-points {
  padding-left: 18px;
  color: var(--text-body);
}

.exp-points li {
  margin-bottom: 4px;
}

.exp-points li:empty {
  display: none;
}

.exp-earlier {
  color: var(--text-body);
  margin-top: 4px;
}

.exp-link {
  flex: 0 0 auto;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  line-height: 28px;
  color: var(--text-primary);
}

/* Contact Section */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  font-size: 15px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.contact-links a:hover,
.exp-link:hover {
  opacity: 0.5;
}

/* Wave under Contact (drawn by registry/scripts/wave.js) */
.contact-wave {
  margin-bottom: 32px;
}

.mesh-wave {
  display: block;
  width: 100%;
  aspect-ratio: 680 / 75;
  color: var(--text-primary);
}

/* Footer */
.main-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  margin-top: auto;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Nav Active Link */
.nav-links a.active, .mobile-menu a.active {
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--text-primary);
}

/* Work Page Styles */
.work-header {
  padding: 40px 0 56px;
}

.page-title {
  font-family: var(--f-serif);
  font-size: clamp(38px, 4.6vw, 64px);
  font-weight: 900;
  line-height: 1.08;
  margin-bottom: 16px;
}

.work-header-subtitle {
  font-size: 18px;
  color: var(--text-body);
  max-width: 640px;
  text-wrap: pretty;
}

/* Case studies (behind the caseStudies flag) */
.case-study {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px 40px;
}

.case-study + .case-study {
  margin-top: 56px;
  padding-top: 56px;
  border-top: 1px solid #e6e6e6;
}

.case-media {
  flex: 1 1 360px;
  min-width: 0;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ececea;
  border: 1px solid var(--border-color);
  font-size: 13px;
  color: #555555;
}

.case-body {
  flex: 1 1 360px;
  min-width: 0;
}

.case-meta {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.case-title {
  font-family: var(--f-serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
}

.case-facts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
}

.case-facts div {
  display: flex;
  gap: 16px;
}

.case-facts dt {
  flex: 0 0 84px;
  font-weight: 600;
}

.case-facts dd {
  color: var(--text-body);
}

/* Explorations: 4x4 mesh grid */
/* Span the full content width (below the label) so the grid is centered on the page */
#interactive-3d-mesh .section-body {
  flex-basis: 100%;
}

.mesh-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.mesh-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

@media (max-width: 768px) {
  .mesh-grid {
    gap: 6px;
  }
}

.three-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
}

.three-canvas:active {
  cursor: grabbing;
}

.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
