/* ============================================================
   DentalTechLab — dentaltechlab.ca · v6 "one system"
   ------------------------------------------------------------
   THE SYSTEM (everything on this site obeys these rules):
   · Palette: slate #14171f/#353b48 · porcelain #eef1f6 · steel #c8d2df
   · Chrome gradient appears ONLY on: h1/h2 <em>, active process
     number, counter values. Nowhere else.
   · Type: Barlow Condensed (display, uppercase) + Inter (body)
   · Every photo lives in a .ph frame: same duotone, same hairline,
     same vignette — mixed photography reads as one shoot
   · One easing for everything: --ez
   · Sections share one header component (.shead) and one index
     numbering language (01–05)
   ============================================================ */

:root {
  --bg: #14171f;
  --bg-2: #1a1e29;
  --slate: #353b48;            /* logo background colour */
  --ink: #eef1f6;              /* porcelain white */
  --dim: #9aa3b1;
  --faint: #5b6371;
  --steel: #c8d2df;            /* chrome-ring silver */
  --steel-dim: rgba(200, 210, 223, 0.5);
  --chrome: linear-gradient(115deg, #f4f7fa 0%, #aeb9c6 38%, #e8edf3 55%, #8f9aa8 100%);
  --hairline: rgba(238, 241, 246, 0.12);
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sans: "Inter", system-ui, sans-serif;
  --ez: cubic-bezier(0.16, 1, 0.3, 1);
  --gut: clamp(20px, 5vw, 64px);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scrollbar-color: var(--slate) var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16.5px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
p a { color: var(--steel); text-underline-offset: 4px; }
p a:hover { text-decoration: underline; }
::selection { background: var(--slate); color: #fff; }

.container {
  width: min(1320px, 100% - 2 * var(--gut));
  margin-inline: auto;
}
.section { padding-block: clamp(110px, 16vh, 180px); }
section[id] { scroll-margin-top: 86px; }   /* anchor jumps clear the fixed nav */

/* ---------- accessibility ---------- */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--cond);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: top 0.3s var(--ez);
}
.skip-link:focus { top: 16px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 3px;
}

/* ---------- type system ---------- */
h1, h2, h3 {
  font-family: var(--cond);
  text-transform: uppercase;
  margin: 0;
}
h1 {
  font-size: clamp(3.4rem, 9vw, 8.2rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: 0.005em;
}
h2 {
  font-size: clamp(2.6rem, 5.4vw, 4.8rem);
  font-weight: 700;
  line-height: 0.95;
  margin-bottom: clamp(40px, 7vh, 72px);
}
h3 { font-size: 1.5rem; font-weight: 600; letter-spacing: 0.02em; }
p  { margin: 0 0 1em; }

/* chrome accent — restricted use (see system rules) */
h1 em, h2 em {
  font-style: normal;
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* the chrome catches light — one slow sheen, shared by every chrome use */
h1 em, h2 em, .num strong, .proc.on .proc-num {
  background-size: 220% 100%;
  animation: sheen 6s ease-in-out infinite alternate;
}
@keyframes sheen {
  from { background-position: 0% 0; }
  to   { background-position: 100% 0; }
}

.eyebrow {
  font-family: var(--cond);
  font-size: 0.84rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--steel-dim);
  margin-bottom: 28px;
}

/* one section-header component, everywhere — hairline wipes in from the left */
.shead {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding-top: 22px;
  margin-bottom: 30px;
}
.shead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--hairline);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.3s var(--ez) 0.1s;
}
.shead.visible::before { transform: scaleX(1); }
.shead .idx {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1rem;
  color: var(--steel);
}
.shead .lbl {
  font-family: var(--cond);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--dim);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--cond);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 14px 28px;
  border: 1px solid rgba(238, 241, 246, 0.3);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.4s var(--ez), background 0.4s var(--ez), color 0.4s var(--ez);
}
.btn:hover { border-color: var(--ink); }
.btn.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.solid:hover { background: var(--steel); border-color: var(--steel); }

/* ---------- THE photo component ---------- */
/* every image on the site goes through this frame: grayscale base,
   slate colorize, vignette, hairline — one shoot, one mood */
.ph {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bg-2);
}
.ph img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.92) brightness(0.84) contrast(1.1);
}
.ph::before {                      /* slate colorize over the grayscale */
  content: "";
  position: absolute;
  inset: 0;
  background: #43506a;
  mix-blend-mode: color;
  pointer-events: none;
  z-index: 1;
}
.ph::after {                       /* vignette + hairline */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 23, 31, 0) 55%, rgba(20, 23, 31, 0.45));
  box-shadow: inset 0 0 0 1px var(--hairline);
  pointer-events: none;
  z-index: 2;
}
/* .case = clinical/case photography: keeps the frame language but only a
   gentle cool grade — full slate duotone makes tissue look lifeless */
.ph.case img { filter: grayscale(0.3) brightness(0.94) contrast(1.04) saturate(0.85); }
.ph.case::before { opacity: 0.3; }

/* .deep = in-frame scroll depth: image is taller than its frame,
   JS slides it vertically. .deepx = wider than its frame, JS slides it
   horizontally (work gallery). Same coefficient everywhere. */
.ph.deep img { height: 118%; will-change: transform; }
.ph.deepx img { width: 114%; height: 100%; max-width: none; will-change: transform; }

/* photo entrance: frame wipes open, image settles from a slight zoom.
   `scale` is a separate property, so the JS translate never clobbers it */
.reveal .ph {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.25s var(--ez);
}
.reveal.visible .ph { clip-path: inset(0 0 0% 0); }
.reveal .ph img { scale: 1.12; transition: scale 1.6s var(--ez); }
.reveal.visible .ph img { scale: 1; }

figure { margin: 0; }
figure figcaption {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--dim);
}
figure figcaption .idx {
  font-family: var(--cond);
  font-weight: 600;
  color: var(--steel);
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  transition: background 0.5s var(--ez), border-color 0.5s var(--ez),
              transform 0.55s var(--ez);
  border-bottom: 1px solid transparent;
}
.nav.hide { transform: translateY(-100%); }
.nav.scrolled {
  background: rgba(20, 23, 31, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--hairline);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 auto; position: relative; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark svg { display: none; width: 100%; height: 100%; }
.brand-mark.fallback svg { display: block; }
.brand-word {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nav-links { display: flex; gap: 30px; }
.nav-links a {
  font-family: var(--cond);
  font-size: 0.86rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--dim);
  transition: color 0.3s var(--ez);
}
.nav-links a:hover { color: var(--ink); }
.nav-cta { padding: 11px 22px; }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 7fr 4fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
}
/* masked line reveal — the hero's signature, extended to every heading */
.lines .line { display: block; overflow: hidden; }
.lines .line-inner {
  display: block;
  transform: translateY(115%);
  transition: transform 1.15s var(--ez);
}
.lines.visible .line:nth-child(1) .line-inner { transition-delay: 0.05s; }
.lines.visible .line:nth-child(2) .line-inner { transition-delay: 0.14s; }
.lines.visible .line:nth-child(3) .line-inner { transition-delay: 0.23s; }
.lines.visible .line-inner { transform: translateY(0); }
h2.lines.reveal { opacity: 1; transform: none; }   /* lines do the moving */

.hero-copy .eyebrow, .hero-copy .hero-sub {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s var(--ez), transform 0.9s var(--ez);
}
.hero-copy.visible .eyebrow { opacity: 1; transform: none; transition-delay: 0.1s; }
.hero-copy.visible .hero-sub { opacity: 1; transform: none; transition-delay: 0.55s; }
.hero-sub { margin-top: 40px; max-width: 46ch; }
.hero-sub p { color: var(--dim); }
.hero-cta { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-photo .ph { aspect-ratio: 4 / 5; }
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 1px;
  height: 52px;
  background: var(--hairline);
  overflow: hidden;
}
.scroll-cue span {
  position: absolute;
  left: 0;
  top: -40%;
  width: 100%;
  height: 40%;
  background: var(--steel);
  animation: cue 2.4s var(--ez) infinite;
}
@keyframes cue { to { top: 110%; } }

/* ---------- marquee (scroll-coupled) ---------- */
.marquee {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding-block: clamp(28px, 6vh, 64px);
  overflow: hidden;
}
.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.marquee-track span {
  font-family: var(--cond);
  font-weight: 700;
  font-size: clamp(3.4rem, 8.5vw, 7.6rem);
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(200, 210, 223, 0.38);
}

/* ---------- 01 · work (horizontal gallery) ---------- */
.work { height: 340vh; }
.work-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.work-track {
  display: flex;
  align-items: center;
  gap: clamp(28px, 4vw, 72px);
  padding-inline: max(var(--gut), calc((100vw - 1320px) / 2));
  will-change: transform;
}
.work-lead { flex: 0 0 auto; width: min(460px, 78vw); }
.work-lead h2 { margin-bottom: 24px; }
.work-lead p { color: var(--dim); max-width: 40ch; }
.work-hint {
  font-family: var(--cond);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--steel-dim);
  margin-top: 36px;
}
.work-hint::after {
  content: "→";
  display: inline-block;
  margin-left: 10px;
  animation: nudge 2s var(--ez) infinite;
}
@keyframes nudge { 50% { transform: translateX(8px); } }
.work-count {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.2em;
  color: var(--dim);
  margin-top: 14px;
}
.work-count span { color: var(--steel); }
.work-card { flex: 0 0 auto; width: clamp(300px, 32vw, 440px); }
.work-card .ph { aspect-ratio: 4 / 5; }

/* ---------- 02 · services ---------- */
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc {
  display: grid;
  grid-template-columns: clamp(64px, 8vw, 110px) 1fr;
  gap: 20px;
  align-items: start;
  padding-block: clamp(30px, 5vh, 46px);
  border-bottom: 1px solid var(--hairline);
  transition: background 0.5s var(--ez), padding-left 0.5s var(--ez);
}
.svc:first-child { border-top: 1px solid var(--hairline); }
.svc:hover { background: rgba(53, 59, 72, 0.22); padding-left: 14px; }
.svc-idx {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--steel-dim);
  padding-top: 6px;
}
.svc-body h3 { margin-bottom: 10px; }
.svc-body p { color: var(--dim); max-width: 60ch; margin: 0; }

/* ---------- 03 · process ---------- */
.proc-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.proc {
  display: grid;
  grid-template-columns: clamp(90px, 13vw, 180px) 1fr;
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding-block: clamp(36px, 7vh, 70px);
  border-bottom: 1px solid var(--hairline);
  opacity: 0.34;
  transition: opacity 0.6s var(--ez);
}
.proc:first-child { border-top: 1px solid var(--hairline); }
.proc-num {
  font-family: var(--cond);
  font-weight: 700;
  font-size: clamp(4.4rem, 9vw, 8.6rem);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px var(--steel-dim);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.7s var(--ez);
}
.proc.on { opacity: 1; }
.proc.on .proc-num { transform: scale(1); }
.proc.on .proc-num {
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px transparent;
}
.proc-body h3 { margin-bottom: 10px; }
.proc-body p { color: var(--dim); max-width: 58ch; margin: 0; }

/* ---------- 04 · lab ---------- */
.lab-grid {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(48px, 7vw, 110px);
  align-items: center;
}
.lab-photo .ph { aspect-ratio: 3 / 4; }
.lab-copy blockquote {
  margin: 0 0 48px;
  border-left: 1px solid var(--steel-dim);
  padding-left: 26px;
}
.lab-copy blockquote p {
  font-size: 1.32rem;
  line-height: 1.5;
  color: var(--ink);
}
.lab-copy cite {
  font-style: normal;
  font-size: 0.86rem;
  color: var(--dim);
}
.num-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 34px 28px;
  margin: 0;
}
.num strong {
  display: block;
  font-family: var(--cond);
  font-weight: 700;
  font-size: clamp(2.5rem, 4.5vw, 3.9rem);
  line-height: 1;
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.num dd {
  margin: 8px 0 0;
  font-family: var(--cond);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--dim);
}

/* ---------- 05 · contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(48px, 7vw, 110px);
  align-items: start;
}
.connect { list-style: none; margin: 0; padding: 0; }
.connect li {
  border-top: 1px solid var(--hairline);
  padding-block: 26px;
}
.connect h3 { font-size: 1.2rem; margin-bottom: 8px; }
.connect p { color: var(--dim); margin: 0; max-width: 44ch; }
.connect strong { color: var(--ink); font-weight: 500; }
.connect .vanity { font-size: 0.84rem; color: var(--faint); white-space: nowrap; }

.case-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px 28px;
}
.ff { display: grid; gap: 8px; }
.ff-wide { grid-column: 1 / -1; }
.ff label {
  font-family: var(--cond);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--dim);
}
.ff input, .ff textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  padding: 8px 0 12px;
  border-radius: 0;
  resize: vertical;
  transition: border-color 0.4s var(--ez);
}
.ff input:focus, .ff textarea:focus {
  outline: none;
  border-bottom-color: var(--steel);
}
.case-form .btn { grid-column: 1 / -1; justify-self: start; margin-top: 6px; }
.form-note { grid-column: 1 / -1; font-size: 0.84rem; color: var(--steel); margin: 0; }

/* ---------- legal pages (privacy / sms-terms) ---------- */
.legal { max-width: 780px; }
.legal h2 { font-size: 1.6rem; margin: 44px 0 14px; }
.legal h2:first-of-type { margin-top: 0; }
.legal p, .legal li { color: #c3cad6; font-size: 0.98rem; }
.legal li { margin-bottom: 8px; }
.legal .updated {
  font-family: var(--cond);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel-dim);
  margin-bottom: 34px;
}
.legal .callout {
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--steel);
  padding: 18px 22px;
  margin: 22px 0;
}
.legal .callout p { color: var(--ink); }
.legal a { color: var(--steel); text-decoration: underline; text-underline-offset: 4px; }

/* SMS opt-in checkbox */
.ff-check { display: flex; gap: 10px; align-items: flex-start; }
.ff-check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--steel); flex: 0 0 auto; }
.ff-check span { font-size: 0.84rem; color: var(--dim); }
.ff-check a { color: var(--steel); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--hairline);
  padding-block: 52px 60px;
}
.footer-grid { display: grid; gap: 18px; }
.footer-meta { color: var(--dim); font-size: 0.92rem; margin: 0; }
.footer-meta a { color: var(--steel); }
.footer-fine { color: var(--faint); font-size: 0.78rem; margin: 0; }

/* ---------- reveal system (one motion language) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ez), transform 0.9s var(--ez);
}
.reveal.visible { opacity: 1; transform: none; }
.hero-copy.reveal { transform: none; }          /* lines handle their own motion */
[data-hspeed], [data-depth] { will-change: transform; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero { padding-top: 120px; }
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .hero-photo { max-width: 420px; }
  .scroll-cue { display: none; }

  /* horizontal gallery becomes native swipe */
  .work { height: auto; padding-block: clamp(80px, 12vh, 120px); }
  .work-sticky { position: static; height: auto; overflow: visible; display: block; }
  .work-track {
    overflow-x: auto;
    padding-block: 8px 24px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    transform: none !important;
  }
  .work-lead, .work-card { scroll-snap-align: start; }
  .work-card { width: min(78vw, 360px); }

  .proc { grid-template-columns: clamp(64px, 16vw, 90px) 1fr; align-items: start; }
  .proc-num { font-size: clamp(3rem, 12vw, 4.4rem); text-align: left; }
  .lab-grid, .contact-grid { grid-template-columns: 1fr; }
  .lab-photo { max-width: 460px; }
  .case-form { grid-template-columns: 1fr; }
  .num-row { gap: 26px 20px; }
}

/* ---------- ?static — final-state rendering for captures ---------- */
.static .reveal { opacity: 1; transform: none; transition: none; }
.static .line-inner { transform: none; transition: none; }
.static .reveal .ph { clip-path: none; transition: none; }
.static .reveal .ph img { scale: none; transition: none; }
.static .shead::before { transform: scaleX(1); transition: none; }
.static .hero-copy .eyebrow, .static .hero-copy .hero-sub { opacity: 1; transform: none; transition: none; }
.static h1 em, .static h2 em, .static .num strong, .static .proc-num { animation: none; }
.static .hero { min-height: 0; padding: 150px 0 90px; }
.static .scroll-cue, .static .work-hint::after { display: none; }
.static .marquee-track { transform: none !important; }
.static .work { height: auto; padding-block: 100px; }
.static .work-sticky { position: static; height: auto; overflow: visible; display: block; }
.static .work-track { flex-wrap: wrap; transform: none !important; }
.static .work-card { transform: none !important; }
.static .proc { opacity: 1; }
.static .proc-num {
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px transparent;
  transform: none;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .line-inner { opacity: 1; transform: none; transition: none; }
  .reveal .ph { clip-path: none; transition: none; }
  .reveal .ph img { scale: none; transition: none; }
  .shead::before { transform: scaleX(1); transition: none; }
  .hero-copy .eyebrow, .hero-copy .hero-sub { opacity: 1; transform: none; transition: none; }
  h1 em, h2 em, .num strong, .proc.on .proc-num { animation: none; }
  .scroll-cue span, .work-hint::after { animation: none; }
  .proc { opacity: 1; }
  .proc-num { transform: none; transition: none; }
  .nav.hide { transform: none; }
}
