/* Case-study pages. Each page sets its own theme color with --theme on <body>. */
:root {
  --theme: rgb(12, 117, 50);             /* card color: Pinterest green */
  --bg-top: #15683a;                     /* dark green at the top of the page */
  --bg-bottom: #05150a;                  /* deeper green at the bottom */
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, .62);
  --head: #8fbf9f;                       /* section headings, muted mint */
  --head-on: #b9f0cb;                    /* section headings when in view */
  --card: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .12);
  --col: 1020px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--fg);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6; -webkit-font-smoothing: antialiased;
  /* background shifts from --bg-top to --bg-bottom as you scroll (script sets --p from 0 to 1) */
  --p: 0;
  --bgc: color-mix(in srgb, var(--bg-top) calc((1 - var(--p)) * 100%), var(--bg-bottom));
  background: var(--bgc);
}
a { color: inherit; }
img { max-width: 100%; display: block; }

/* Page-enter wipe in the card's color */
.wipe { display: none; position: fixed; inset: 0; z-index: 100; background: var(--theme); pointer-events: none; animation: wipe .75s cubic-bezier(.7, 0, .2, 1) .05s forwards; }
@keyframes wipe { to { transform: translateY(-100%); } }


/* Header */
/* Fixed nav. The gradient lets content fade out under it instead of hitting a hard edge. */
header.top { position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 104px; display: flex; justify-content: space-between; align-items: flex-start; padding: 28px clamp(28px, 6vw, 96px) 0;
  background: linear-gradient(to bottom, var(--bgc) 0%, var(--bgc) 38%, color-mix(in srgb, var(--bgc) 70%, transparent) 62%, transparent 100%); pointer-events: none; }
header.top a { pointer-events: auto; }
header.top .brand { font-weight: 700; font-size: 18px; text-decoration: none; }
header.top nav a { margin-left: 22px; text-decoration: none; color: var(--muted); font-size: 18px; font-weight: 500; }
header.top nav a:hover, header.top nav a.on { color: #fff; }
header.top nav a.on { font-weight: 700; }

/* Hero banner */
.hero { max-width: calc(1350px + 2 * clamp(28px, 6vw, 96px)); margin: 96px auto 0; padding: 0 clamp(28px, 6vw, 96px); }
.hero .frame { border-radius: 24px; overflow: hidden; background: var(--theme); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.hero img { width: 100%; height: auto; transform: scale(1.04); will-change: transform; }

/* Article column */
main { max-width: calc(var(--col) + 2 * clamp(28px, 6vw, 96px)); margin: 0 auto; padding: 0 clamp(28px, 6vw, 96px) 40px; }
.logo { height: 36px; width: auto; margin: 60px 0 22px; }
h1 { font-size: clamp(38px, 5.4vw, 64px); line-height: 1.08; font-weight: 800; letter-spacing: -0.035em; margin: 0 0 28px; }
/* Readability: comfortable line length (~65 characters), larger text, more air, higher contrast.
   Text size can be changed with the A- / A+ buttons (--fs). */
main { --fs: 21px; }
section { margin: 0 0 24px; padding-top: 56px; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
section:first-of-type { border-top: 0; padding-top: 0; }
h2 {
  font-size: clamp(32px, 4vw, 46px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.12;
  color: var(--head-on); margin: 0 0 22px;
}
p { font-size: var(--fs); line-height: 1.75; font-weight: 450; color: #f1f7f3; margin: 0 0 1.15em; max-width: 44em; }
.list { list-style: none; padding: 0; margin: 0 0 1.4em; max-width: 44em; }
.list li { position: relative; padding: 8px 0 8px 28px; font-size: var(--fs); font-weight: 450; color: #f1f7f3; line-height: 1.7; }
.list li::before { content: ""; position: absolute; left: 4px; top: calc(.85em + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--head-on); }
.list.wide { max-width: none; }

/* Roles */
.roles, .principles { display: grid; gap: 28px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 900px) { .roles { grid-template-columns: repeat(3, 1fr); } }

/* Principles */
.principles { display: grid; gap: 28px; grid-template-columns: 1fr; margin: 6px 0 26px; }
@media (min-width: 900px) { .principles { grid-template-columns: repeat(3, 1fr); } }

/* Figures */
figure { margin: 6px 0 40px; }
figure img { width: 100%; height: auto; border-radius: 20px; }
figure.small { max-width: 520px; margin-left: auto; margin-right: auto; }
figure.med { max-width: 889px; }
figure.video { position: relative; }
figure.video video { width: 100%; height: auto; border-radius: 20px; display: block; background: #1a1a1a; }
.playpause { position: absolute; right: 18px; bottom: 18px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; display: grid; place-items: center; transition: transform .2s ease; }
.playpause:hover { transform: scale(1.08); }
.playpause svg { width: 20px; height: 20px; fill: #fff; }
.playpause .i-play { display: none; }
.playpause.paused .i-play { display: block; }
.playpause.paused .i-pause { display: none; }
blockquote { max-width: 44em; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* Quote */
blockquote { margin: 34px 0 10px; padding: 26px 30px; border-left: 4px solid var(--head-on); background: var(--card); border-radius: 0 16px 16px 0; font-size: clamp(22px, 2.6vw, 28px); font-style: italic; font-weight: 500; line-height: 1.45; }

/* Back / next */
.back { display: inline-flex; align-items: center; gap: 10px; margin: 8px 0 60px; padding: 14px 22px; border: 2px solid rgba(255, 255, 255, .5); border-radius: 12px; text-decoration: none; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; transition: background .2s ease, color .2s ease; }
.back:hover { background: #fff; color: #06150a; }

/* Back to top */
.totop { position: fixed; right: 22px; bottom: 22px; z-index: 50; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); cursor: pointer; display: grid; place-items: center; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .25s ease, transform .25s ease, background .2s ease; }
.totop.show { opacity: 1; pointer-events: auto; transform: none; }
.totop:hover { background: var(--head-on); }
.totop svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.totop:hover svg { stroke: #06150a; }

/* Reveal on scroll */
.rv { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.rv.in { opacity: 1; transform: none; }


/* Footer */
footer.site { margin-top: 40px; background: var(--bgc); padding: 30px clamp(28px, 6vw, 96px); display: flex; justify-content: space-between; align-items: center; color: rgba(255, 255, 255, .4); font-size: 15px; }
footer.site .icons { display: flex; gap: 22px; align-items: center; }
footer.site .icons svg { width: 34px; height: 34px; fill: #fff; transition: transform .2s ease; }
footer.site .icons a:hover svg { transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  .wipe { display: none; }
  .rv { opacity: 1; transform: none; transition: none; }
  .hero img { transform: none; }
  html { scroll-behavior: auto; }
}

/* Card -> page transition: the tapped card on the home page morphs into this banner */
@view-transition { navigation: auto; }
.hero .frame { view-transition-name: hero-card; }
::view-transition-group(hero-card) { animation-duration: .75s; animation-timing-function: cubic-bezier(.7, 0, .2, 1); border-radius: 24px; overflow: clip; }
::view-transition-old(hero-card), ::view-transition-new(hero-card) { height: 100%; width: 100%; object-fit: cover; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .5s; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }

/* Roles and principles share one boxed style (soft tinted card, no border lines) */
.role, .principle { background: rgba(255, 255, 255, .07); border-radius: 18px; padding: 24px 24px 26px; }
.role h3, .principle h3 { font-size: 20px; font-weight: 700; color: var(--head-on); margin: 0 0 8px; line-height: 1.3; }
.role p, .principle p { font-size: 18px; line-height: 1.65; margin: 0; max-width: none; color: #f1f7f3; }
.roles.one { grid-template-columns: 1fr; }

/* Extras used by some case studies */
h3.sub { font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; color: var(--head); margin: 30px 0 10px; letter-spacing: -0.01em; }
p.lead { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.4; font-weight: 500; color: var(--head); max-width: 34em; margin: 34px 0 20px; }
ul.links { list-style: none; padding: 0; margin: 0 0 1.4em; }
ul.links li { padding: 6px 0 6px 28px; position: relative; font-size: var(--fs); color: #f1f7f3; }
ul.links li::before { content: ""; position: absolute; left: 4px; top: calc(.85em + 6px); width: 9px; height: 9px; border-radius: 50%; background: var(--head-on); }
.logo.spot { height: 44px; }

/* Themes: set a class on <body> to recolor a page */
body.t-green { --theme: rgb(19, 154, 90); --bg-top: #128a52; --bg-bottom: #04301c; --head: #8fd9b4; --head-on: #b9f2d3; --dd-accent: #3ddc84; }
body.t-red { --theme: rgb(209, 42, 69); --bg-top: #b8233d; --bg-bottom: #430912; --head: #f5a3b0; --head-on: #ffc9d1; }

html.framed header.top { display: none; }
header.top { display: none !important; }

/* Double diamond, drawn in SVG to match the page */
figure.dd { background: rgba(255, 255, 255, .05); border-radius: 22px; padding: clamp(20px, 3.4vw, 44px) clamp(16px, 3vw, 40px); margin: 10px 0 44px; }
.dd svg { width: 100%; height: auto; display: none; overflow: visible; }
.dd .half.a { fill: rgba(255, 255, 255, .13); }
.dd .half.b { fill: rgba(255, 255, 255, .05); }
.dd .out { fill: none; stroke: var(--head-on); stroke-width: 5; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.rv.in .dd .out { animation: dd-draw 1.8s cubic-bezier(.6, 0, .2, 1) .15s forwards; }
.dd-shape g + g .out, .dd .out + .out { animation-delay: .5s; }
@keyframes dd-draw { to { stroke-dashoffset: 0; } }
.dd-mid line { stroke: var(--dd-accent, #1ed760); stroke-width: 4; stroke-linecap: round; }
.dd-mid circle { fill: var(--dd-accent, #1ed760); }
.dd-ticks line { stroke: rgba(255, 255, 255, .5); stroke-width: 2.5; stroke-dasharray: 2 9; stroke-linecap: round; }
.dd-t text { font: 800 29px "DM Sans", sans-serif; fill: #fff; letter-spacing: -0.015em; }
.dd-l text { font: 500 20px "DM Sans", sans-serif; fill: rgba(255, 255, 255, .8); }
.dd-list { list-style: none; counter-reset: p; margin: 0; padding: 0; display: grid; gap: 16px; }
.dd-list li { counter-increment: p; position: relative; padding-left: 46px; }
.dd-list li::before { content: counter(p); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--dd-accent, #1ed760); color: #062b14; font-weight: 800; display: grid; place-items: center; font-size: 15px; }
.dd-list b { display: block; font-size: 19px; color: #fff; }
.dd-list span { color: rgba(255, 255, 255, .72); font-size: 16px; }
@media (min-width: 700px) { .dd svg { display: block; } .dd-list { display: none; } }
@media (prefers-reduced-motion: reduce) { .dd .out { stroke-dashoffset: 0; animation: none !important; } }
ul.links a { text-decoration: underline; text-underline-offset: 4px; font-weight: 600; }
ul.links a span { display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 8px; background: rgba(255, 255, 255, .1); font-size: 13px; font-weight: 600; text-decoration: none; color: rgba(255, 255, 255, .8); vertical-align: 2px; }

body.t-pink { --theme: rgb(224, 53, 158); --bg-top: #c42a8a; --bg-bottom: #430a2e; --head: #f08fc8; --head-on: #ffbde3; --dd-accent: #ff4fc3; }
.logo.lyft { height: 38px; }
.list strong, p strong { color: #fff; font-weight: 700; }
.list li strong:first-child { color: var(--head-on); }
.soon-page { min-height: 70vh; padding-top: 140px; }

/* A single headline result */
.callout { display: flex; align-items: center; gap: clamp(18px, 3vw, 36px); background: rgba(255, 255, 255, .07); border-radius: 20px; padding: clamp(22px, 3vw, 34px) clamp(24px, 3.4vw, 44px); margin: 8px 0 40px; }
.callout b { font-size: clamp(56px, 8vw, 104px); line-height: .95; font-weight: 800; letter-spacing: -0.05em; color: var(--head-on); flex: none; }
.callout span { font-size: clamp(18px, 2vw, 24px); line-height: 1.45; font-weight: 500; color: #f4eef2; max-width: 26em; }
@media (max-width: 560px) { .callout { flex-direction: column; align-items: flex-start; } }

/* Back chevron (top left) */
.backchev { position: fixed; top: 20px; left: 20px; z-index: 60; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(0,0,0,.35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.18); transition: background .2s ease, transform .2s ease; }
.backchev:hover { background: rgba(0,0,0,.55); transform: translateX(-2px); }
.backchev svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.totop { display: none !important; }

/* Chevron sits in the page's top margin and scrolls away, so it never covers content */
.backchev { position: fixed; top: 20px; left: 20px; }

@media (max-width: 900px) { html.framed .backchev { position: absolute; } }

/* Next project card at the bottom of each case study */
.next-project { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; margin: 40px 0 70px; border-radius: 24px; overflow: hidden; background: var(--nc, #333); color: #fff; text-decoration: none; transition: transform .25s ease, box-shadow .25s ease; box-shadow: 0 20px 50px rgba(0,0,0,.28); }
.next-project:hover { transform: translateY(-4px); box-shadow: 0 28px 60px rgba(0,0,0,.36); }
.np-media { aspect-ratio: 856 / 730; background: rgba(255,255,255,.14); display: block; }
.np-media img { width: 100%; height: 100%; object-fit: cover; }
.np-text { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: clamp(22px, 4vw, 48px); }
.np-text small { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.np-text strong { font-size: clamp(22px, 3vw, 36px); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.np-text i { font-style: normal; font-size: 28px; transition: transform .25s ease; }
.next-project:hover .np-text i { transform: translateX(6px); }
.soon-page .next-project { max-width: 900px; width: 100%; margin: 56px auto 0; text-align: left; }
@media (max-width: 700px) { .next-project { grid-template-columns: 1fr; } .np-media { aspect-ratio: 856 / 560; } }

/* Simpler, smaller next-project card */
.next-project { grid-template-columns: 150px 1fr; align-items: center; max-width: 560px; margin: 32px 0 60px; border-radius: 18px; box-shadow: none; }
.next-project:hover { transform: none; box-shadow: none; outline: 2px solid rgba(255,255,255,.7); outline-offset: 3px; }
.np-media { aspect-ratio: 1 / 1; }
.np-text { gap: 4px; padding: 14px 20px 14px 4px; }
.np-text small { font-size: 11px; }
.np-text strong { font-size: clamp(16px, 2vw, 20px); font-weight: 600; letter-spacing: -0.01em; }
.np-text i { display: none; }
.soon-page .next-project { margin: 40px auto 0; }
@media (max-width: 700px) { .next-project { grid-template-columns: 110px 1fr; } .np-media { aspect-ratio: 1 / 1; } }

/* Page transitions: simple and quick (the card morph into a project page is kept) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }


/* Footer: "Built with love" line on the lower left, social icons on the right */
footer.site { flex-direction: row-reverse; }
