/* NAV — not fixed on case study pages, stays at the top and scrolls away */
nav { position: absolute; }

/* STICKY BAR — appears after the dark header scrolls away */
.sticky-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 3rem;
  background: rgba(247,245,240,0.96);
  border-bottom: 1px solid rgba(17,17,16,0.08);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sticky-bar.visible {
  opacity: 1;
  pointer-events: auto;
}

.sticky-bar-logo {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.sticky-bar-sep { font-size: 0.78rem; color: var(--mid-gray); }

.sticky-bar-item { font-size: 0.82rem; color: var(--mid-gray); font-weight: 400; }

.sticky-bar-current { font-size: 0.82rem; color: var(--ink); font-weight: 500; }

.sticky-bar-back {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.sticky-bar-back:hover { opacity: 0.7; }

/* CONTAINER VARIANT */
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 3rem; }

/* CASE HEADER */
.case-header {
  padding-top: 9rem;
  padding-bottom: 5rem;
  background: var(--ink);
}

.case-back {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.35);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  transition: color 0.2s;
}
.case-back:hover { color: var(--accent-2); }

.case-tag {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 1.25rem;
  display: block;
}

.case-title {
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ivory);
  margin-bottom: 2.5rem;
  max-width: 700px;
}
.case-title em { font-style: italic; color: var(--accent-2); }

.skills-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 3rem; }

.skill-pill {
  font-size: 0.7rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid rgba(247,245,240,0.15);
  border-radius: 4px;
  color: rgba(247,245,240,0.55);
  font-weight: 400;
}

.case-meta {
  display: flex;
  gap: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(247,245,240,0.08);
}

.meta-item-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(247,245,240,0.3);
  margin-bottom: 0.25rem;
}

.meta-item-value { font-size: 0.88rem; font-weight: 400; color: rgba(247,245,240,0.7); }

/* PROCESS SEQUENCE — arrow stepper */
.process-sequence {
  background: var(--ivory);
  padding: 4rem 0;
  border-top: 1px solid rgba(17,17,16,0.07);
  border-bottom: 1px solid rgba(17,17,16,0.07);
}

.sequence-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 3rem;
  display: flex;
  align-items: stretch;
}

.seq-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem 1.25rem 1.25rem;
  text-decoration: none;
  background: var(--warm-gray);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%);
  transition: background 0.2s;
  cursor: pointer;
}

.seq-item:first-child {
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%);
  padding-left: 1.5rem;
}

.seq-item:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 18px 50%);
}

.seq-item:hover { background: var(--accent-light); }
.seq-item.active { background: var(--accent); }

.seq-num {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.3rem;
  transition: color 0.2s;
}
.seq-item.active .seq-num { color: rgba(247,245,240,0.6); }

.seq-label {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--dark-gray);
  line-height: 1.3;
  transition: color 0.2s;
}
.seq-item:hover .seq-label { color: var(--ink); }
.seq-item.active .seq-label { color: var(--ivory); font-weight: 500; }

/* SECTION WRAPPERS */
.section { padding: 5rem 0; }
.section-dark { background: var(--ink); }
.section-warm { background: var(--warm-gray); }
.section-dark .section-label { color: rgba(247,245,240,0.3); }

/* CHALLENGE */
.challenge-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 5rem;
  align-items: start;
}

.challenge-heading {
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}
.challenge-heading em { font-style: italic; color: var(--accent); }

.challenge-body p {
  font-size: 0.97rem;
  color: var(--dark-gray);
  line-height: 1.8;
  font-weight: 300;
  margin-bottom: 1.25rem;
}
.challenge-body p:last-child { margin-bottom: 0; }
.challenge-body strong { color: var(--ink); font-weight: 500; }

/* PROCESS STEPS TABLE */
.steps-overview {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(17,17,16,0.08);
  border-radius: 14px;
  overflow: hidden;
}

.step-row {
  display: grid;
  grid-template-columns: 3.5rem 14rem 1fr auto;
  gap: 0 2rem;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(17,17,16,0.06);
  text-decoration: none;
  transition: background 0.2s;
  cursor: pointer;
}
.step-row:last-child { border-bottom: none; }
.step-row:hover { background: var(--accent-light); }

.step-num { font-size: 0.7rem; font-weight: 500; color: var(--accent); letter-spacing: 0.08em; }
.step-title { font-size: 0.92rem; font-weight: 500; color: var(--ink); }
.step-desc { font-size: 0.83rem; color: var(--mid-gray); font-weight: 300; line-height: 1.45; }

.step-arrow {
  font-size: 0.85rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.step-row:hover .step-arrow { opacity: 1; transform: translateX(4px); }

/* STEP DETAIL SECTIONS */
.step-section { padding: 5rem 0; scroll-margin-top: 130px; }

.step-section-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.step-section-inner.reversed { direction: rtl; }
.step-section-inner.reversed > * { direction: ltr; }

.step-below { display: flex; flex-direction: column; gap: 2.5rem; }

.step-visuals-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.step-visuals-row.single { grid-template-columns: 1fr; }
.step-visuals-row.three { grid-template-columns: 1fr 1fr 1fr; }

.step-visual-caption {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--mid-gray);
  font-weight: 300;
}

.step-tag {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: block;
}

.step-heading {
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.step-heading em { font-style: italic; color: var(--accent); }

.step-body p {
  font-size: 0.92rem;
  color: var(--dark-gray);
  line-height: 1.78;
  font-weight: 300;
  margin-bottom: 1rem;
}
.step-body p:last-child { margin-bottom: 0; }
.step-body strong { color: var(--ink); font-weight: 500; }

/* VISUAL PLACEHOLDERS */
.visual-placeholder {
  background: var(--warm-gray);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 320px;
  border: 1px solid rgba(17,17,16,0.12);
  overflow: hidden;
}

/* When a placeholder contains an image or video, drop the frame and let media fill the space */
.visual-placeholder:has(img),
.visual-placeholder:has(video) {
  background: transparent;
  border: none;
  padding: 0;
  gap: 0;
  border-radius: 12px;
}

.visual-placeholder img,
.visual-placeholder video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}

.visual-placeholder-dark {
  background: rgba(247,245,240,0.04);
  border-color: rgba(247,245,240,0.1);
}

.visual-placeholder-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid-gray);
}

.placeholder-icon {
  width: 36px; height: 36px;
  border: 1.5px dashed var(--mid-gray);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--mid-gray);
  font-size: 1.1rem;
  opacity: 0.5;
}

/* FAIL SECTION */
.fail-section { background: var(--ink); padding: 5rem 0; scroll-margin-top: 130px; }

.fail-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.fail-heading {
  font-size: 2.4rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ivory);
  margin-bottom: 1.5rem;
}
.fail-heading em { font-style: italic; color: var(--accent-2); }

.fail-body p {
  font-size: 0.95rem;
  color: rgba(247,245,240,0.55);
  line-height: 1.8;
  font-weight: 300;
  margin-bottom: 1rem;
}
.fail-body strong { color: var(--ivory); font-weight: 500; }

.fail-stat {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 1.75rem;
  background: rgba(247,245,240,0.04);
  border: 1px solid rgba(247,245,240,0.08);
  border-radius: 12px;
}

.fail-stat-num {
  font-size: 3.5rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--accent-2);
  line-height: 1;
}

.fail-stat-label {
  font-size: 0.88rem;
  color: rgba(247,245,240,0.45);
  font-weight: 300;
  line-height: 1.4;
  max-width: 160px;
}

/* IMPACT */
.impact-section { padding: 5rem 0; scroll-margin-top: 130px; }

.impact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.impact-heading {
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 1.5rem;
}
.impact-heading em { font-style: italic; color: var(--accent); }

.impact-body p {
  font-size: 0.95rem;
  color: var(--dark-gray);
  line-height: 1.8;
  font-weight: 300;
  margin-bottom: 1rem;
}
.impact-body strong { color: var(--ink); font-weight: 500; }

.impact-note {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--warm-gray);
  border-radius: 10px;
  border-left: 3px solid var(--accent);
  font-size: 0.85rem;
  color: var(--dark-gray);
  font-weight: 300;
  line-height: 1.65;
}

/* DIVIDER */
.divider { height: 0.5px; background: rgba(17,17,16,0.08); }

/* BOTTOM CASE NAV */
.case-nav-bottom { background: var(--warm-gray); padding: 3rem 0; }

.case-nav-inner { display: flex; justify-content: space-between; align-items: center; }

.case-nav-link { text-decoration: none; display: flex; flex-direction: column; gap: 0.25rem; }

.case-nav-dir {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mid-gray);
  font-weight: 500;
}

.case-nav-title { font-size: 1rem; font-weight: 400; color: var(--ink); transition: color 0.2s; }
.case-nav-link:hover .case-nav-title { color: var(--accent); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .container-narrow { padding: 0 1.5rem; }
  .case-meta { flex-wrap: wrap; gap: 1.5rem; }
  .sequence-inner { flex-direction: column; gap: 0.5rem; padding: 0 1.5rem; }
  .seq-item, .seq-item:first-child, .seq-item:last-child {
    clip-path: none;
    border-radius: 8px;
    padding: 1rem 1.25rem;
  }
  .challenge-grid, .step-section-inner, .fail-inner, .impact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .step-section-inner.reversed { direction: ltr; }
  .step-visuals-row, .step-visuals-row.three { grid-template-columns: 1fr; }
  .step-row { grid-template-columns: 2.5rem 1fr; }
  .step-desc { display: none; }
}

/* VISUAL REAL — actual images */
.visual-real { border-radius: 12px; overflow: hidden; border: 1px solid rgba(17,17,16,0.08); }
.visual-real img { width: 100%; display: block; }

/* SPRINT SECTION */
.sprint-heading { font-size: 2.4rem; font-weight: 300; letter-spacing: -0.03em; line-height: 1.1; color: var(--ivory); margin-bottom: 4rem; }
.sprint-heading em { font-style: italic; color: var(--accent-2); }
.sprint-sub { font-size: 1.1rem; font-weight: 400; color: var(--accent-2); margin-bottom: 0.75rem; letter-spacing: -0.01em; }
.sprint-body p { font-size: 0.92rem; color: rgba(247,245,240,0.55); line-height: 1.78; font-weight: 300; margin-bottom: 1rem; }
.sprint-body strong { color: var(--ivory); font-weight: 500; }
.sprint-body ul { margin: 0.5rem 0 1rem 1.25rem; }
.sprint-body ul li { font-size: 0.92rem; color: rgba(247,245,240,0.55); line-height: 1.78; font-weight: 300; margin-bottom: 0.35rem; }
.sprint-divider { height: 1px; background: rgba(247,245,240,0.07); margin: 3.5rem 0; }

/* DISCOVERY CARD */
.discovery-card { background: rgba(247,245,240,0.04); border: 1px solid rgba(247,245,240,0.08); border-radius: 12px; padding: 2rem; display: flex; gap: 2rem; align-items: center; margin-top: 1.5rem; }
.discovery-stat { text-align: center; flex-shrink: 0; }
.discovery-num { font-size: 2.5rem; font-weight: 300; color: var(--accent-2); letter-spacing: -0.03em; line-height: 1; }
.discovery-label { font-size: 0.72rem; color: rgba(247,245,240,0.35); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.06em; }
.discovery-sep { width: 1px; height: 60px; background: rgba(247,245,240,0.08); flex-shrink: 0; }
.discovery-text { font-size: 0.88rem; color: rgba(247,245,240,0.5); line-height: 1.65; font-weight: 300; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(17,17,16,0.96); z-index: 9998; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; padding: 2rem; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box { position: relative; display: flex; flex-direction: column; max-width: 88vw; max-height: 88vh; border: 1.5px solid rgba(247,245,240,0.4); border-radius: 14px; overflow: hidden; background: var(--ink); }
.modal-caption { padding: 0.9rem 1.5rem; font-size: 0.8rem; font-style: italic; color: rgba(247,245,240,0.6); font-weight: 300; border-bottom: 1px solid rgba(247,245,240,0.08); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.modal-img-wrap { overflow: auto; flex: 1; }
.modal-img-wrap img { display: block; max-width: 100%; height: auto; }
.modal-close { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid rgba(247,245,240,0.35); background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: border-color 0.2s, background 0.2s; }
.modal-close:hover { border-color: var(--ivory); background: rgba(247,245,240,0.08); }
.modal-close svg { width: 12px; height: 12px; stroke: rgba(247,245,240,0.7); stroke-width: 2; }

@media (max-width: 640px) {
  .modal-overlay { padding: 0; }
  .modal-box { max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; border-radius: 0; border: none; }
  .discovery-card { flex-direction: column; }
}

/* IDA CASE — layout & text variants */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.two-col.reversed { direction: rtl; }
.two-col.reversed > * { direction: ltr; }
.two-col.center { align-items: center; }

.section-heading { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 300; letter-spacing: -0.03em; line-height: 1.1; color: var(--ink); margin-bottom: 1.5rem; }
.section-heading em { font-style: italic; color: var(--accent); }
.section-heading-dark { color: var(--ivory); }
.section-heading-dark em { color: var(--accent-2); }

.body-text p { font-size: 0.92rem; color: var(--dark-gray); line-height: 1.78; font-weight: 300; margin-bottom: 1rem; }
.body-text p:last-child { margin-bottom: 0; }
.body-text strong { color: var(--ink); font-weight: 500; }
.body-text-dark p { font-size: 0.92rem; color: rgba(247,245,240,0.55); line-height: 1.78; font-weight: 300; margin-bottom: 1rem; }
.body-text-dark p:last-child { margin-bottom: 0; }
.body-text-dark strong { color: var(--ivory); font-weight: 500; }

.step-tag-dark { color: var(--accent-2); }
.visual-caption { margin-top: 0.75rem; font-size: 0.8rem; font-style: italic; color: var(--mid-gray); font-weight: 300; }
.visual-caption-dark { color: rgba(247,245,240,0.3); }

/* AUDIT EMBED */
.audit-embed { border-radius: 12px; overflow: hidden; border: 1px solid rgba(17,17,16,0.1); background: white; }
.audit-embed-header { background: var(--ink); padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.audit-embed-title { font-size: 0.78rem; font-weight: 500; color: rgba(247,245,240,0.7); letter-spacing: 0.06em; }
.audit-embed-badge { font-size: 0.65rem; color: var(--accent-2); border: 1px solid rgba(232,149,106,0.3); padding: 0.2rem 0.6rem; border-radius: 4px; }
.audit-iframe { width: 100%; height: 600px; border: none; display: block; }

@media (max-width: 640px) {
  .two-col, .two-col.reversed { grid-template-columns: 1fr; direction: ltr; }
}

/* L2 SUBTITLE under case-title */
.case-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 300;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: rgba(247,245,240,0.55);
  max-width: 700px;
  margin-top: -1.5rem;
  margin-bottom: 2.5rem;
}

/* PASSWORD BADGE in nav */
.password-badge {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid rgba(232,149,106,0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}
