/* ==========================================================================
   CASE STUDY TEMPLATE — shared stylesheet
   Used by every case study page (greenimpact, harmony, etc.)
   Design tokens: Bricolage Grotesque (headings) / Public Sans (body) / #7C2CDD (accent)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS & RESET
   -------------------------------------------------------------------------- */
:root {
  --accent: #7C2CDD;
  --accent-deep: #4A0F96;
  --accent-lift: #8F45E8;
  --accent-soft: #A46BF5;

  --ink: #141414;
  --paper: #F5F5F5;
  --body: #3B3835;
  --muted: #6E6A66;
  --ink-dim: #B9B4AE;
  --ink-faint: #8C8781;
  --frame: #EAE7E3;

  --pad: clamp(24px, 5vw, 80px);
  --maxw: 1680px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: "Public Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #5C17B0; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
figure { margin: 0; }

/* --------------------------------------------------------------------------
   2. ANIMATIONS
   -------------------------------------------------------------------------- */
@keyframes logoHold {
  0%, 43%  { opacity: 1; }
  47%, 93% { opacity: 0; }
  97%, 100% { opacity: 1; }
}
@keyframes typeName {
  0%, 46%   { width: 0; border-right-color: transparent; }
  47%       { width: 0; border-right-color: var(--accent); }
  62%, 92%  { width: var(--name-w); border-right-color: var(--accent); }
  94%, 100% { width: 0; border-right-color: transparent; }
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .45; transform: scale(.82); }
}

/* --------------------------------------------------------------------------
   3. LAYOUT PRIMITIVES & SHARED UI
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: var(--paper);
  padding: 16px 31px;
  min-height: 48px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 15px;
  box-shadow: 5px 7px 0 #5C17B0;
  transition: transform .14s ease, box-shadow .14s ease, background .18s ease;
}
.btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translate(3px, 3px);
  box-shadow: 2px 4px 0 #5C17B0;
}
.eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   4. TOP BAR
   -------------------------------------------------------------------------- */
.bar { border-bottom: 1px solid rgba(20, 20, 20, .14); }
.bar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: clamp(20px, 2.4vw, 28px);
}
.lockup { position: relative; height: 44px; width: 220px; --name-w: 176px; flex: 0 0 auto; }
.lockup svg {
  position: absolute; left: 0; bottom: 0;
  height: 44px; width: auto;
  animation: logoHold 6s ease-in-out infinite;
}
.lockup .name {
  position: absolute; left: 0; bottom: 4px;
  overflow: hidden; white-space: nowrap;
  border-right: 2px solid transparent;
  animation: typeName 6s steps(16, end) infinite;
}
.lockup .name span {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 21px; font-weight: 700;
  letter-spacing: -.025em; color: var(--ink);
}
.bar-nav { display: flex; align-items: center; gap: clamp(16px, 2vw, 28px); font-size: 15px; font-weight: 500; }
.bar-nav a { color: var(--body); }
.bar-nav a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   5. HERO / TITLE
   -------------------------------------------------------------------------- */
.head { padding-block: clamp(48px, 6vw, 88px) clamp(32px, 4vw, 48px); }
.index-rule { display: flex; align-items: baseline; gap: 16px; max-width: 900px; }
.index-rule b { font-family: "Bricolage Grotesque", sans-serif; font-size: 15px; font-weight: 700; color: var(--accent); }
.index-rule i { flex: 1; height: 1px; background: rgba(20, 20, 20, .18); }
.head h1 {
  margin-top: 24px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(40px, 6.6vw, 96px);
  line-height: .94;
  letter-spacing: -.045em;
  color: var(--ink);
}
.head .role {
  margin-top: 10px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 500;
  font-size: clamp(19px, 2.4vw, 32px);
  letter-spacing: -.02em;
  color: var(--accent);
}
.head .lede {
  margin-top: clamp(20px, 2.4vw, 32px);
  max-width: 56ch;
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.55;
  color: var(--body);
  text-wrap: pretty;
}

.meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 32px);
  margin-top: clamp(32px, 4vw, 52px);
  border-top: 1px solid rgba(20, 20, 20, .18);
  padding-top: 22px;
}
.meta dt { font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.meta dd { margin: 8px 0 0; font-size: 16px; font-weight: 500; color: var(--ink); }
.meta .live { display: inline-flex; align-items: center; gap: 8px; }
.meta .live i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 2.4s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   6. HERO MEDIA (browser-chrome frame)
   -------------------------------------------------------------------------- */
.media {
  background: var(--frame);
  border: 1px solid rgba(20, 20, 20, .14);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 18px 44px rgba(20, 20, 20, .12);
}
.chrome { display: flex; align-items: center; gap: 10px; padding: 2px 4px 12px; }
.chrome u { width: 9px; height: 9px; border-radius: 50%; background: #D9D4CE; }
.chrome .url {
  margin-left: 8px; flex: 1;
  background: var(--paper);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chrome .loop {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.chrome .loop i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 2s ease-in-out infinite;
}
.media figure { border-radius: 6px; overflow: hidden; aspect-ratio: 808 / 632; background: #DEDAD5; }
.media img { width: 100%; height: 100%; object-fit: cover; }

/* Image placeholders — replace the .ph div with a real <img> when the asset is ready */
.ph {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 24px;
  background: #E9E6E2;
  border: 1px dashed rgba(20, 20, 20, .28);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px; line-height: 1.5;
}
.ph.tall   { aspect-ratio: 4 / 5; }
.ph.wide   { aspect-ratio: 16 / 9; }
.ph.square { aspect-ratio: 1; }
.media .ph { width: 100%; height: 100%; }

/* --------------------------------------------------------------------------
   7. CONTENT SECTIONS (brief / process / design / outcome)
   -------------------------------------------------------------------------- */
.section { padding-block: 0 clamp(48px, 6vw, 88px); }
.section::before {
  content: "";
  display: block;
  height: 1px;
  background: rgba(20, 20, 20, .14);
  margin-bottom: clamp(48px, 6vw, 88px);
}
.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: start;
}
.section h2 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.04;
  letter-spacing: -.035em;
  color: var(--ink);
}
.prose p { font-size: clamp(16px, 1.4vw, 19px); line-height: 1.65; color: var(--body); text-wrap: pretty; }
.prose p + p { margin-top: 20px; }
.prose > * + h3 { margin-top: 36px; }
.prose h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: clamp(19px, 1.8vw, 24px);
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: 12px;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); margin-top: clamp(28px, 3vw, 44px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); margin-top: clamp(28px, 3vw, 44px); }
.caption { margin-top: 12px; font-size: 13.5px; color: var(--muted); }

/* --------------------------------------------------------------------------
   8. PROCESS STEPS
   -------------------------------------------------------------------------- */
.steps { display: grid; gap: clamp(20px, 2.4vw, 32px); margin-top: clamp(24px, 3vw, 40px); }
.step {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: clamp(16px, 2vw, 28px);
  border-top: 1px solid rgba(20, 20, 20, .14);
  padding-top: 20px;
}
.step b { font-family: "Bricolage Grotesque", sans-serif; font-size: 15px; font-weight: 700; color: var(--accent); }
.step h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: clamp(19px, 1.8vw, 26px);
  letter-spacing: -.02em;
  color: var(--ink);
}
.step p { margin-top: 10px; font-size: clamp(15px, 1.3vw, 17px); line-height: 1.6; color: var(--body); max-width: 60ch; }

/* --------------------------------------------------------------------------
   9. PULL QUOTE
   -------------------------------------------------------------------------- */
.quote { background: var(--ink); color: var(--paper); padding-block: clamp(40px, 5vw, 80px); }
.quote blockquote {
  margin: 0;
  max-width: 26ch;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -.035em;
  color: var(--paper);
  text-wrap: balance;
}
.quote blockquote em { font-style: italic; font-weight: 700; color: var(--accent-soft); }
.quote cite {
  display: block;
  margin-top: clamp(20px, 2.4vw, 32px);
  font-family: "Public Sans", sans-serif;
  font-style: normal;
  font-size: 15px;
  color: var(--ink-dim);
}

/* --------------------------------------------------------------------------
   10. OUTCOME STATS
   -------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); margin-top: clamp(28px, 3vw, 44px); }
.stat { border-top: 2px solid var(--accent); padding-top: 18px; }
.stat b {
  display: block;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--ink);
}
.stat span { display: block; margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--body); }

/* --------------------------------------------------------------------------
   11. NEXT PROJECT NAV
   -------------------------------------------------------------------------- */
.next {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 24px;
  padding-block: 0 clamp(40px, 5vw, 72px);
}
.next::before {
  content: "";
  flex: 0 0 100%;
  height: 1px;
  background: rgba(20, 20, 20, .14);
  margin-bottom: calc(clamp(40px, 5vw, 72px) - 24px);
}
.next .label { font-size: 12.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.next h2 {
  margin-top: 10px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 44px);
  letter-spacing: -.035em;
  color: var(--ink);
}
.next h2 a { color: var(--ink); }
.next h2 a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   12. FOOTER
   -------------------------------------------------------------------------- */
.foot { background: var(--ink); color: var(--ink-dim); padding: clamp(44px, 6vw, 72px) var(--pad) clamp(28px, 3vw, 40px); }
.foot-in { width: 100%; max-width: calc(var(--maxw) - var(--pad) * 2); margin: 0 auto; }
.foot-top {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: clamp(24px, 4vw, 48px);
  border-bottom: 1px solid rgba(245, 245, 245, .14);
  padding-bottom: clamp(28px, 3.4vw, 40px);
}
.foot-cta {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.04;
  letter-spacing: -.035em;
  color: var(--paper);
  max-width: 22ch;
}
.foot-cta a { color: var(--accent-soft); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.foot-cta a:hover { color: var(--paper); }
.foot-nav { display: flex; flex-wrap: wrap; gap: clamp(16px, 2vw, 28px); font-size: 15px; font-weight: 500; }
.foot-nav a { color: #DAD6D1; }
.foot-nav a:hover { color: #fff; }

.foot-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-top: clamp(22px, 2.6vw, 32px);
  font-size: 13px;
  color: var(--ink-faint);
}
.foot-brand { display: inline-flex; align-items: center; gap: 12px; }
.foot-bottom .lock { display: inline-flex; align-items: center; gap: 12px; }
.foot-bottom .lock svg { height: 32px; width: auto; }
.foot-bottom .lock span { font-family: "Bricolage Grotesque", sans-serif; font-size: 15px; font-weight: 600; letter-spacing: -.02em; color: var(--paper); }
.to-top { color: #DAD6D1; font-weight: 500; }
.to-top:hover { color: #fff; }

/* --------------------------------------------------------------------------
   13. RESPONSIVE — tablet (≤1000px)
   -------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .section-grid { grid-template-columns: minmax(0, 1fr); }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   14. RESPONSIVE — mobile (≤640px)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .lockup { height: 34px; width: 170px; --name-w: 133px; }
  .lockup svg { height: 34px; }
  .lockup .name { bottom: 3px; }
  .lockup .name span { font-size: 16px; }
  .bar-in { flex-direction: column; align-items: flex-start; gap: 16px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .step { grid-template-columns: minmax(0, 1fr); gap: 8px; }

  .foot-top { flex-direction: column; align-items: flex-start; }
  .foot-bottom { flex-direction: column; align-items: center; gap: 16px; text-align: center; }
  .btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   15. REDUCED MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .lockup svg { opacity: 1; }
  .lockup .name { width: auto; border-right-color: transparent; }
}

/* --------------------------------------------------------------------------
   16. PASSWORD GATE
   -------------------------------------------------------------------------- */
html.locked, body.locked { overflow: hidden; }
.gate {
  position: fixed; inset: 0; z-index: 99;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  padding: var(--pad);
}
.gate[hidden] { display: none; }
.gate-card { width: 100%; max-width: 440px; }
.gate svg { height: 48px; width: auto; display: block; margin-bottom: 32px; }
.gate h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.02;
  letter-spacing: -.035em;
  color: var(--paper);
}
.gate p { margin-top: 16px; font-size: 16px; line-height: 1.6; color: var(--ink-dim); }
.gate form { display: flex; flex-direction: column; gap: 14px; margin-top: 32px; }
.gate label { font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.gate input {
  width: 100%;
  background: #1E1E1E;
  border: 1px solid rgba(245, 245, 245, .22);
  border-radius: 15px;
  padding: 15px 18px;
  min-height: 52px;
  font: inherit; font-size: 16px;
  color: var(--paper);
}
.gate input:focus { outline: 2px solid var(--accent-soft); outline-offset: 2px; border-color: transparent; }
.gate button {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 16px 31px;
  min-height: 52px;
  font: inherit; font-size: 16px; font-weight: 600;
  border-radius: 15px;
  box-shadow: 5px 7px 0 var(--accent-deep);
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, background .18s ease;
}
.gate button:hover { background: var(--accent-lift); transform: translate(3px, 3px); box-shadow: 2px 4px 0 var(--accent-deep); }
.gate .err { color: #FF8A7A; font-size: 14px; min-height: 20px; margin-top: 2px; }
.gate .back { margin-top: 28px; font-size: 15px; color: #DAD6D1; }
.gate .back:hover { color: #fff; }
