/* ============================================================
   Shared stylesheet for case-study pages
   Mirrors tokens, nav, footer & accessibility rules in final.html
   ============================================================ */

@font-face {
  font-family: 'Gadey';
  src: url('../fonts/gadey-modern-logo-font-2026-04-07-06-21-29-utc/Gadey-Regular.otf') format('opentype'),
       url('../fonts/gadey-modern-logo-font-2026-04-07-06-21-29-utc/Gadey-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter/Inter-VariableFont_opsz,wght.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --bg:   #EDEEF0;
  --bg2:  #E4E5E8;
  --bg3:  #D8D9DC;
  --ink:  #0E0E10;
  --ink2: #141416;
  --dim:  #65656D;
  --rule: rgba(14,14,16,0.12);
  --f-cond: 'Gadey', sans-serif;
  --pad-x: clamp(20px, 4.5vw, 64px);
  --pad-section: clamp(36px, 6vw, 80px);
  --f-sans: 'Inter', -apple-system, sans-serif;
  --f-slab: var(--f-sans);
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── NAV (shared with final.html) ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--ink2);
  border-bottom: 1px solid rgba(237,238,240,0.08);
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--pad-x);
}
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-logo {
  font-family: var(--f-cond);
  font-size: 22px;
  letter-spacing: 0.01em;
  color: var(--bg);
  text-decoration: none;
}
nav a:not(.nav-logo) {
  font-family: var(--f-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(237,238,240,0.65);
  transition: color 0.15s;
  position: relative;
  padding: 4px 0;
}
nav a:not(.nav-logo)::after {
  content: '';
  position: absolute; left: 0; right: 100%; bottom: -1px;
  height: 1px;
  background: var(--bg);
  transition: right 0.2s ease;
}
nav a:not(.nav-logo):hover { color: var(--bg); }
nav a:not(.nav-logo):hover::after { right: 0; }

/* mobile nav toggle */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 48px; height: 48px;
  margin-left: auto;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 20px; height: 2px;
  background: var(--bg);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child {
  transform: translateY(3.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

.mobile-menu { display: none; }

/* ── CASE STUDY HERO ── */
.cs-hero {
  padding: var(--pad-section) var(--pad-x);
  border-bottom: 2px solid var(--ink);
}
.cs-hero--dark  { background: var(--ink); }
.cs-hero--mid   { background: var(--ink2); }
.cs-hero--light { background: var(--bg); }

.cs-hero-top {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 28px;
}
.cs-back {
  font-family: var(--f-sans);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none;
  color: var(--dim);
  transition: color 0.15s;
}
.cs-hero--dark .cs-back,
.cs-hero--mid  .cs-back  { color: rgba(237,238,240,0.55); }
.cs-back:hover { color: var(--ink); }
.cs-hero--dark .cs-back:hover,
.cs-hero--mid  .cs-back:hover  { color: var(--bg); }

.cs-cat {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 700;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  color: var(--dim);
}
.cs-hero--dark .cs-cat,
.cs-hero--mid  .cs-cat  { color: rgba(237,238,240,0.55); border-color: rgba(237,238,240,0.15); }

.cs-title {
  font-family: var(--f-cond);
  font-size: clamp(56px, 9vw, 128px);
  line-height: 0.95; letter-spacing: -0.01em;
  margin: 4px 0 18px;
  color: var(--ink);
}
.cs-hero--dark .cs-title,
.cs-hero--mid  .cs-title  { color: var(--bg); }

.cs-tagline {
  font-family: var(--f-slab);
  font-weight: 400;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.55; letter-spacing: -0.01em;
  color: var(--dim);
  max-width: 640px;
}
.cs-hero--dark .cs-tagline,
.cs-hero--mid  .cs-tagline  { color: rgba(237,238,240,0.65); }

.cs-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 28px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.cs-hero--dark .cs-meta,
.cs-hero--mid  .cs-meta  { border-top-color: rgba(237,238,240,0.08); }

.cs-meta-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 9px;
}
.cs-hero--dark .cs-meta-label,
.cs-hero--mid  .cs-meta-label  { color: rgba(237,238,240,0.55); }

.cs-meta-val {
  font-family: var(--f-slab);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
}
.cs-hero--dark .cs-meta-val,
.cs-hero--mid  .cs-meta-val  { color: var(--bg); }

/* ── GALLERY ── */
.cs-gallery {
  padding: var(--pad-section) var(--pad-x);
  border-bottom: 2px solid var(--ink);
  background: var(--bg2);
}
.cs-cover {
  height: clamp(280px, 40vw, 520px);
  margin-bottom: 20px;
}
.cs-image {
  display: block;
  width: 100%;
  object-fit: cover;
  background: var(--bg3);
}
.cs-cover.cs-image {
  height: clamp(280px, 40vw, 520px);
}
.cs-image-grid .cs-image {
  height: 100%;
  min-height: 220px;
}
.cs-image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.cs-image-placeholder {
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 0 20px;
  font-family: var(--f-sans);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px dashed var(--rule);
  color: var(--dim);
  background-image: repeating-linear-gradient(135deg, rgba(14,14,16,0.04) 0 1px, transparent 1px 14px);
  min-height: 220px;
}
.cs-cover.cs-image-placeholder { min-height: clamp(280px, 40vw, 520px); }

/* ── CONTENT BLOCKS ── */
.cs-content {
  padding: var(--pad-section) var(--pad-x);
  border-bottom: 2px solid var(--ink);
}
.cs-block {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
}
.cs-block:first-child { border-top: none; padding-top: 0; }
.cs-block .sect-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dim);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 0;
}
.cs-block .sect-label::before { content: ''; width: 24px; height: 1px; background: var(--dim); }
.cs-block p {
  font-size: 15px; line-height: 1.75;
  color: var(--ink);
  max-width: 640px;
}
.cs-block p + p { margin-top: 16px; }

/* ── HIGHLIGHTS ── */
.cs-highlights {
  padding: var(--pad-section) var(--pad-x);
  border-bottom: 2px solid var(--ink);
}
.cs-highlights .sect-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dim);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.cs-highlights .sect-label::before { content: ''; width: 24px; height: 1px; background: var(--dim); }
.cs-highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.cs-highlight-card {
  border: 1px solid var(--rule);
  padding: 24px;
}
.cs-highlight-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 12px;
}
.cs-highlight-val {
  font-family: var(--f-slab);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
}

/* ── NEXT PROJECT ── */
.cs-next {
  display: flex; flex-direction: column;
  padding: var(--pad-section) var(--pad-x);
  background: var(--ink);
  text-decoration: none;
  transition: background 0.2s;
}
.cs-next:hover { background: var(--ink2); }
.cs-next-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(237,238,240,0.55);
}
.cs-next-name {
  font-family: var(--f-cond);
  font-size: clamp(44px, 8vw, 110px);
  line-height: 1; letter-spacing: -0.01em;
  color: var(--bg);
  margin-top: 14px;
  display: flex; align-items: center; gap: 18px;
  transition: transform 0.2s ease;
}
.cs-next:hover .cs-next-name { transform: translateX(10px); }

/* ── FOOTER (shared with final.html) ── */
footer {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  align-items: start;
  padding: 28px var(--pad-x);
  border-top: 1px solid var(--rule);
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dim);
  gap: 24px;
}
.footer-name { font-weight: 700; color: var(--ink); }
.footer-services { display: flex; flex-direction: column; gap: 5px; }
.footer-social { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
footer a { color: var(--dim); text-decoration: none; transition: color 0.15s; }
footer a:hover { color: var(--ink); }

/* ── SCREEN READER ONLY ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── SKIP LINK ── */
.skip-link {
  position: absolute; top: -100%; left: var(--pad-x);
  background: var(--bg); color: var(--ink);
  padding: 10px 20px;
  font-family: var(--f-sans); font-size: 13px; font-weight: 700;
  text-decoration: none; z-index: 9999;
  border: 2px solid var(--ink);
  transition: top 0.15s;
}
.skip-link:focus { top: 16px; }
/* tabindex="-1" target for the skip link — no extra ring needed, the link's own
   focus state already communicates the jump */
main:focus-visible { outline: none; }

/* ── FOCUS STATES ── */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }
.cs-hero--dark :focus-visible,
.cs-hero--mid  :focus-visible,
.cs-next:focus-visible,
nav :focus-visible,
.mobile-menu :focus-visible { outline-color: var(--bg); }

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.on { opacity: 1; transform: none; }
.d1 { transition-delay: 0.1s; }
.d2 { transition-delay: 0.2s; }
.d3 { transition-delay: 0.3s; }

/* ── FORCED COLORS (Windows High Contrast) ── */
@media (forced-colors: active) {
  .cs-image-placeholder, .cs-cover { border: 1px solid ButtonText; }
  :focus-visible { outline: 3px solid Highlight; }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .cs-next:hover .cs-next-name { transform: none !important; }
}

/* ── RESPONSIVE 860px ── */
@media (max-width: 860px) {
  nav { height: auto; padding: 6px var(--pad-x); }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .mobile-menu:not([hidden]) {
    display: flex;
    flex-direction: column;
    background: var(--ink);
    border-top: 1px solid rgba(237,238,240,0.08);
  }
  .mobile-menu a {
    display: flex; align-items: center;
    min-height: 48px;
    padding: 0 var(--pad-x);
    font-family: var(--f-sans);
    font-size: 13px; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: rgba(237,238,240,0.75);
    text-decoration: none;
    border-bottom: 1px solid rgba(237,238,240,0.08);
    transition: color 0.15s, background 0.15s;
  }
  .mobile-menu a:last-child { border-bottom: none; }
  .mobile-menu a:hover, .mobile-menu a:focus-visible { color: var(--bg); background: rgba(237,238,240,0.06); }

  .cs-title { font-size: clamp(40px, 11vw, 80px); }
  .cs-meta { grid-template-columns: 1fr; gap: 18px; }
  .cs-image-grid { grid-template-columns: 1fr; }
  .cs-block { grid-template-columns: 1fr; gap: 12px; }
  .cs-highlights-grid { grid-template-columns: 1fr; }
  .cs-next-name { font-size: clamp(34px, 12vw, 64px); }

  footer { grid-template-columns: 1fr; gap: 16px; }
  .footer-social { align-items: flex-start; }
}

/* ── RESPONSIVE 520px ── */
@media (max-width: 520px) {
  .cs-title { font-size: clamp(34px, 10vw, 50px); }
  .cs-cover, .cs-image-placeholder { min-height: 160px; }
}

/* Section label override — real headers */
.sect-label,
.cs-block .sect-label,
.cs-highlights .sect-label {
  font-family: var(--f-cond);
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
  display: block;
  margin-bottom: 12px;
  line-height: 1.1;
}
.sect-label::before,
.cs-block .sect-label::before,
.cs-highlights .sect-label::before {
  display: none;
}
.cs-block {
  grid-template-columns: 1fr;
}
