﻿/* =========================================================
   AlterEco Case Study (cs--altereco)
   Consolidated, commented, and de-duplicated stylesheet
   ---------------------------------------------------------
   Sections
   0) Page-level nav fixes (scoped)
   1) Page scope & palette
   2) Base layout & typography (case)
   3) Brand hero
   4) Summary Strip (lede + badges)
   5) Section styling (app-pane + tints + leaf tabs)
   6) Lists & text rhythm
   7) Marketing stat cards
   8) Prototype embed (Figma)
   9) Footer ribbon & CTAs
  10) Decorative stitches & paper texture
  11) Case footer nav (prev / next)
  12) Section reveal (fade-in)
   ========================================================= */

/* ============= 0) PAGE-LEVEL NAV FIXES (SCOPED) =======================
   Keep the bar height consistent and the left drawer snug to viewport.
   These overrides are scoped to this page only via .cs--altereco. */
.cs--altereco nav {
  height: var(--header-h) !important;
}
@media (min-width: 769px) {
  .cs--altereco nav ul {
    margin-left: 0 !important; /* guard against stray margins */
    left: 0 !important; /* pin to viewport edge */
  }
}

/* ============= 1) PAGE SCOPE & PALETTE ================== */
.cs--altereco {
  /* Brand palette */
  --light-bgc: #fffef6;
  --app-bgc: #e9ead9;
  --lighter-green: #5a764c;
  --blue-accent: #c7dae6;
  --red-accent: #c45825;
  --darker-green: #264732;

  color: var(--darker-green);
  background: var(--app-bgc);
  font-family: "DM Sans", ui-sans-serif, system-ui;
}

/* === PAGE BACKGROUND RESTORATION ==================================== */
/* Return AlterEco pages to app-inspired palette */
body.altereco {
  background: var(--app-bgc, #e9ead9);
  color: #264732; /* darker-green text tone for contrast */
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

body.altereco::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(to bottom right, rgba(255, 255, 240, 0.3), rgba(90, 118, 76, 0.08));
  pointer-events: none;
  z-index: 0;
}

/* Utility tints (optional helpers) */
.cs--altereco .u-ink {
  color: #2b3b31;
}
.cs--altereco .u-green {
  color: var(--lighter-green);
}
.cs--altereco .u-green-bg {
  background: color-mix(in oklab, var(--lighter-green) 10%, #fff 90%);
}
.cs--altereco .u-blue-bg {
  background: color-mix(in oklab, var(--blue-accent) 18%, #fff 82%);
}
.cs--altereco .u-red-bg {
  background: color-mix(in oklab, var(--red-accent) 12%, #fff 88%);
}

/* ============= 2) BASE LAYOUT & TYPOGRAPHY ============== */
.cs--altereco .case {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 20px 56px;
}
.cs--altereco .case-article a {
  color: #20462f;
}
.cs--altereco .case-article a:hover {
  color: var(--lighter-green);
}
.cs--altereco .case > section {
  padding-bottom: 28px;
}

/* Headings (brand feel) */
.cs--altereco h1,
.cs--altereco h2 {
  font-family: "DM Serif Display", Georgia, serif;
}
.cs--altereco .brand-title {
  font-family: "Fraunces", "DM Serif Display", Georgia, serif;
  font-weight: 800;
  font-variation-settings: "SOFT" 1, "opsz" 72, "wght" 800;
  color: var(--lighter-green);
}

/* ============= 3) BRAND HERO ============================ */
.cs--altereco .case-hero {
  background: radial-gradient(1200px 600px at 10% -20%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(255, 255, 255, 0.35), transparent 60%), var(--app-bgc);
  border-bottom: 1px solid #d7dbc9;
  padding: 44px 20px 24px;
}
.cs--altereco .case-hero__inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.cs--altereco .case-hero__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(2.2rem, 4vw + 1rem, 3.25rem);
}
.cs--altereco .case-hero__brand .brand-title {
  font-size: 1em;
  margin: 0;
  letter-spacing: 0.01em;
}
.cs--altereco .case-hero__brand .brand-logo {
  height: 1.8em;
  width: auto;
  object-fit: contain;
}
.cs--altereco .case-hero .case-tagline {
  font-family: "DM Mono", ui-monospace;
  color: var(--red-accent);
  font-size: clamp(1rem, 0.6vw + 0.9rem, 1.1rem);
  margin: 8px 0 0;
}
.cs--altereco .stitch-divider {
  margin: 18px auto 0;
  width: min(560px, 80%);
  height: 0;
  border-bottom: 2px dashed #c8d0b9;
}

/* ============= 4) SUMMARY STRIP ========================= */
.cs--altereco .summary-strip {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.35)), color-mix(in oklab, var(--app-bgc) 90%, #fff 10%);
  border: 1px solid rgba(38, 71, 50, 0.08);
  border-radius: 14px;
  padding: 18px;
  display: grid;
  gap: 14px;
  position: relative;
  box-shadow: 0 1px 0 rgba(38, 71, 50, 0.05), 0 8px 18px rgba(38, 71, 50, 0.06);
  margin: 16px 0 20px;
}
@media (min-width: 768px) {
  .cs--altereco .summary-strip {
    grid-template-columns: 1.1fr 0.9fr;
    column-gap: 20px;
    align-items: start;
  }
}
/* stitched thread decoration top/bottom */
.cs--altereco .summary-strip::before,
.cs--altereco .summary-strip::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  height: 18px;
  opacity: 0.45;
  background: url("../images/stitched-thread.svg") repeat-x left center / 600px 24px;
}
.cs--altereco .summary-strip::before {
  top: -10px;
}
.cs--altereco .summary-strip::after {
  bottom: -10px;
}

/* left: kicker + lede + impact chips */
.cs--altereco .summary-lede-block {
  display: grid;
  gap: 8px;
}
.cs--altereco .lede-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--lighter-green);
  letter-spacing: 0.02em;
}
.cs--altereco .lede-kicker .badge-ico {
  width: 16px;
  height: 16px;
  translate: 0 0.5px;
}
.cs--altereco .summary-lede {
  margin: 0;
  color: #2b3b31;
  font-size: 1rem;
  line-height: 1.55;
}
.cs--altereco .lede-impact {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cs--altereco .lede-impact li {
  background: #fffef6;
  border: 1px solid #e2e6d6;
  border-radius: 9999px;
  padding: 6px 10px;
  font-size: 0.93rem;
  line-height: 1.3;
  color: #2b3b31;
}

/* right: three-column badges (icon • label • value) */
.cs--altereco .summary-badges {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.cs--altereco .summary-badges li {
  display: grid;
  grid-template-columns: 18px auto 1fr;
  align-items: baseline;
  column-gap: 8px;
  padding: 4px 0;
  color: #2b3b31;
  border-bottom: 1px dotted #dfe5d3;
}
.cs--altereco .summary-badges li:last-child {
  border-bottom: 0;
}
.cs--altereco .summary-badges .badge-ico {
  width: 18px;
  height: 18px;
  color: var(--lighter-green);
  translate: 0 0.5px;
}
.cs--altereco .summary-badges .badge-label {
  font-weight: 700;
  color: var(--lighter-green);
}
.cs--altereco .summary-badges .badge-val {
  min-width: 0;
  line-height: 1.5;
}

/* ============= 5) SECTION STYLING (APP-LIKE) ============ */
.cs--altereco .app-pane {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.38)), color-mix(in oklab, var(--app-bgc) 90%, #fff 10%);
  border: 1px solid rgba(38, 71, 50, 0.08);
  border-radius: 14px;
  padding: clamp(14px, 2.2vw, 22px) clamp(14px, 2vw, 20px);
  box-shadow: 0 1px 0 rgba(38, 71, 50, 0.05), 0 8px 20px rgba(38, 71, 50, 0.06);
  position: relative;
}
.cs--altereco .sec--research.app-pane {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.38)), color-mix(in oklab, var(--app-bgc) 90%, var(--blue-accent) 10%);
}
.cs--altereco .sec--marketing.app-pane {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.38)), color-mix(in oklab, var(--app-bgc) 92%, var(--red-accent) 8%);
}
.cs--altereco .sec--design.app-pane {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.38)), color-mix(in oklab, var(--app-bgc) 92%, var(--lighter-green) 8%);
}

/* App-style pill tab behind H2 text */
.cs--altereco .app-pane > h2 {
  margin: 0 0 10px;
  padding: 0;
}
.cs--altereco .h2-tab {
  display: inline-block;
  background: var(--lighter-green);
  color: var(--light-bgc);
  padding: 6px 12px;
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  font-weight: 800;
  letter-spacing: 0.01em;
}

/* Small “leaf” subsection tab */
.cs--altereco .leaf-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--darker-green);
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.cs--altereco .leaf-tab::before {
  content: "";
  width: 14px;
  height: 14px;
  background: var(--lighter-green);
  border-radius: 7px 7px 2px 7px;
  transform: rotate(-12deg);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

/* ============= 6) LISTS & TEXT RHYTHM =================== */
.cs--altereco ul {
  margin-left: 1.75rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.cs--altereco li {
  margin-bottom: 0.4rem;
}

/* ============= 7) MARKETING STAT CARDS ================== */
.cs--altereco .stat-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin: 12px 0 10px;
}
.cs--altereco .stat-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(38, 71, 50, 0.1);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.cs--altereco .stat-card h3 {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.05rem;
  margin: 0 0 6px;
  color: #2a3b31;
}
.cs--altereco .stat-card .stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--lighter-green);
  margin: 0 0 4px;
}
.cs--altereco .stat-card .stat-note {
  margin: 0;
  color: #3b4a42;
  font-size: 0.95rem;
}

/* ============= 8) PROTOTYPE EMBED (FIGMA) =============== */
.cs--altereco .prototype-embed {
  display: flex;
  justify-content: center;
  background: var(--light-bgc);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.cs--altereco .prototype-embed iframe {
  width: clamp(280px, 40vw, 400px);
  aspect-ratio: 9 / 19.5; /* phone-like; trims black bars */
  height: auto;
  border-radius: 18px;
  background: #f8f8f0;
}

/* ============= 9) FOOTER RIBBON & CTAS ================== */
.cs--altereco .case-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 28px;
  padding: 16px 12px 20px;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)), var(--app-bgc);
  border-top: 1px solid #d7dbc9;
  border-radius: 12px;
  position: relative;
  z-index: 1100;
}
.cs--altereco .case-footer .cta-link {
  color: #20462f;
  text-decoration: none;
  font-weight: 600;
}
.cs--altereco .case-footer .cta-link:hover {
  text-decoration: underline;
}
.cs--altereco .next-project {
  background: var(--darker-green);
  color: var(--light-bgc);
  border: none;
  border-radius: 9999px;
  padding: 12px 24px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.cs--altereco .next-project:hover {
  transform: translateY(-2px);
  background: var(--lighter-green);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

/* ============= 10) DECORATIVE DETAILS =================== */
.cs--altereco {
  background: url("../images/paper-texture.png") repeat, var(--app-bgc);
  background-size: 600px 600px;
}
.cs--altereco .brand-stitch {
  margin: 8px 0 16px;
  display: block;
  line-height: 0;
}
@media (min-width: 992px) {
  .cs--altereco .brand-stitch {
    display: none;
  }
}
.cs--altereco .brand-stitch img {
  display: block;
  width: 100%;
  max-width: 620px;
  height: auto;
  margin-inline: auto;
  opacity: 0.9;
}

/* Numbered steps with brand pills */
.cs--altereco .ol-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.cs--altereco .ol-steps > li {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(38, 71, 50, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.cs--altereco .ol-steps > li::before {
  counter-increment: step;
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: 8px;
  background: var(--lighter-green);
  color: var(--light-bgc);
  border-radius: 9999px;
  font-weight: 700;
}

/* Simple two-column helper */
.cs--altereco .two-col {
  display: grid;
  gap: 14px;
}
@media (min-width: 820px) {
  .cs--altereco .two-col {
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
  }
}

/* IA list spacing */
.cs--altereco .ia-tree {
  margin-left: 1rem;
}
.cs--altereco .ia-tree li {
  margin-bottom: 0.35rem;
}

/* ============= 11) CASE FOOTER NAV (PREV/NEXT) ========== */
.cs--altereco .case-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.35)), color-mix(in oklab, var(--app-bgc) 90%, #fff 10%);
  border: 1px solid rgba(38, 71, 50, 0.1);
  border-radius: 9999px;
  padding: 12px 16px;
  box-shadow: 0 1px 0 rgba(38, 71, 50, 0.05), 0 10px 22px rgba(38, 71, 50, 0.06);
}
.cs--altereco .case-nav a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: color-mix(in oklab, var(--darker-green) 88%, #0b0b0b 12%);
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 9999px;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.cs--altereco .case-nav a .arrow {
  opacity: 0.85;
}
@media (hover: hover) and (pointer: fine) {
  .cs--altereco .case-nav a:hover {
    background: color-mix(in oklab, var(--lighter-green) 12%, #fff 88%);
    color: #1e3327;
    transform: translateY(-1px);
  }
}
/* Footer should remain visible even with fade-in pattern */
.cs--altereco .case-nav.app-pane {
  opacity: 1 !important;
  transform: none !important;
}

/* ============= 12) SECTION REVEAL (FADE-IN) ============= */
.cs--altereco .app-pane {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
@media (prefers-reduced-motion: reduce) {
  .cs--altereco .app-pane {
    transition: none;
    transform: none;
  }
}
.cs--altereco .app-pane.visible {
  opacity: 1;
  transform: none;
}

/* Optional utility for non-pane elements */
.cs--altereco .fade-in {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.cs--altereco .fade-in.visible {
  opacity: 1;
  transform: none;
}
