/* ==========================================================================
   OUR WORK / CASE STUDY — page-specific, built on the design-kit tokens.
   Only composition lives here; every colour/space value comes from tokens.css.
   ========================================================================== */

/* --- Page hero: full-viewport darkened photo, centred content ----------- */
.work-hero {
  position: relative; overflow: hidden;
  min-height: 100vh; display: flex; align-items: center;
  padding: calc(var(--navbar-height, 72px) + var(--space-16)) 0 var(--space-16);
  text-align: center;
}
.work-hero__bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
}
.work-hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15, 17, 18, 0.55), rgba(15, 17, 18, 0.8));
}
.work-hero > .container { position: relative; z-index: 1; }
.work-hero__logo { height: 64px; width: auto; margin: 0 auto var(--space-6); display: block; }
/* render colored client logos as solid white so they read on the dark hero */
.work-hero__logo--mono { filter: brightness(0) invert(1); }
.work-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.03em; line-height: 1.1; max-width: 22ch; margin: 0 auto; }
.work-hero .lede { font-size: var(--text-lg); color: var(--color-text-muted); max-width: 60ch; margin: var(--space-5) auto 0; line-height: 1.7; }

/* --- Project metadata band (its own strip below the hero) --------------- */
/* --- Case pager: yellow stripe to browse between projects -------------- */
.case-pager { background-color: var(--color-primary); padding: var(--space-6) 0; }
.case-pager__inner { display: flex; align-items: center; justify-content: flex-start; gap: var(--space-8); }
.case-pager__link { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-bg); text-decoration: none; }
.case-pager__chev { font-size: 1.6rem; line-height: 1; flex: 0 0 auto; transition: transform 0.25s var(--ease-out); }
.case-pager__link--prev:hover .case-pager__chev { transform: translateX(-4px); }
.case-pager__link--next:hover .case-pager__chev { transform: translateX(4px); }
.case-pager__label { font-family: var(--font-body); font-size: var(--text-base); font-weight: 600; }
.case-pager__sep { flex: 0 0 auto; width: 1px; align-self: stretch; min-height: 1.4em; background-color: rgba(15, 17, 18, 0.28); }

.case-meta-band { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.case-meta { display: grid; grid-template-columns: 1fr; gap: var(--space-5); }
.case-meta__item {
  border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: var(--space-5) var(--space-6); background: var(--color-surface);
  transition: background-color var(--t-base) ease, border-color var(--t-base) ease, box-shadow var(--t-base) ease, transform var(--t-base) ease;
}
/* same hover as the home 'What we do' cards: pop up + turn yellow, invert text */
.case-meta__item:hover { background-color: var(--color-primary); border-color: var(--color-primary); box-shadow: var(--shadow-md); transform: translateY(-4px); }
.case-meta__item:hover .case-meta__k, .case-meta__item:hover .case-meta__v { color: var(--color-bg); }
.case-meta__k { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-primary); }
.case-meta__v { margin-top: var(--space-2); font-family: var(--font-heading); font-weight: 700; font-size: var(--text-lg); color: var(--color-text); }

/* --- Challenge / Result split: text + illustration --------------------- */
.case-split { display: grid; grid-template-columns: 1fr; gap: var(--space-8); align-items: center; }
.case-split__media { display: flex; justify-content: center; }
.case-split__media img { width: 100%; max-width: 300px; height: auto; }

/* "reactive → predictive" transformation graphic (red sensor → green sensor) */
.case-transform { display: flex; align-items: center; justify-content: center; gap: var(--space-4); }
.case-transform img { width: 38%; max-width: 150px; height: auto; }
.case-transform__arrow { color: var(--color-primary); font-size: var(--text-3xl); line-height: 1; flex: 0 0 auto; }

/* --- Architecture flow (sensor → gateway → backend → dashboard) -------- */
/* section 02 architecture flow — same look as the About "essentials" molecular timeline */
.arch-flow { list-style: none; display: flex; position: relative; gap: var(--space-4); margin-top: var(--space-12); }
.arch-step {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: none; border: none; padding: 0;
}
/* bond connecting each atom to the next */
.arch-step:not(:last-child)::after {
  content: ""; position: absolute; top: 26px; left: 50%; width: calc(100% + var(--space-4)); height: 2px; z-index: 1;
  background: linear-gradient(90deg, rgba(242, 183, 5, 0.55), rgba(242, 183, 5, 0.25));
}
.arch-step__n {
  position: relative; z-index: 2; flex: 0 0 auto;
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-bg); border: 1px solid rgba(242, 183, 5, 0.5); color: var(--color-primary);
  font-family: var(--font-heading); font-weight: 700; font-size: var(--text-lg);
  box-shadow: 0 0 0 6px rgba(242, 183, 5, 0.06);
  transition: border-color var(--t-base) ease, background var(--t-base) ease, box-shadow var(--t-base) ease, transform 0.35s var(--ease-out);
}
.arch-step > div { margin-top: var(--space-5); transition: transform 0.35s var(--ease-out); }
.arch-step:hover .arch-step__n { border-color: var(--color-primary); background: rgba(242, 183, 5, 0.12); box-shadow: 0 0 0 8px rgba(242, 183, 5, 0.1); transform: translateY(-6px); }
.arch-step:hover > div { transform: translateY(-6px); }
.arch-step h4 { color: var(--color-primary); text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--text-xs); font-weight: 700; margin: 0 0 var(--space-1); }
.arch-step p { color: var(--color-text-muted); font-size: var(--text-sm); line-height: 1.5; margin: 0; max-width: 22ch; }
@media (max-width: 699px) {
  .arch-flow { flex-direction: column; gap: var(--space-6); }
  .arch-step { flex-direction: row; align-items: center; text-align: left; gap: var(--space-5); }
  .arch-step:not(:last-child)::after { top: 52px; left: 26px; width: 2px; height: calc(100% + var(--space-6)); background: linear-gradient(180deg, rgba(242, 183, 5, 0.55), rgba(242, 183, 5, 0.25)); }
  .arch-step > div { margin-top: 0; }
  .arch-step p { max-width: none; }
}

/* --- Framed dashboard screenshots -------------------------------------- */
.gallery { display: grid; grid-template-columns: 1fr; gap: var(--space-6); margin-top: var(--space-10); }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.shot {
  display: flex; flex-direction: column;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-md); background: var(--color-surface);
}
.shot img { width: 100%; height: auto; display: block; cursor: zoom-in; }
.shot__cap { margin-top: auto; }

/* --- Lightbox (click a gallery image to enlarge) ----------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: var(--space-8);
  background: rgba(15, 17, 18, 0.9); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.lightbox.is-open { display: flex; animation: lightbox-in 0.2s ease both; }
.lightbox__img { max-width: 94vw; max-height: 88vh; width: auto; height: auto; border-radius: var(--radius-lg); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); cursor: zoom-out; }
.lightbox__close {
  position: absolute; top: var(--space-4); right: var(--space-6);
  background: none; border: none; color: #FCFCFC; font-size: 2.6rem; line-height: 1; cursor: pointer;
}
.lightbox__close:hover { color: var(--color-primary); }
@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }
.shot__cap { padding: var(--space-3) var(--space-5); font-size: var(--text-sm); color: var(--color-text-muted); border-top: 1px solid var(--color-border); }

/* --- Homepage featured case study — full-bleed image, info on hover ----- */
.work-feature {
  position: relative; display: block; overflow: hidden;
  min-height: 420px; border-radius: var(--radius-lg);
  margin-top: var(--space-10);
  text-decoration: none; color: var(--color-text);
}
.work-feature__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.work-feature:hover .work-feature__img { transform: scale(1.04); }
.work-feature__overlay {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--space-8);
  background: linear-gradient(to top, rgba(15, 17, 18, 0.92) 0%, rgba(15, 17, 18, 0.55) 34%, rgba(15, 17, 18, 0.04) 70%);
  transition: background 0.4s ease;
}
.work-feature:hover .work-feature__overlay,
.work-feature:focus-visible .work-feature__overlay {
  background: linear-gradient(to top, rgba(15, 17, 18, 0.95) 0%, rgba(15, 17, 18, 0.82) 55%, rgba(15, 17, 18, 0.4) 100%);
}
.work-feature .case-industry { color: var(--color-primary); margin: 0 0 var(--space-2); }
.work-feature h3 { color: #FCFCFC; font-size: var(--text-2xl); margin: 0; }
.work-feature .case-industry, .work-feature h3, .work-feature__reveal { max-width: 640px; }
/* hidden by default; slides up from the bottom on hover/focus */
.work-feature__reveal {
  max-height: 0; opacity: 0; overflow: hidden; transform: translateY(16px);
  transition: max-height 0.55s var(--ease-out), opacity 0.4s ease, transform 0.55s var(--ease-out);
}
.work-feature:hover .work-feature__reveal,
.work-feature:focus-visible .work-feature__reveal {
  max-height: 340px; opacity: 1; transform: translateY(0); margin-top: var(--space-4);
}
.work-feature__reveal .work-blurb { color: rgba(252, 252, 252, 0.85); margin: 0; }
.work-feature__reveal .work-quote { color: rgba(252, 252, 252, 0.8); border-left-color: var(--color-primary); }
.work-feature__reveal .work-quote cite { color: #FCFCFC; }
.work-feature__reveal .work-link { color: var(--color-primary); display: inline-block; margin-top: var(--space-3); }
/* same treatment, smaller, inside the 3-up grid */
.work-grid .work-feature { min-height: 340px; margin-top: 0; }
.work-grid .work-feature .work-feature__overlay { padding: var(--space-6); }
.work-grid .work-feature h3 { font-size: var(--text-xl); }
/* coming-soon variant: dark card, no image, no hover reveal */
.work-feature--soon { background: var(--color-surface); border: 1px solid var(--color-border); cursor: default; }
.work-feature--soon .work-feature__overlay { background: linear-gradient(to top, rgba(15, 17, 18, 0.85), rgba(15, 17, 18, 0.25) 60%); }
.work-feature--soon .work-feature__img { opacity: 0.55; }
.work-feature__ph { position: absolute; top: var(--space-6); right: var(--space-6); z-index: 1; font-size: 40px; color: rgba(252, 252, 252, 0.22); }
.work-feature__badge { margin-top: var(--space-3); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-dim); }

/* --- Our Work index: project card grid --------------------------------- */
.work-index-head { text-align: center; }
.work-index-head h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; }
.work-index-head .lede { font-size: var(--text-lg); color: var(--color-text-muted); max-width: 58ch; margin: var(--space-4) auto 0; line-height: 1.7; }

.work-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); margin-top: var(--space-12); }
.work-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  text-decoration: none; color: inherit;
  transition: border-color var(--t-base) ease, transform var(--t-base) ease, box-shadow var(--t-base) ease;
}
a.work-card:hover { border-color: var(--color-primary); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.work-card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--color-surface-2); }
.work-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--t-base) ease; }
a.work-card:hover .work-card__media img { transform: scale(1.04); }
.work-card__media--ph { display: flex; align-items: center; justify-content: center; color: rgba(252, 252, 252, 0.4); font-size: 54px; }
.work-card__body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-6); flex: 1; }
.work-card__tag { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-primary); }
.work-card h3 { font-size: var(--text-xl); }
.work-card p { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6; }
.work-card__more { margin-top: auto; padding-top: var(--space-3); font-weight: 700; font-size: var(--text-sm); color: var(--color-primary); }
.work-card--soon { opacity: 0.85; }
.work-card--soon .work-card__tag { color: var(--color-text-dim); }
.work-card__badge { margin-top: auto; padding-top: var(--space-3); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-dim); }

@media (min-width: 640px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .work-grid { grid-template-columns: repeat(3, 1fr); } }

/* --- App-store badges (case-study result) ------------------------------ */
.store-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-4); margin-top: var(--space-8); }
.store-badge { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-5); border: 1px solid var(--color-border); border-radius: 999px; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); }
.store-badge iconify-icon { font-size: 1.25em; color: var(--color-primary); }

/* --- About: team cards ------------------------------------------------- */
.team-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); margin-top: var(--space-10); }
@media (min-width: 700px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
/* founders reuse the .work-feature hover behaviour; drop its standalone top margin */
.team-grid .work-feature { margin-top: 0; }
/* founder name/title row + vertical 3-dot icon on the side */
.founder-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.founder-head__text { min-width: 0; }
.founder-dots { flex: 0 0 auto; font-size: 26px; color: var(--color-primary); line-height: 1; }

/* --- About: foundation cards (reuse .card--invert: pop + turn yellow) --- */
.found-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); margin-top: var(--space-10); }
@media (min-width: 800px) { .found-grid { grid-template-columns: repeat(3, 1fr); } }
.found-card--logo { display: flex; align-items: center; justify-content: center; }
.found-card--logo img { width: 88px; height: auto; transition: filter var(--t-base) ease; }
/* logo is yellow — flip it to dark on hover so it reads on the yellow card */
.found-card--logo:hover img { filter: brightness(0); }

/* --- About: molecular timeline (at-a-glance) --------------------------- */
.mol-timeline { list-style: none; display: flex; position: relative; margin-top: var(--space-12); gap: var(--space-4); }
.mol-node { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
/* bond: connects each atom to the next */
.mol-node:not(:last-child)::after {
  content: ""; position: absolute; top: 26px; left: 50%; width: calc(100% + var(--space-4)); height: 2px; z-index: 1;
  background: linear-gradient(90deg, rgba(242, 183, 5, 0.55), rgba(242, 183, 5, 0.25));
}
.mol-atom {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--color-bg); border: 1px solid rgba(242, 183, 5, 0.5); color: var(--color-primary);
  box-shadow: 0 0 0 6px rgba(242, 183, 5, 0.06);
  transition: border-color var(--t-base, 0.3s) ease, background var(--t-base, 0.3s) ease, box-shadow var(--t-base, 0.3s) ease, transform 0.35s var(--ease-out);
}
.mol-atom iconify-icon { font-size: 26px; }
.mol-node:hover .mol-atom { border-color: var(--color-primary); background: rgba(242, 183, 5, 0.12); box-shadow: 0 0 0 8px rgba(242, 183, 5, 0.1); transform: translateY(-6px); }
.mol-info { margin-top: var(--space-5); transition: transform 0.35s var(--ease-out); }
.mol-node:hover .mol-info { transform: translateY(-6px); }
.mol-k { color: var(--color-primary); text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--text-xs); font-weight: 700; margin: 0 0 var(--space-1); }
.mol-v { color: var(--color-text-muted); font-size: var(--text-sm); line-height: 1.5; margin: 0; max-width: 22ch; }
/* vertical molecule on narrow screens */
@media (max-width: 699px) {
  .mol-timeline { flex-direction: column; gap: var(--space-6); }
  .mol-node { flex-direction: row; align-items: center; text-align: left; gap: var(--space-5); }
  .mol-node:not(:last-child)::after { top: 52px; left: 26px; width: 2px; height: calc(100% + var(--space-6)); background: linear-gradient(180deg, rgba(242, 183, 5, 0.55), rgba(242, 183, 5, 0.25)); }
  .mol-atom { flex: 0 0 auto; }
  .mol-info { margin-top: 0; }
  .mol-v { max-width: none; }
}
.team-card { display: flex; flex-direction: column; overflow: hidden; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.team-card__photo { aspect-ratio: 4 / 3; overflow: hidden; background: var(--color-surface-2); }
.team-card__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.team-card__body { padding: var(--space-6); }
.team-card__body h3 { font-size: var(--text-xl); color: var(--color-text); }
.team-card__body .team-card__role { color: var(--color-primary); font-weight: 600; font-size: var(--text-sm); margin: var(--space-1) 0 var(--space-3); }
.team-card__body p:last-child { color: var(--color-text-muted); font-size: var(--text-sm); line-height: 1.6; }
/* empty-photo placeholder (swap the div for an <img> once you have the shot) */
.team-card__photo--placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); color: var(--color-text-dim); }
.team-card__photo--placeholder iconify-icon { font-size: 3.5rem; opacity: 0.45; }
.team-card__photo--placeholder span { font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; }

/* --- CTA band ----------------------------------------------------------- */
.work-cta { text-align: center; }
.work-cta h2 { max-width: 22ch; margin: 0 auto; }
.work-cta .btn { margin-top: var(--space-8); }

@media (min-width: 768px) {
  .case-meta { grid-template-columns: repeat(4, 1fr); }
  .case-split { grid-template-columns: 1.5fr 1fr; gap: var(--space-12); }
  .case-split--rev .case-split__text { order: 2; }
}
