/* ==========================================================================
   Young Futures Digital — v3 "Consultancy grade"
   Editorial refinement layer over v2 "Night Shift".
   Goals: institutional credibility, denser proof, editorial headings,
   real conversion mechanics. Loaded after site.css.
   ========================================================================== */

:root {
  --tx-mut:   #A5A29A;          /* lifted for legibility on near-black */
  --line:     #262623;
  --line-2:   #383832;
  --ink-soft: rgba(255,255,255,.022);
  --sec-y:       clamp(56px, 6.4vw, 104px);
  --sec-y-tight: clamp(44px, 5vw, 78px);
  --shadow-lift: 0 1px 0 rgba(255,255,255,.03), 0 18px 44px -28px rgba(0,0,0,.9);
}
html[data-theme="light"] {
  --tx-mut:   #4E4C44;
  --line:     #D9D5C9;
  --line-2:   #BEB9AA;
  --ink-soft: rgba(21,21,15,.026);
  --shadow-lift: 0 1px 0 rgba(255,255,255,.6), 0 18px 40px -30px rgba(40,34,22,.42);
}

/* ---------- Film grain: the cheapest way to look expensive ---------- */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 999;
  pointer-events: none;
  opacity: .34;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
html[data-theme="light"] body::after { opacity: .2; mix-blend-mode: multiply; }

/* ---------- Editorial headings: mixed case, tighter, less shouty ---------- */
.dh {
  font-family: var(--f-disp);
  font-weight: 800;
  text-transform: none;
  font-size: clamp(1.62rem, 2.9vw, 2.6rem);
  line-height: 1.04;
  letter-spacing: -.032em;
  text-wrap: balance;
  color: var(--tx);
}
.dh--sm {
  font-size: clamp(1.24rem, 1.9vw, 1.62rem);
  line-height: 1.1;
  letter-spacing: -.026em;
}
.dh--lg {
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1;
  letter-spacing: -.034em;
}
.dh em { font-style: normal; color: var(--acc-fg); }

/* section kicker above an editorial heading */
.kick {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--acc-fg);
  margin-bottom: var(--s-2);
}
.kick::before { content: ""; width: 22px; height: 1px; background: var(--acc); flex: none; }

/* two-column editorial header: heading left, standfirst right — closes the voids */
.ehead { display: grid; gap: var(--s-3); align-items: end; }
@media (min-width: 900px) {
  .ehead { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 0 clamp(32px, 5vw, 88px); }
  .ehead__aside { padding-bottom: 4px; }
  /* Let the aside fill its column so its right edge lines up with the
     grids and rails below it, rather than stopping short. */
  .ehead__aside p { max-width: none; }
}
.ehead__aside p { color: var(--tx-mut); font-size: 16.5px; line-height: 1.62; max-width: 50ch; text-wrap: pretty; }
@media (min-width: 900px) { .ehead .ehead__aside p { max-width: none; } }
.ehead__aside p strong { color: var(--tx); font-weight: 600; }

/* ---------- Proof metrics band ---------- */
.metrics { border-top: 1px solid var(--line); background: var(--bg-2); }
.metrics__in { padding: clamp(30px, 3.4vw, 52px) 0 clamp(32px, 3.6vw, 56px); }
.metrics__hd {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding-bottom: clamp(20px, 2.2vw, 30px);
}
.metrics__hd .mono { color: var(--tx-mut); }
.metrics ul {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line-2); border-left: 1px solid var(--line);
}
@media (min-width: 780px) { .metrics ul { grid-template-columns: repeat(4, 1fr); } }
.metrics li {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: clamp(20px, 2.2vw, 28px) clamp(16px, 1.8vw, 24px) clamp(22px, 2.4vw, 30px);
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
}
.metrics li::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--acc); transform: scaleY(0); transform-origin: top;
  transition: transform .5s var(--ease);
}
.metrics li:hover::before { transform: scaleY(1); }
.metric__n {
  font-family: var(--f-disp); font-weight: 800;
  font-size: clamp(2.4rem, 4.4vw, 3.6rem); line-height: .86;
  letter-spacing: -.04em; color: var(--tx);
  display: flex; align-items: baseline; gap: 6px;
}
.metric__n sup {
  font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .1em;
  color: var(--acc-fg); top: -1.4em; position: relative;
}
.metric__u { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--acc-fg); }
.metric__l { font-size: 14.5px; line-height: 1.5; color: var(--tx-mut); text-wrap: pretty; max-width: 26ch; }

/* ---------- Capability cards ---------- */
.cards {
  display: grid; gap: 0;
  border-top: 1px solid var(--line-2); border-left: 1px solid var(--line);
}
@media (min-width: 700px)  { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1180px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  position: relative; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: clamp(24px, 2.5vw, 36px) clamp(20px, 2.1vw, 32px) clamp(28px, 2.9vw, 40px);
  text-decoration: none; color: inherit;
  transition: background-color .3s var(--ease);
  min-height: 100%;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--acc); transform: scaleY(0); transform-origin: top;
  transition: transform .42s var(--ease);
}
.card:hover { background: var(--ink-soft); }
.card:hover::before { transform: scaleY(1); }
.card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: clamp(28px, 3.4vw, 48px); }
.card__n { font-family: var(--f-mono); font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--acc-fg); }
.card__arw {
  font-family: var(--f-mono); font-size: 14px; color: var(--tx-faint);
  transition: transform .3s var(--ease), color .3s var(--ease);
}
.card:hover .card__arw { transform: translate(3px, -3px); color: var(--acc-fg); }
.card__h { margin-bottom: 12px; }
.card__b { color: var(--tx-mut); font-size: 15.5px; line-height: 1.6; text-wrap: pretty; }
.card__l { margin-top: auto; padding-top: clamp(18px, 2vw, 26px); }
.card__l ul { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.card__l li {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--tx-mut); border: 1px solid var(--line); padding: 4px 8px;
}

/* ---------- Process rail ---------- */
.rail7 { border-top: 1px solid var(--line-2); }
.rail7 ol {
  display: grid; gap: 0;
  list-style: none; padding: 0; margin: 0;
}
@media (min-width: 760px)  { .rail7 ol { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1160px) { .rail7 ol { grid-template-columns: repeat(7, 1fr); } }
.rail7 li {
  --rail-pad: clamp(14px, 1.35vw, 20px);
  border-bottom: 1px solid var(--line);
  padding: clamp(20px, 2.1vw, 28px) var(--rail-pad) clamp(24px, 2.5vw, 32px) 0;
  position: relative;
  display: flex; flex-direction: column; gap: 9px;
}
/* The first cell of every row stays flush to the page margin so the rail
   aligns with the headline and the button beneath it. */
@media (min-width: 760px) and (max-width: 1159.98px) {
  .rail7 li { border-left: 1px solid var(--line); padding-left: var(--rail-pad); }
  .rail7 li:nth-child(4n+1) { border-left: 0; padding-left: 0; }
}
@media (min-width: 1160px) {
  .rail7 li { border-left: 1px solid var(--line); padding-left: var(--rail-pad); }
  .rail7 li:first-child { border-left: 0; padding-left: 0; }
}
.rail7 li::before {
  content: ""; position: absolute; left: 0; top: -1px; width: 0; height: 2px;
  background: var(--acc); transition: width .5s var(--ease);
}
.rail7 li:hover::before { width: 100%; }
/* Rules run the full width of the rail instead of stopping under the
   last populated cell, so the block reads as one closed rectangle. */
@media (min-width: 760px) {
  .rail7 ol { border-bottom: 1px solid var(--line); }
  .rail7 li { border-bottom: 0; }
}
@media (min-width: 760px) and (max-width: 1159.98px) {
  .rail7 li:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
}
.rail7 .s-n { font-family: var(--f-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; color: var(--acc-fg); }
.rail7 .s-h {
  font-family: var(--f-disp); font-weight: 700; font-size: clamp(1rem, 1.25vw, 1.14rem);
  letter-spacing: -.018em; line-height: 1.14; color: var(--tx);
}
.rail7 .s-b { font-size: 13.5px; line-height: 1.55; color: var(--tx-mut); text-wrap: pretty; }

/* ---------- Feature row: image + dense text ---------- */
.frow { display: grid; gap: clamp(24px, 3vw, 44px); align-items: center; }
@media (min-width: 900px) {
  .frow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 clamp(34px, 4.4vw, 76px); }
  .frow--flip .frow__fig { order: 2; }
}
.frow__fig { margin: 0; position: relative; overflow: hidden; }
.frow__fig img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  filter: var(--img-grade);
  transition: transform 1.1s var(--ease);
}
.frow__fig:hover img { transform: scale(1.03); }
.frow__txt > * + * { margin-top: var(--s-3); }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line-2); max-width: 92ch; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: baseline; gap: clamp(14px, 2vw, 26px);
  padding: clamp(17px, 1.9vw, 23px) 0;
  font-family: var(--f-disp); font-weight: 700;
  font-size: clamp(1.02rem, 1.35vw, 1.2rem); letter-spacing: -.018em; line-height: 1.3;
  color: var(--tx);
  transition: color var(--dur) var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--acc-fg); }
.faq summary .q { font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; color: var(--acc-fg); flex: none; padding-top: 5px; }
.faq summary .sign {
  margin-left: auto; flex: none; font-family: var(--f-mono); font-size: 15px;
  color: var(--tx-faint); line-height: 1; padding-top: 3px;
  transition: transform .3s var(--ease), color .3s var(--ease);
}
.faq details[open] summary .sign { transform: rotate(45deg); color: var(--acc-fg); }
.faq .a {
  padding: 0 0 clamp(20px, 2.2vw, 28px) 0;
  color: var(--tx-mut); font-size: 15.5px; line-height: 1.66; max-width: 74ch; text-wrap: pretty;
}
@media (min-width: 700px) { .faq .a { padding-left: calc(clamp(14px, 2vw, 26px) + 3.4em); } }
.faq .a strong { color: var(--tx); font-weight: 600; }
.faq .a p + p { margin-top: .9em; }

/* ---------- Enquiry form ---------- */
.form { display: grid; gap: 0; border-top: 1px solid var(--line-2); }
.form__row { display: grid; gap: 0; }
@media (min-width: 640px) { .form__row--2 { grid-template-columns: 1fr 1fr; } }
.field {
  border-bottom: 1px solid var(--line); border-right: 1px solid transparent;
  padding: 13px 0 14px; position: relative;
}
@media (min-width: 640px) {
  .form__row--2 .field:first-child { border-right: 1px solid var(--line); padding-right: clamp(18px, 2vw, 28px); }
  .form__row--2 .field:last-child { padding-left: clamp(18px, 2vw, 28px); }
}
.field label {
  display: block; font-family: var(--f-mono); font-size: 9.5px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--tx-faint);
  margin-bottom: 7px;
}
.field input, .field select, .field textarea {
  width: 100%; background: transparent; border: 0; padding: 0;
  color: var(--tx); font-family: var(--f-body); font-size: 16px; line-height: 1.5;
  border-radius: 0;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; }
.field:focus-within label { color: var(--acc-fg); }
.field::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--acc); transform: scaleX(0); transform-origin: left;
  transition: transform .34s var(--ease);
}
.field:focus-within::after { transform: scaleX(1); }
.field select { appearance: none; cursor: pointer; }
.field input::placeholder, .field textarea::placeholder { color: var(--tx-faint); }
.form__foot {
  display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center;
  padding-top: var(--s-4);
}
.form__note { font-size: 13px; color: var(--tx-faint); line-height: 1.55; max-width: 44ch; text-wrap: pretty; }

/* ---------- Sticky conversion bar ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 75;
  display: flex; align-items: center; gap: 14px;
  padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-top: 1px solid var(--line-2);
  transform: translateY(110%);
  transition: transform .42s var(--ease);
}
.dock.is-on { transform: none; }
@media (min-width: 1024px) { .dock { left: var(--rail); } }
.dock__t { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--tx-mut); }
.dock__t b { color: var(--tx); font-weight: 500; }
@media (max-width: 719px) { .dock__t { display: none; } }
.dock .btn { min-height: 42px; margin-left: auto; }
@media (max-width: 420px) { .dock .btn { width: auto; flex: 1; } }
.dock__x { flex: none; color: var(--tx-faint); font-family: var(--f-mono); font-size: 15px; line-height: 1; padding: 6px; }
.dock__x:hover { color: var(--acc-fg); }

/* ---------- Pull quote / positioning statement ---------- */
.pull {
  border-left: 2px solid var(--acc);
  padding: clamp(6px, 1vw, 10px) 0 clamp(6px, 1vw, 10px) clamp(20px, 2.4vw, 34px);
  max-width: 34ch;
}
.pull p {
  font-family: var(--f-disp); font-weight: 700; text-transform: none;
  font-size: clamp(1.12rem, 1.6vw, 1.42rem); line-height: 1.22; letter-spacing: -.02em;
  color: var(--tx); margin: 0; text-wrap: balance;
}
.pull .mono { display: block; margin-top: 12px; color: var(--tx-faint); }

/* ---------- Dense fact table (Bloomberg-ish) ---------- */
.dtab { border-top: 1px solid var(--line-2); }
.dtab__r {
  display: grid; gap: 4px 24px; padding: 14px 0 15px;
  border-bottom: 1px solid var(--line);
  transition: background-color .26s var(--ease);
}
@media (min-width: 720px) { .dtab__r { grid-template-columns: minmax(150px, 20%) minmax(0, 1fr) minmax(120px, 18%); align-items: baseline; } }
.dtab__r:hover { background: var(--ink-soft); }
.dtab__k { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--acc-fg); }
.dtab__v { font-size: 15.5px; line-height: 1.55; color: var(--tx); text-wrap: pretty; }
.dtab__m { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--tx-faint); }
@media (min-width: 720px) { .dtab__m { text-align: right; } }

/* ---------- Refinements to inherited components ---------- */
.hero h1 { max-width: 19ch; }
.hero__sub { color: #E4E0D7; }
.band__inner { padding: var(--sec-y) 0; }
.stmt { font-size: clamp(1.46rem, 3vw, 2.5rem); }
.entry__b, .essay__b, .spec__v, .chk li, .prose p, .prose li { font-size: 15.5px; }
.tags li { min-height: 96px; }
.credstrip__v { font-size: 13px; color: var(--tx-mut); }

/* keep long uppercase display headings from sprawling */
.d2 { font-size: clamp(1.6rem, 3.1vw, 2.5rem); }

/* section top-edge accent tick for institutional rhythm */
.band > .wrap > .band__head { position: relative; }
.band > .wrap > .band__head::before {
  content: ""; position: absolute; top: -1px; left: 0; width: 44px; height: 2px;
  background: var(--acc);
}

/* image figure hover on existing slabs and talls */
.slab img, .tall__img img { transition: transform 1.1s var(--ease); }
.slab:hover img, .tall__img:hover img { transform: scale(1.02); }

/* footer wordmark presence */
.ft__wm { font-size: clamp(1.5rem, 2.7vw, 2.2rem); }

/* light-theme photograph handling stays legible */
html[data-theme="light"] .metrics { background: var(--bg-2); }

/* ---------- v3 corrections after first QA pass ---------- */
.frow__fig img {
  height: clamp(300px, 34vw, 470px);
  aspect-ratio: auto;
}
@media (min-width: 900px) { .frow { align-items: stretch; } .frow__txt { align-self: center; } }
.faq { max-width: none; }
.faq summary { padding-right: 4px; }
.band__inner { padding-top: calc(var(--sec-y) * .72); }
.metrics li:nth-child(4) .metric__n { letter-spacing: -.05em; }
/* ---------- v3: selects must read as controls, not as text ---------- */
.field select {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  /* native popup inherits the right scheme instead of dark-on-dark */
  color-scheme: light dark;
  cursor: pointer;
  padding: 9px 40px 9px 12px;
  margin-top: 1px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background-color: var(--bg-2);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--acc) 50%),
    linear-gradient(135deg, var(--acc) 50%, transparent 50%);
  background-position: right 15px center, right 9px center;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
html[data-theme="dark"] .field select { background-color: rgba(255, 255, 255, .035); }
html[data-theme="light"] .field select { background-color: rgba(0, 0, 0, .035); }
.field select:hover { border-color: var(--acc); }
.field select:focus-visible {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 26%, transparent);
}
/* a select is its own bordered control — kill the shared underline treatment */
.field:has(select) { border-bottom-color: transparent; }
.field:has(select)::after { display: none; }
/* native option list: force readable colours (Firefox / Windows Chrome) */
.field select option {
  background-color: #17171A;
  color: #F2F0E9;
}
html[data-theme="light"] .field select option {
  background-color: #FFFFFF;
  color: #1A1A17;
}
@media (min-width: 700px) {
  .faq .a { padding-left: calc(clamp(14px, 2vw, 26px) + 15px); max-width: 84ch; }
}

/* ---------- v3: close editorial voids — heading columns track the prose ---------- */
@media (min-width: 980px) {
  .band__inner .g12 > .c-b,
  .band__inner .g12 > .c-d,
  .ehead > :first-child {
    position: sticky;
    top: calc(var(--hdr) + 46px);
    align-self: start;
  }
}

/* ---------- Process rail: five-stage variant ---------- */
@media (min-width: 760px) and (max-width: 1159.98px) {
  .rail7--5 ol { grid-template-columns: repeat(3, 1fr); }
  .rail7--5 li:nth-child(4n+1) { border-left: 1px solid var(--line); padding-left: var(--rail-pad); }
  .rail7--5 li:nth-child(3n+1) { border-left: 0; padding-left: 0; }
  .rail7--5 li:nth-child(-n+4) { border-bottom: 0; }
  .rail7--5 li:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (min-width: 1160px) {
  .rail7--5 ol { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- Services family: link to the dedicated page ---------- */
.essay__more { margin-top: 20px; }
.essay__more + .essay__more { margin-top: 8px; }
.essay__more .lnk { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Lede: readable mixed-case paragraph under a short statement ---------- */
.lede {
  font-size: clamp(1.06rem, 1.35vw, 1.28rem);
  line-height: 1.58;
  letter-spacing: -.006em;
  color: var(--tx);
  max-width: 58ch;
  text-wrap: pretty;
}
.lede strong { font-weight: 600; color: var(--acc-fg); }
@media (min-width: 900px) { .lede { margin-top: var(--s-3); } }

/* a statement that hands off to a lede can sit tighter */
.stmt:has(+ .lede) { max-width: 30ch; }
