:root {
  --bg: #F4F2ED;
  --ink: #111111;
  --accent: #5D1900;
  --accent-hover: #3D1000;
  --paper-bg: #EDE7D8;
  --paper-text: #3a352a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Source Serif 4', serif;
  overflow-x: hidden;
  background-color: #3a2418;
  background-image: url("assets/team-collage-bg.png");
  background-repeat: repeat;
  background-size: 900px 900px;
  background-attachment: fixed;
}
body.modal-open {
  overflow: hidden;
}

.page {
  background: var(--bg);
  max-width: 1100px;
  margin: 0 auto;
  box-shadow: 0 0 80px rgba(0,0,0,0.4);
  position: relative;
}

@media (max-width: 900px) {
  .page { box-shadow: none; }
}

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

.folio {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.accent { color: var(--accent); }

.wordmark {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Buttons */
.btn {
  cursor: pointer;
  display: inline-block;
  flex-shrink: 0;
  white-space: nowrap;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1.5px solid var(--ink);
  padding: 12px 24px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-align: center;
}
.btn-invert { background: var(--bg); color: var(--ink); padding: 9px 18px; font-size: 13px; }
.btn-invert:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-outline { background: var(--bg); color: var(--ink); }
.btn-outline:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1.5px solid var(--ink);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Generic section */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 32px;
  border-bottom: 1.5px solid var(--ink);
  text-align: center;
}
.section-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 4.2vw, 48px);
  text-transform: uppercase;
  margin: 0 0 32px;
}

/* Hero */
.hero { padding: 56px 32px 40px; }
.hero-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(56px, 10vw, 124px);
  line-height: 0.92;
  margin: 16px 0 20px;
  letter-spacing: -1px;
  text-transform: uppercase;
}
.hero-tagline {
  max-width: 600px;
  margin: 0 auto;
  border-top: 1.5px solid var(--ink);
  padding-top: 20px;
}
.hero-tagline p {
  font-size: 17px;
  line-height: 1.6;
  margin: 0;
  font-style: italic;
}

/* Marquee */
.marquee {
  background: var(--ink);
  padding: 10px 0;
  overflow: hidden;
  white-space: nowrap;
}
.marquee-track {
  display: inline-flex;
  animation: marquee 44s linear infinite;
}
.marquee-text {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding-right: 40px;
  color: var(--bg);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Bio */
.bio {
  max-width: 1100px;
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: 48px;
  align-items: center;
  text-align: left;
}
.bio-photo {
  aspect-ratio: 4 / 5;
  border: 1.5px solid var(--ink);
  overflow: hidden;
}
.bio-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bio-text-col p { font-size: 17px; line-height: 1.7; margin: 0 0 14px; }

/* Team */
.team-track {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.team-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
  margin-right: 20px;
  padding: 16px;
  border: 1.5px solid var(--ink);
  text-align: left;
}
.team-card:last-child { margin-right: 0; }
.flip-wrap {
  perspective: 1400px;
  margin-bottom: 14px;
}
.flip-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}
.flip-inner.flipped { transform: rotateY(180deg); }
.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border: 1px solid var(--ink);
  overflow: hidden;
}
.flip-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flip-face-back {
  cursor: pointer;
  transform: rotateY(180deg);
  background: var(--paper-bg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}
.flip-face-back .folio { opacity: 0.5; margin-bottom: 10px; }
.bio-chart {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--paper-text);
  margin: 0 0 12px;
  transform: rotate(-0.6deg);
}
.bio-specialties-label { opacity: 0.5; margin-bottom: 6px; transform: rotate(-0.6deg); }
.bio-specialties {
  font-family: 'Source Serif 4', serif;
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
  color: var(--paper-text);
  margin: 0;
  padding-left: 18px;
  flex: 1;
  overflow-y: auto;
  transform: rotate(-0.6deg);
}
.team-card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.team-card-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 17px;
  text-transform: uppercase;
}
.team-card-ig { display: inline-flex; align-items: center; }
.team-card-role { opacity: 0.6; margin-bottom: 10px; }
.team-card-toggle {
  cursor: pointer;
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink);
  border-bottom: 1.5px solid var(--accent);
  margin-bottom: 10px;
  background: none;
  border-top: none; border-left: none; border-right: none;
  padding: 0;
}
.team-card-book {
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--ink);
  padding: 10px;
  margin-top: 4px;
}
.team-card-book:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.scroll-arrows {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 28px;
}
.arrow {
  cursor: pointer;
  border: 1.5px solid var(--ink);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.arrow:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Work carousel */
.work-carousel-track {
  display: flex;
  align-items: center;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 40px calc(50% - clamp(80px, 15vw, 130px));
  margin: 0 -32px 12px;
  scrollbar-width: thin;
}
.work-tile {
  flex: 0 0 clamp(160px, 30vw, 260px);
  scroll-snap-align: center;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--ink);
  overflow: hidden;
  opacity: 0.55;
  transform: scale(0.88);
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.work-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-tile.is-active {
  opacity: 1;
  transform: scale(1.12);
  border: 1.5px solid var(--ink);
  box-shadow: 0 14px 28px rgba(0,0,0,0.25);
  z-index: 2;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-panel {
  background: var(--bg);
  border: 1.5px solid var(--ink);
  width: 100%;
  overflow: hidden;
}
.modal-panel-wide { max-width: 760px; }
.modal-panel-narrow { max-width: 440px; padding: 28px 24px; position: relative; text-align: left; }
.modal-header {
  background: var(--ink);
  color: var(--bg);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-close {
  cursor: pointer;
  color: var(--bg);
  font-size: 18px;
  line-height: 1;
}
.modal-close-dark {
  color: var(--ink);
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 20px;
}
.modal-iframe { width: 100%; height: 80vh; max-height: 820px; border: none; display: block; }
.modal-iframe-wrap { position: relative; }
.modal-iframe-wrap .modal-iframe.is-loading { visibility: hidden; }
.modal-iframe-loading {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink);
}
.modal-iframe-loading.is-visible { display: flex; }
.modal-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 24px;
  text-transform: uppercase;
  margin: 0 0 20px;
}

/* Footer */
.footer a { color: var(--bg); text-decoration: underline; }
.footer a:hover { color: var(--accent); }
.footer {
  background: var(--ink);
  color: var(--bg);
  padding: 32px 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 720px) {
  .bio { grid-template-columns: 1fr; }
  .marquee { padding: 7px 0; }
  .marquee-text { font-size: 10px; letter-spacing: 1.5px; padding-right: 28px; }
}
