/* Home page, third pass: one dark page. This file is loaded last and owns the index rail, the command
   reel on the first screen, the About and support section, the dot model and the submission steps.
   The older sections that remain (project areas, SHAIQAS, news, events, Instagram, contact) are
   darkened in home-dark.css. Tokens come from brand.css. */

:root { --rail: 216px; --footage: #0c0c0c; --quiet: #a0a0a0; --ease-out: cubic-bezier(.16, 1, .3, 1); }
@media (max-width: 1199px) { :root { --rail: 76px; } }
@media (max-width: 800px) { :root { --rail: 0px; } }

html { scrollbar-color: #3e3e3e var(--ink); }
html body { background: var(--ink); color: var(--off); }
::selection { background: var(--signal); color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html body :focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ---------------------------------------------------------------------------------------- index rail */
/* A gauge down the left edge: a scale of ticks, one numbered entry per part of the page, and a signal
   marker that rides the scale in step with scrolling. Wide screens show the names; between 801 and
   1199px it folds to numbers and opens on hover or keyboard focus. */
.index-rail { position: fixed; z-index: 12; inset: 0 auto 0 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: var(--rail); padding: 30px 0 28px; color: var(--off); }
.ix-brand { justify-self: start; display: block; margin-left: 40px; }
.ix-brand img { display: block; width: 34px; height: auto; }
.ix-nav { position: relative; align-self: center; }
.ix-sections, .ix-pages { margin: 0; padding: 0; list-style: none; }
.ix-sections { padding-left: 40px; background: repeating-linear-gradient(rgb(237 237 237 / .26) 0 1px, transparent 1px 8px) 16px 0 / 5px 100% no-repeat; }
.ix-sections li { position: relative; }
/* The long tick of each entry on the scale. */
.ix-sections li::before { content: ""; position: absolute; top: 50%; left: -24px; width: 12px; height: 1px; background: rgb(237 237 237 / .55); }
.index-rail a { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: baseline; gap: 12px; min-height: 44px; padding: 12px 16px 12px 0; color: var(--quiet); font-size: 14px; line-height: 1.35; text-decoration: none; transition: color 160ms; }
.index-rail a b { color: var(--quiet); font: 400 11px/1 var(--mono); letter-spacing: .04em; transition: color 160ms; }
.index-rail a:hover, .index-rail a.is-current { color: var(--off); }
.index-rail a.is-current b { color: var(--signal); }
.ix-marker { position: absolute; top: -1px; left: 10px; width: 22px; height: 2px; background: var(--signal); transform: translateY(var(--marker, 20px)); }
.ix-pages { margin: 22px 0 0 40px; padding-top: 14px; border-top: 1px solid var(--line-dark); }
.ix-out { align-self: center; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.ix-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 16px 0 40px; }
.ix-readout { display: flex; align-items: baseline; gap: 8px; margin: 0; color: var(--quiet); font: 400 11px/1 var(--mono); letter-spacing: .04em; }
/* One switch for everything that moves on the page: the reel, the section clips and the dot model. */
.ix-motion, .mobile-motion { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line-mid, #3e3e3e); border-radius: 4px; background: transparent; color: var(--off); cursor: pointer; transition: border-color 160ms; }
.ix-motion:hover, .mobile-motion:hover { border-color: var(--off); }
.ix-motion svg, .mobile-motion svg { fill: none; stroke: currentColor; stroke-width: 1.5; }
.mobile-motion { display: none; }
.ix-readout b { color: var(--off); font-weight: 400; font-size: 22px; }

@media (max-width: 1199px) {
  /* Folded: the scale, the numbers and the marker stay; the names wait for hover or focus. */
  .index-rail { width: 76px; overflow: hidden; border-right: 1px solid transparent; transition: width 420ms var(--ease-out), background 200ms, border-color 200ms; }
  .index-rail:has(:focus-visible), .index-rail.is-open { width: 236px; border-color: var(--line-dark); background: var(--ink); }
  @media (hover: hover) { .index-rail:hover { width: 236px; border-color: var(--line-dark); background: var(--ink); } }
  .ix-brand { margin-left: 21px; }
  .ix-foot { margin-left: 16px; }
  .ix-sections { padding-left: 30px; background-position: 10px 0; }
  .ix-sections li::before { left: -20px; width: 10px; }
  .ix-marker { left: 6px; width: 18px; }
  .ix-pages { margin-left: 30px; }
  .index-rail a { width: 206px; outline-offset: -2px; }
  .index-rail a span { opacity: 0; transition: opacity 200ms; }
  .index-rail:has(:focus-visible) a span, .index-rail.is-open a span { opacity: 1; }
  @media (hover: hover) { .index-rail:hover a span { opacity: 1; } }
  .ix-readout { display: none; }
}
@media (max-width: 800px) { .index-rail { display: none; } }

/* Phones: the top bar names the part of the page being read and carries a progress line. */
.mobile-where, .mobile-progress { display: none; }
@media (max-width: 800px) {
  html .dtc-industrial .mobile-bar { gap: 14px; }
  .mobile-where { display: flex; flex: 1 1 auto; align-items: baseline; gap: 10px; min-width: 0; margin: 0; color: var(--off); font-size: 14px; }
  .mobile-where b { color: var(--signal); font: 400 11px/1 var(--mono); letter-spacing: .04em; }
  /* The language buttons share the bar, so there is room for the number of the part only. */
  .mobile-where span { display: none; }
  .mobile-progress { position: absolute; right: 0; bottom: -1px; left: 0; display: block; height: 2px; background: var(--signal); transform: scaleX(var(--read, 0)); transform-origin: left; }
  html .dtc-industrial .mobile-menu { counter-reset: part; align-content: start; height: calc(100dvh - 63px); overflow-y: auto; }
  .mobile-motion { display: grid; margin-top: 16px; }
  html .dtc-industrial .mobile-menu a[data-section] { counter-increment: part; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: baseline; }
  html .dtc-industrial .mobile-menu a[data-section]::before { content: counter(part, decimal-leading-zero); color: #8a8a8a; font: 400 11px/1 var(--mono); letter-spacing: .04em; }
  html .dtc-industrial .mobile-menu a.is-current { color: var(--off); }
  html .dtc-industrial .mobile-menu a.is-current::before { color: var(--signal); }
  html .dtc-industrial .mobile-menu a.mobile-page { padding-left: 28px; }
}

/* ---------------------------------------------------------------------------------------- first screen: the command reel */
/* Every clip in turn, full bleed, inside an instrument frame: corner marks, the place and time, the
   clip count and timecode. One statement in capitals sits over it. As the page starts to scroll, the
   footage closes in to a framed screen (--dock runs 0 to 1) and the statement lifts away. */
@property --shade { syntax: "<number>"; inherits: true; initial-value: 0; }
.command { --dock: 0; position: relative; height: calc(100svh + 62vh); background: var(--ink); }
.command-pin { position: sticky; top: 0; display: grid; place-items: center; height: 100svh; overflow: hidden; }
.command-frame { --shade: 0; --top: calc(var(--dock) * 11vh); --side: calc(var(--dock) * 5vw); position: absolute; inset: 0; background: var(--footage); clip-path: inset(var(--top) var(--side) var(--top) calc(var(--dock) * (var(--rail) + 2vw)) round calc(var(--dock) * 6px)); transition: --shade 900ms ease; }
.command-media { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 900ms ease; }
.command-media.is-showing { opacity: 1; }
.command-media.is-front { z-index: 1; }
/* The footage stays clear at the edges; the middle is darkened just enough to carry the statement, and the left edge to carry the rail. */
.command-frame::after { content: ""; position: absolute; z-index: 2; inset: 0; background: linear-gradient(rgb(12 12 12 / var(--shade)), rgb(12 12 12 / var(--shade))), radial-gradient(ellipse 70% 66% at calc(50% + var(--rail) / 2) 48%, rgb(12 12 12 / .62), rgb(12 12 12 / .4) 60%, transparent), linear-gradient(90deg, rgb(12 12 12 / .8), transparent calc(var(--rail) + 14vw)), linear-gradient(rgb(12 12 12 / .62), rgb(12 12 12 / .6) 14%, transparent 30%, transparent 68%, rgb(12 12 12 / .66)); pointer-events: none; }
.command-corner, .command-readout, .command-caption, .command-controls { position: absolute; z-index: 3; }
/* The frame's inner edge, which the corner marks and readouts hold on to as it closes in. */
.command-frame { --edge-top: max(76px, calc(var(--top) + 24px)); --edge-bottom: calc(var(--top) + 28px); --edge-left: calc(var(--rail) + var(--dock) * 2vw + 28px); --edge-right: calc(var(--side) + 28px); }
.command-corner { width: 20px; height: 20px; border: solid rgb(237 237 237 / .8); border-width: 0; }
.command-corner:nth-of-type(1) { top: var(--edge-top); left: var(--edge-left); border-top-width: 1px; border-left-width: 1px; }
.command-corner:nth-of-type(2) { top: var(--edge-top); right: var(--edge-right); border-top-width: 1px; border-right-width: 1px; }
.command-corner:nth-of-type(3) { bottom: var(--edge-bottom); left: var(--edge-left); border-bottom-width: 1px; border-left-width: 1px; }
.command-corner:nth-of-type(4) { right: var(--edge-right); bottom: var(--edge-bottom); border-right-width: 1px; border-bottom-width: 1px; }
.command-readout, .command-caption { margin: 0; color: var(--off); font: 400 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.command-readout { display: flex; gap: 14px; }
.command-readout span + span, .command-readout time { color: rgb(237 237 237 / .7); }
.command-place { top: calc(var(--edge-top) + 16px); left: calc(var(--edge-left) + 18px); }
.command-count { top: calc(var(--edge-top) + 16px); right: calc(var(--edge-right) + 18px); }
.command-caption { bottom: calc(var(--edge-bottom) + 18px); left: calc(var(--edge-left) + 18px); display: flex; align-items: center; gap: 10px; font-size: 12px; }
.command-caption:not(:empty)::before { content: ""; flex: none; width: 7px; height: 7px; background: var(--signal); }
.command-controls { right: calc(var(--edge-right) + 18px); bottom: calc(var(--edge-bottom) + 12px); display: flex; align-items: center; gap: 14px; }
.reel-ticks { display: flex; gap: 6px; }
.reel-ticks i { width: 24px; height: 2px; background: rgb(237 237 237 / .28); }
.reel-ticks i.is-done { background: rgb(237 237 237 / .7); }
.reel-ticks i.is-current { background: linear-gradient(90deg, var(--signal) var(--progress, 0%), rgb(237 237 237 / .28) var(--progress, 0%)); }
.reel-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgb(237 237 237 / .4); border-radius: 4px; background: rgb(12 12 12 / .35); color: var(--off); cursor: pointer; transition: border-color 160ms, background 160ms; }
.reel-toggle:hover { border-color: var(--off); background: rgb(12 12 12 / .6); }
.reel-toggle svg, .command-link svg { fill: none; stroke: currentColor; stroke-width: 1.5; }

.command-copy { position: relative; z-index: 4; display: grid; justify-items: center; max-width: 100%; padding: 0 var(--page-x) 0 calc(var(--rail) + var(--page-x)); opacity: calc(1 - var(--dock) * 1.8); text-align: center; transform: translateY(calc(var(--dock) * -7vh)); }
/* The statement: capitals, tight leading. It waits for its decode effect; if the script never runs, it shows by itself after a moment. */
html .command-title { max-width: 13em; margin: 0; color: var(--off); font-size: clamp(34px, 5.5vw, 92px); font-weight: 500; line-height: .98; letter-spacing: -.025em; text-transform: uppercase; text-wrap: balance; opacity: 0; animation: title-fallback 1ms 3.5s forwards; }
html .command-title.is-ready { opacity: 1; animation: none; }
@keyframes title-fallback { to { opacity: 1; } }
/* A line of text while it decodes: it never wraps, and the side margins let it stay centred if the loose letters run a little wide. */
.decode-line { display: block; margin-inline: -2em; white-space: nowrap; }
.command-caption .decode-line { display: inline; margin: 0; }
.decode-word { display: inline-block; white-space: nowrap; }
.decode-char { display: inline-block; text-align: center; transition: color 260ms; }
.decode-char.is-loose { color: var(--signal); }
.command.is-docked .command-copy { visibility: hidden; }
.command-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: clamp(20px, 3.4vw, 56px); margin-top: clamp(28px, 5vh, 52px); }
html .command-row .action { justify-self: end; padding: 12px 20px; border: 1px solid var(--signal); background: var(--signal); color: var(--ink); }
html .command-row .action:hover { border-color: #6de1ab; background: #6de1ab; color: var(--ink); }
.command-mark { width: auto; height: clamp(40px, 5vw, 60px); }
.command-link { justify-self: start; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--off); font-size: 14px; font-weight: 500; letter-spacing: .04em; text-decoration: none; text-transform: uppercase; }
.command-link:hover { color: var(--signal); }
.command-link svg { transition: transform 240ms var(--ease-out); }
.command-link:hover svg { transform: translateX(3px); }

/* ---------------------------------------------------------------------------------------- clips in the sections */
.clip { position: relative; isolation: isolate; overflow: hidden; border-radius: 4px; background: var(--footage); }
.clip-media { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
video.clip-media { opacity: 0; transition: opacity 700ms ease; }
video.clip-media.is-playing { opacity: 1; }
video.clip-media.is-playing.is-wrapping { opacity: 0; transition-duration: 380ms; }
.clip-corner { position: absolute; width: 16px; height: 16px; border: solid rgb(237 237 237 / .8); border-width: 0; pointer-events: none; }
.clip-corner:nth-of-type(1) { top: 14px; left: 14px; border-top-width: 1px; border-left-width: 1px; }
.clip-corner:nth-of-type(2) { top: 14px; right: 14px; border-top-width: 1px; border-right-width: 1px; }
.clip-corner:nth-of-type(3) { bottom: 14px; left: 14px; border-bottom-width: 1px; border-left-width: 1px; }
.clip-corner:nth-of-type(4) { right: 14px; bottom: 14px; border-right-width: 1px; border-bottom-width: 1px; }

/* ---------------------------------------------------------------------------------------- about and how we support a project */
.work, .submit { margin-left: var(--rail); padding: var(--section-y) var(--page-x); background: var(--ink); color: var(--off); }
html .work h2, html .submit h2 { margin: 0; color: var(--off); font-size: clamp(34px, 4.2vw, 64px); font-weight: 500; line-height: 1.05; letter-spacing: -.03em; text-wrap: balance; }
.work-head, .submit-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: end; gap: 24px clamp(32px, 5vw, 96px); }
.work-lead { display: grid; gap: 14px; }
.work-lead p, .submit-head p { max-width: 56ch; margin: 0; color: var(--quiet); font-size: 16px; line-height: 1.6; }
html .work-lead .lead { color: var(--off); font-size: clamp(18px, 1.5vw, 22px); line-height: 1.45; }
.work-band { margin: clamp(40px, 5vw, 72px) 0 0; aspect-ratio: 21 / 9; }
html .work h2.work-subhead { margin-top: clamp(72px, 9vw, 140px); }
/* Four panels side by side: the open one is wide and shows its text; the others wait as narrow strips. */
.work-panels { display: flex; gap: 10px; height: clamp(400px, 58vh, 640px); margin: clamp(28px, 4vw, 48px) 0 0; padding: 0; list-style: none; }
.work-panel { flex: 1 1 0; min-width: 0; cursor: pointer; transition: flex-grow 640ms var(--ease-out); }
.work-panel.is-open { flex-grow: 3.6; cursor: default; }
.work-panel::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(transparent 38%, rgb(12 12 12 / .9)); transition: background 400ms; }
.work-panel:not(.is-open)::after { background: linear-gradient(rgb(12 12 12 / .22), rgb(12 12 12 / .82)); }
.panel-copy { position: absolute; inset: auto 0 0; display: grid; gap: 10px; padding: clamp(18px, 1.8vw, 28px); }
html .panel-copy h3 { margin: 0; color: var(--off); font-size: clamp(18px, 1.6vw, 26px); font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
.panel-copy button { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.panel-copy p { display: none; max-width: 46ch; margin: 0; color: rgb(237 237 237 / .86); font-size: 15px; line-height: 1.5; }
.work-panel.is-open .panel-copy p { display: block; animation: panel-text 520ms 160ms var(--ease-out) both; }
/* A closed panel is a narrow strip, so its name runs up the strip instead of across it. */
.work-panel:not(.is-open) .panel-copy { inset: 0 auto 0 0; align-content: end; }
html .work-panel:not(.is-open) h3 { font-size: clamp(16px, 1.3vw, 20px); white-space: nowrap; writing-mode: vertical-rl; rotate: 180deg; }
@keyframes panel-text { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------------------------------- the dot model */
/* It stands beside "How to submit a project": the bench a submitted prototype is examined on. */
.jet-stage { position: relative; grid-column: 2; grid-row: 1 / span 2; align-self: center; height: clamp(420px, 62svh, 640px); }
.jet-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 700ms ease; }
.jet-stage.is-ready canvas { opacity: 1; }
.jet-stage.is-lost canvas { opacity: 0; }

/* Project areas: the specimen stage runs the full width of the section. */
html body .uav-study { --frame-w: calc(100% - 2 * var(--page-x)); }

/* ---------------------------------------------------------------------------------------- how to submit a project */
.submit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: auto 1fr; gap: 0 clamp(32px, 4vw, 72px); padding-bottom: clamp(24px, 3vw, 48px); }
html body .submit-head { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 18px; }
.submit-steps { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 0; margin: clamp(32px, 4vw, 56px) 0 0; padding: 0; border-top: 1px solid var(--line-dark); list-style: none; counter-reset: step; }
.submit-steps li { display: grid; align-content: start; gap: 10px; padding: 22px 0; border-bottom: 1px solid var(--line-dark); counter-increment: step; }
.submit-steps li::before { content: counter(step, decimal-leading-zero); color: var(--signal); font: 400 11px/1 var(--mono); letter-spacing: .04em; }
html .submit-steps h3 { margin: 0; color: var(--off); font-size: clamp(19px, 1.5vw, 24px); font-weight: 500; line-height: 1.2; }
.submit-steps p { max-width: 44ch; margin: 0; color: var(--quiet); font-size: 15px; line-height: 1.55; }

/* The form follows the steps as one task: its own heading stays for screen readers only and its lead, which the steps already say, is dropped. */
html body .contact-section > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html body .contact-section > p[data-site-text="contactIntro"] { display: none; }
html body .contact-section { padding-top: clamp(40px, 5vw, 72px); }
/* News cards: the title first, the date and label under it. */
html body .news-text > div { display: flex; flex-direction: column-reverse; gap: 12px; }
/* A part of the page that received focus after a rail link shows no ring of its own. */
main > section:focus { outline: none; }
html body .ix-motion[hidden], html body .mobile-motion[hidden] { display: none; }
.footer-note { flex-basis: 100%; max-width: 68ch; margin: 0; color: var(--quiet); font-size: 13px; line-height: 1.5; }

/* ---------------------------------------------------------------------------------------- narrower screens */
@media (max-width: 1000px) {
  .work-head, .submit-head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .work-band { aspect-ratio: 16 / 9; }
  .submit { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .jet-stage { grid-column: 1; grid-row: auto; height: clamp(300px, 56vw, 460px); }
}
@media (max-width: 800px) {
  /* Phones: the footage keeps the whole screen and does not close in. */
  .command { height: 100svh; }
  .command-frame { --edge-top: 84px; --edge-bottom: 20px; --edge-left: 14px; --edge-right: 14px; }
  .command-place { top: calc(var(--edge-top) + 12px); left: calc(var(--edge-left) + 12px); }
  .command-count { top: calc(var(--edge-top) + 12px); right: calc(var(--edge-right) + 12px); }
  .command-caption { bottom: calc(var(--edge-bottom) + 26px); left: calc(var(--edge-left) + 12px); }
  .command-controls { right: calc(var(--edge-right) + 12px); bottom: calc(var(--edge-bottom) + 12px); }
  .reel-ticks i { width: 10px; }
  .command-copy { padding: 0 22px; }
  html .command-title { font-size: clamp(31px, 9.4vw, 44px); letter-spacing: -.015em; }
  .command-row { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 12px; }
  html .command-row .action, .command-link { justify-self: center; }
  .command-mark { display: none; }
  .work-panels { flex-direction: column; height: auto; gap: 12px; }
  .work-panel, .work-panel.is-open { flex: none; aspect-ratio: 4 / 3; cursor: default; }
  .work-panel::after, .work-panel:not(.is-open)::after { background: linear-gradient(transparent 30%, rgb(12 12 12 / .9)); }
  .panel-copy p, .work-panel.is-open .panel-copy p { display: block; animation: none; }
  .work-panel:not(.is-open) .panel-copy { inset: auto 0 0; }
  html .work-panel:not(.is-open) h3 { font-size: 20px; white-space: normal; writing-mode: horizontal-tb; rotate: none; }
  .jet-stage { height: clamp(250px, 70vw, 340px); }
  .submit-steps { grid-template-columns: minmax(0, 1fr); }
  .submit-steps li { padding: 20px 0; border-bottom: 1px solid var(--line-dark); }
  .submit-steps li:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .command { height: 100svh; }
  .command-media, .work-panel, .index-rail, video.clip-media, .jet-stage canvas { transition-duration: 0s; }
  .work-panel.is-open .panel-copy p { animation: none; }
}
