/*
 * Essex SDS Hub — page styles: Landing, About the SDS, Digital Place Portrait.
 */

/* =========================================================================
 * LANDING — hero: three video slides on the 7.422246 s Figma timeline.
 * The timeline plays ONCE per visit: the SDS slide nudges 42 px then slides
 * off right, revealing "Drive coordination", which does the same, ending on
 * "Deliver growth in the right way". (Keyframes exported from Figma.)
 * ========================================================================= */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  max-height: 1100px;
  overflow: hidden;
  background: var(--hero-scrim);
}
.hero__slide {
  position: absolute;
  inset: 0;
  background: var(--hero-scrim);
}
.hero__slide video,
.hero__slide img.hero__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
:root[data-theme="contrast"] .hero__slide video,
:root[data-theme="contrast"] .hero__slide img.hero__poster {
  filter: grayscale(1);
}
.hero__slide-title {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--c-grey);
  white-space: nowrap;
}
/* Figma: SDS title top 345.5 / 832; other slides top 8.33 % + 158.25 px → 227.6 / 832 */
.hero__slide--1 .hero__slide-title { top: 41.53%; }
.hero__slide--2 .hero__slide-title,
.hero__slide--3 .hero__slide-title { top: 27.36%; }

/* stacking: slide 1 (SDS) on top, slide 3 (Thamesmead) at the bottom */
.hero__slide--3 { z-index: 1; }
.hero__slide--2 { z-index: 2; }
.hero__slide--1 { z-index: 3; }
.hero__inner { z-index: 4; }

/* --- timeline (one-shot; static fallback shows slide 1) --- */
:root[data-simplified="false"]:not([data-theme="contrast"]) .hero__slide--1 {
  animation: hero-slide-1 var(--hero-t) linear 1 both;
}
:root[data-simplified="false"]:not([data-theme="contrast"]) .hero__slide--1 .hero__slide-title {
  animation: hero-title-1 var(--hero-t) linear 1 both;
}
:root[data-simplified="false"]:not([data-theme="contrast"]) .hero__slide--2 {
  animation: hero-slide-2 var(--hero-t) linear 1 both;
}
:root[data-simplified="false"]:not([data-theme="contrast"]) .hero__slide--2 .hero__slide-title {
  animation: hero-title-2 var(--hero-t) linear 1 both;
}
:root[data-simplified="false"]:not([data-theme="contrast"]) .hero__info {
  animation: info-in var(--hero-t) linear 1 both;
}
/* simplified / contrast: static SDS slide only */
:root[data-simplified="true"] .hero__slide--2,
:root[data-simplified="true"] .hero__slide--3,
:root[data-theme="contrast"] .hero__slide--2,
:root[data-theme="contrast"] .hero__slide--3 {
  display: none;
}

@keyframes hero-slide-1 {
  0%      { translate: 0 0; animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
  10.778% { translate: 42px 0; animation-timing-function: cubic-bezier(0.34, 1.2, 0.64, 1); }
  21.557% { translate: 0 0; }
  26.946% { translate: 0 0; animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1); }
  47.156% { translate: 100% 0; }
  100%    { translate: 100% 0; }
}
@keyframes hero-title-1 {
  0%      { opacity: 1; }
  26.946% { opacity: 1; animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
  40.419% { opacity: 0; }
  100%    { opacity: 0; }
}
@keyframes hero-slide-2 {
  0%      { translate: 0 0; }
  47.156% { translate: 0 0; animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
  57.934% { translate: 42px 0; animation-timing-function: cubic-bezier(0.34, 1.2, 0.64, 1); }
  68.712% { translate: 0 0; }
  74.102% { translate: 0 0; animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1); }
  94.311% { translate: 100% 0; }
  100%    { translate: 100% 0; }
}
@keyframes hero-title-2 {
  0%      { opacity: 1; }
  74.102% { opacity: 1; animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
  87.575% { opacity: 0; }
  100%    { opacity: 0; }
}
@keyframes info-in {
  0%      { opacity: 0; translate: 0 20px; }
  24.251% { opacity: 0; translate: 0 20px; animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }
  32.335% { translate: 0 -6px; animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
  33.683% { opacity: 1; }
  37.724% { translate: 0 2px; animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
  41.766% { translate: 0 0; }
  100%    { opacity: 1; translate: 0 0; }
}

.hero__inner {
  position: absolute;
  inset: var(--margin) var(--margin) 42px;
  max-width: calc(var(--page-max) - var(--margin) * 2);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
/* hero chrome sits on video — always light-on-dark */
.hero__inner .logo-plus { color: var(--c-blue); }
.hero__inner .btn-circle { --btn-bg: var(--c-blue); --btn-fg: var(--c-aubergine); }
:root[data-theme="contrast"] .hero__inner .logo-plus { color: var(--c-grey); }
:root[data-theme="contrast"] .hero__inner .btn-circle { --btn-bg: var(--c-grey); --btn-fg: var(--c-black); }

.hero__info {
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
}
.hero__info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.hero__cta {
  max-width: clamp(300px, 32.1875vw, 618px);   /* 412 @1280 */
  color: var(--c-grey);
}
.hero__credit {
  color: var(--c-grey);
}
.hero__credit a:hover {
  text-decoration: underline;
}

/* ---------- Our plan ---------- */
.section-plan {
  background: var(--bg);
  padding: var(--section-pad) var(--margin);
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 6.25vw, 100px);
  max-width: var(--page-max);
  margin-inline: auto;
}
.plan__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gutter);
}
.plan__head h2 {
  flex: 0 0 auto;
  width: clamp(200px, 26.015625vw, 500px);     /* 333 @1280 */
}
.plan__head p {
  width: clamp(320px, 46.015625vw, 884px);     /* 589 @1280 */
  max-width: 60%;
}

/* Placeholder for the interactive plan embed — red outline as drawn.
   Keeps the 1196 × 735 proportion of the 1280 frame instead of a fixed height. */
.plan__embed {
  position: relative;
  aspect-ratio: 1196 / 735;
  min-height: 320px;
  border: 1px solid #ff0004;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.plan__embed--dashed {
  border-style: dashed;
}
.plan__mouse {
  width: 36px;
  height: 36px;
  border-radius: 24px;
  background: var(--c-black);
  display: grid;
  place-items: center;
}
.plan__mouse img {
  width: 16.2px;
  height: 26px;
}
.tag--grey-text {
  color: var(--c-grey);
}
/* About page embed spans the full page width */
body.page-about > .plan__embed {
  aspect-ratio: 1280 / 735;
  max-width: var(--page-max);
  margin-inline: auto;
}

/* =========================================================================
 * ABOUT THE SDS
 * ========================================================================= */
.about {
  padding: 42px var(--margin) 40px;
  max-width: var(--page-max);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: clamp(48px, 6.25vw, 100px);
}
.about__title {
  display: none;
}
.about__intro {
  width: clamp(560px, 69.765625vw, 1340px);    /* 893 @1280 */
  max-width: 100%;
}
.about__rows {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 5vw, 80px);
}
.about-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gutter);
}
.about-row__num {
  width: clamp(120px, 26.015625vw, 500px);     /* 333 @1280 */
  flex: 0 1 auto;
}
.about-row__body {
  width: clamp(480px, 69.765625vw, 1340px);    /* 893 @1280 */
  max-width: 74.7%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gutter);
}
.about-row__body h2 {
  width: clamp(180px, 26.015625vw, 500px);     /* 333 @1280 */
  max-width: 40%;
}
.about-row__body p {
  width: clamp(260px, 38.203125vw, 734px);     /* 489 @1280 */
  max-width: 56%;
}
/* scroll-in */
:root[data-simplified="false"] .about-row {
  opacity: 0;
  translate: 0 24px;
  transition: opacity 0.7s var(--ease-soft), translate 0.7s var(--ease-soft);
}
:root[data-simplified="false"] .about-row.is-in {
  opacity: 1;
  translate: 0 0;
}
.about-embed-wrap {
  width: 100%;
  padding-bottom: 84px;
}

/* =========================================================================
 * DIGITAL PLACE PORTRAIT
 * ========================================================================= */
.dpp {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-top: clamp(120px, 17.66vw, 300px);   /* 226 @1280 */
  display: flex;
  flex-direction: column;
  gap: clamp(160px, 30.7vw, 480px);            /* 393 @1280 */
}
.dpp__title-clip {
  overflow: hidden;
  padding-inline: var(--margin);
  height: clamp(45px, 5.46875vw, 95px);   /* Title Clip: 70 @1280 */
}
.dpp__title {
  text-align: center;
  white-space: nowrap;
  color: var(--fg);
  font-weight: 500;
  font-size: clamp(36px, 4.375vw, 76px);   /* 56 @1280 */
  line-height: 0.9642857;                   /* 54/56 */
  letter-spacing: -0.03em;
  clip-path: inset(0 0 0 0);
}
:root[data-simplified="false"] .dpp__title {
  animation: dpp-title-wipe var(--hero-t) linear 1 both;
}
@keyframes dpp-title-wipe {
  0%      { clip-path: inset(0 100% 0 0); translate: 0 -3px; animation-timing-function: ease-out; }
  13.473% { translate: 0 3px; animation-timing-function: ease-in-out; }
  16.168% { clip-path: inset(0 0 0 0); }
  17.515% { translate: 0 0; }
  100%    { clip-path: inset(0 0 0 0); translate: 0 0; }
}

/* Theme strip: 8 columns on a Place+ Grey ground, 832 px @1280.
   --theme-pad scales the 42 px column padding with the frame; --theme-open-w
   is the open column's real width (27.8125 % of the strip, which is capped at
   --page-max) so hidden copy is laid out at its final width and does not
   reflow while the column animates open. */
.themes {
  --theme-pad: clamp(16px, 3.28125vw, 63px);                       /* 42 @1280 */
  --theme-open-w: calc(27.8125 * min(1vw, 19.2px));                /* 356 @1280 */
  display: flex;
  align-items: stretch;
  background: var(--c-grey);
  height: clamp(560px, 65vw, 1080px);          /* 832 @1280 */
  overflow: hidden;
}
.theme {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--theme-c);
  color: var(--th-fg);
  width: 12.5%;                                 /* 160 / 1280 */
  min-width: 0;
  padding: clamp(20px, 2.1875vw, 42px) var(--theme-pad);   /* 28 42 @1280 */
  text-align: left;
  transition: width 0.45s var(--ease-soft);
  cursor: pointer;
}
.themes.has-open .theme {
  width: 10.3125%;                              /* 132 / 1280 */
}
.themes.has-open .theme.is-open {
  width: 27.8125%;                              /* 356 / 1280 */
  cursor: default;
}
.theme__chev {
  display: none;
}
.theme__hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}
.theme__hit:focus-visible {
  outline: 2px solid var(--c-black);
  outline-offset: -4px;
}
.theme:focus-visible {
  outline: 2px solid var(--c-black);
  outline-offset: -4px;
}
.theme__num,
.theme__title {
  font-weight: 500;
  font-size: clamp(18px, 1.875vw, 32px);        /* 24 @1280 */
  line-height: 1.0833333;
  letter-spacing: -0.03em;
  color: var(--th-num);
  white-space: nowrap;
}
.theme__head {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 3.28125vw, 63px);            /* 42 @1280 */
  align-items: flex-start;
}
.theme__body {
  font-weight: 300;
  letter-spacing: -0.01em;           /* Figma: −1 % on the theme copy */
  color: var(--th-fg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s 0.25s;
  min-width: calc(var(--theme-open-w) - 2 * var(--theme-pad) - 6px);   /* 272 @1280 (−6 px scrollbar allowance) */
}
.theme__body .link-hwb {
  color: inherit;
  text-decoration: underline;
  text-underline-position: from-font;
}
.theme.is-open .theme__body,
.theme.is-open .theme__subs {
  opacity: 1;
  visibility: visible;
}
.theme__subs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s 0.25s;
  min-width: calc(var(--theme-open-w) - 2 * var(--theme-pad) - 6px);
}
.theme__subs-head {
  font-weight: 500;
  color: var(--th-fg);
  letter-spacing: -0.01em;
}
.theme__subs-list {
  display: flex;
  flex-direction: column;
}
.sub-row {
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 26px;
  padding: 4px;
  border-radius: 2px;
  background: rgba(113, 113, 113, 0.3);
  font-weight: 300;
  color: var(--th-fg);
  width: 100%;
}
.sub-row:nth-child(even) {
  background: rgba(169, 169, 169, 0.25);
}
.sub-row img {
  width: 14px;
  height: 11px;
  flex: 0 0 auto;
  transition: translate 0.2s var(--ease-soft);
}
.sub-row:hover img {
  translate: 4px 0;
}

/* =========================================================================
 * Shared bits
 * ========================================================================= */
.site-nav {
  padding: 42px var(--margin) 0;
  max-width: var(--page-max);
  margin-inline: auto;
}
body.page-dark {
  background: var(--bg);
}
