/*
  MDA subpage layouts
  Loaded after styles.css so the Expertise and About layouts remain stable
  even when an older version of the main stylesheet is cached.
*/

body[data-page="expertise"],
body[data-page="about"] {
  background: #030303;
  color: #f4f4f0;
  overflow-x: hidden;
}

body[data-page="expertise"] .site-header,
body[data-page="about"] .site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 82px;
  background: rgba(3, 3, 3, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-page="expertise"] .section-shell,
body[data-page="about"] .section-shell,
body[data-page="expertise"] .site-header,
body[data-page="about"] .site-header {
  width: min(calc(100% - 96px), 1480px);
  margin-inline: auto;
}

/* =========================
   Expertise page
   ========================= */

.projects-page {
  padding: 0 0 72px;
}

.projects-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(420px, 1.3fr);
  gap: clamp(48px, 7vw, 110px);
  align-items: end;
  min-height: auto;
  padding: 82px 0 58px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.projects-intro .section-kicker {
  margin-bottom: 16px;
}

.projects-intro h1 {
  margin: 0;
  font-size: clamp(3.6rem, 5.5vw, 6.6rem);
  line-height: 0.92;
  font-weight: 400;
  letter-spacing: -0.065em;
}

.projects-intro-copy {
  max-width: 760px;
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 1rem;
  line-height: 1.7;
}

.project-list {
  padding: 56px 0 96px;
}

.project-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: clamp(18px, 1.8vw, 30px) !important;
  align-items: start;
  width: 100%;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.project-image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.project-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(0.12) saturate(0.85);
  transition: transform 600ms cubic-bezier(.2, .7, .1, 1), filter 250ms ease;
}

.project-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, 0.52));
  opacity: 0;
  transition: opacity 250ms ease;
}

.project-image:hover img,
.project-image:focus-visible img {
  transform: scale(1.035);
  filter: grayscale(0) saturate(1);
}

.project-image:hover::after,
.project-image:focus-visible::after {
  opacity: 1;
}

.project-index {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.78);
}

.project-card-copy {
  padding-top: 17px;
}

.project-card-copy h2 {
  min-height: 0;
  margin: 0;
  font-size: clamp(1.05rem, 1.4vw, 1.35rem);
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.project-card-copy p {
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.72rem;
  line-height: 1.55;
  letter-spacing: 0.03em;
}

/* =========================
   About page
   ========================= */

.about-page {
  padding: 0 0 72px;
}

.manifesto {
  display: grid !important;
  grid-template-columns: minmax(0, 1.42fr) minmax(280px, 0.58fr) !important;
  align-items: center;
  gap: clamp(60px, 8vw, 130px);
  min-height: calc(100svh - 82px);
  padding: 76px 0 90px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.manifesto-copy {
  min-width: 0;
}

.manifesto-copy h1 {
  max-width: 980px;
  margin: 0 0 38px;
  font-size: clamp(3.4rem, 5.6vw, 6.8rem);
  line-height: 0.96;
  font-weight: 400;
  letter-spacing: -0.065em;
}

.manifesto-copy > p:not(.section-kicker) {
  max-width: 980px;
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(0.96rem, 1.05vw, 1.08rem);
  line-height: 1.62;
}

.manifesto-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
}

.manifesto-mark img {
  display: block;
  width: min(100%, 330px);
  height: auto;
}

.manifesto-mark p {
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.9rem;
}

.manifesto-mark span {
  margin-inline: 5px;
  color: rgba(255, 255, 255, 0.3);
}

.founders {
  padding: 0;
}

.founder-profile,
.founder-profile.founder-profile-reverse {
  display: grid !important;
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, 0.58fr) !important;
  align-items: center;
  gap: clamp(60px, 8vw, 130px);
  min-height: 720px;
  padding: 96px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.founder-profile-reverse .founder-copy,
.founder-profile-reverse .founder-photo {
  order: initial !important;
}

.founder-copy {
  min-width: 0;
}

.profile-number {
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
}

.founder-copy h2 {
  margin: 0;
  font-size: clamp(3.2rem, 5vw, 6rem);
  line-height: 0.94;
  font-weight: 400;
  letter-spacing: -0.065em;
}

.founder-role {
  margin: 16px 0 34px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.95rem;
}

.founder-copy > p:not(.profile-number):not(.founder-role) {
  max-width: 970px;
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(0.95rem, 1.02vw, 1.06rem);
  line-height: 1.62;
}

.founder-photo {
  width: min(100%, 430px);
  margin: 0;
  justify-self: end;
}

.founder-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(1) contrast(1.02);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.founder-photo figcaption {
  margin-top: 13px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Shared CTA/footer for both subpages */
body[data-page="expertise"] .page-cta,
body[data-page="about"] .page-cta {
  padding: 68px 0;
}

body[data-page="expertise"] .compact-footer,
body[data-page="about"] .compact-footer {
  padding: 28px 0 34px;
}

@media (max-width: 1180px) {
  body[data-page="expertise"] .section-shell,
  body[data-page="about"] .section-shell,
  body[data-page="expertise"] .site-header,
  body[data-page="about"] .site-header {
    width: min(calc(100% - 56px), 1480px);
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    row-gap: 56px !important;
  }

  .projects-intro,
  .manifesto,
  .founder-profile,
  .founder-profile.founder-profile-reverse {
    gap: 54px;
  }
}

@media (max-width: 900px) {
  body[data-page="expertise"] .section-shell,
  body[data-page="about"] .section-shell,
  body[data-page="expertise"] .site-header,
  body[data-page="about"] .site-header {
    width: min(calc(100% - 40px), 1480px);
  }

  .projects-intro,
  .manifesto,
  .founder-profile,
  .founder-profile.founder-profile-reverse {
    grid-template-columns: 1fr !important;
  }

  .projects-intro {
    padding-top: 58px;
  }

  .manifesto {
    min-height: auto;
    padding-top: 64px;
  }

  .manifesto-mark {
    align-items: flex-start;
    text-align: left;
  }

  .manifesto-mark img {
    width: min(68vw, 330px);
  }

  .founder-profile,
  .founder-profile.founder-profile-reverse {
    min-height: auto;
    padding: 78px 0;
  }

  .founder-photo {
    width: min(100%, 500px);
    justify-self: start;
  }
}

@media (max-width: 640px) {
  body[data-page="expertise"] .section-shell,
  body[data-page="about"] .section-shell,
  body[data-page="expertise"] .site-header,
  body[data-page="about"] .site-header {
    width: min(calc(100% - 24px), 1480px);
  }

  .projects-intro {
    padding: 48px 0 42px;
  }

  .projects-intro h1 {
    font-size: clamp(3.4rem, 18vw, 5rem);
  }

  .project-list {
    padding-top: 36px;
  }

  .project-grid {
    grid-template-columns: 1fr !important;
    gap: 46px !important;
  }

  .project-image {
    aspect-ratio: 4 / 5;
  }

  .manifesto-copy h1,
  .founder-copy h2 {
    font-size: clamp(3.1rem, 15vw, 4.8rem);
  }

  .manifesto {
    padding-bottom: 70px;
  }

  .founder-profile,
  .founder-profile.founder-profile-reverse {
    padding: 66px 0;
  }
}

/* =========================
   Expertise card refinement
   ========================= */

.project-image {
  aspect-ratio: 16 / 10;
}

.project-open {
  position: absolute;
  z-index: 3;
  left: 16px;
  bottom: 14px;
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.project-image:hover .project-open,
.project-image:focus-visible .project-open {
  opacity: 1;
  transform: translateY(0);
}

.project-card-copy h2 a {
  transition: opacity 180ms ease;
}

.project-card-copy h2 a:hover,
.project-card-copy h2 a:focus-visible {
  opacity: 0.62;
}

/* =========================
   Project detail page
   ========================= */

.project-detail-page {
  padding-bottom: 84px;
}

.project-detail-head {
  display: grid;
  grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1.85fr);
  gap: clamp(28px, 5vw, 90px);
  align-items: end;
  padding: 60px 0 48px;
}

.back-link {
  align-self: start;
  width: fit-content;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  transition: color 180ms ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: #fff;
}

.project-detail-title .section-kicker {
  margin-bottom: 14px;
}

.project-detail-title h1 {
  margin: 0;
  font-size: clamp(3.4rem, 6.8vw, 8rem);
  line-height: 0.9;
  font-weight: 400;
  letter-spacing: -0.07em;
}

.project-showcase {
  padding-bottom: 82px;
}

.project-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 8.8;
  min-height: 420px;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.14);
  outline: none;
}

.project-slides,
.project-slide {
  position: absolute;
  inset: 0;
}

.project-slide {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.018);
  transition: opacity 700ms ease, transform 1200ms ease, visibility 700ms;
}

.project-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.project-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.project-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.project-carousel-control {
  position: absolute;
  z-index: 4;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(6px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 180ms ease, background 180ms ease;
}

.project-carousel:hover .project-carousel-control,
.project-carousel:focus-within .project-carousel-control {
  opacity: 1;
}

.project-carousel-control:hover,
.project-carousel-control:focus-visible {
  background: rgba(0, 0, 0, 0.78);
}

.project-carousel-previous {
  left: 24px;
}

.project-carousel-next {
  right: 24px;
}

.project-carousel-status {
  position: absolute;
  z-index: 4;
  left: 22px;
  bottom: 20px;
  display: flex;
  gap: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}

.project-carousel-dots {
  position: absolute;
  z-index: 4;
  right: 22px;
  bottom: 20px;
  display: flex;
  gap: 9px;
}

.project-carousel-dot {
  width: 24px;
  height: 2px;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: width 180ms ease, background 180ms ease;
}

.project-carousel-dot.is-active {
  width: 42px;
  background: #fff;
}

.project-story {
  display: grid;
  grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1.85fr);
  gap: clamp(50px, 9vw, 150px);
  padding: 72px 0 88px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.project-story-heading .section-kicker {
  margin: 5px 0 0;
}

.project-story-copy {
  max-width: 820px;
}

.project-story-copy p {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(0.96rem, 1.05vw, 1.08rem);
  line-height: 1.72;
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(var(--project-fact-count, 3), minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.project-facts > div {
  min-height: 150px;
  padding: 34px 26px 32px 0;
}

.project-facts > div + div {
  padding-left: 26px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.project-facts span {
  display: block;
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-facts strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.5;
  font-weight: 400;
}

.project-next {
  padding: 92px 0 58px;
}

.project-next p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-next a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.26);
  font-size: clamp(2.6rem, 6vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
  transition: opacity 180ms ease;
}

.project-next a:hover,
.project-next a:focus-visible {
  opacity: 0.58;
}

.project-not-found {
  padding: 120px 0;
}

@media (max-width: 1100px) {
  .project-detail-head {
    grid-template-columns: 1fr 2fr;
  }

  .project-story {
    grid-template-columns: 1fr;
    gap: 32px;
  }

}

@media (max-width: 900px) {
  .project-carousel {
    aspect-ratio: 4 / 3;
    min-height: 0;
  }

}

@media (max-width: 640px) {
  .project-image {
    aspect-ratio: 16 / 11;
  }

  .project-open {
    display: none;
  }

  .project-detail-head {
    grid-template-columns: 1fr;
    padding-top: 44px;
  }

  .project-detail-title h1 {
    font-size: clamp(3.1rem, 16vw, 5rem);
  }

  .project-showcase {
    padding-bottom: 54px;
  }

  .project-carousel {
    aspect-ratio: 1 / 1;
  }

  .project-carousel-control {
    width: 42px;
    height: 42px;
    opacity: 1;
  }

  .project-carousel-previous {
    left: 12px;
  }

  .project-carousel-next {
    right: 12px;
  }

  .project-carousel-status {
    left: 14px;
    bottom: 14px;
  }

  .project-carousel-dots {
    right: 14px;
    bottom: 14px;
  }

  .project-story {
    padding: 54px 0 62px;
  }

  .project-facts {
    grid-template-columns: 1fr;
  }

  .project-facts > div,
  .project-facts > div + div {
    min-height: 0;
    padding: 26px 0;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .project-facts > div:first-child {
    border-top: 0;
  }

  .project-next {
    padding-top: 66px;
  }
}


/* =========================
   Contact page
   ========================= */

body[data-page="contact"] {
  background: #030303;
  color: #f4f4f0;
  overflow-x: hidden;
}

body[data-page="contact"] .site-header,
body[data-page="contact"] .section-shell {
  width: min(calc(100% - 96px), 1480px);
  margin-inline: auto;
}

body[data-page="contact"] .site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 82px;
  background: rgba(3, 3, 3, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.contact-page {
  padding: 0;
}

.contact-page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.92fr);
  gap: clamp(56px, 7vw, 110px);
  align-items: stretch;
  min-height: calc(100svh - 82px);
  padding: 42px 0 72px;
}

.contact-page-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px 0 10px;
}

.contact-page-heading {
  margin-bottom: clamp(58px, 8vh, 96px);
}

.contact-page-heading .section-kicker {
  margin-bottom: 20px;
}

.contact-page-heading h1 {
  margin: 0;
  font-size: clamp(3.8rem, 6.4vw, 7.2rem);
  line-height: 0.92;
  font-weight: 400;
  letter-spacing: -0.065em;
}

.contact-page-heading h1 em {
  font-weight: 400;
}

.contact-lead {
  max-width: 650px;
  margin: 24px 0 0;
  color: rgba(255,255,255,0.72);
  font-size: 1rem;
  line-height: 1.55;
}

.contact-direct {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 22px;
}

.contact-direct a {
  color: rgba(255,255,255,0.88);
  font-size: 0.94rem;
}

.contact-direct a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact-socials {
  margin-top: 58px;
}

.contact-page-form {
  display: grid;
  gap: 24px;
  width: 100%;
  max-width: 680px;
  margin-top: auto;
}

.contact-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.contact-page-form label {
  display: block;
  min-width: 0;
}

.contact-page-form label > span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.92);
  font-size: 0.9rem;
}

.contact-page-form small {
  color: rgba(255,255,255,0.46);
  font-size: 0.75rem;
  font-weight: 400;
}

.contact-page-form input,
.contact-page-form textarea {
  width: 100%;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.42);
  border-radius: 0;
  outline: none;
}

.contact-page-form input {
  height: 48px;
  padding: 0 14px;
}

.contact-page-form textarea {
  min-height: 150px;
  padding: 14px;
  resize: vertical;
}

.contact-page-form input:focus,
.contact-page-form textarea:focus {
  border-color: #fff;
  background: rgba(255,255,255,0.03);
}

.contact-form-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.contact-page-visual {
  position: relative;
  min-height: 760px;
  margin: 0;
  overflow: hidden;
  background: #111;
}

.contact-page-visual img {
  width: 100%;
  height: 100%;
  min-height: 760px;
  object-fit: cover;
  object-position: center;
}

.contact-page-visual figcaption {
  position: absolute;
  left: 20px;
  bottom: 18px;
  margin: 0;
  padding: 8px 10px;
  color: rgba(255,255,255,0.76);
  background: rgba(0,0,0,0.38);
  backdrop-filter: blur(6px);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact-page-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 34px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.46);
  font-size: 0.74rem;
}

@media (max-width: 1180px) {
  body[data-page="contact"] .site-header,
  body[data-page="contact"] .section-shell {
    width: min(calc(100% - 56px), 1480px);
  }

  .contact-page-shell {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
    gap: 46px;
  }
}

@media (max-width: 900px) {
  body[data-page="contact"] .site-header,
  body[data-page="contact"] .section-shell {
    width: min(calc(100% - 40px), 1480px);
  }

  .contact-page-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 34px;
  }

  .contact-page-heading {
    margin-bottom: 52px;
  }

  .contact-page-form {
    max-width: none;
  }

  .contact-page-visual,
  .contact-page-visual img {
    min-height: 620px;
  }
}

@media (max-width: 640px) {
  body[data-page="contact"] .site-header,
  body[data-page="contact"] .section-shell {
    width: min(calc(100% - 24px), 1480px);
  }

  .contact-page-heading h1 {
    font-size: clamp(3.2rem, 17vw, 5rem);
  }

  .contact-form-row {
    grid-template-columns: 1fr;
  }

  .contact-page-visual,
  .contact-page-visual img {
    min-height: 480px;
  }

  .contact-page-footer {
    flex-direction: column;
  }
}
