/* ============================================================
   Streamline Labs — streamlinelabs.ca (V2)
   Engineering-led static site. Dark base / safety-orange accent.
   Type: Chakra Petch (display) · IBM Plex Sans (body) · IBM Plex Mono (utility)

   V2 adds two product-line treatments on one fixed shell:
   .line-hardware (warm, photographic, solid rules — the V1 look) and
   .line-software (cool desaturated steel tint, terminal texture, dashed rules).
   The shell — header, nav, footer, cursor, grid, type, orange CTA — is locked
   and identical on every page. Line contrast comes only from the --tint-*
   custom properties and texture rules scoped under body.line-software.
   ============================================================ */

:root{
  --ink:        #0D0E10;
  --panel:      #141619;
  --panel-2:    #191C20;
  --line:       #26292D;
  --line-soft:  #1B1E21;
  --bone:       #E9E7E2;
  --steel:      #8B929B;
  --accent:     #FF6B2C;
  --accent-dim: rgba(255,107,44,.13);

  /* Line tint layer — hardware default equals the V1 base so hardware pages
     render exactly as V1 did. Software pages override these only. */
  --tint-panel:   var(--panel);
  --tint-panel-2: var(--panel-2);
  --tint-line:    var(--line);
  --tint-dim:     var(--accent-dim);
  --rule-style:   solid;

  --font-display: "Chakra Petch", sans-serif;
  --font-body:    "IBM Plex Sans", sans-serif;
  --font-mono:    "IBM Plex Mono", monospace;

  --max: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(.22,.61,.2,1); /* controlled, no bounce */
}

/* Cool, low-saturation steel/cyan surface tone. Not an accent — orange remains
   the only CTA colour; these are supporting surfaces per the design brief. */
body.line-software{
  --tint-panel:   #12181B;
  --tint-panel-2: #161F23;
  --tint-line:    #253238;
  --tint-dim:     rgba(122,168,182,.10);
  --rule-style:   dashed;
}

*{ margin:0; padding:0; box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  background:var(--ink);
  color:var(--bone);
  font-family:var(--font-body);
  font-size:17px;
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
}

/* Blueprint grid — faint, fixed. Locked: identical geometry and opacity on
   every page, both lines. */
body::before{
  content:"";
  position:fixed; inset:0; z-index:-1;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size:72px 72px;
  opacity:.5;
}

::selection{ background:var(--accent); color:var(--ink); }

img{ display:block; max-width:100%; }
a{ color:inherit; }

/* ---------- type scale ---------- */
h1,h2,h3{ font-family:var(--font-display); font-weight:600; line-height:1.08; letter-spacing:.005em; }
h1{ font-size:clamp(2.4rem, 6vw, 4.4rem); text-transform:uppercase; }
h2{ font-size:clamp(1.6rem, 3.4vw, 2.5rem); text-transform:uppercase; }
h3{ font-size:1.15rem; text-transform:uppercase; letter-spacing:.04em; }

.eyebrow{
  font-family:var(--font-mono);
  font-size:.72rem;
  letter-spacing:.22em;
  text-transform:uppercase;
  color:var(--accent);
  display:flex; align-items:center; gap:12px;
  margin-bottom:18px;
}
.eyebrow::before{ content:""; width:28px; height:1px; background:var(--accent); }

/* Terminal cursor-blink after eyebrows — software-line texture only */
body.line-software .eyebrow::after{
  content:"▍"; color:var(--accent); animation:sl-blink 1.1s steps(1) infinite;
}
@keyframes sl-blink{ 50%{ opacity:0; } }

.lede{ color:var(--steel); font-size:clamp(1.02rem, 1.6vw, 1.2rem); max-width:60ch; }
.muted{ color:var(--steel); }
.mono{ font-family:var(--font-mono); }

/* ---------- layout ---------- */
.wrap{ max-width:var(--max); margin:0 auto; padding:0 var(--gutter); }
section{ padding:clamp(64px, 9vw, 120px) 0; border-bottom:1px var(--rule-style) var(--line-soft); }
section:last-of-type{ border-bottom:none; }

.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:clamp(28px,4vw,64px); align-items:center; }
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
@media (max-width:860px){
  .grid-2, .grid-3{ grid-template-columns:1fr; }
}

/* ---------- header (locked shell) ---------- */
header{
  position:sticky; top:0; z-index:50;
  background:rgba(13,14,16,.86);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
}
.nav{
  max-width:var(--max); margin:0 auto; padding:0 var(--gutter);
  display:flex; align-items:center; justify-content:space-between;
  height:68px;
}
.brand{ display:flex; align-items:center; gap:12px; text-decoration:none; }
.brand img{ height:34px; width:34px; }
.brand span{
  font-family:var(--font-display); font-weight:600;
  letter-spacing:.06em; text-transform:uppercase; font-size:.95rem;
}
nav ul{ display:flex; gap:8px; list-style:none; }
nav a{
  font-family:var(--font-mono); font-size:.74rem; letter-spacing:.14em;
  text-transform:uppercase; text-decoration:none; color:var(--steel);
  padding:8px 12px; border:1px solid transparent;
  transition:color .2s var(--ease), border-color .2s var(--ease);
}
nav a:hover, nav a:focus-visible{ color:var(--bone); border-color:var(--line); }
nav a[aria-current="page"]{ color:var(--accent); border-color:var(--accent); }
.nav-toggle{ display:none; background:none; border:1px solid var(--line); color:var(--bone);
  font-family:var(--font-mono); font-size:.72rem; letter-spacing:.14em; padding:8px 12px; cursor:pointer; }
@media (max-width:760px){
  .nav-toggle{ display:block; }
  header nav{ position:absolute; top:68px; left:0; right:0; background:var(--ink);
       border-bottom:1px solid var(--line); display:none; }
  header nav.open{ display:block; }
  header nav ul{ flex-direction:column; gap:0; padding:8px var(--gutter) 16px; }
  header nav a{ display:block; padding:12px; }
}

/* ---------- dividers ---------- */
/* Hardware signature: dovetail joint profile */
.dovetail{
  height:18px;
  background-repeat:repeat-x;
  background-size:96px 18px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='18' viewBox='0 0 96 18'%3E%3Cpath d='M0 4 H30 L38 14 H58 L66 4 H96' fill='none' stroke='%2326292D' stroke-width='2'/%3E%3C/svg%3E");
  margin:0;
}
.dovetail.accent{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='18' viewBox='0 0 96 18'%3E%3Cpath d='M0 4 H30 L38 14 H58 L66 4 H96' fill='none' stroke='%23FF6B2C' stroke-width='2'/%3E%3C/svg%3E");
  opacity:.85;
}
/* Software signature: ruler-tick rule, mono-flavoured */
.tickrule{
  height:18px;
  background-repeat:repeat-x;
  background-size:96px 18px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='18' viewBox='0 0 96 18'%3E%3Cpath d='M0 9 H96 M12 9 V14 M36 9 V14 M60 9 V14 M84 9 V14 M24 9 V4 M48 9 V4 M72 9 V4' fill='none' stroke='%23253238' stroke-width='2'/%3E%3C/svg%3E");
  margin:0;
}
.tickrule.accent{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='18' viewBox='0 0 96 18'%3E%3Cpath d='M0 9 H96 M12 9 V14 M36 9 V14 M60 9 V14 M84 9 V14 M24 9 V4 M48 9 V4 M72 9 V4' fill='none' stroke='%23FF6B2C' stroke-width='2'/%3E%3C/svg%3E");
  opacity:.85;
}

/* ---------- buttons (locked component) ---------- */
.btn{
  display:inline-flex; align-items:center; gap:10px;
  font-family:var(--font-mono); font-size:.78rem;
  letter-spacing:.16em; text-transform:uppercase; text-decoration:none;
  padding:14px 26px; border:1px solid var(--accent); color:var(--accent);
  background:transparent; cursor:pointer;
  transition:background .2s var(--ease), color .2s var(--ease);
}
.btn:hover, .btn:focus-visible{ background:var(--accent); color:var(--ink); }
.btn.solid{ background:var(--accent); color:var(--ink); }
.btn.solid:hover{ background:transparent; color:var(--accent); }
.btn.ghost{ border-color:var(--line); color:var(--bone); }
.btn.ghost:hover{ border-color:var(--bone); background:var(--bone); color:var(--ink); }
.btn::after{ content:"→"; font-family:var(--font-body); }
.btn.no-arrow::after{ content:none; }

/* ---------- status badges ---------- */
.badge{
  display:inline-block;
  font-family:var(--font-mono); font-size:.66rem; letter-spacing:.18em;
  text-transform:uppercase; padding:5px 10px; border:1px solid var(--steel);
  color:var(--steel);
}
.badge.available{ border-color:var(--accent); color:var(--accent); }

/* ---------- figure plates (engineering-drawing framing) ---------- */
.plate{
  border:1px var(--rule-style) var(--tint-line);
  background:var(--tint-panel);
  position:relative;
}
.plate img{ width:100%; height:100%; object-fit:cover; }
.plate .tag{
  position:absolute; left:0; bottom:0; z-index:1;
  font-family:var(--font-mono); font-size:.68rem; letter-spacing:.14em;
  text-transform:uppercase; color:var(--steel);
  background:var(--ink); border:1px solid var(--tint-line); border-left:none; border-bottom:none;
  padding:6px 12px;
}
.plate .tag b{ color:var(--accent); font-weight:500; }
/* corner ticks */
.plate::before, .plate::after{
  content:""; position:absolute; width:14px; height:14px; pointer-events:none; z-index:1;
}
.plate::before{ top:-1px; left:-1px; border-top:2px solid var(--accent); border-left:2px solid var(--accent); }
.plate::after{ bottom:-1px; right:-1px; border-bottom:2px solid var(--accent); border-right:2px solid var(--accent); }

/* ---------- cards ---------- */
.card{
  border:1px var(--rule-style) var(--tint-line); background:var(--tint-panel);
  padding:28px;
  transition:border-color .25s var(--ease), transform .25s var(--ease);
}
.card:hover{ border-color:var(--steel); }
.card h3{ margin:14px 0 10px; }
.card .num{
  font-family:var(--font-mono); font-size:.72rem; color:var(--accent); letter-spacing:.18em;
}
.card p{ color:var(--steel); font-size:.95rem; }

/* product card (hub) */
a.product-card{ text-decoration:none; display:block; }
a.product-card .plate{ aspect-ratio:4/3; overflow:hidden; }
a.product-card img{ transition:transform .5s var(--ease); }
a.product-card:hover img{ transform:scale(1.03); }
a.product-card .pc-body{ border:1px var(--rule-style) var(--tint-line); border-top:none; background:var(--tint-panel); padding:20px 24px; }
a.product-card .pc-body h3{ display:flex; justify-content:space-between; align-items:center; gap:12px; }
a.product-card .pc-body h3 span{ color:var(--accent); }
a.product-card .pc-body .badge{ margin-bottom:10px; }

/* "more coming soon" slot */
.slot{
  border:1px dashed var(--tint-line); min-height:220px;
  display:flex; flex-direction:column; gap:16px; align-items:center; justify-content:center;
  font-family:var(--font-mono); font-size:.72rem; letter-spacing:.18em;
  text-transform:uppercase; color:var(--steel); text-align:center; padding:24px;
}

/* ---------- software-line texture: scanlines on panels ---------- */
body.line-software .plate,
body.line-software .card,
body.line-software .frame{
  background-image:repeating-linear-gradient(
    0deg, rgba(233,231,226,.016) 0 1px, transparent 1px 3px);
}

/* ---------- diagram frames (software imagery — no photography) ---------- */
.frame{
  border:1px var(--rule-style) var(--tint-line); background:var(--tint-panel);
  font-family:var(--font-mono); font-size:.8rem; color:var(--bone);
}
.frame .frame-bar{
  display:flex; align-items:center; gap:8px;
  border-bottom:1px var(--rule-style) var(--tint-line);
  padding:9px 14px; color:var(--steel); font-size:.68rem;
  letter-spacing:.14em; text-transform:uppercase;
}
.frame .frame-bar::before{
  content:""; width:8px; height:8px; border:1px solid var(--steel);
}
.frame .frame-body{ padding:18px; display:grid; gap:10px; }
.frame .k{ color:var(--steel); }
.frame .v{ color:var(--bone); }
.frame .hl{ color:var(--accent); }

/* ---------- spec table ---------- */
.spec{
  border:1px var(--rule-style) var(--tint-line); background:var(--tint-panel);
}
.spec-row{
  display:grid; grid-template-columns:220px 1fr; gap:16px;
  padding:16px 22px; border-bottom:1px var(--rule-style) var(--line-soft);
}
.spec-row:last-child{ border-bottom:none; }
.spec-row dt{
  font-family:var(--font-mono); font-size:.72rem; letter-spacing:.16em;
  text-transform:uppercase; color:var(--accent); padding-top:3px;
}
.spec-row dd{ color:var(--bone); font-size:.98rem; }
.spec-row dd .muted{ font-size:.9rem; }
.spec-row dd.pending{
  font-family:var(--font-mono); font-size:.8rem; letter-spacing:.12em;
  text-transform:uppercase; color:var(--steel);
}
@media (max-width:600px){ .spec-row{ grid-template-columns:1fr; gap:4px; } }

.notice{
  border:1px solid var(--accent); background:var(--tint-dim);
  padding:18px 22px; display:flex; gap:14px; align-items:flex-start;
}
.notice .mono{ color:var(--accent); font-size:.72rem; letter-spacing:.16em; white-space:nowrap; padding-top:3px; }
.notice p{ font-size:.95rem; }

/* ---------- forms (locked component) ---------- */
form.inline-capture{ display:flex; gap:10px; flex-wrap:wrap; max-width:520px; }
form.inline-capture input[type=email]{
  flex:1 1 260px; background:var(--panel); border:1px solid var(--line);
  color:var(--bone); font-family:var(--font-mono); font-size:.85rem;
  padding:14px 16px; outline:none;
}
form.inline-capture input[type=email]:focus{ border-color:var(--accent); }
.form-note{ font-family:var(--font-mono); font-size:.72rem; color:var(--steel); margin-top:10px; }
.form-note.ok{ color:var(--accent); }
.form-note.err{ color:#E4574B; }

.contact-form{ display:grid; gap:16px; max-width:640px; }
.contact-form label{
  font-family:var(--font-mono); font-size:.72rem; letter-spacing:.16em;
  text-transform:uppercase; color:var(--steel); display:block; margin-bottom:6px;
}
.contact-form input, .contact-form textarea, .contact-form select{
  width:100%; background:var(--panel); border:1px solid var(--line);
  color:var(--bone); font-family:var(--font-body); font-size:.95rem;
  padding:13px 15px; outline:none;
}
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus{ border-color:var(--accent); }
.contact-form input[aria-invalid="true"], .contact-form textarea[aria-invalid="true"]{ border-color:#E4574B; }
.contact-form textarea{ min-height:160px; resize:vertical; }
.field-err{ font-family:var(--font-mono); font-size:.7rem; color:#E4574B; margin-top:6px; display:none; }
.field-err.show{ display:block; }

/* ---------- hero ---------- */
.hero{ padding:clamp(72px,10vw,140px) 0; }
.hero .grid-2{ align-items:center; }
.hero-cta{ display:flex; gap:14px; margin-top:34px; flex-wrap:wrap; }

/* Home hero — full-bleed generative canvas behind the copy */
.hero-home{
  position:relative;
  min-height:min(78vh, 720px);
  display:flex; align-items:center;
  overflow:hidden;
  border-bottom:1px solid var(--line-soft);
}
.hero-home canvas{
  position:absolute; inset:0; width:100%; height:100%; display:block;
}
.hero-home .wrap{ position:relative; z-index:1; width:100%; }
.hero-home .lede{ max-width:52ch; }

/* ---------- 3d viewer ---------- */
/* Space is reserved with aspect-ratio so the model never shifts layout.
   The mono loading label sits underneath until JS adds .is-ready. */
.viewer-shell{
  border:1px var(--rule-style) var(--tint-line); background:var(--tint-panel);
  position:relative;
  aspect-ratio:4/3;
}
@media (min-width:861px){ .viewer-shell{ aspect-ratio:16/10; } }
.viewer-shell::before{
  content:"Loading model …";
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-mono); font-size:.72rem; letter-spacing:.22em;
  text-transform:uppercase; color:var(--steel);
}
.viewer-shell.is-ready::before{ content:none; }
model-viewer{
  position:absolute; inset:0; width:100%; height:100%; display:block;
  background:radial-gradient(ellipse at center, #1A1D21 0%, var(--tint-panel) 70%);
  --poster-color:transparent;
}
.viewer-hint{
  position:absolute; right:0; bottom:0; z-index:1;
  font-family:var(--font-mono); font-size:.68rem; letter-spacing:.14em;
  text-transform:uppercase; color:var(--steel);
  background:var(--ink); border:1px solid var(--tint-line); border-right:none; border-bottom:none;
  padding:6px 12px;
}

/* Scroll-scrubbed assembly section: on desktop GSAP pins the viewer in place
   while scroll drives the clip, so the page holds still until the animation
   completes. On small screens viewer.js falls back to play-once instead. */
.assembly-copy{ margin-bottom:34px; }

/* ---------- footer (locked shell) ---------- */
footer{ border-top:1px solid var(--line); padding:48px 0 40px; }
.foot{
  display:flex; justify-content:space-between; align-items:center; gap:24px; flex-wrap:wrap;
}
.foot .mono{ font-size:.72rem; color:var(--steel); letter-spacing:.12em; }
.foot nav ul{ gap:4px; }

/* ---------- scroll reveal ---------- */
.reveal{ opacity:0; transform:translateY(26px); transition:opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in{ opacity:1; transform:none; }
.reveal.d1{ transition-delay:.08s; } .reveal.d2{ transition-delay:.16s; } .reveal.d3{ transition-delay:.24s; }

/* ---------- custom cursor (CAD crosshair — locked shell) ---------- */
@media (hover:hover) and (pointer:fine){
  body.cursor-on, body.cursor-on a, body.cursor-on button{ cursor:none; }
  #cursor{
    position:fixed; z-index:999; pointer-events:none;
    width:34px; height:34px; margin:-17px 0 0 -17px;
    transition:transform .15s var(--ease), opacity .2s;
  }
  #cursor::before, #cursor::after{
    content:""; position:absolute; background:var(--accent);
  }
  #cursor::before{ left:50%; top:0; width:1px; height:100%; transform:translateX(-.5px); }
  #cursor::after{ top:50%; left:0; height:1px; width:100%; transform:translateY(-.5px); }
  #cursor .ring{
    position:absolute; inset:8px; border:1px solid var(--accent);
    opacity:0; transform:scale(.6); transition:opacity .18s, transform .18s var(--ease);
  }
  #cursor.hovering{ transform:rotate(45deg); }
  #cursor.hovering .ring{ opacity:1; transform:scale(1); }
}
#cursor{ display:none; }
body.cursor-on #cursor{ display:block; }

/* ---------- 404 ---------- */
.err-code{
  font-family:var(--font-mono); font-size:clamp(4rem,14vw,9rem);
  color:var(--accent); line-height:1; letter-spacing:.04em;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion:reduce){
  html{ scroll-behavior:auto; }
  .reveal{ opacity:1; transform:none; transition:none; }
  *{ animation:none !important; transition-duration:.01ms !important; }
  body.line-software .eyebrow::after{ animation:none; opacity:1; }
}

/* focus visibility */
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
