/* =========================================================================
   AI MAESTRO — base layer
   Reset, typography, layout primitives, shared components, chrome.
   Section stylesheets extend this; they never override it globally.
   ========================================================================= */

/* ---- reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: var(--t-0);
  font-weight: 300;
  line-height: 1.65;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
summary::-webkit-details-marker { display: none; }
::selection { background: var(--ink); color: var(--bg); }

:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* ---- headings ----------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 300;
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: var(--tr-2);
  text-transform: uppercase;
  text-wrap: balance;
}

p { text-wrap: pretty; }
strong { color: var(--ink); font-weight: 400; }

code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.92em; }

kbd {
  border: 1px solid var(--line-2);
  padding: 0.1em 0.45em;
  color: var(--ink);
  font-size: 0.85em;
  white-space: nowrap;
}

/* =========================================================================
   LAYOUT
   ========================================================================= */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sec {
  position: relative;
  padding-block: var(--sec-pad);
  border-top: 1px solid var(--line);
}

.sec--flush { border-top: 0; }
.sec--raised { background: var(--bg-1); }

/* Blueprint field: hairline grid under a soft mask. Decorative, inert. */
.grid-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right,  var(--glow) 1px, transparent 1px),
    linear-gradient(to bottom, var(--glow) 1px, transparent 1px);
  background-size: var(--grid) var(--grid);
  -webkit-mask-image: radial-gradient(ellipse 85% 70% at 50% 45%, #000 20%, transparent 78%);
          mask-image: radial-gradient(ellipse 85% 70% at 50% 45%, #000 20%, transparent 78%);
}

/* Vertical measure rails, as on a drawing sheet. */
.rails::after {
  content: '';
  position: absolute;
  inset-block: 0;
  left: 50%;
  translate: -50% 0;
  width: min(100% - (var(--gutter) * 2), var(--maxw) - (var(--gutter) * 2));
  border-inline: 1px solid var(--line);
  pointer-events: none;
}

/* =========================================================================
   TYPE COMPONENTS
   ========================================================================= */

/* Mono plate label: "03 / CAPABILITIES" */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75em;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 400;
  letter-spacing: var(--tr-3);
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow__idx { color: var(--ink); }

.eyebrow::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--line-2);
  max-width: 96px;
}

.eyebrow--bare::after { display: none; }

.mono {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--tr-3);
  text-transform: uppercase;
  color: var(--ink-3);
}

.mono--l { font-size: var(--t-mono-l); }
.mono--ink { color: var(--ink); }

.sec__head { max-width: 64ch; margin-bottom: clamp(40px, 5vw, 76px); }
.sec__head--center { margin-inline: auto; text-align: center; }
.sec__head--center .eyebrow { justify-content: center; }
.sec__head--center .eyebrow::after { display: none; }
.sec__head--center .sec__lede { margin-inline: auto; }

.sec__title { font-size: var(--t-3); margin-top: 1.1rem; }

.sec__lede {
  margin-top: 1.35rem;
  font-size: var(--t-1);
  color: var(--ink-2);
  max-width: 58ch;
  line-height: 1.6;
}

/* =========================================================================
   BUTTONS
   ========================================================================= */

.btn {
  --btn-pad: 1.05rem 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.85em;
  padding: var(--btn-pad);
  font-family: var(--font-mono);
  font-size: var(--t-mono-l);
  font-weight: 400;
  letter-spacing: var(--tr-3);
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--line-3);
  color: var(--ink);
  position: relative;
  isolation: isolate;
  transition: color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease);
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  scale: 0 1;
  transform-origin: left center;
  transition: scale var(--dur) var(--ease);
}

.btn:hover::before, .btn:focus-visible::before { scale: 1 1; }
.btn:hover, .btn:focus-visible { color: var(--bg); border-color: var(--ink); box-shadow: 0 12px 28px -16px rgba(244, 243, 240, 0.35); }
.btn { transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), translate var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }

.btn__ico { width: 14px; height: 14px; flex: none; }

.btn__sub {
  font-size: var(--t-mono);
  letter-spacing: var(--tr-2);
  text-transform: none;
  color: var(--ink-3);
  transition: color var(--dur-fast) var(--ease);
}
.btn:hover .btn__sub, .btn:focus-visible .btn__sub { color: var(--bg); }

.btn--primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  --btn-pad: 1.15rem 2.35rem;
}
.btn--primary::before { background: transparent; }
.btn--primary .btn__sub { color: rgba(7, 7, 7, 0.62); }
.btn--primary:hover, .btn--primary:focus-visible { background: transparent; color: var(--ink); }
.btn--primary:hover .btn__sub, .btn--primary:focus-visible .btn__sub { color: var(--ink-3); }

.btn--ghost { border-color: var(--line-2); color: var(--ink-2); }
.btn--sm { --btn-pad: 0.7rem 1.35rem; font-size: var(--t-mono); }

.link {
  color: var(--ink);
  border-bottom: 1px solid var(--line-3);
  padding-bottom: 1px;
  transition: border-color var(--dur-fast) var(--ease);
}
.link:hover { border-color: var(--ink); }

/* =========================================================================
   SURFACES
   ========================================================================= */

.card {
  position: relative;
  border: 1px solid var(--line);
  padding: clamp(24px, 2.6vw, 38px);
}
/* No movement on hover: an element that shifts away from the pointer flickers
   in and out of :hover at its edge. The lift is carried by shadow alone. */
.card:hover {
  border-color: var(--line-3);
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--line);
}

/* Spotlight: a faint lamp that follows the pointer across a card, drawn as
   the card's own background image so the bracket corner ticks keep their
   pseudo-elements. app.js writes --mx / --my in px; --spot fades it in. */
@property --spot { syntax: "<number>"; inherits: false; initial-value: 0; }
.card {
  --spot: 0;
  background-color: var(--bg-2);
  background-image: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%),
                    rgba(244, 243, 240, var(--spot)), transparent 65%);
  transition: border-color var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              --spot var(--dur) var(--ease),
              translate var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.card:hover { --spot: 0.07; background-color: var(--bg-3); }

/* Corner ticks — drawing-sheet registration marks */
.bracket::before, .bracket::after {
  content: '';
  position: absolute;
  width: 9px; height: 9px;
  border: 1px solid var(--line-3);
  pointer-events: none;
  transition: border-color var(--dur) var(--ease);
}
.bracket::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.bracket::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.bracket:hover::before, .bracket:hover::after { border-color: var(--ink); }

/* Free-standing crosshair marker */
.xhair {
  position: absolute;
  width: 15px; height: 15px;
  pointer-events: none;
  opacity: 0.55;
}
.xhair::before, .xhair::after { content: ''; position: absolute; background: var(--line-4); }
.xhair::before { left: 50%; top: 0; width: 1px; height: 100%; translate: -50% 0; }
.xhair::after  { top: 50%; left: 0; height: 1px; width: 100%; translate: 0 -50%; }

.hr { height: 1px; background: var(--line); border: 0; }
.hr--dash {
  height: 1px;
  border: 0;
  background: repeating-linear-gradient(to right, var(--line-2) 0 4px, transparent 4px 10px);
}

/* Dot leader: label ......... value */
.leader { display: flex; align-items: baseline; gap: 0.75rem; }
.leader::before {
  content: '';
  order: 1;
  flex: 1 1 auto;
  height: 0;
  border-bottom: 1px dashed var(--line-2);
  translate: 0 -0.28em;
}
.leader > :first-child { order: 0; }
.leader > :last-child { order: 2; }

/* =========================================================================
   SCREENSHOT PLACEHOLDERS
   Drop a real PNG at the documented path and the frame swaps itself in;
   until then the technical placeholder holds the exact aspect ratio.
   ========================================================================= */

.shot { position: relative; margin: 0; }

.shot__frame {
  position: relative;
  aspect-ratio: var(--shot-ar, 16 / 10);
  border: 1px solid var(--line-2);
  background:
    linear-gradient(to right,  var(--glow) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(to bottom, var(--glow) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg-1);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.shot__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  z-index: 1;
  background: var(--bg-1);
  transition: scale calc(var(--dur) * 2) var(--ease);
  will-change: scale;
}

/* Hover: the frame brightens and the shot eases in a touch, like a lens
   settling on the drawing. */
.shot__frame { transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.shot:hover .shot__frame {
  border-color: var(--line-4);
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, 0.95), 0 0 0 1px var(--line);
}
.shot:hover .shot__frame img { scale: 1.02; }
.shot__frame::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 70%, rgba(7, 7, 7, 0.55));
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.shot:hover .shot__frame::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .shot:hover .shot__frame img { scale: 1; }
}

/* The placeholder is always laid down; a screenshot that loads paints over
   it on an opaque ground. js/app.js then adds .is-missing to pull a file
   that 404s, so the frame degrades to the placeholder rather than to a
   broken-image icon. With JS off, a real screenshot still shows. */
.shot__ph { display: block; text-align: center; padding: 1.5rem; z-index: 0; }
.shot.is-missing .shot__frame img { display: none; }

.shot__ph-box {
  width: 44px; height: 44px;
  border: 1px solid var(--line-3);
  margin: 0 auto 1.15rem;
  position: relative;
  overflow: hidden;
}
.shot__ph-box::before, .shot__ph-box::after {
  content: '';
  position: absolute;
  left: -30%;
  top: 50%;
  width: 160%;
  height: 1px;
  background: var(--line-2);
}
.shot__ph-box::before { rotate: 42deg; }
.shot__ph-box::after  { rotate: -42deg; }

.shot__ph-title {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--tr-3);
  text-transform: uppercase;
  color: var(--ink-2);
}
.shot__ph-meta {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--tr-2);
  color: var(--ink-3);
  margin-top: 0.5rem;
}

.shot figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--tr-2);
  text-transform: uppercase;
  color: var(--ink-3);
}

/* =========================================================================
   CHROME — skip link, header, nav, footer
   ========================================================================= */

.skip {
  position: absolute;
  left: 50%;
  top: 0;
  translate: -50% -120%;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 0.8rem 1.4rem;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--tr-3);
  text-transform: uppercase;
  transition: translate var(--dur-fast) var(--ease);
}
.skip:focus { translate: -50% 0; }

.hdr {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.hdr.is-stuck {
  background: rgba(7, 7, 7, 0.82);
  backdrop-filter: blur(14px) saturate(120%);
  border-bottom-color: var(--line);
}

.hdr__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  height: 72px;
}

.hdr__brand { display: flex; align-items: center; gap: 0.85rem; }
.hdr__mark { width: 23px; height: 24px; flex: none; }
.hdr__name {
  font-family: var(--font-display);
  font-size: var(--t-mono-l);
  font-weight: 400;
  letter-spacing: var(--tr-4);
  text-transform: uppercase;
  color: var(--ink);
}

.nav { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 34px); }
.nav__link {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--tr-3);
  text-transform: uppercase;
  color: var(--ink-3);
  position: relative;
  padding-block: 0.4rem;
  transition: color var(--dur-fast) var(--ease);
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--ink);
  scale: 0 1;
  transform-origin: left;
  transition: scale var(--dur-fast) var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link:hover::after, .nav__link.is-current::after { scale: 1 1; }
.nav__link.is-current { color: var(--ink); }

/* The in-menu download button is for the mobile drawer only. */
.nav > .btn { display: none; }

.hdr__cta { display: flex; align-items: center; gap: 1rem; }

.burger {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line-2);
  place-items: center;
  flex: none;
}
.burger span {
  display: block;
  width: 16px; height: 1px;
  background: var(--ink);
  position: relative;
  transition: background-color var(--dur-fast) var(--ease);
}
.burger span::before, .burger span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 16px; height: 1px;
  background: var(--ink);
  transition: translate var(--dur-fast) var(--ease), rotate var(--dur-fast) var(--ease);
}
.burger span::before { translate: 0 -5px; }
.burger span::after  { translate: 0 5px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { translate: 0 0; rotate: 45deg; }
.burger[aria-expanded="true"] span::after  { translate: 0 0; rotate: -45deg; }

.ftr { border-top: 1px solid var(--line); padding-block: clamp(48px, 6vw, 84px) 2.5rem; }
.ftr__top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  padding-bottom: clamp(36px, 4.5vw, 64px);
}
.ftr__brand { display: flex; flex-direction: column; gap: 1.1rem; max-width: 34ch; }
.ftr__mark { width: 33px; height: 34px; }
.ftr__blurb { font-size: var(--t--1); color: var(--ink-3); line-height: 1.7; }
.ftr__col h3 {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--tr-3);
  color: var(--ink);
  margin-bottom: 1.35rem;
}
.ftr__col li + li { margin-top: 0.7rem; }
.ftr__col a {
  font-size: var(--t--1);
  color: var(--ink-3);
  transition: color var(--dur-fast) var(--ease);
}
.ftr__col a:hover { color: var(--ink); }
.ftr__bot {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--tr-2);
  text-transform: uppercase;
  color: var(--ink-3);
}

/* =========================================================================
   MOTION
   ========================================================================= */

.reveal {
  opacity: 0;
  translate: 0 18px;
  transition: opacity 0.9s var(--ease), translate 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.is-in { opacity: 1; translate: 0 0; }

/* No JS: everything is simply visible. */
html:not(.js) .reveal { opacity: 1; translate: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; translate: none !important; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* =========================================================================
   RESPONSIVE CHROME
   ========================================================================= */

@media (max-width: 960px) {
  .ftr__top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.75rem var(--gap); }
  .ftr__brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .burger { display: grid; }
  .hdr__cta > .btn { display: none; }

  .nav {
    position: fixed;
    inset: 72px 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(7, 7, 7, 0.97);
    backdrop-filter: blur(16px);
    border-block: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 2rem;
    max-height: calc(100svh - 72px);
    overflow-y: auto;
    overscroll-behavior: contain;
    translate: 0 -8px;
    opacity: 0;
    visibility: hidden;
    /* visibility flips instantly on open and only after the fade on close.
       Transitioning it like the other two would leave the drawer computed
       `hidden` for the whole opening frame, which silently swallows the
       focus move in app.js and keeps the links out of the tab order. */
    transition: opacity var(--dur-fast) var(--ease),
                translate var(--dur-fast) var(--ease),
                visibility 0s linear var(--dur-fast);
  }
  .nav.is-open {
    opacity: 1;
    visibility: visible;
    translate: 0 0;
    transition: opacity var(--dur-fast) var(--ease),
                translate var(--dur-fast) var(--ease),
                visibility 0s linear;
  }
  .nav__link {
    padding-block: 1.15rem;
    border-bottom: 1px solid var(--line);
    font-size: var(--t-mono-l);
  }
  .nav__link::after { display: none; }
  .nav > .btn { display: inline-flex; margin-top: 1.5rem; justify-content: center; }
}

@media (max-width: 560px) {
  .ftr__bot { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

/* Accordion panel — app.js animates height; with JS off it just opens. */
[data-panel] { overflow: hidden; transition: height 0.38s var(--ease); }
