/* ============================================================
   MIDIOS TECHNOLOGIES — ART DIRECTION v2
   ------------------------------------------------------------
   Loaded AFTER tokens.css and tech.css. Additive: nothing here
   edits a house constant or a v1 rule in place.

   What it adds, from the approved UI concept round:
     · the division palette moved to deep navy and electric blue
       (every pair measured; all pass WCAG AA, including --type-3,
       which fixes the house-wide AA miss for this division)
     · a photographic head-end that keeps the live schematic panel
       — the photograph sets the register, the panel still does
       the demonstrating
     · the Bodoni display voice set in capitals for the opening
       statement — the MDS equivalent is heavy Archivo; this
       division speaks in the house serif instead
     · a six-column capability rail beneath the hero
     · a light "paper" band — the one light surface on the site,
       used once, so it reads as deliberate

   Every photograph is a PLACEHOLDER pending real imagery. None
   is captioned, labelled or positioned to imply a MIDIOS-owned
   facility, deployment, client or product.
   ============================================================ */

/* ------------------------------------------------------------
   0. PALETTE — within the shared token system
   ------------------------------------------------------------ */

html[data-division="technologies"] {
  --ground:        #09111E;
  --ground-raised: #0F1A2B;
  --line:          #1C2A3F;
  --type:          #E6ECF4;   /* 15.9:1 */
  --type-2:        #93A2B6;   /*  7.3:1 */
  --type-3:        #8494AA;   /*  6.1:1 — clears AA, unlike the house default */
  --accent:        #5B9BFF;   /*  6.8:1 as text */
  --accent-dim:    #2B4A7A;
  --on-accent:     #09111E;
  --accent-solid:  #2563EB;   /* white text on this: 5.2:1 */

  --grid-line: rgba(91, 155, 255, .06);
  --sig-face: var(--mono);

  /* literal rgba: legibility over photographs must not depend on
     color-mix(), which iOS Safari < 16.2 drops silently */
  --scrim-strong: rgba(9, 17, 30, .94);
  --scrim-mid:    rgba(9, 17, 30, .66);
  --scrim-none:   rgba(9, 17, 30, 0);

  /* the paper band */
  --paper:        #EEF2F7;
  --paper-raised: #E3E9F1;
  --paper-line:   #C9D3E0;
  --ink:          #0B1424;    /* 16.4:1 on paper */
  --ink-2:        #3C4A5E;    /*  8.0:1 */
  --ink-3:        #5B6B80;    /*  4.8:1 */
  --accent-ink:   #1D4FBF;    /*  6.4:1 */
}

/* Primary action: a solid electric field with white type, as in
   the concept. Secondary stays the house ghost button. */
[data-division="technologies"] .cta--solid {
  background: var(--accent-solid);
  border-color: var(--accent-solid);
  color: #fff;
}
[data-division="technologies"] .cta--solid:hover {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

/* ------------------------------------------------------------
   1. THE PHOTOGRAPHIC HEAD-END
   ------------------------------------------------------------ */

.headend--photo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(84vh, 48rem);
  min-height: min(84svh, 48rem);
  display: flex;
  align-items: center;
}
.headend--photo .headend-media { position: absolute; inset: 0; z-index: -2; }
.headend--photo .headend-media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 45%;
  display: block;
}
/* Scrim from the left for the statement, from the foot for the
   rail below, plus the drafting grid laid over the photograph —
   the schematic register sitting on top of the physical one. */
.headend--photo::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to right, var(--scrim-strong) 0%, var(--scrim-mid) 45%, var(--scrim-none) 85%),
    linear-gradient(to top, var(--scrim-strong) 0%, var(--scrim-none) 45%);
  pointer-events: none;
}
.headend--photo::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.headend--photo .headend-grid { width: 100%; max-width: 90rem; }

/* Three tracks when the keystack is present: statement, panel,
   stack. The stack is in flow here rather than floating, because
   the panel owns the right side of the photograph. */
.headend--photo .headend-grid:has(> .keystack) {
  grid-template-columns: minmax(0, 1fr) minmax(0, .95fr) auto;
}
.headend--photo .keystack { position: static; align-self: end; }
@media (max-width: 1180px) {
  .headend--photo .headend-grid:has(> .keystack) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .headend--photo .keystack { display: none; }
}
@media (max-width: 900px) {
  .headend--photo .headend-grid:has(> .keystack) { grid-template-columns: minmax(0, 1fr); }
  .headend--photo { min-height: 0; }
}

/* The display statement: house serif, set in capitals. */
.headend--photo h1.t-display {
  font-family: var(--display);
  font-weight: 500;
  text-transform: uppercase;
  font-size: clamp(2.3rem, 1rem + 3.3vw, 4rem);
  line-height: 1;
  letter-spacing: -.005em;
  max-width: 14ch;
  color: var(--type);
}
.headend--photo .headend-lede {
  font-family: var(--display);
  font-size: var(--step-1);
  line-height: 1.3;
  color: var(--type);
  margin: 1.25rem 0 0;
  max-width: 30ch;
}
.headend--photo .headend-lede em { font-style: italic; color: var(--accent); }
.headend--photo .headend-sub { color: var(--type-2); margin-top: 1.25rem; }

/* The panel sits on the photograph; it needs its own ground. */
.headend--photo .panel {
  background: rgba(15, 26, 43, .9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .8);
}

@media (prefers-reduced-motion: no-preference) {
  .headend--photo .headend-grid > div:first-child > * { animation: t-rise .45s cubic-bezier(.2,.7,.3,1) both; }
  .headend--photo .headend-grid > div:first-child > :nth-child(2) { animation-delay: .05s; }
  .headend--photo .headend-grid > div:first-child > :nth-child(3) { animation-delay: .1s; }
  .headend--photo .headend-grid > div:first-child > :nth-child(4) { animation-delay: .15s; }
  .headend--photo .headend-grid > div:first-child > :nth-child(5) { animation-delay: .2s; }
  .headend--photo .panel { animation: t-rise .5s .18s cubic-bezier(.2,.7,.3,1) both; }
}
@keyframes t-rise {
  from { opacity: 0; transform: translateY(.6rem); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------
   2. CAPABILITY RAIL — six ruled columns beneath the hero
   ------------------------------------------------------------ */

.caprail {
  background: var(--ground-raised);
  border-bottom: 1px solid var(--line);
  padding: 0 var(--gutter);
}
.caprail ul {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  max-width: 90rem;
}
.caprail li + li { border-left: 1px solid var(--line); }
.caprail a {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1.5rem 1.1rem;
  text-decoration: none;
  color: var(--type-2);
  height: 100%;
  transition: color .18s ease, background-color .18s ease;
}
.caprail li:first-child a { padding-left: 0; }
.caprail svg {
  flex: none;
  width: 30px; height: 30px;
  stroke: currentColor; fill: none; stroke-width: 1.25;
  stroke-linecap: round; stroke-linejoin: round;
  color: var(--accent);
}
.caprail .c-name {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .12em;
  line-height: 1.45;
  text-transform: uppercase;
}
.caprail a:hover { color: var(--type); background: var(--ground); }
@media (max-width: 1100px) {
  .caprail ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .caprail li { border-top: 1px solid var(--line); }
  .caprail li:nth-child(-n+3) { border-top: 0; }
  .caprail li:nth-child(3n+1) { border-left: 0; }
  .caprail li:nth-child(3n+1) a { padding-left: 0; }
}
@media (max-width: 640px) {
  .caprail ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .caprail li:nth-child(3) { border-top: 1px solid var(--line); }
  .caprail li:nth-child(3n+1) { border-left: 1px solid var(--line); }
  .caprail li:nth-child(3n+1) a { padding-left: 1.1rem; }
  .caprail li:nth-child(odd) { border-left: 0; }
  .caprail li:nth-child(odd) a { padding-left: 0; }
  .caprail a { padding: 1.15rem .9rem; gap: .65rem; }
  .caprail svg { width: 24px; height: 24px; }
}

/* ------------------------------------------------------------
   3. THE PAPER BAND — the site's one light surface
   Tokens are redefined locally, so every component inside it
   (pull quote, text links, rails) inverts without new rules.
   ------------------------------------------------------------ */

.band--paper {
  --ground:        var(--paper);
  --ground-raised: var(--paper-raised);
  --line:          var(--paper-line);
  --type:          var(--ink);
  --type-2:        var(--ink-2);
  --type-3:        var(--ink-3);
  --accent:        var(--accent-ink);
  --accent-dim:    #8FA8D6;
  background: var(--paper);
  color: var(--ink);
  border-bottom: 0;
}
/* The homepage split runs edge to edge; an interior paper section
   keeps the house band padding. */
.band--paper--flush { padding: 0; }
.band--paper :focus-visible { outline-color: var(--accent-ink); }

.paper-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, .6fr);
  align-items: stretch;
}
.paper-media { position: relative; min-height: 24rem; }
.paper-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.paper-body {
  padding: clamp(3rem, 6vw, 5.5rem) clamp(1.5rem, 4vw, 4rem);
  display: flex; flex-direction: column; justify-content: center;
}
.paper-eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 1.1rem;
}
.paper-body h2 { font-size: var(--step-3); line-height: 1.06; max-width: 16ch; }
.paper-body .quiet { color: var(--ink-2); }
.paper-body .pull { font-size: var(--step-1); }

.paper-aside {
  border-left: 1px solid var(--paper-line);
  padding: clamp(3rem, 6vw, 5.5rem) var(--gutter) clamp(3rem, 6vw, 5.5rem) clamp(1.5rem, 3vw, 2.5rem);
  display: flex; flex-direction: column; justify-content: center;
}
.paper-aside ul { list-style: none; margin: 0; padding: 0; }
.paper-aside li { margin: 0 0 .35rem; }
.paper-aside a {
  font-family: var(--display);
  font-size: var(--step-1);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.paper-aside a:hover { border-bottom-color: var(--accent-ink); color: var(--accent-ink); }
.paper-aside .is-self a { color: var(--accent-ink); }
.paper-aside .paper-foot {
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--paper-line);
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

@media (max-width: 1100px) {
  .paper-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .paper-aside { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--paper-line); padding: 2rem var(--gutter); }
  .paper-aside ul { display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; }
}
@media (max-width: 760px) {
  .paper-split { grid-template-columns: minmax(0, 1fr); }
  .paper-media { min-height: 15rem; }
  .paper-body { padding: 2.75rem var(--gutter); }
}

/* ------------------------------------------------------------
   4. PRINT
   ------------------------------------------------------------ */

@media print {
  .headend--photo { min-height: 0; }
  .headend--photo .headend-media, .paper-media { display: none; }
  .headend--photo::before, .headend--photo::after { display: none; }
}

/* Keep the pair of calls to action on one line in the statement
   column, as the house does elsewhere; stacked, they read as two
   unrelated buttons. */
.headend--photo .headend-actions .cta { padding-left: 1.2rem; padding-right: 1.2rem; }

/* ------------------------------------------------------------
   5. RULED GRIDS — v1 draws the rules as the container colour
   showing through 1px gaps. On the navy ground the unfilled
   remainder of a short last row reads as a blank slab, so the
   rules move onto the cells instead (collapsed with -1px).
   ------------------------------------------------------------ */
.cards, .doors, .loop, .split {
  background: transparent;
  border: 0;
  gap: 0;
  padding: 0 0 0 1px;   /* room for the first column's collapsed rule */
  padding-top: 1px;
}
.cards > li, .doors > li, .loop > li, .split > div {
  border: 1px solid var(--line);
  margin: -1px 0 0 -1px;
}
.cards > li > .card, .doors > li > .door { height: 100%; }

/* v1 zeroes the margin on these lists, which also cancels the
   stack rhythm when one follows a heading directly. */
.stack-lg > * + .cards,
.stack-lg > * + .doors,
.stack-lg > * + .loop,
.stack-lg > * + .split { margin-top: 2.25rem; }

/* Stacked, the statement spans the full width of the photograph,
   so the directional scrim no longer covers it: go uniform. */
@media (max-width: 900px) {
  .headend--photo::before {
    background: linear-gradient(to bottom,
      rgba(9, 17, 30, 0.72) 0%,
      rgba(9, 17, 30, 0.84) 55%,
      var(--scrim-strong) 100%);
  }
}

/* ------------------------------------------------------------
   6. INTERIOR HEADS
   The division speaks in the same capitalised serif everywhere,
   at section-heading scale rather than hero scale.
   ------------------------------------------------------------ */

.hero--t2 .statement {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.9rem, 1.1rem + 2.1vw, 3.1rem);
  line-height: 1.04;
  letter-spacing: -.005em;
  max-width: 17ch;
}
.hero--t2 .rail { color: var(--accent); }

/* ------------------------------------------------------------
   7. PHOTOGRAPHIC INTERIOR HEAD
   Two pages earn a photograph: the page where someone decides to
   make contact, and the page they read to decide whether to
   trust us. The house credit grid is unchanged underneath.
   ------------------------------------------------------------ */

.hero--photo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.hero--photo .hero-media { position: absolute; inset: 0; z-index: -2; }
.hero--photo .hero-media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 50%;
  display: block;
}
.hero--photo::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to right, var(--scrim-strong) 0%, rgba(9, 17, 30, 0.78) 55%, rgba(9, 17, 30, 0.4) 100%),
    linear-gradient(to bottom, rgba(9, 17, 30, 0.55) 0%, var(--scrim-strong) 100%);
  pointer-events: none;
}
@media (max-width: 900px) {
  .hero--photo::before {
    background: linear-gradient(to bottom,
      rgba(9, 17, 30, 0.76) 0%,
      var(--scrim-strong) 100%);
  }
}
