/* ============================================================
   Sinc — Independent Design Studio
   Global stylesheet
   ============================================================ */

/* ---- Fonts ---- */
@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap");

/* Flecha Test M (OpenType) */
@font-face {
  font-family: "Flecha Test M";
  src: url("../fonts/FlechaM-Light.woff2") format("opentype"); 
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* Flecha Test M (Medium) */
@font-face {
  font-family: "Flecha Test M";
  src: url("../fonts/FlechaM-Medium.woff2") format("opentype"); 
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Aeonik Pro (OpenType) */
@font-face {
  font-family: "Aeonik Pro";
  src: url("../fonts/AeonikPro-Regular.otf") format("opentype"); 
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---- Design tokens ---- */
:root {
  --c-0: #ffffff;
  --c-30: #f7f7f7;
  --c-50: #f2f2f2;
  --c-100: #e5e5e5;
  --c-150: #d9d9d9;
  --c-200: #cccccc;
  --c-400: #999999;
  --c-500: #808080;
  --c-600: #666666;
  --c-700: #4d4d4d;
  --c-800: #333333;
  --c-900: #1a1a1a;
  --c-950: #0d0d0d;
  --c-1000: #000000;
  --error: #bf3030;
}

/* ---- 1. Base / Mobile (Screens under 768px) ---- */
:root {
  /* Strings (Declared once, used everywhere) */
  --font-family-sans-serif: "Aeonik Pro", sans-serif; 
  --font-family-serif: "Flecha Test M", serif;
  --font-weight-bold: bold;
  --font-weight-italic: italic;
  --font-weight-light: 300;
  --font-weight-medium: 500;
  --font-weight-regular: 400;
  --font-weight-semibold: 600;
  --font-weight-thin: 100;

  /* Mobile Sizes */
  --font-size-small: 0.875rem;  /* Bumped from 13px to 14px */
  --font-size-body: 1rem;       /* Bumped from 15px to 16px */
  --font-size-h-6: 1.25rem;     /* Bumped from 18px to 20px */
  --font-size-h-5: 1.5rem;      /* Bumped from 22px to 24px */
  
  /* Titles - Untouched */
  --font-size-h-4: 1.75rem;
  --font-size-h-3: 2.125rem;
  --font-size-h-2: 2.5rem;
  --font-size-h-1: 2.75rem;
  --font-size-h-0: 3rem;
}

/* ---- 2. Netbook / Tablet (Screens 768px to 1280px) ---- */
@media (min-width: 768px) {
  :root {
    --font-size-small: 0.875rem; /* Bumped from 12px to 14px */
    --font-size-body: 1rem;      /* Bumped from 15px to 16px */
    --font-size-h-6: 1.25rem;    /* Bumped from 19px to 20px */
    --font-size-h-5: 1.5rem;
    
    /* Titles - Untouched */
    --font-size-h-4: 2rem;
    --font-size-h-3: 2.5rem;
    --font-size-h-2: 3.1875rem;
    --font-size-h-1: 4rem;
    --font-size-h-0: 5rem;
  }
}

/* ---- 3. Desktop (Screens 1440px and larger) ---- */
@media (min-width: 1440px) {
  :root {
    --font-size-small: 0.875rem;  /* Bumped from 12px to 14px */
    --font-size-body: 1.0625rem;  /* Bumped from 15px to 17px */
    --font-size-h-6: 1.375rem;    /* Bumped from 20px to 22px */
    --font-size-h-5: 1.625rem;
    
    /* Titles - Untouched */
    --font-size-h-4: 2.25rem;
    --font-size-h-3: 2.875rem;
    --font-size-h-2: 3.875rem;
    --font-size-h-1: 5.25rem;
    --font-size-h-0: 7.0625rem;
  }
}

/* Horizontal page padding */
:root {
  --pad: 1.25rem;
}

@media (min-width: 768px) {
  :root { --pad: 4rem; }
}
/* ---- Reset (scoped, non-universal safe) ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-family-sans-serif);
  font-size: var(--font-size-body);
  line-height: 1.4;
  color: var(--c-900);
  background: var(--c-30);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Apply to the <body> tag of any page that needs a full dark background */
body.bg-dark {
  background: var(--c-950);
}

h1, h2, h3, p, figure, blockquote { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

.serif { font-family: var(--font-family-serif); font-weight: 300; }

/* ---- Shared section title ---- */
.section-title {
  font-size: var(--font-size-h-1);
  line-height: 1;
  margin-bottom: 3rem;
}
@media (min-width: 768px) {
  .section-title { margin-bottom: 8rem; }
}

/* ---- Pill CTA ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  padding: 1rem;
  font-size: var(--font-size-body);
  line-height: 1;
  border: 1px solid var(--c-1000);
  border-radius: 9999px;
  color: var(--c-1000);
  transition: background-color 0.3s ease, color 0.3s ease;
}
.pill i { font-style: normal; transition: transform 0.3s ease; }
.pill:hover { background: var(--c-1000); color: var(--c-0); }
.pill:hover i { transform: translateX(4px); }
.pill--dark { border-color: var(--c-0); color: var(--c-0); }
.pill--dark:hover { background: var(--c-0); color: var(--c-1000); }

/* ============================================================
   Navigation & Desktop Menu (Aligned & Responsive)
   ============================================================ */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1.25rem var(--pad);
  color: var(--c-0);
  mix-blend-mode: difference;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 768px) { .navbar { padding: 2rem var(--pad); } }
.navbar--hidden { transform: translateY(-120%); }
.navbar__logo svg,
.footer__logo svg { display: block; }
.navbar__burger { display: flex; padding: 0; }
.navbar__burger svg { transition: color 0.3s ease; }
.navbar__burger:hover svg { color: var(--c-500); }

/* Fullscreen menu (Layout-Safe Drawer) */
.menu {
  position: fixed;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--c-950);
  color: var(--c-0);
  visibility: hidden;
  transition: top 0.6s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0.6s;
}
.menu.is-open { 
  top: 0; 
  visibility: visible; 
  transition: top 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1.25rem var(--pad);
  width: 100%;
  box-sizing: border-box !important;
  flex-shrink: 0;
  
  /* Force hide scrollbars */
  overflow: hidden !important; 
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE/Edge */
}

/* Chrome, Safari, Opera */
.menu__top::-webkit-scrollbar {
  display: none !important;
}

@media (min-width: 768px) { .menu__top { padding: 2rem var(--pad); } }
@media (min-width: 1024px) { 
  .menu__top { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    z-index: 10;
  }
}
.menu__logo { font-family: var(--font-family-serif); font-size: 1.5rem; }
.menu__logo span { color: var(--c-400); }
.menu__close {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: none;
  border: none;
  color: var(--c-0);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu__close-icon {
  display: none;
}
@media (min-width: 1024px) {
  .menu__close-text { display: none; }
  .menu__close-icon { display: block; width: 28px; height: 28px; }
}

.menu__contact-details a,
.menu__socials a,
.menu__primary-links a,
.menu__secondary-links a,
.menu__terms a,
.menu__checkbox-label a {
  transition: color 0.3s ease;
}

.menu__contact-details a:hover,
.menu__socials a:hover,
.menu__primary-links a:hover,
.menu__secondary-links a:hover,
.menu__terms a:hover,
.menu__checkbox-label a:hover {
  color: var(--c-500);
}

.menu__contact-details a { 
  display: block; 
  margin-top: 16px; 
}

/* Form Refinements */
.menu__textarea {
  min-height: 60px; 
  height: 60px; 
  resize: vertical !important; 
  padding-top: 16px; 
}

.menu__checkbox-label {
  font-size: var(--font-size-small);
}

.menu__form-bottom .pill {
  margin-left: auto;
}

@media (max-width: 1280px) {
  .menu__secondary-links a {
    flex: 1 1 100%;
    border-bottom: 1px solid var(--c-500);
    padding-bottom: 24px;
    font-weight: var(--font-weight-light);
  }
}

/* Mobile Menu */
.menu__mobile {
  flex: 1;
  display: flex;
  flex-direction: column;
}
@media (min-width: 1024px) {
  .menu__mobile { display: none; }
}
.menu__links {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad);
}
.menu__links a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-family-serif);
  font-size: clamp(2rem, 5vw, 2.875rem);
  color: var(--c-200);
  transition: color 0.3s ease;
}
.menu__links a span { font-family: var(--font-family-sans-serif); font-size: 0.75rem; color: var(--c-500); }
.menu__links a:hover { color: var(--c-0); }
.menu__foot { padding: 0 var(--pad) 2rem; color: var(--c-500); }
.menu__foot a:hover { color: var(--c-0); }

@media (min-width: 768px) and (max-width: 1023px) {
  .menu__links a {
    font-size: 3rem;
  }
}

/* Desktop Menu Layout & Alignment Fix */
.menu__desktop {
  display: none;
}
@media (min-width: 1024px) {
  .menu__desktop {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100%;
    overflow: hidden;
  }

  .menu__desktop-left,
  .menu__desktop-right {
    padding: 128px 64px 32px 64px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .menu__contact-title {
    font-family: var(--font-family-serif);
    font-weight: var(--font-weight-light);
    font-size: 62px;
    line-height: 1.2;
    margin-bottom: 0;
  }
  
  /* Nudges the contact box down by roughly 80px (5rem) from the title */
  .menu__contact-box {
    margin-top: 5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .menu__desktop-right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  /* Aligns the right column top section to match the contact box offset */
  .menu__right-top {
    margin-top: 7rem;
    display: flex;
    flex-direction: column;
    gap: 4rem; /* Fixed distance between primary and secondary links */
    width: 100%;
  }

  .menu__primary-links {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

 .menu__desktop-left {
    flex: 0 0 581px;
    width: 581px;
    position: relative; /* Establishes positioning context for the exact border */
    border-right: none; /* Removes the default full-height border */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 128px 64px 32px 64px;
    height: 100%;
  }

  /* Custom line bounded strictly between Contact and Socials */
  .menu__desktop-left::after {
    content: "";
    position: absolute;
    top: 128px;   /* Matches top padding so it starts at Contact */
    bottom: 32px; /* Matches bottom padding so it ends at Socials */
    right: 0;
    width: 1px;
    background: var(--c-600);
  }

  .menu__contact-title {
    font-family: var(--font-family-serif);
    font-weight: var(--font-weight-light);
    font-size: 62px;
    line-height: 1.2;
    margin-bottom: 0;
  }
  
  .menu__contact-box {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 2.5rem; /* Controls the close distance between contact info and the form */
  }

  .menu__contact-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-family: var(--font-family-sans-serif);
    font-size: 15px;
    line-height: 1.4;
    color: var(--c-0);
  }
  
  .menu__contact-details a, .menu__contact-details p {
    color: var(--c-0);
    text-decoration: none;
    margin: 0;
  }
  .menu__contact-details p { margin-top: 16px; }

  .menu__contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }

  .menu__input, .menu__textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--c-0);
    font-family: var(--font-family-sans-serif);
    font-size: 15px;
    outline: none;
  }
  
  /* Keep the email input border normal */
  .menu__input { 
    height: 48px; 
    border-bottom: 1px solid var(--c-600); 
  }
  
  /* The new wrapper handles the bottom border and padding securely */
  .menu__textarea-wrap {
    border-bottom: 1px solid var(--c-600);
    padding-bottom: 0.75rem; /* Safe breathing room! */
    display: flex;
    transition: border-color 0.3s ease;
  }
  
  .menu__input::placeholder, .menu__textarea::placeholder { color: var(--c-500); }

  .menu__form-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center !important;
    margin-top: 1.5rem; 
  }

  .menu__checkbox-label {
    display: flex;
    align-items: center; /* Centers the box with the text */
    gap: 8px;
    font-family: var(--font-family-sans-serif);
    font-size: var(--font-size-small);
    line-height: 1; /* Matches the button's line-height to fix the visual offset! */
    margin: 0; /* Strips any accidental browser margins */
    cursor: pointer;
  }
  
.menu__checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none; /* Crucial for Safari! */
    width: 14px;
    height: 14px;
    border: 1px solid var(--c-600);
    background: transparent;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .menu__checkbox-label input[type="checkbox"]:checked {
    background: transparent; 
    border-color: var(--c-0); /* Highlights the box in white when checked */
  }
  .menu__checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    font-size: 12px;
    color: var(--c-0);
  }
  
  .menu__submit {
    background: none;
    border: none;
    color: var(--c-0);
    font-family: var(--font-family-sans-serif);
    font-size: 20px;
    cursor: pointer;
    line-height: 1.4;
  }

  .menu__socials {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--c-600);
    width: 100%;
  }
  .menu__socials a {
    font-family: var(--font-family-serif);
    font-weight: var(--font-weight-light);
    font-size: 26px;
    color: var(--c-0);
    line-height: 1.2;
    text-decoration: none;
  }
  .menu__social-sep {
    width: 1px;
    height: 19px;
    background: var(--c-600);
  }

  .menu__desktop-right {
    flex: 1;
  }

  .menu__right-top {
    display: flex;
    flex-direction: column;
    gap: 6rem;
    width: 100%;
  }

  .menu__primary-links {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }
  .menu__primary-links a {
    display: block;
    font-family: var(--font-family-serif);
    font-weight: var(--font-weight-light);
    font-size: 84px;
    line-height: 1;
    color: var(--c-0);
    text-decoration: none;
    border-bottom: 1px solid var(--c-500);
    padding-bottom: 32px;
  }

  .menu__secondary-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
  }
  .menu__secondary-links a {
    flex: 1 1 calc(50% - 24px);
    font-family: var(--font-family-serif);
    font-weight: var(--font-weight-light);
    font-size: 46px;
    line-height: 1.2;
    color: var(--c-0);
    text-decoration: none;
    border-bottom: 1px solid var(--c-500);
    padding-bottom: 24px;
  }

  .menu__terms {
    display: flex;
    justify-content: flex-end;
  }
  .menu__terms a {
    font-family: var(--font-family-sans-serif);
    font-size: 15px;
    color: var(--c-0);
    text-decoration: none;
    line-height: 1.4;
  }
}

/* ---- 1280px Netbook Scaling & Fit ---- */
@media (min-width: 1024px) and (max-width: 1439px) {
  .menu__desktop-left,
  .menu__desktop-right {
    padding: 72px 48px 24px 48px;
  }
  .menu__desktop-left { width: 480px; flex: 0 0 480px; }
  .menu__contact-title { font-size: 48px; font-weight: var(--font-weight-light); }
  .menu__contact-box { gap: 24px; }
  .menu__textarea { height: 60px; }
  .menu__right-top { gap: 5 rem; }
  .menu__primary-links { gap: 20px; }
  .menu__primary-links a { font-size: 56px; padding-bottom: 20px; }
  .menu__secondary-links a { font-size: 32px; padding-bottom: 16px; font-weight: var(--font-weight-light); }
  .menu__socials a { font-size: 20px; }
}

/* Hide tablet menu by default */
.menu__tablet {
  display: none;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .menu__mobile {
    display: none;
  }
  .menu__desktop {
    display: none;
  }
  .menu__tablet {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto; /* Enables scrolling */
    -webkit-overflow-scrolling: touch;
    padding: 2rem var(--pad) 4rem var(--pad);
  }

  .menu__tablet-scroll {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    width: 100%;
  }

  /* 1. Two main links */
  .menu__tablet-primary {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }
  .menu__tablet-primary a {
    font-family: var(--font-family-serif);
    font-size: 3.5rem;
    line-height: 1.1;
    color: var(--c-0);
    border-bottom: 1px solid var(--c-600);
    padding-bottom: 1.5rem;
  }

  /* 2. Smaller secondary links */
  .menu__tablet-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2rem;
  }
  .menu__tablet-secondary a {
    font-family: var(--font-family-serif);
    font-size: 2rem;
    line-height: 1.2;
    color: var(--c-400);
  }
  .menu__tablet-secondary a:hover {
    color: var(--c-0);
  }

  /* 3. Inverted Footer Form Section */
  .menu__tablet-form-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 3rem 0;
  }
  
  .menu__tablet-contact-top {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  .menu__tablet-contact-top h3 {
    font-size: 2rem;
    color: var(--c-0);
  }
  .menu__tablet-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    color: var(--c-200);
    font-size: 0.9375rem;
  }
  .menu__tablet-details a {
    color: var(--c-0);
    transition: color 0.3s ease;
  }
  .menu__tablet-details a:active,
  .menu__tablet-details a:hover {
    color: var(--c-500);
  }
  .menu__tablet-clock {
    font-variant-numeric: tabular-nums;
    color: var(--c-400);
  }

  .menu__tablet-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  .menu__tablet-form input[type="email"],
  .menu__tablet-form textarea {
    font: inherit;
    color: var(--c-0);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--c-600);
    padding-bottom: 0.75rem;
    resize: none;
  }
  .menu__tablet-form input::placeholder,
  .menu__tablet-form textarea::placeholder {
    color: var(--c-500);
  }
  .menu__tablet-textarea-wrap {
    border-bottom: 1px solid var(--c-600);
    padding-bottom: 0.75rem;
    display: flex;
  }
  .menu__tablet-form .menu__tablet-textarea-wrap textarea {
    border-bottom: none !important;
    width: 100%;
    padding-bottom: 0;
  }
  .menu__tablet-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
  }
  .menu__tablet-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem; /* Increased from 0.75rem to match standard body text size */
    color: var(--c-200);
  }
  .menu__tablet-check a {
    color: var(--c-0);
    text-decoration: underline;
  }
  .menu__tablet-check input {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--c-0);
    border-radius: 2px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .menu__tablet-check input:checked::after {
    content: '✓';
    font-size: 12px;
    color: var(--c-0);
  }

  /* 4. Three social media links next to each other */
  .menu__tablet-socials {
    display: flex;
    gap: 2rem;
  }
  .menu__tablet-socials a {
    font-size: 1.75rem;
    color: var(--c-0);
  }

  /* 5. Terms & Conditions at the very bottom */
  .menu__tablet-bottom-terms {
    padding-top: 1rem;
  }
  .menu__tablet-bottom-terms a {
    font-size: 0.9375rem;
    color: var(--c-400);
    text-decoration: none;
  }
  .menu__tablet-bottom-terms a:hover {
    color: var(--c-0);
  }
}

/* ---- 1280px Netbook Scaling & Fit ---- */
@media (min-width: 1024px) and (max-width: 1439px) {
  .menu__desktop-left,
  .menu__desktop-right {
    padding: 72px 48px 24px 48px;
  }
  .menu__desktop-left { width: 480px; flex: 0 0 480px; }
  .menu__contact-title { font-size: 48px; font-weight: var(--font-weight-light); }
  .menu__contact-box { gap: 24px; }
  .menu__textarea { height: 60px; }
  .menu__right-top { gap: 5 rem; } /* Note: you might want to fix this typo to 5rem while you're here! */
  .menu__primary-links { gap: 20px; }
  .menu__primary-links a { font-size: 56px; padding-bottom: 20px; }
  .menu__secondary-links a { font-size: 32px; padding-bottom: 16px; font-weight: var(--font-weight-light); }
  .menu__socials a { font-size: 20px; }

  /* Add these new Footer rules here: */
  .footer__main {
    grid-template-columns: 1fr 1fr; /* Swaps rigid pixels for fluid halves */
    gap: 4rem; /* Reduces the massive 8rem gap */
  }
  
  .footer__form,
  .footer__social-links {
    width: 100%; /* Allows the children to shrink naturally */
  }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { 
  position: relative;
  width: 100%; 
  height: 100vh; /* Locks the container to the exact height of the screen */
  overflow: hidden; 
  background: var(--c-950); 
}

.hero__video {
  position: absolute;
  top: 50%;
  left: 50%;
  /* Force a 16:9 ratio based on viewport width */
  width: 100vw;
  height: 56.25vw; 
  /* Force a 16:9 ratio based on viewport height */
  min-height: 100vh;
  min-width: 177.77vh; 
  /* Center the oversized iframe perfectly */
  transform: translate(-50%, -50%);
  border: none;
  pointer-events: none; /* Prevents users from accidentally pausing the background video */
}

/* ============================================================
   About
   ============================================================ */
.about {
  padding: 6rem var(--pad);
  display: flex;
  flex-direction: column;
  gap: 4rem; 
}

@media (min-width: 768px) { 
  .about { 
    padding: 10rem var(--pad); 
    gap: 8rem; 
  } 
}

.about__title {
  font-size: var(--font-size-h-0);
  line-height: 1;
  letter-spacing: -0.01em;
  width: 100%;
  max-width: 1086px; /* Restores the original wide boundary */
  margin: 0;
}

.about__content {
  align-self: center; /* Centers just this text block in the middle of the page */
  width: 100%;
  max-width: 582px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem; 
  text-align: left; /* Keeps the text itself aligned to the left edge of its container */
}

.about__body {
  font-size: var(--font-size-h-6);
  line-height: 1.4;
  margin: 0;
}

/* Gives your final emphasis sentence a bit of breathing room from the body text */
.about__content .capabilities__lede {
  margin-top: 1rem;
  margin-bottom: 0;
}

/* ============================================================
   Clients
   ============================================================ */
.clients { padding: 4rem var(--pad); }
@media (min-width: 768px) { .clients { padding: 6rem var(--pad); } }
.clients__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .clients__grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .clients__grid { grid-template-columns: repeat(7, 1fr); } }
.client {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5rem;
  padding: 1rem;
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-400);
  transition: color 0.3s ease;
}
@media (min-width: 768px) { .client { min-height: 6rem; } }
.client:hover { color: var(--c-900); }

.client img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* ============================================================
   Case studies
   ============================================================ */
.cases {
  background: var(--c-950);
  color: var(--c-0);
  padding: 6rem var(--pad);
}
@media (min-width: 768px) { .cases { padding: 10rem var(--pad); } }

.cases__title {
  font-size: var(--font-size-h-0);
  line-height: 1;
  text-align: center;
  margin-bottom: 5rem;
}

.cases__carousel {
  max-width: 100%;
  height: 60vh;
  min-height: 400px;
  margin: 0 auto;
}
@media (min-width: 1920px) {
  .cases__carousel { max-width: 1600px; }
}

/* ------------------------------------------------------------
   MOBILE LAYOUT: Horizontal Swipe Carousel
   ------------------------------------------------------------ */
.cases__track { 
  display: flex; 
  height: 100%;
  gap: 1rem;
  /* Enable native horizontal scrolling */
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* Hide the scrollbar for a cleaner look */
  -ms-overflow-style: none;
  scrollbar-width: none; 
}
.cases__track::-webkit-scrollbar { display: none; }

.case {
  position: relative;
  /* Set width to 85% so users see a peek of the next card */
  flex: 0 0 85%; 
  scroll-snap-align: center;
  overflow: hidden;
  background: var(--c-900);
}

.case img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.case__label {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column; /* Stacks the title and button on mobile */
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem;
  width: 100%;
}

.case__label span { 
  font-size: clamp(2rem, 4vw, 3rem); 
  letter-spacing: 0.02em; 
  line-height: 1;
  white-space: normal; /* Allows long titles to wrap on phones */
}

.case__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  font-family: var(--font-family-sans-serif);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 9999px;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ------------------------------------------------------------
   THEME CLASSES (Applies to Mobile and Desktop)
   ------------------------------------------------------------ */
.case.theme-dark { color: var(--c-1000); }
.case.theme-dark .case__btn { border-color: rgba(0, 0, 0, 0.4); }

/* ------------------------------------------------------------
   DESKTOP LAYOUT: Expanding Accordion (768px and up)
   ------------------------------------------------------------ */
@media (min-width: 768px) {
  .cases__track {
    overflow-x: visible;
    scroll-snap-type: none;
  }
  
  /* All items start equal and transition smoothly */
  .case {
    flex: 1;
    cursor: pointer;
    transition: flex 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }
  
  /* Expands the hovered item */
  .case:hover {
    flex: 15;
  }
  
  .case img {
    opacity: 1;
    transition: transform 1.2s ease;
  }
  
  .case:hover img { 
    transform: scale(1.03);
  }
  
  .case__label {
    flex-direction: row; 
    justify-content: space-between; 
    align-items: flex-end; 
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  
  .case:hover .case__label {
    opacity: 1;
    visibility: visible;
    transition-delay: 0.4s;
  }
  .case__label span { white-space: nowrap; }
  
  .case__btn {
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
  }
  
  .case:hover .case__btn {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition-delay: 0.4s;
  }
  
  /* Standard Button Hover */
  .case:hover .case__btn:hover {
    background-color: var(--c-0);
    color: var(--c-1000);
    border-color: var(--c-0);
    transition-delay: 0s;
  }
  
  /* Dark Theme Button Hover */
  .case.theme-dark:hover .case__btn:hover {
    background-color: var(--c-1000);
    color: var(--c-0);
    border-color: var(--c-1000);
  }
}

.cases__cta { max-width: 100%; margin: 3.5rem auto 0; display: flex; justify-content: center; }

  #casesTrack > .case:nth-child(2) .case__btn {
    color: var(--c-0);
    border-color: rgba(255, 255, 255, 0.4);
  }
  
  #casesTrack > .case:nth-child(2):hover .case__btn:hover {
    background-color: var(--c-0);
    color: var(--c-1000);
    border-color: var(--c-0);
  }

/* ============================================================
   Dark elements class for light backgrounds
   ============================================================ */
.case.theme-dark {
  color: var(--c-1000); 
}

.case.theme-dark .case__btn {
  border-color: rgba(0, 0, 0, 0.4); 
}

.cases__cta { max-width: 80rem; margin: 3.5rem auto 0; display: flex; justify-content: center; }

/* ============================================================
   Capabilities
   ============================================================ */

.capabilities { 
  padding: 6rem var(--pad) 0; 
}

.capabilities__inner {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  border-bottom: 1px solid var(--c-900);
  padding-bottom: 6rem;
}

@media (min-width: 768px) {
  .capabilities__inner { 
    flex-direction: row; 
    align-items: flex-start; 
    gap: 2rem; /* Tighter, proportional gap for Tablets & Netbooks */
    padding-bottom: 8rem; 
  }
}

@media (min-width: 1440px) {
  .capabilities__inner { 
    gap: 4rem; /* Restores the wide gap for 1440px+ screens */
  }
}

.capabilities__title {
  font-size: var(--font-size-h-1);
  line-height: 1;
  letter-spacing: -0.01em;
  max-width: 984px;
}
.capabilities__col {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}
@media (min-width: 768px) { .capabilities__col { width: 480px; flex-shrink: 0; padding-top: 1rem; } }
.capabilities__lede { font-size: var(--font-size-h-5); line-height: 1.2; font-weight: var(--font-weight-medium);}
.capabilities__text { display: flex; flex-direction: column; gap: 1rem; margin-top: -1.25rem; }

/* ============================================================
   Testimonials
   ============================================================ */
.testimonials { 
  position: relative; /* Anchors the border line below */
  padding: 6rem 0; 
  overflow: hidden; 
  /* Remove the direct border-bottom from here! */
}

/* This creates the perfectly padded bottom border */
.testimonials::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: var(--pad);
  right: var(--pad);
  height: 1px;
  background: var(--c-900);
}

@media (min-width: 768px) { .testimonials { padding: 10rem 0; } }

.testimonials__title {
  font-size: var(--font-size-h-1);
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 3rem;
  padding: 0 var(--pad); /* Keeps the title aligned with the page margins */
}
@media (min-width: 768px) { .testimonials__title { margin-bottom: 5rem; } }

.testimonials__marquee {
  display: flex;
  overflow: hidden;
  /* Adds a smooth fade out on the left and right edges of the stream */
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.testimonials__track {
  display: flex;
  width: max-content;
  /* Adjust '40s' to change the scrolling speed */
  animation: marqueeStream 40s linear infinite; 
}
/* Only mouse-like pointers can pause on hover; touch browsers retain :hover after a tap. */
@media (hover: hover) and (pointer: fine) {
  .testimonials__track:hover {
    animation-play-state: paused;
  }
}

.testimonials__group {
  display: flex;
  flex-shrink: 0; /* Add this! Forces Safari to respect the container's natural width */
  gap: 2rem;
  padding-right: 2rem; 
}

@keyframes marqueeStream {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Individual Card Styles */
.testimonial-card {
  flex: 0 0 320px;
  width: 320px; /* Safari fallback */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem;
  border-left: 1px solid var(--c-900);
}

@media (min-width: 768px) { 
  .testimonial-card { 
    flex: 0 0 600px; 
    width: 600px; /* Safari fallback */
  } 
}

@media (min-width: 1920px) { 
  .testimonial-card { 
    flex: 0 0 900px; 
    width: 900px; /* Safari fallback */
  } 
}

.testimonial-card__quote { 
  font-size: var(--font-size-h-6); 
  line-height: 1.5; 
}

.testimonial-card__cap { 
  display: flex; 
  flex-direction: column;
  padding-top: 1.5rem; 
}

.testimonial-card__name { 
  font-family: var(--font-family-serif); 
  font-size: 1.6rem; 
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  padding-bottom: 0.35rem;
}

.testimonial-card__role, 
.testimonial-card__org { 
  font-size: var(--font-size-small, 0.75rem); 
  color: var(--c-1000); 
}

/* ============================================================
   Team
   ============================================================ */
.team { 
  padding: 6rem var(--pad); 
}

@media (min-width: 768px) { 
  .team { 
    /* Sets Top to 6rem, keeps Bottom at 10rem, applies var(--pad) to sides */
    padding: 6rem var(--pad) 10rem var(--pad); 
  } 
}

@media (min-width: 1440px) { 
  .team { 
    padding-top: 10rem; /* Restores the massive top gap for large desktop screens */
  } 
}

.team__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 640px) { .team__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .team__grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
    padding-top: 0; 
    
    /* Adds exact padding to the bottom of the grid to account for the text below the images */
    padding-bottom: calc( ((100% - 5 * 1.5rem) / 6) * 1.3333 + 4.5rem );
  }
}

.member { position: relative; }
.member--offset { margin-top: 3rem; }
.member__frame {
  position: relative;
  aspect-ratio: 279 / 372;
  overflow: hidden;
  border-radius: 2px;
  background: var(--c-900);
}
.member__img-default,
.member__img-hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: none;
}

.member__img-hover {
  opacity: 0;
}

.member:hover .member__img-hover {
  opacity: 1;
}

.member:hover .member__img-default {
  opacity: 0;
}

.member__cap {
  display: flex;
  flex-direction: column; 
  justify-content: space-between; 
  align-items: baseline;
  padding-top: 0.5rem; 
}

.member__name { 
  font-family: var(--font-family-sans-serif); 
  font-size: var(--font-size-body); 
  color: var(--c-900); /* Dark text for light page background */
  font-weight: 400; 
  line-height: 1.4; 
}

#teamGrid > figure:nth-child(5) .member__name {
  font-weight: 500; /* Triggers FlechaTestM-Medium */
}

#teamGrid > figure:nth-child(4) .member__name {
  font-weight: 400; /* Triggers FlechaTestM-Medium */
}

.member__role { 
  font-family: var(--font-family-sans-serif);
  font-style: normal; 
  font-size: var(--font-size-small);
  line-height: 1.4; 
  color: var(--c-600); 
  text-align: right; 
}

.team__cta {
  margin-top: 5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
@media (min-width: 768px) {
  .team__cta { margin-top: 8rem; flex-direction: row; align-items: center; justify-content: space-between; }
}
.team__cta p { max-width: 163px; font-size: var(--font-size-body); line-height: 1.4; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  /* Apply the spacing as margin so the border is physically constrained */
  margin-top: -1px;
  margin-left: var(--pad);
  margin-right: var(--pad);
  padding: 2rem 0; /* Keep the top/bottom spacing, but remove horizontal padding */
  
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 1px solid var(--c-900);
  background: var(--c-30);
  color: var(--c-900);
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center; /* Centers all navbar elements */
  gap: 0.75rem 1.5rem;
  font-size: var(--font-size-body);
}
.footer__logo { 
  margin-right: auto; /* Pushes the logo to the far left */
}
.footer__nav a:hover { color: var(--c-500); }
.footer__sep { color: var(--c-500); }
.footer__clock { 
  margin-left: auto; /* Pushes the clock to the far right */
  font-variant-numeric: tabular-nums; 
}
.footer__main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  padding: 5rem 0;
  width: 100%; /* Ensures it stretches fully */
  /* Removed max-width and margin: 0 auto so it relies entirely on var(--pad) */
}
/* Hide tablet/mobile clock on desktop by default */
.footer__clock-tablet {
  display: none;
}

@media (min-width: 768px) {
  .footer__main { 
    grid-template-columns: minmax(auto, 581px) minmax(auto, 581px); 
    justify-content: center; /* Snaps the columns securely back to the middle */
    gap: 8rem; /* Restores your exact, static distance between the two columns */
    padding: 5rem 0; /* Keeps the padding at 0 so we don't recreate the double-padding issue */
    width: 100%; 
  }
}
.footer__contact,
.footer__social {
  display: flex;
  flex-direction: column;
  height: auto;
  width: 100%;
}

.footer__contact-top { 
  display: flex; 
  flex-direction: column; 
  gap: 2rem; 
  margin-bottom: 3rem; 
}

@media (min-width: 768px) { 
  .footer__contact-top { 
    flex-direction: row; 
    align-items: flex-start; 
    margin-bottom: 2rem; /* Sets a rigid gap before the form starts */
  } 
}

.footer__contact-top h3, 
.footer__social h3 { 
  font-size: var(--font-size-h-4); 
  line-height: 1.2; 
  margin: 0; 
}

.footer__details { 
  display: flex; 
  flex-direction: column; 
  gap: 1rem; 
}

@media (min-width: 768px) { 
  .footer__details { 
    width: 279px; 
    margin-left: auto; /* Pushes the block strictly to the right boundary */
    margin-top: 0.6rem; /* Nudges the block down to visually match the title's cap height */
    text-align: left; /* Keeps the text left-aligned as shown in your reference image */
  }
  .footer__social h3 {
    margin-bottom: 4rem; /* Desktop exact match */
  }
.footer__details a:hover { color: var(--c-500); }
.footer__form { 
  display: flex; 
  flex-direction: column; 
  flex: none; /* Removed flex: 1 */
  gap: 1.5rem; /* Tighter spacing between email and textarea */
}

.footer__textarea-wrap {
  border-bottom: 1px solid var(--c-500);
  padding-bottom: 0.75rem; /* This gives the handle its breathing room! */
  display: flex; 
}

/* Override the combined rule to remove the border from the text area itself */
.footer__form .footer__textarea-wrap textarea {
  min-height: 96;
  height: auto;
  width: 100%;
  border-bottom: none !important; 
  padding-bottom: 0; 
  resize: vertical !important;
}

@media (min-width: 768px) { 
  .footer__form { width: 581px; max-width: 100%; } 
}

.footer__form input[type="email"],
.footer__form textarea {
  font: inherit;
  color: var(--c-900);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--c-500);
  padding-bottom: 0.75rem;
  resize: none;
}
.footer__form input::placeholder,
.footer__form textarea::placeholder { color: var(--c-500); }
.footer__form input:focus,
.footer__form textarea:focus { outline: none; border-bottom-color: var(--c-900); }
.footer__form-row { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  margin-top: 0; /* Removed auto margin */
  padding-top: 0.5rem; /* Creates a small, exact distance from the textarea */
}
.footer__check { 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
  font-size: var(--font-size-small); /* Swapped 12px for your variable! */
}

.footer__check a { text-decoration: underline; }

.footer__check input { 
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--c-900);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer__check input:checked::after {
  content: '✓';
  font-size: var(--font-size-small); /* Scaled the checkmark up too! */
  color: var(--c-900);
}

.footer__form button {
  font-size: var(--font-size-h-6);
  transition: color 0.3s ease;
}
.footer__form button:hover:not(:disabled) { color: var(--c-500); }
.footer__form .pill:disabled { 
  opacity: 0.4; 
  cursor: not-allowed; 
}
.footer__form .pill:disabled:hover {
  background: transparent;
  color: var(--c-1000);
}
.footer__form .pill:disabled:hover i {
  transform: none;
}

.footer__social { display: flex; flex-direction: column; gap: auto; }
.footer__social-links { 
  display: flex; 
  flex-direction: column; 
  flex: none; /* Removed flex: 1 */
  gap: 1.5rem; /* Controls distance naturally without expanding to fill space */
}

@media (min-width: 768px) { 
  .footer__social-links { 
    width: 581px; 
    max-width: 100%; 
  } 
}
.footer__social-links a {
  display: block; 
  padding: 0 0 1.5rem; /* 0 top, 1.5rem bottom */
  border-bottom: 1px solid var(--c-500);
  font-size: var(--font-size-h-4);
  line-height: 1.2;
  color: var(--c-500);
  transition: color 0.3s ease;
}

.footer__social-links a:hover { 
  color: var(--c-900); 
}

.footer__copy {
  font-size: 3rem; /* Scaled down for mobile, tablets, and 1280px netbooks */
  line-height: 1;
  color: var(--c-200);
  text-align: center;
}

@media (min-width: 1440px) {
  .footer__copy {
    font-size: clamp(2.5rem, 12vw, 113px); /* Restores massive display size for large monitors */
  }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

.footer__social > div, /* Targets the wrapper holding your social links */
.footer__social > ul { 
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between; /* Distributes the links so the last one hits the absolute bottom */
}

/* Hide the mobile back-to-top button on larger screens */
.footer__mobile-back-top {
  display: none;
}

/* ============================================================
   Desktop Team Layout (Staggered Grid)
   ============================================================ */
@media (min-width: 1024px) {
  .team {
    position: relative;
    /* Restores the normal 256px spacing below the entire section */
    padding-bottom: 256px; 
  }
  
  /* 1. Title pulled out and aligned exactly with the top of the grid */
  .team .section-title {
    position: absolute;
    left: var(--pad);
    width: auto;
    margin: 0;
    line-height: 1;
    z-index: 10;
  }
  
  .team__grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
    padding-top: 0; 
    
    /* 
       4. HUG THE CONTENTS: 
       This adds exact padding to the bottom of the grid to account for 
       the 100% translateY shift of Cols 2 & 4. 
       (1 avatar height = column width * 1.3333 aspect ratio)
    */
    padding-bottom: calc( ((100% - 5 * 1.5rem) / 6) * 1.3333 + 1.5rem );
  }
  
  .member.member--offset { margin-top: 0; }
  
  /* --- EXACT AVATAR ALIGNMENTS --- */
  
  .member:nth-child(1) { grid-column: 1; grid-row: 2; transform: translateY(calc(50% + 0.75rem)); }
  
  .member:nth-child(2) { grid-column: 2; grid-row: 1; transform: translateY(calc(100% + 1.5rem)); }
  .member:nth-child(3) { grid-column: 2; grid-row: 2; transform: translateY(calc(100% + 1.5rem)); }
  
  .member:nth-child(6) { grid-column: 4; grid-row: 1; transform: translateY(calc(100% + 1.5rem)); }
  .member:nth-child(7) { grid-column: 4; grid-row: 2; transform: translateY(calc(100% + 1.5rem)); }

  .member:nth-child(4) { grid-column: 3; grid-row: 1; transform: translateY(calc(50% + 0.75rem)); }
  .member:nth-child(5) { grid-column: 3; grid-row: 2; transform: translateY(calc(50% + 0.75rem)); }
  
  .member:nth-child(8) { grid-column: 5; grid-row: 1; transform: translateY(calc(50% + 0.75rem)); }
  .member:nth-child(9) { grid-column: 5; grid-row: 2; transform: translateY(calc(50% + 0.75rem)); }
  
  /* Top-right avatar stays at 0 to align with the Title */
  .member:nth-child(10){ grid-column: 6; grid-row: 1; transform: translateY(0); }
  .member:nth-child(11){ grid-column: 6; grid-row: 2; transform: translateY(0); }

  /* 2 & 3. CTA aligned left, reduced distance, sits in empty space below Col 6 */
  .team__cta {
    position: absolute;
    right: var(--pad);
    bottom: 256px; 
    width: min-content; /* Shrinks the container to exactly match the button's width */
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    gap: 16px; /* Sets the exact 16px distance */
    margin-top: 0;
  }
  
  .team__cta p {
    font-size: 0.85rem;
    text-align: left; 
    margin: 0; /* Removed margin since we are using gap */
  }

  .team__cta .pill {
    white-space: nowrap; /* Prevents the button from wrapping, forcing the container width */
  }
}}

/* ============================================================
   Tablet Tier Optimizations (768px to 1023px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --pad: 3rem;
  }

  body {
    width: 100%;
    overflow-x: hidden;
  }

  .navbar {
    padding: 1.5rem var(--pad);
    width: 100%;
  }

  .hero {
    width: 100%;
    height: 56.25vw;
    min-height: auto;
  }
  .hero__video {
    width: 100vw;
    height: 56.25vw;
    min-height: auto;
    min-width: auto;
  }

  .about, .clients, .cases, .capabilities, .testimonials, .team {
    width: 100%;
    box-sizing: border-box;
  }
  .about {
    padding: 5rem var(--pad);
    gap: 2rem;
  }
  .about__title {
    font-size: 3.5rem;
    max-width: 100%;
  }
  .about__body {
    font-size: 1.25rem;
    max-width: 100%;
  }

  .capabilities {
    padding: 5rem var(--pad) 0;
  }
  .capabilities__inner {
    flex-direction: column;
    gap: 3rem;
    padding-bottom: 5rem;
    width: 100%;
  }
  .capabilities__title {
    font-size: 3.5rem;
    max-width: 100%;
  }
  .capabilities__col {
    width: 100%;
  }

  /* Clients Dual Marquee Rows */
  .clients {
    padding: 4rem 0 6rem 0;
    overflow: hidden;
    width: 100%;
  }
  .clients__grid {
    display: flex;
    flex-direction: column;
    gap: 1rem; 
    width: 100%;
    overflow: hidden;
  }

  .clients__row-1, .clients__row-2, .clients__row-3 {
    display: flex;
    width: max-content;
    gap: 1rem;
    flex-wrap: nowrap;
  }
  .clients__row-1 {
    animation: marqueeLeft 60s linear infinite;
  }
  .clients__row-2 {
    animation: marqueeRight 60s linear infinite;
  }
  .clients__row-3 {
    animation: marqueeLeft 60s linear infinite;
  }

.clients .section-title {
    padding: 0 var(--pad);
    margin-bottom: 2rem; 
  }
  
  .client {
    flex: 0 0 280px; /* Increased width to accommodate larger logos */
    min-height: 4rem; /* Taller container */
    padding: 1.5rem;
  }
  .client img {
    max-height: 90px; /* Makes the logo images significantly larger */
    max-width: 100%;
    object-fit: contain;
  }

  .cases {
    padding: 5rem 0;
    width: 100%;
  }
  .cases__title, .testimonials__title {
    padding: 0 var(--pad);
    margin-bottom: 3rem;
    font-size: 3.5rem;
  }
  .cases__carousel {
    width: 100%;
    height: 55vh;
  }
  .testimonials {
    padding: 5rem 0;
    width: 100%;
  }

  /* Team Dual Marquee Rows */
  .team {
    padding: 5rem 0 6rem 0;
    overflow: hidden;
    width: 100%;
  }
  .team .section-title {
    padding: 0 var(--pad);
    font-size: 3.5rem;
  }
  .team__grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    overflow: hidden;
  }
  .team__row-1, .team__row-2 {
    display: flex;
    width: max-content;
    gap: 2rem;
    flex-wrap: nowrap;
  }
  .team__row-1 {
    animation: marqueeLeft 35s linear infinite;
  }
  .team__row-2 {
    animation: marqueeRight 35s linear infinite;
  }
  .member {
    flex: 0 0 260px;
    margin-top: 0 !important;
  }
  .team__cta {
    padding: 0 var(--pad);
    margin-top: 4rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  /* Footer Modifications for Tablet */
  /* Footer Layout Adjustments for Tablet */
  .footer {
    margin-top: -1px;
    margin-left: var(--pad); /* Respects page margins left */
    margin-right: var(--pad); /* Respects page margins right */
    padding: 3rem 0 1rem 0;
    width: auto;
    gap: 2rem;
  }

  .footer__main {
    grid-template-columns: 1fr;
    gap: 4rem;
    padding: 3rem 0 0 0;
    width: 100%;
  }

  /* Footer Contact Top: Details under "Get in Touch" */
  .footer__contact-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 2rem;
    gap: 1.5rem;
  }

  .footer__details {
    display: grid;
    grid-template-columns: 1fr auto; /* Mail & address in left column, time in right column */
    align-items: flex-end;           /* Aligns both columns to the bottom */
    width: 100%;
    margin-left: 0;
    margin-top: 0;
    text-align: left;
  }

  /* Left column for mail and address details */
  .footer__details > a:first-child,
  .footer__details > a:last-child {
    grid-column: 1;
  }

  /* Right column for the Athens clock, pushed right and aligned bottom */
  .footer__clock-tablet {
    display: block !important;
    grid-column: 2;
    grid-row: 1 / span 2;           /* Spans across to match the height and align bottom */
    text-align: right;
    margin: 0;
    align-self: flex-end;
  }

  .footer__form {
    width: 100%;
  }
  .footer__social-links {
    width: 100%;
  }

  /* Copyright margins: Larger top margin, reduced bottom margin */
  .footer__copy {
    font-size: 2.5rem;
    margin-top: 3rem;
    text-align: center;
  }

@media (min-width: 1024px) {
  .footer__clock-tablet { display: none; }
}

@keyframes marqueeLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes marqueeRight {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.footer__nav {
    display: none !important;
  }
/* Ensure desktop menu displays correctly on desktop viewports */
@media (min-width: 1024px) {
  .menu__desktop {
    display: flex;
  }
  .menu__tablet {
    display: none !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .menu__mobile { display: none; }
  .menu__desktop { display: none; }
  .menu__tablet {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2rem var(--pad) 2rem var(--pad);
  }

  .menu__tablet-scroll {
    display: flex;
    flex-direction: column;
    gap: 6rem;
    width: 100%;
  }

  /* 1. Primary links: active/hover state color --c-500 */
  .menu__tablet-primary {
    display: flex;
    flex-direction: column;
  }
  .menu__tablet-primary a {
    font-family: var(--font-family-serif);
    font-size: 3.5rem;
    line-height: 1.1;
    color: var(--c-0);
    border-bottom: 1px solid var(--c-600);
    padding-bottom: 1.5rem;
    transition: color 0.3s ease;
  }
  .menu__tablet-primary a:active,
  .menu__tablet-primary a:hover {
    color: var(--c-500);
  }

  /* 2. Secondary links: 2 columns (wrap), default white, active --c-500, matched padding */
  .menu__tablet-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
  }
  .menu__tablet-secondary a {
    flex: 0 0 calc(50% - 1rem);
    font-family: var(--font-family-serif);
    font-size: 2rem;
    line-height: 1.2;
    color: var(--c-0);
    border-bottom: 1px solid var(--c-600);
    padding-bottom: 1.5rem;
    transition: color 0.3s ease;
  }
  .menu__tablet-secondary a:active,
  .menu__tablet-secondary a:hover {
    color: var(--c-500);
  }

  /* 3. Form Information in Two Columns: Mail/Address left, Time right aligned bottom */
  .menu__tablet-form-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 3rem 0;
  }
  .menu__tablet-contact-top {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .menu__tablet-contact-top h3 {
    font-size: 2rem;
    color: var(--c-0);
  }
  .menu__tablet-details {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: flex-end;
    width: 100%;
    gap: 0.5rem;
  }
  .menu__tablet-details > a:first-child,
  .menu__tablet-details > a:last-child {
    grid-column: 1;
  }
  .menu__tablet-details a {
    color: var(--c-0);
  }
  .menu__tablet-clock {
    grid-column: 2;
    grid-row: 1 / span 2;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--c-0000);
    align-self: flex-end;
  }

  /* 4. Input fields focus/active: border becomes white */
  .menu__tablet-form input[type="email"],
  .menu__tablet-form textarea {
    font: inherit;
    color: var(--c-0);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--c-600);
    padding-bottom: 0.75rem;
    resize: none;
    transition: border-color 0.3s ease;
  }
  .menu__tablet-form input:focus,
  .menu__tablet-form textarea:focus {
    outline: none;
    border-bottom-color: var(--c-0);
  }
  .menu__tablet-textarea-wrap {
    border-bottom: 1px solid var(--c-600);
    padding-bottom: 0.75rem;
    display: flex;
    transition: border-color 0.3s ease;
  }
  .menu__tablet-textarea-wrap:focus-within {
    border-bottom-color: var(--c-0);
  }
  .menu__tablet-form .menu__tablet-textarea-wrap textarea {
    border-bottom: none !important;
    width: 100%;
    padding-bottom: 0;
  }

  .menu__tablet-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
  }
  .menu__tablet-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--c-200);
  }
  .menu__tablet-check a {
    color: var(--c-0);
    text-decoration: underline;
  }
  .menu__tablet-check input {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--c-0);
    border-radius: 2px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .menu__tablet-check input:checked::after {
    content: '✓';
    font-size: 12px;
    color: var(--c-0);
  }

  /* 5. Social media with separator lines */
  .menu__tablet-socials {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid var(--c-600);
  }
  .menu__tablet-socials a {
    font-family: var(--font-family-serif);
    font-size: 1.75rem;
    color: var(--c-0);
    transition: color 0.3s ease;
  }
  .menu__tablet-socials a:hover {
    color: var(--c-500);
  }
  .menu__tablet-social-sep {
    width: 1px;
    height: 19px;
    background: var(--c-600);
  }

  /* 6. Terms & conditions default white, active --c-500 */
  .menu__tablet-bottom-terms {
    padding-top: 0.5rem;
  }
  .menu__tablet-bottom-terms a {
    font-size: 0.9375rem;
    color: var(--c-0);
    text-decoration: none;
    transition: color 0.3s ease;
  }
  .menu__tablet-bottom-terms a:active,
  .menu__tablet-bottom-terms a:hover {
    color: var(--c-500);
  }
}}

/* ============================================================
   Mobile Tier Optimizations (max-width: 767px)
   ============================================================ */
@media (max-width: 767px) {
  /* 1. Hero Video 16:9 & Full Viewport Width */
  .hero {
    height: 56.25vw;
    min-height: auto;
    margin-top: 4.5rem;
  }
  .hero__video {
    width: 100vw;
    height: 56.25vw;
    min-height: auto;
    min-width: auto;
  }

  /* 2. About section gap reduction */
  .about {
    gap: 2rem;
    padding: 4rem var(--pad);
  }

  /* 3. Clients Section (4 lines & margin reduction) */
  #clients > .section-title {
    margin-bottom: 2rem;
  }
  .clients__grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
    /* Pulls the grid out to the absolute edges of the viewport */
    margin-left: calc(-1 * var(--pad));
    margin-right: calc(-1 * var(--pad));
  }
  .clients__row-1, .clients__row-2, .clients__row-3, .clients__row-4 {
    display: flex;
    width: max-content;
    gap: 1rem;
    flex-wrap: nowrap;
  }
  .clients__row-1 { animation: marqueeLeft 40s linear infinite; }
  .clients__row-2 { animation: marqueeRight 45s linear infinite; }
  .clients__row-3 { animation: marqueeLeft 42s linear infinite; }
  .clients__row-4 { animation: marqueeRight 47s linear infinite; }

  @keyframes marqueeLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
  }

  @keyframes marqueeRight {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
  }

  .client {
    flex: 0 0 210px; /* Widened to fit the larger logos safely */
    min-height: 4rem;
    padding: 1rem;
  }
  .client img { 
    max-height: 75px; /* Scaled up 1.5x */
    object-fit: contain; 
  }

  /* 4. Case Studies Aspect Ratio & CTA Layout */
  .cases { padding: 4rem var(--pad); }
  .cases__title { margin-bottom: 2rem; }
  .cases__carousel {
    height: auto;
    min-height: auto;
    overflow: visible;
  }
  .cases__track { gap: 1.5rem; }
  .case {
    display: flex;
    flex-direction: column;
    background: transparent;
  }
  .case img {
    position: static;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    opacity: 1;
    transform: none !important;
  }
  .case__label {
    position: static;
    display: flex;
    flex-direction: row;
    justify-content: center; /* Changed from space-between to align center */
    align-items: center;
    padding: 1.5rem 0 0 0;
    color: var(--c-0);
    opacity: 1;
    visibility: visible;
    text-align: center;
  }
  .case__label span { font-size: 1.5rem; }
  .case__btn {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none !important; /* hides the button from mobile */
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.8125rem;
    font-family: var(--font-family-sans-serif);
    border: 1px solid var(--c-0);
    border-radius: 9999px;
    color: var(--c-0);
    background: transparent;
    white-space: nowrap;
  }
  #case-studies > div.cases__cta > a {
    width: 100%;
    justify-content: center;
  }

  /* 5. Capabilities gap & full-width button */
  #capabilities > div { gap: 2rem; }
  #capabilities .capabilities__col > a.pill {
    width: 100%;
    justify-content: center;
  }

  /* 6. Testimonials Title Width Constraint */
  #testimonials > h2 {
    max-width: 300px;
    margin-bottom: 2rem;
  }

  /* 7. Team Marquee Mechanism */
  .team { padding: 4rem 0; overflow: hidden; }
  .team .section-title { padding: 0 var(--pad); margin-bottom: 2rem; }
  .team__grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    overflow: hidden;
    padding-top: 1rem;
    padding-bottom: 0;
  }
  .team__row-1, .team__row-2 {
    display: flex;
    width: max-content;
    gap: 1rem;
    flex-wrap: nowrap;
  }
  .team__row-1 { animation: marqueeLeft 30s linear infinite; }
  .team__row-2 { animation: marqueeRight 35s linear infinite; }
  .member {
    flex: 0 0 200px;
    margin-top: 0 !important;
    transform: none !important;
  }
  .team__cta {
    padding: 0 var(--pad);
    margin-top: 3rem;
  }

  .team__cta p {
    text-align: center;
    max-width: 100%;
    width: 100%;
    white-space: nowrap;
    margin: 0 auto 1.5rem auto;
  }

  #team > div.team__cta > a {
    width: 100%;
    justify-content: center;
  }

  /* 8. Mobile Footer Layout Fixes */
  .footer {
    display: flex;
    flex-direction: column;
    margin: 0 var(--pad); 
    padding: 3rem 0 1rem 0;
    gap: 0; /* Changed to 0 so flex ordering handles spacing */
    width: auto;
  }
  .footer__main {
    order: 1;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    padding: 0;
    width: 100%;
  }
  .footer__contact-top {
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .footer__details {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: flex-end;
    width: 100%;
    gap: 0.5rem;
  }
  .footer__details > a:first-child,
  .footer__details > a:last-child { grid-column: 1; }
  .footer__clock-tablet {
    display: block !important;
    grid-column: 2;
    grid-row: 1 / span 2;
    text-align: right;
    align-self: flex-end;
    margin: 0;
  }
  .footer__clock { display: none !important; }
  
  .footer__form { width: 100%; display: flex; flex-direction: column; gap: 1.5rem; }
  .footer__form #submitBtn { border: none; padding: 0; font-size: 1rem; }
  .footer__form #submitBtn i { display: none; }
  .footer__form input[type="email"],
  .footer__form textarea {
    font-family: var(--font-family-sans-serif); /* Forces standard sans-serif */
    font-size: 0.9375rem; /* Ensures size consistency */
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--c-600);
    padding-bottom: 0.75rem;
    resize: none;
    border-radius: 0;
    color: var(--c-900);
  }
  .footer__form input:focus,
  .footer__form textarea:focus {
    outline: none;
    border-bottom-color: var(--c-900);
  }
  .footer__textarea-wrap {
    border-bottom: 1px solid var(--c-600);
    padding-bottom: 0.75rem;
    display: flex;
  }
  .footer__textarea-wrap:focus-within {
    border-bottom-color: var(--c-900);
  }
  .footer__form .footer__textarea-wrap textarea {
    border-bottom: none !important;
    padding-bottom: 0;
    width: 100%;
  }
  
  /* Restored Social Links (Size, Underline, Full Width) */
  .footer__social { 
    width: 100%;
    margin-top: 4rem; 
  }
  .footer__social h3 { margin-bottom: 1.5rem; }
  .footer__social-links { display: flex; flex-direction: column; gap: 0; width: 100%; }
  .footer__social-links a {
    display: block;
    width: 100%;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--c-600);
    font-family: var(--font-family-serif);
    font-size: 2.25rem;
    color: var(--c-500);
    text-decoration: none;
    transition: color 0.3s ease;
  }
  .footer__social-links a:active,
  .footer__social-links a:hover {
    color: var(--c-1000);
  }

  /* Hide the original navigation on mobile */
  .footer__nav {
    display: none !important;
  }

  /* Show the new full-width mobile button */
  .footer__mobile-back-top {
    display: flex !important;
    order: 2;
    width: 100%;
    justify-content: center;
    margin-top: 5rem;
  }

  /* Copyright to the very bottom with proper styling */
  .footer__copy {
    order: 3;
    margin-top: 5rem;
    margin-bottom: 1rem;
    font-size: 3rem !important; /* ~48px */
    text-align: center;
    width: 100%;
    color: var(--c-200);
  }

  /* Hide the 'See more' button on the Case Studies list for mobile */
  .page-cases-list .cs-item__link {
    display: none !important;
  }
}

@media (max-width: 767px) {
/* ------------------------------------------------
     Mobile Fullscreen Menu Adjustments
     ------------------------------------------------ */
  .menu__mobile {
    padding: 2rem var(--pad) 2rem var(--pad); /* Clears the header */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex !important;
  }
  .menu__mobile-scroll {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  
  /* Primary & Secondary Links */
  .menu__mobile-primary,
  .menu__mobile-secondary {
    display: flex;
    flex-direction: column;
  }

.menu__mobile-secondary {
    padding-top: 2rem;
  }

  .menu__mobile-primary a {
    font-family: var(--font-family-serif);
    font-size: 3rem;
    color: var(--c-0);
    border-bottom: 1px solid var(--c-600);
    padding: 1.5rem 0;
    transition: color 0.3s ease;
  }
  .menu__mobile-secondary a {
    font-family: var(--font-family-serif);
    font-size: 2rem;
    color: var(--c-0);
    border-bottom: 1px solid var(--c-600);
    padding: 1.25rem 0;
    transition: color 0.3s ease;
  }
  .menu__mobile-primary a:active,
  .menu__mobile-secondary a:active {
    color: var(--c-500);
  }

  /* Form Section */
  .menu__mobile-form-section {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding: 6rem 0 6rem 0;
  }
  .menu__mobile-contact-top h3 {
    font-size: 1.75rem;
    color: var(--c-0);
    margin-bottom: 1.5rem;
  }
  .menu__mobile-details {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: flex-end;
    gap: 0.5rem;
  }
  .menu__mobile-details > a:first-child,
  .menu__mobile-details > a:last-child {
    grid-column: 1;
    color: var(--c-0);
    font-size: 0.9375rem;
    line-height: 1.4;
  }
  .menu__mobile-clock {
    grid-column: 2;
    grid-row: 1 / span 2;
    text-align: right;
    align-self: flex-end;
    font-variant-numeric: tabular-nums;
    font-size: 0.9375rem;
    color: var(--c-0);
  }

  /* Inputs & Checkbox */
  .menu__mobile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  .menu__mobile-form input[type="email"],
  .menu__mobile-form textarea {
    font-family: var(--font-family-sans-serif);
    font-size: 0.9375rem;
    color: var(--c-0);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--c-600);
    padding-bottom: 0.75rem;
    resize: none;
    border-radius: 0;
  }
  .menu__mobile-textarea-wrap {
    border-bottom: 1px solid var(--c-600);
    padding-bottom: 0.75rem;
    display: flex;
  }
  .menu__mobile-form textarea {
    border-bottom: none !important;
    padding-bottom: 0;
    width: 100%;
  }
  .menu__mobile-form input:focus,
  .menu__mobile-form textarea:focus,
  .menu__mobile-textarea-wrap:focus-within {
    border-bottom-color: var(--c-0);
    outline: none;
  }
  .menu__mobile-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
  }
  .menu__mobile-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--c-0);
  }
  .menu__mobile-check a { text-decoration: underline; color: var(--c-0); }
  .menu__mobile-check input {
    appearance: none;
    -webkit-appearance: none; /* Crucial for Safari! */
    width: 14px;
    height: 14px;
    border: 1px solid var(--c-0);
    background: transparent;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .menu__mobile-check input:checked::after {
    content: '✓';
    font-size: 12px;
    color: var(--c-0);
  }
  .menu__mobile-form button {
    font-size: 1rem;
    color: var(--c-0);
    padding: 0;
    border: none;
    background: transparent;
  }

  /* Socials & Bottom Terms */
  .menu__mobile-socials {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    padding-bottom: 6rem;
    border-top: 1px solid var(--c-600);
  }
  .menu__mobile-socials a {
    font-size: 1.25rem;
    color: var(--c-0);
  }
  .menu__mobile-social-sep {
    width: 1px;
    height: 16px;
    background: var(--c-600);
  }
  .menu__mobile-bottom-terms {
    padding-top: 1.5rem;
    border-top: 1px solid var(--c-600);
  }
  .menu__mobile-bottom-terms a {
    font-size: 0.8125rem;
    color: var(--c-0);
  }
  }

  /* ============================================================
   Page: Case Studies List
   ============================================================ */
.page-cases-list {
  padding-top: 6rem;
  background: var(--c-30); /* Matches site background */
  min-height: 100vh;
}
@media (min-width: 1024px) {
  .page-cases-list { padding-top: 10rem; }
}

.cs-list {
  padding: 0 var(--pad) 12rem var(--pad);
}
.cs-list__title {
  font-size: 3rem;
  margin-bottom: 2rem;
  color: var(--c-900);
}
@media (min-width: 1024px) {
  .cs-list__title { 
    font-size: var(--font-size-h-1); 
    margin-bottom: 4rem; 
  }
}

.cs-list__grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .cs-list__grid { gap: 2rem; }
}

/* Individual Case Study Card */
.cs-item {
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  color: inherit;
}
.cs-item__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--c-100);
}
.cs-item__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.cs-item:hover .cs-item__img-wrap img {
  transform: scale(1.03);
}

.cs-item__info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cs-item__name {
  font-family: var(--font-family-serif);
  font-size: 2rem;
  line-height: 1;
}

/* -------------------------------------------
   Desktop Overlay Logic (>= 1024px) 
   ------------------------------------------- */
@media (min-width: 1024px) {
  .cs-item__info {
    position: absolute;
    inset: auto 0 0 0;
    padding: 2.5rem;
    z-index: 2;
    color: var(--c-0); /* Default white text */
  }
  .cs-item__name {
    font-size: 2.5rem;
  }
  
  /* Pill Button Default (White Outline) */
  .cs-item:not(.theme-dark) .cs-item__link {
    border-color: rgba(255,255,255,0.4);
    color: var(--c-0);
  }
  .cs-item:not(.theme-dark):hover .cs-item__link {
    background: var(--c-0);
    color: var(--c-1000);
    border-color: var(--c-0);
  }
  
  /* Dark Theme Override (Gray/Beige Backgrounds) */
  .cs-item.theme-dark .cs-item__info {
    color: var(--c-1000);
  }
  .cs-item.theme-dark .cs-item__link {
    border-color: rgba(0,0,0,0.4);
    color: var(--c-1000);
  }
  .cs-item.theme-dark:hover .cs-item__link {
    background: var(--c-1000);
    color: var(--c-0);
    border-color: var(--c-1000);
  }

  /* Force only the Sygnia (1st child) CTA button to be white */
  .cs-list__grid .cs-item:nth-child(1) .cs-item__link {
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--c-0);
  }
  
  /* Sygnia CTA hover state */
  .cs-list__grid .cs-item:nth-child(1):hover .cs-item__link {
    background: var(--c-0);
    color: var(--c-1000);
    border-color: var(--c-0);
  }
}

/* -------------------------------------------
   Tablet & Mobile Stacked Logic (< 1024px) 
   ------------------------------------------- */
@media (max-width: 1023px) {
  .cs-item__info {
    padding-top: 0.75rem;
    color: var(--c-900); /* Text falls underneath onto page background */
  }
  /* Strip the Pill styling for mobile 'See more' text */
  .cs-item__link.pill {
    border: none;
    padding: 0;
    font-size: 0.9375rem;
    font-family: var(--font-family-sans-serif);
    background: transparent;
    color: var(--c-900);
  }
  .cs-item__link.pill i {
    display: none; /* Hides the arrow */
  }
  .cs-item__link.pill:hover {
    color: var(--c-500);
    background: transparent;
  }
  .cs-item__info {
    padding-top: 1rem;
    color: var(--c-900); /* Text falls underneath onto page background */
  }
  /* Hide the 'See more' button on Tablet and Mobile */
  .page-cases-list .cs-item__link {
    display: none !important;
  }
  .cs-list {
  padding: 0 var(--pad) 8rem var(--pad);
  }
}

/* ============================================================
   Page: Case Study Detail Template (Academias & Generic)
   ============================================================ */

.cs-page {
  padding-top: 6rem;
  min-height: 100vh;
  background: var(--c-30);
}

@media (min-width: 1024px) {
  .cs-page {
    padding-top: 10rem;
  }
}

.cs-container {
  width: 100%;
  padding: 0 var(--pad);
}

/* ---------- Section 1: Hero & Metadata ---------- */
.cs-detail-hero {
  display: flex;
  align-items: flex-start;
  gap: 4.5rem; /* Reduced from 125px (~7.8rem) */
  align-self: stretch;
  padding-bottom: 5rem;
}

.cs-detail-hero__primary {
  display: flex;
  width: 884px;
  max-width: 55%;
  flex-direction: column;
  align-items: flex-start;
  gap: 48px;
}

.cs-detail-hero__title {
  color: var(--c-900);
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h-0);
  font-style: normal;
  font-weight: var(--font-weight-light);
  line-height: 1;
}

.cs-detail-hero__tags {
  display: flex;
  width: 783px;
  max-width: 100%;
  align-items: flex-start;
  align-content: flex-start;
  gap: 8px 32px; /* Reduced to 8px vertically, expanded to 32px horizontally */
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: hidden; 
}

.cs-detail-hero__tag {
  position: relative;
  display: flex;
  align-items: center;
  font-family: var(--font-family-sans-serif);
  font-size: var(--font-size-body);
  color: var(--c-900);
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
}

.cs-detail-hero__tag:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -16px; /* Exactly half of the new 32px horizontal gap! */
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 14px;
  background: var(--c-500);
}

.cs-detail-hero__secondary {
  display: flex;
  padding-top: 24px;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  flex: 1 0 0;
  align-self: stretch;
}

.cs-accordion-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.cs-info__visible {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  margin-bottom: 1.5rem; /* Creates exact distance to the button when closed */
}

@media (min-width: 1024px) {
  .cs-info__visible,
  .cs-accordion__content {
    max-width: 540px; /* Constrains reading width nicely on desktop */
  }
  .cs-accordion-wrap {
    padding-top: 24px; /* Makes the drawer align with the h1 */
  }
}

.cs-info__title {
  font-family: var(--font-family-sans-serif);
  font-size: var(--font-size-h-4);
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  margin: 0;
  color: var(--c-900);
}

.cs-info__subtitle {
  font-family: var(--font-family-sans-serif);
  font-size: var(--font-size-h-5);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
  margin: 0;
  color: var(--c-900);
}

.cs-info__text {
  font-family: var(--font-family-sans-serif);
  font-size: var(--font-size-body);
  line-height: 1.4;
  margin: 0;
  color: var(--c-900);
}

.cs-info__text strong {
  font-weight: var(--font-weight-semibold);
}

.cs-accordion__drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
}

.cs-accordion__drawer.is-expanded {
  grid-template-rows: 1fr;
}

.cs-accordion__content {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.cs-accordion__drawer.is-expanded .cs-accordion__content {
  padding-bottom: 1.5rem; /* Pushes the button down seamlessly when opened */
}

.cs-accordion__toggle {
  display: inline-flex;
  height: 37px;
  padding: 12px 16px;
  align-items: center;
  gap: 8px;
  border-radius: 9999px;
  border: 1px solid var(--c-900);
  background: transparent;
  color: var(--c-900);
  font-family: var(--font-family-sans-serif);
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  width: fit-content;
}

.cs-accordion__toggle:hover {
  background: var(--c-900);
  color: var(--c-0);
}

/* ---------- Section 2: List ---------- */
.cap-list {
  display: flex;
  flex-direction: column;
  padding: 0 var(--pad);
}

.cap-item {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 4rem 0;
  border-bottom: 1px solid var(--c-500);
}

.cap-item:first-child {
  border-top: 1px solid var(--c-500);
}

.cap-item__left {
  display: flex;
  width: calc((100% - 24px) * 0.66666); /* Strict 2/3 width */
  flex-shrink: 0; /* Prevents squishing */
  gap: 1.5rem;
  align-items: flex-start;
}

.cap-item__left-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cap-item__num {
  color: var(--c-500);
  font-size: 1rem;
  font-family: var(--font-family-sans-serif);
  
  /* Match the exact height of the h2 next to it */
  height: calc(var(--font-size-h-2) * 0.78);
  
  /* Push the number to the absolute bottom */
  display: flex;
  align-items: flex-end;
  line-height: 1; /* Removes extra vertical space so it sits flush */
}

.cap-item__title {
  color: var(--c-0);
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h-2); /* Increased size to match screenshot */
  font-weight: var(--font-weight-light);
  line-height: 1.1;
  margin: 0;
}

.cap-item__subtitle {
  color: var(--c-150);
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h-5);
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
}

.cap-item__right {
  display: flex;
  flex-direction: column;
  width: calc((100% - 24px) * 0.33333); /* Strict 1/3 width */
  flex-shrink: 0; /* Prevents squishing */
  gap: 1.5rem;
}

.cap-item__desc {
  color: var(--c-0);
  font-family: var(--font-family-sans-serif);
  font-size: var(--font-size-h-6); /* Bumps it up to 20px */
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
}

.cap-item__desc--emphasis {
  color: var(--c-0);
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h-5) !important;
  font-style: normal;
  font-weight: 400;
  line-height: 1.2;
  margin-top: 1.5rem; /* Gives it a little breathing room from the paragraph above it */
}

.cap-item__tags {
  display: flex;
  width: 783px;
  max-width: 100%;
  align-items: flex-start;
  align-content: flex-start;
  gap: 8px 32px; /* Reduced to 8px vertically, expanded to 32px horizontally */
  flex-wrap: wrap;
  list-style: none;
  padding: 1rem 0 0 0;
  margin: 0;
  overflow: hidden;
}

.cap-item__tag {
  display: flex;
  align-items: center;
  font-family: var(--font-family-sans-serif);
  font-size: var(--font-size-body);
  color: var(--c-0);
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
}

.cap-item__tag:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -16px; /* Exactly half of the new 32px horizontal gap! */
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 14px;
  background: var(--c-500);
}

@media (max-width: 1023px) {
  .cap-item {
    flex-direction: column;
    padding: 3rem 0;
  }
  .cap-item__left,
  .cap-item__right {
    width: 100%;
  }
  .cap-item__left {
    gap: 1rem;
  }
}

/* ---------- Section 3: Next Project ---------- */
.cs-next {
  padding: 8rem 0 10rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cs-next__label {
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-500);
}

.cs-next__title {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h-1);
  font-weight: var(--font-weight-light);
  color: var(--c-900);
  margin-bottom: 2rem;
}

.cs-next__link {
  display: block;
  width: 100%;
  max-width: 1388px;       /* Centers and caps width at 1388px */
  margin: 0 auto;
  overflow: hidden;
  text-decoration: none;
}

.cs-next__img-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--c-100);
  overflow: hidden;
}

.cs-next__img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.cs-next__link:hover .cs-next__img-box img {
  transform: scale(1.04);
}

/* ---------- Responsive Breakpoints (< 1024px) ---------- */
@media (max-width: 1023px) {
  .cs-detail-hero {
    flex-direction: column;
    gap: 32px;
    padding-bottom: 3rem;
  }

  .cs-detail-hero__primary {
    width: 100%;
    max-width: 100%;
    gap: 24px;
  }

  .cs-detail-hero__tags {
    gap: 8px;
  }

  .cs-detail-hero__secondary {
    width: 100%;
    padding-top: 0;
  }

  .cs-feed__grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .cs-next {
    padding: 5rem 0 6rem 0;
  }

  .cs-next__title {
    margin-bottom: 1rem;
  }
}

/* ============================================================
   Page: Capabilities
   ============================================================ */
.page-capabilities {
  background: var(--c-950);
  color: var(--c-0);
  padding-top: 6rem;
  min-height: 100vh;
}
@media (min-width: 1024px) {
  .page-capabilities { padding-top: 10rem; }
}

/* ---------- Section 1: Intro ---------- */
.cap-intro {
  display: flex;
  padding: 0 var(--pad);
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 6rem;
}

.cap-intro__title {
  width: 60%;
  flex-shrink: 0; /* Prevents squishing */
  color: var(--c-0);
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h-0);
  font-weight: var(--font-weight-light);
  line-height: 1;
  margin: 0;
}

.cap-intro__text-container {
  width: 25%;
}

.cap-intro__text {
  width: 100%;
  flex-shrink: 0; /* Prevents squishing */
  color: var(--c-0);
  font-family: var(--font-family-sans-serif);
  font-size: var(--font-size-body);
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

@media (max-width: 1023px) {
  .cap-intro {
    flex-direction: column;
    margin-bottom: 4rem;
  }
  .cap-intro__title,
  .cap-intro__text-container {
    width: 100%;
  }
}

/* ---------- Section 2: Content Feed ---------- */
.cs-feed {
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* The vertical space between rows of images */
  padding: 0 var(--pad); /* Keeps the images aligned with your page margins */
}

/* The side-by-side 2-column grid */
.cs-feed__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); 
  gap: 1.5rem;
}

/* Image wrappers */
.cs-feed__media {
  position: relative;
  width: 100%;
  height: 100%; /* Allows it to stretch to the grid row height */
  background: var(--c-100); 
  overflow: hidden;
}

/* Forces images to fill their boxes cleanly */
.cs-feed__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Full-width 16:9 ratio blocks */
.cs-feed__media--16-9 {
  aspect-ratio: 16 / 9;
}

/* Video embed wrappers */
.cs-feed__video-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* CSS trick to force iframe to act like object-fit: cover */
.cs-feed__video-wrap iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  aspect-ratio: 16 / 9;
  max-width: none;
  border: 0;
  pointer-events: none;
}

/* Mobile layout: Revert to 16:9 in normal document flow */
@media (max-width: 1023px) {
  .cs-feed__video-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
  }
  .cs-feed__video-wrap iframe {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
  }
}

/* ---------- Section 2: List ---------- */
.cap-list {
  display: flex;
  flex-direction: column;
  padding: 0 var(--pad);
}

.cap-item {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 4rem 0;
  border-bottom: 1px solid var(--c-500);
}

.cap-item:first-child {
  border-top: 1px solid var(--c-500);
}

.cap-item__left {
  display: flex;
  width: 60%;
  flex-shrink: 0; /* Prevents squishing */
  gap: 2rem;
  align-items: flex-start;
}

.cap-item__num {
  color: var(--c-0);
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h-6);
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
  
  /* Retaining the bottom-alignment logic we just added */
  height: calc(var(--font-size-h-2) * 0.78);
  display: flex;
  align-items: flex-end;
}

.cap-item__title {
  color: var(--c-0);
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h-3);
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
}

.cap-item__right {
  display: flex;
  flex-direction: column;
  width: 40%;
  flex-shrink: 0; /* Prevents squishing */
  gap: 2rem;
}

.cap-item__desc {
  color: var(--c-0);
  font-size: var(--font-size-body);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.cap-item__tags-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem; /* Keeps the subtitle close to the tags */
}

.cap-item__subtitle {
  color: var(--c-0);
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h-5);
  font-style: normal;
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
}

.cap-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.cap-item__tag {
  display: inline-flex;
  padding: 8px 16px;
  border: 1px solid var(--c-500);
  border-radius: 9999px;
  font-size: 13px;
  color: var(--c-0);
}

@media (max-width: 1023px) {
  .cap-item {
    flex-direction: column;
    padding: 3rem 0;
  }
  .cap-item__left,
  .cap-item__right {
    width: 100%;
  }
  .cap-item__left {
    flex-direction: column;
    gap: 1rem;
  }
}

/* ---------- Section 3: Outro ---------- */
.cap-outro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 100vh;
  min-height: 600px;
  padding: 0 var(--pad);
  gap: 2rem;
}
.cap-outro__title {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h-1);
  color: var(--c-0);
  font-weight: var(--font-weight-light);
  line-height: 1.1;
  max-width: 900px;
  margin: 0;
}

.cap-outro__desc-container {
  display: inherit;
  flex-direction: inherit;
  justify-content: inherit;
  align-items: inherit;
  text-align: inherit;
  gap: 1rem;
}

.cap-outro__desc {
  color: var(--c-0);
  text-align: center;
  font-family: var(--font-family-sans-serif);
  font-size: var(--font-size-h-6);
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
  max-width: 600px; /* Kept this to ensure the text wraps nicely in the center! */
}

/* ---------- Dark Footer Overrides ---------- */
.footer--dark {
  background: var(--c-950);
  color: var(--c-0);
  border-top-color: var(--c-600);
}
.footer--dark .footer__nav a { color: var(--c-0); }
.footer--dark .footer__nav a:hover { color: var(--c-400); }
.footer--dark .footer__sep, 
.footer--dark .footer__clock, 
.footer--dark .footer__clock-tablet { color: var(--c-400); }

.footer--dark .footer__details { color: var(--c-400); }
.footer--dark .footer__details a { color: var(--c-0); }
.footer--dark .footer__details a:hover { color: var(--c-400); }

.footer--dark .footer__form input[type="email"],
.footer--dark .footer__form textarea {
  color: var(--c-0);
  border-bottom-color: var(--c-600);
}
.footer--dark .footer__form input::placeholder,
.footer--dark .footer__form textarea::placeholder {
  color: var(--c-500);
}
.footer--dark .footer__textarea-wrap {
  border-bottom-color: var(--c-600);
}
.footer--dark .footer__form input:focus,
.footer--dark .footer__form textarea:focus,
.footer--dark .footer__textarea-wrap:focus-within {
  border-bottom-color: var(--c-0);
}

.footer--dark .footer__check,
.footer--dark .footer__check a { color: var(--c-0); }
.footer--dark .footer__check input { border-color: var(--c-0); }
.footer--dark .footer__check input:checked::after { color: var(--c-0); }

.footer--dark .pill {
  border-color: var(--c-0);
  color: var(--c-0);
}
.footer--dark .pill:hover:not(:disabled) {
  background: var(--c-0);
  color: var(--c-1000);
}

.footer--dark .footer__social-links a {
  color: var(--c-0);
  border-bottom-color: var(--c-600);
}
.footer--dark .footer__social-links a:hover {
  color: var(--c-400);
}
.footer--dark .footer__copy {
  color: var(--c-800);
}

/* ---- Footer Fix for Small Desktops ---- */
@media (min-width: 1024px) and (max-width: 1439px) {
  .footer__main {
    grid-template-columns: 1fr 1fr; /* Fluid halves instead of fixed 581px */
    gap: 4rem; /* Smaller gap */
  }
  
  .footer__form,
  .footer__social-links {
    width: 100%; /* Allows them to shrink to fit the column */
  }
}

/* ============================================================
   Page: Legal
   ============================================================ */
.page-legal {
  padding-top: 8rem;
  padding-bottom: 6rem;
}
@media (min-width: 1024px) {
  .page-legal { 
    padding-top: 12rem; 
    padding-bottom: 10rem; 
  }
}

.legal-layout {
  display: flex;
  flex-direction: column;
  padding: 0 var(--pad); /* Respects global page margins */
  gap: 3rem;
}

@media (min-width: 1024px) {
  .legal-layout {
    display: grid;
    /* This creates a 320px sidebar, a fluid center column, and a 320px invisible right column */
    grid-template-columns: 320px 1fr 320px; 
    align-items: flex-start;
    gap: 0; /* We remove the gap because the grid handles the spacing naturally now */
  }
}

/* --- Sidebar & Navigation --- */
.legal__sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .legal__sidebar {
    width: 320px; 
    flex-shrink: 0;
    position: sticky; /* Locks the sidebar in place on desktop */
    top: 12rem; 
  }
}

.legal__title {
  color: var(--c-900);
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h-0);
  font-style: normal;
  font-weight: var(--font-weight-light);
  line-height: 1;
  margin: 0;
}

.legal__nav {
  display: flex;
  flex-wrap: wrap; /* Pills sit side-by-side on mobile */
  gap: 0.75rem;
}

@media (min-width: 1024px) {
  .legal__nav {
    flex-direction: column; /* Pills stack vertically on desktop */
    align-items: flex-start;
  }
}

/* Standardized pill styling */
.legal__nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  font-family: var(--font-family-sans-serif);
  font-size: var(--font-size-body);
  font-weight: 400;
  line-height: 1.4;
  color: var(--c-1000) !important;
  border: 1px solid var(--c-1000) !important;
  border-radius: 9999px;
  text-decoration: none;
  background: transparent !important;
  transition: all 0.3s ease;
}

/* Active State (Always pure black) */
.legal__nav-link.is-active {
  background: var(--c-1000) !important;
  color: var(--c-0) !important; 
  border-color: var(--c-1000) !important;
}

/* Hover State (Only triggers on desktop/mouse devices!) */
@media (hover: hover) {
  .legal__nav-link:hover {
    background: var(--c-1000) !important;
    color: var(--c-0) !important; 
    border-color: var(--c-1000) !important;
  }
}
  
/* --- Content Typography --- */
.legal__content {
    grid-column: 2; /* Locks the text into the exact center of the screen */
    margin: 0 auto;
    width: 100%;
    max-width: 720px;
  }


.legal__section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* Controls spacing between all paragraphs */
  scroll-margin-top: 8rem; /* Prevents anchor links from hiding under the top edge */
  margin-bottom: 6rem;
}

@media (min-width: 1024px) {
  .legal__section {
    scroll-margin-top: 12rem;
  }
}

.legal__section h2 {
  color: var(--c-900);
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h-4);
  font-style: normal;
  font-weight: var(--font-weight-light);
  line-height: 1.2;
}

.legal__section h3 {
  color: var(--c-900);
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h-5);
  font-style: normal;
  font-weight: var(--font-weight-light);
  line-height: 1.2;
}

.legal__section p, 
.legal__section ul {
  color: var(--c-900);
  font-family: var(--font-family-sans-serif);
  font-size: var(--font-size-h-6);
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
}

.legal__section ul {
  padding-left: 1.5rem;
}

.legal__section li {
  margin-bottom: 0.5rem;
}

/* ============================================================
   Page: 404 Error
   ============================================================ */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Centers everything vertically on mobile */
  min-height: 100vh;
  padding: 6rem var(--pad); /* Unified padding so true center is achieved */
  background: var(--c-30);
  color: var(--c-900);
  text-align: center;
  overflow: hidden;
  gap: 2rem; /* Tighter distance between photo and text on mobile */
}

@media (min-width: 1024px) {
  .error-page {
    flex-direction: row;
    justify-content: center; /* Centers both blocks horizontally */
    align-items: center; /* Centers both blocks vertically */
    gap: 4rem; /* Controls the exact distance between the text and the photo */
    text-align: left;
  }
}

.error-page__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  z-index: 10;
}

@media (min-width: 1024px) {
  .error-page__content {
    align-items: flex-start;
    /* Removed the flex:1 and bottom padding so it no longer pushes the image away */
  }
}

.error-page__title {
  font-size: clamp(6rem, 20vw, 12rem); 
  line-height: 1;
  color: var(--c-900);
  margin: 0;
  font-weight: var(--font-weight-light);  font-family: var(--font-family-serif);
}

.error-page__text {
  font-size: var(--font-size-h-6);
  color: var(--c-600);
  line-height: 1.4;
}

/* --- Interactive Face Setup --- */
.face-wrap {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex; /* Removes baseline image gaps */
}

@media (min-width: 1024px) {
  .face-wrap {
    margin: 0;
  }
}

.face-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Base Eyeball */
.eye {
  position: absolute;
  width: 13%; /* Shrunk slightly for the closer crop */
  aspect-ratio: 1 / 1;
  background-color: var(--c-30);
  border-radius: 50%;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5); 
}

/* Coordinates tuned for 404_2.jpg */
.eye-left {
  top: 36%; 
  left: 32%;
}

.eye-right {
  top: 36%; 
  right: 32%; /* Adjust slightly if frames are asymmetrical */
}

/* The Pupil */
.pupil {
  position: absolute;
  width: 40%;
  height: 40%;
  background-color: var(--c-900);
  border-radius: 50%;
  top: 50%;
  right: 5%; 
  transform: translateY(-50%);
}

/* Dim the screen when invisible hCaptcha opens */
body.captcha-active::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7); /* Adjust the 0.7 to make it darker or lighter */
  z-index: 9999; 
  pointer-events: none; /* Prevents the overlay from blocking clicks */
  transition: opacity 0.3s ease;
}

/* Hide Google reCAPTCHA floating badge */
.grecaptcha-badge { 
  visibility: hidden !important; 
}
/* Keep the off-screen portion of the reCAPTCHA badge from widening the page. */
html { overflow-x: clip; }
