/* ============================================================
   EMISSC — Endoscopic & Minimally Invasive Spine Surgical
   Consultants, PLLC — Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root{
  --ink: #0B1524;
  --ink-soft: #101C30;
  --ink-line: rgba(245,241,232,0.14);

  --paper: #F3EFE4;
  --paper-raised: #FFFFFF;
  --line: #DED4BE;

  --teal: #17B8A6;
  --teal-deep: #0E8C7E;
  --teal-tint: #E4F4F1;

  --gold: #C99A3E;

  --steel: #4A5566;
  --steel-soft: #7C8494;
  --white: #FFFFFF;

  --display: 'Instrument Serif', Georgia, serif;
  --body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  --max: 1180px;
  --pad: clamp(24px, 5vw, 64px);

  --ease: cubic-bezier(.22,.9,.32,1);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *,*::before,*::after{ animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; scroll-behavior:auto !important; }
}

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--body);
  font-size:17px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}

img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
ul{ margin:0; padding:0; list-style:none; }
button{ font-family:inherit; cursor:pointer; }

:focus-visible{
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap{ max-width:var(--max); margin:0 auto; padding-left:var(--pad); padding-right:var(--pad); }

.eyebrow{
  font-family:var(--mono);
  font-size:13.5px;
  letter-spacing:0.14em;
  text-transform:uppercase;
  color:var(--teal-deep);
  display:flex;
  align-items:center;
  gap:10px;
  margin:0 0 18px;
}
.eyebrow::before{
  content:'';
  width:7px; height:7px;
  border-radius:50%;
  border:1.5px solid var(--teal-deep);
  flex:none;
}
.on-dark .eyebrow{ color:var(--teal); }
.on-dark .eyebrow::before{ border-color:var(--teal); }

h1,h2,h3,h4{ font-family:var(--display); font-weight:400; line-height:1.06; margin:0; letter-spacing:-0.01em; }
h1{ font-size:clamp(40px, 6.4vw, 84px); }
h2{ font-size:clamp(30px, 4.2vw, 52px); }
h3{ font-size:clamp(22px, 2.6vw, 30px); }
em, .accent-italic{ font-style:italic; color:var(--teal-deep); }
.on-dark em, .on-dark .accent-italic{ color:var(--teal); }

p{ margin:0 0 1em; }
.lede{ font-size:clamp(18px, 1.6vw, 21px); color:var(--steel); max-width:56ch; }
.on-dark .lede{ color:rgba(245,241,232,0.72); }

/* ---------- Aperture / reticle signature ---------- */
.aperture{
  width:16px; height:16px;
  border-radius:50%;
  border:1.5px solid currentColor;
  position:relative;
  flex:none;
  transition:transform .5s var(--ease);
}
.aperture::before{
  content:'';
  position:absolute; inset:4px;
  border-radius:50%;
  border:1px solid currentColor;
  opacity:.55;
}
a:hover .aperture, button:hover .aperture{ transform:scale(1.25) rotate(20deg); }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:14px 26px;
  border-radius:999px;
  font-family:var(--body);
  font-weight:600;
  font-size:15.5px;
  letter-spacing:0.01em;
  border:1px solid transparent;
  transition:transform .35s var(--ease), background .3s ease, color .3s ease, border-color .3s ease;
  white-space:nowrap;
}
.btn:hover{ transform:translateY(-2px); }
.btn-primary{ background:var(--teal); color:var(--ink); }
.btn-primary:hover{ background:var(--teal-deep); color:var(--white); }
.btn-ghost{ background:transparent; color:var(--paper); border-color:rgba(245,241,232,0.35); }
.btn-ghost:hover{ border-color:var(--teal); color:var(--teal); }
.btn-outline{ background:transparent; color:var(--ink); border-color:var(--ink); }
.btn-outline:hover{ background:var(--ink); color:var(--paper); }
.btn-sm{ padding:10px 18px; font-size:14px; }

/* ---------- Header / nav ---------- */
header.site{
  position:sticky; top:0; z-index:100;
  background:var(--ink);
  border-bottom:1px solid var(--ink-line);
  transition:box-shadow .35s ease;
}
header.site.scrolled{
  box-shadow:0 12px 28px -18px rgba(0,0,0,0.5);
}
.nav{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px var(--pad);
  max-width:var(--max); margin:0 auto;
  gap:24px;
  transition:padding .35s var(--ease);
}
.brand{
  display:flex; align-items:center; gap:11px;
  color:var(--paper);
}
.brand-mark{
  width:34px; height:34px;
  flex:none;
  object-fit:contain;
  transition:width .35s var(--ease), height .35s var(--ease);
}
.brand-text{
  position:relative;
  display:flex; flex-direction:column; justify-content:center;
  height:38px;
  width:230px;
  overflow:hidden;
}
.brand-word-full, .brand-word-short{
  position:absolute; left:0; top:0; right:0;
  transition:opacity .4s var(--ease), transform .4s var(--ease);
}
.brand-word-full{
  font-family:var(--body); font-weight:500; font-size:12px; line-height:1.4;
  letter-spacing:.01em; color:var(--paper);
  top:50%; transform:translateY(-50%);
  max-width:230px;
}
.brand-word-short{
  font-family:var(--display); font-size:23px; letter-spacing:.02em; color:var(--paper);
  top:50%; transform:translateY(-50%) translateY(6px);
  opacity:0;
}
header.site.scrolled .brand-word-full{ opacity:0; transform:translateY(-50%) translateY(-6px); }
header.site.scrolled .brand-word-short{ opacity:1; transform:translateY(-50%) translateY(0); }
header.site.scrolled .brand-mark{ width:28px; height:28px; }
header.site.scrolled .nav{ padding-top:11px; padding-bottom:11px; }
.brand-word{ font-family:var(--display); font-size:23px; letter-spacing:0.02em; }

.nav-links{ display:flex; align-items:center; gap:30px; }
.nav-links a{
  color:rgba(245,241,232,0.78);
  font-size:14.5px; font-weight:500;
  position:relative; padding:4px 0;
  transition:color .25s ease;
}
.nav-links a:hover, .nav-links a.active{ color:var(--paper); }
.nav-links a.active::after{
  content:''; position:absolute; left:0; right:0; bottom:-3px; height:1px; background:var(--teal);
}
.nav-cta{ display:flex; align-items:center; gap:14px; }
.nav-cta .btn-primary{ font-size:14.5px; }
.nav-phone{ color:var(--paper); font-family:var(--mono); font-size:14.5px; display:none; }

.nav-toggle{
  display:none; background:none; border:none; color:var(--paper);
  width:34px; height:34px; position:relative;
}
.nav-toggle span{
  position:absolute; left:6px; right:6px; height:1.5px; background:currentColor;
  transition:transform .3s ease, opacity .3s ease;
}
.nav-toggle span:nth-child(1){ top:12px; }
.nav-toggle span:nth-child(2){ top:18px; }
.nav-toggle span:nth-child(3){ top:24px; }
.nav-toggle.open span:nth-child(1){ transform:translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2){ opacity:0; }
.nav-toggle.open span:nth-child(3){ transform:translateY(-6px) rotate(-45deg); }

@media (max-width: 900px){
  .nav-links{
    position:fixed; top:65px; left:0; right:0; bottom:0; background:var(--ink);
    flex-direction:column; align-items:flex-start; gap:0;
    padding:10px var(--pad) 30px;
    transform:translateY(-8px); opacity:0; pointer-events:none;
    transition:opacity .3s ease, transform .3s ease;
    z-index:99;
    overflow-y:auto;
  }
  .nav-links.open{ opacity:1; transform:translateY(0); pointer-events:auto; }
  .nav-links a{ padding:14px 0; width:100%; border-bottom:1px solid var(--ink-line); font-size:18px; }
  .nav-toggle{ display:block; }
  .nav .btn-primary{ display:none; }
}

/* ---------- Sections ---------- */
section{ padding:clamp(64px,9vw,120px) 0; }
.section-dark{ background:var(--ink); color:var(--paper); }
.section-tint{ background:var(--teal-tint); }
.section-raised{ background:var(--paper-raised); }
.hr{ height:1px; background:var(--line); border:none; margin:0; }
.on-dark .hr{ background:var(--ink-line); }

.grid{ display:grid; gap:28px; }
.grid-2{ grid-template-columns:1fr 1fr; }
.grid-3{ grid-template-columns:repeat(3,1fr); }
.grid-4{ grid-template-columns:repeat(4,1fr); }
@media (max-width:900px){
  .grid-2, .grid-3, .grid-4{ grid-template-columns:1fr; }
}

.tag{
  font-family:var(--mono); font-size:12.5px; letter-spacing:.08em; text-transform:uppercase;
  color:var(--teal-deep); background:var(--teal-tint);
  padding:5px 10px; border-radius:999px; display:inline-block;
}

/* ---------- Cards ---------- */
.card{
  background:var(--paper-raised);
  border:1px solid var(--line);
  border-radius:18px;
  padding:32px;
  transition:transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover{ transform:translateY(-4px); box-shadow:0 24px 48px -28px rgba(11,21,36,.28); }
.card-num{ font-family:var(--mono); font-size:14px; color:var(--teal-deep); margin-bottom:14px; }

/* ---------- Reveal on scroll ---------- */
.reveal{ opacity:0; transform:translateY(22px); transition:opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in{ opacity:1; transform:translateY(0); }

/* ---------- Incision comparator (signature visual) ---------- */
.comparator{ display:flex; flex-direction:column; gap:26px; max-width:640px; }
.comp-row{ display:grid; grid-template-columns:150px 1fr 70px; align-items:center; gap:18px; }
.comp-label{ font-family:var(--mono); font-size:13.5px; letter-spacing:.04em; color:var(--steel-soft); }
.comp-track{ height:10px; background:rgba(245,241,232,.08); border-radius:999px; overflow:hidden; }
.comp-fill{ height:100%; border-radius:999px; width:0; transition:width 1.1s var(--ease); background:var(--teal); }
.comp-row.open .comp-fill{ background:#9AA3B2; }
.comp-row.micro .comp-fill{ background:var(--gold); }
.comp-value{ font-family:var(--mono); font-size:14.5px; color:var(--paper); text-align:right; }

/* ---------- Footer ---------- */
footer.site{ background:var(--ink); color:rgba(245,241,232,0.7); padding:64px 0 28px; }
.footer-grid{ display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:40px; padding-bottom:44px; }
@media (max-width:900px){ .footer-grid{ grid-template-columns:1fr 1fr; } }
@media (max-width:560px){ .footer-grid{ grid-template-columns:1fr; } }
.footer-grid h4{ font-family:var(--mono); font-size:13px; letter-spacing:.08em; text-transform:uppercase; color:var(--paper); margin-bottom:16px; font-weight:500; }
.footer-grid ul li{ margin-bottom:10px; }
.footer-grid a{ color:rgba(245,241,232,0.68); font-size:15.5px; transition:color .25s ease; }
.footer-grid a:hover{ color:var(--teal); }
.footer-bottom{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:14px; padding-top:26px; border-top:1px solid var(--ink-line); font-size:14px; }
.socials{ display:flex; gap:12px; }
.social-btn{ width:34px; height:34px; border-radius:50%; border:1px solid var(--ink-line); display:flex; align-items:center; justify-content:center; transition:border-color .25s ease, color .25s ease; }
.social-btn:hover{ border-color:var(--teal); color:var(--teal); }
.disclaimer{ font-size:13.5px; color:var(--steel-soft); max-width:70ch; margin-top:18px; }

/* ---------- Misc components ---------- */
.pill-list{ display:flex; flex-wrap:wrap; gap:10px; }
.divider-aperture{ display:flex; align-items:center; gap:14px; color:var(--steel-soft); margin:8px 0 34px; }
.divider-aperture .line{ flex:1; height:1px; background:var(--line); }
.on-dark .divider-aperture .line{ background:var(--ink-line); }

.stat{ display:flex; flex-direction:column; gap:6px; }
.stat b{ font-family:var(--display); font-size:clamp(26px,2.4vw,34px); font-weight:400; color:var(--teal-deep); line-height:1; }
.on-dark .stat b{ color:var(--teal); }
.stat span{ font-family:var(--mono); font-size:12.5px; color:var(--steel-soft); letter-spacing:.03em; text-transform:uppercase; }

/* ---------- Hero stat panel ---------- */
.hero-stat-panel{
  display:flex; align-items:center; flex-wrap:wrap;
  gap:22px;
  margin-top:24px;
  padding:18px 26px;
  background:rgba(11,21,36,0.62);
  border:1px solid rgba(245,241,232,0.14);
  border-radius:16px;
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  width:fit-content;
  max-width:100%;
}
.hero-stat-panel .stat span{ color:rgba(245,241,232,0.66); }
.hero-stat-divider{
  width:1px; align-self:stretch;
  background:rgba(245,241,232,0.16);
  min-height:36px;
}
@media (max-width:700px){
  .hero-stat-panel{ flex-direction:column; align-items:flex-start; gap:16px; padding:20px 22px; }
  .hero-stat-divider{ display:none; }
}

/* ---------- Condition chip mosaic ---------- */
.condition-chips{
  display:flex; flex-wrap:wrap; gap:14px;
  margin-top:44px;
  max-width:760px;
}
.chip{
  display:inline-flex; align-items:center;
  padding:14px 22px;
  border-radius:999px;
  border:1px solid rgba(245,241,232,0.22);
  color:var(--paper);
  font-size:15.5px; font-weight:500;
  background:rgba(245,241,232,0.03);
  transition:background .3s ease, border-color .3s ease, transform .3s var(--ease);
}
.chip:hover{ background:rgba(23,184,166,0.14); border-color:var(--teal); transform:translateY(-2px); }
.chip-lg{ padding:18px 26px; font-size:17px; }
.chip-outline{
  background:transparent; border-color:var(--teal); color:var(--teal);
  font-family:var(--mono); font-size:13.5px; letter-spacing:.03em;
}
.chip-outline:hover{ background:var(--teal); color:var(--ink); }

/* ---------- Evidence-based benefit cards ---------- */
.evidence-card{
  background:rgba(245,241,232,0.04);
  border:1px solid rgba(245,241,232,0.12);
  border-radius:16px;
  padding:26px;
}
.evidence-icon{ width:34px; height:34px; color:var(--teal); }
.affiliation-row{
  display:flex; flex-wrap:wrap; gap:12px 14px;
}
.affiliation-badge{
  font-family:var(--mono); font-size:13px; letter-spacing:.02em;
  color:var(--steel);
  border:1px solid var(--line);
  border-radius:8px;
  padding:11px 15px;
  background:var(--paper-raised);
}
.affiliation-list{
  display:flex; flex-wrap:wrap;
  list-style:none; margin:0; padding:0;
  row-gap:8px;
  font-family:var(--mono); font-size:13.5px; letter-spacing:.01em; line-height:1.4;
  color:var(--steel);
}
.affiliation-list li{ display:flex; align-items:center; white-space:nowrap; }
.affiliation-list li:not(:last-child)::after{
  content:"·";
  margin:0 14px;
  color:var(--line);
}
@media (max-width: 640px){
  .affiliation-list{ font-size:13px; }
  .affiliation-list li{ white-space:normal; }
}

.faq-item{ border-bottom:1px solid var(--line); }
.faq-q{ display:flex; align-items:center; justify-content:space-between; gap:20px; padding:22px 0; width:100%; background:none; border:none; text-align:left; font-family:var(--body); font-weight:600; font-size:17.5px; color:var(--ink); }
.faq-q .plus{ position:relative; width:16px; height:16px; flex:none; }
.faq-q .plus::before, .faq-q .plus::after{ content:''; position:absolute; background:var(--ink); transition:transform .3s ease, opacity .3s ease; }
.faq-q .plus::before{ left:0; right:0; top:7px; height:1.5px; }
.faq-q .plus::after{ top:0; bottom:0; left:7px; width:1.5px; }
.faq-item.open .plus::after{ transform:rotate(90deg); opacity:0; }
.faq-a{ max-height:0; overflow:hidden; transition:max-height .4s var(--ease); }
.faq-a-inner{ padding:0 0 24px; color:var(--steel); max-width:70ch; }

.timeline{ display:flex; flex-direction:column; }
.tl-item{ display:grid; grid-template-columns:120px 26px 1fr; gap:20px; padding-bottom:44px; position:relative; }
.tl-item:last-child{ padding-bottom:0; }
.tl-year{ font-family:var(--mono); font-size:14px; color:var(--steel-soft); padding-top:3px; }
.tl-dot-col{ display:flex; flex-direction:column; align-items:center; }
.tl-dot{ width:12px; height:12px; border-radius:50%; border:1.5px solid var(--teal); background:var(--paper); flex:none; margin-top:4px; }
.tl-line{ flex:1; width:1px; background:var(--line); margin-top:6px; }
.tl-item:last-child .tl-line{ display:none; }
@media (max-width:640px){ .tl-item{ grid-template-columns:80px 20px 1fr; } }

.form-field{ margin-bottom:20px; }
.form-field label{ display:block; font-family:var(--mono); font-size:13px; letter-spacing:.05em; text-transform:uppercase; color:var(--steel); margin-bottom:8px; }
.form-field input, .form-field textarea, .form-field select{
  width:100%; padding:13px 16px; border-radius:10px; border:1px solid var(--line);
  background:var(--paper-raised); font-family:var(--body); font-size:16px; color:var(--ink);
  transition:border-color .25s ease, box-shadow .25s ease;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus{
  outline:none; border-color:var(--teal); box-shadow:0 0 0 3px var(--teal-tint);
}
.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:18px; }
@media (max-width:640px){ .form-row{ grid-template-columns:1fr; } }
.form-note{ font-size:14px; color:var(--steel-soft); margin-top:-8px; margin-bottom:20px; }
.form-success{ display:none; background:var(--teal-tint); border:1px solid var(--teal); border-radius:14px; padding:22px 24px; color:var(--teal-deep); font-weight:500; }
.form-success.show{ display:block; }
.form-error{ display:none; background:#FBEAEA; border:1px solid #D66; border-radius:14px; padding:18px 22px; color:#A33; font-size:15.5px; margin-top:16px; }
.form-error.show{ display:block; }
.hp-field{ position:absolute !important; left:-9999px !important; width:1px; height:1px; overflow:hidden; }

.cta-band{
  background:var(--ink); color:var(--paper);
  border-radius:28px;
  padding:clamp(40px,6vw,72px);
  display:flex; align-items:center; justify-content:space-between; gap:30px; flex-wrap:wrap;
}
.cta-band h3{ color:var(--paper); max-width:520px; }

/* ---------- Scroll hint (homepage hero) ---------- */
.scroll-hint{
  display:flex; align-items:center; gap:12px;
  margin-top:28px;
  color:var(--steel-soft);
  opacity:1;
  transition:opacity .4s ease;
}
.scroll-hint.hide{ opacity:0; pointer-events:none; }
.scroll-hint-label{
  font-family:var(--mono); font-size:12px; letter-spacing:.14em; text-transform:uppercase;
}
.scroll-hint-ring{
  width:20px; height:32px;
  border:1.5px solid var(--teal);
  border-radius:12px;
  position:relative;
  display:flex; justify-content:center;
  padding-top:6px;
  flex:none;
}
.scroll-hint-dot{
  width:4px; height:4px;
  border-radius:50%;
  background:var(--teal);
  animation:scrollDotFall 1.6s ease infinite;
}
@keyframes scrollDotFall{
  0%{ transform:translateY(0); opacity:1; }
  70%{ transform:translateY(12px); opacity:0; }
  100%{ transform:translateY(0); opacity:0; }
}

/* ---------- Hero photo background (Ken Burns) ---------- */
.hero-photo-bg{
  position:absolute; inset:0; z-index:0;
  background-image:url('images/hero-endoscope.jpg');
  background-size:cover;
  background-position:62% 45%;
  animation:heroKenBurns 22s ease-in-out infinite alternate;
  will-change:transform;
}
@media (max-width:700px){
  .hero-photo-bg{ background-image:url('images/hero-endoscope-mobile.jpg'); background-position:70% 40%; }
}
@keyframes heroKenBurns{
  0%{ transform:scale(1.0) translate(0,0); }
  100%{ transform:scale(1.12) translate(-1.5%, -1%); }
}
@media (prefers-reduced-motion: reduce){
  .hero-photo-bg{ animation:none; }
}
.hero-photo-scrim{
  position:absolute; inset:0; z-index:1;
  background:
    linear-gradient(100deg, rgba(11,21,36,0.94) 0%, rgba(11,21,36,0.82) 38%, rgba(11,21,36,0.55) 62%, rgba(11,21,36,0.35) 100%),
    linear-gradient(0deg, rgba(11,21,36,0.5) 0%, rgba(11,21,36,0) 30%);
}

.photo-frame{
  border-radius:20px; overflow:hidden; position:relative;
  background:linear-gradient(160deg,#16233A,#0B1524);
  aspect-ratio:4/5;
  display:flex; align-items:center; justify-content:center;
}
.photo-frame .placeholder-note{
  color:rgba(245,241,232,.45); font-family:var(--mono); font-size:13px; text-align:center; padding:20px; letter-spacing:.03em;
}
.photo-frame img{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center top;
}
.ring-deco{ position:absolute; border:1px solid rgba(23,184,166,.35); border-radius:50%; }

.photo-frame-sticky .photo-frame{ aspect-ratio:1/1; }
.photo-frame-sticky .photo-frame img{ object-position:center 20%; }
.photo-frame-sticky h1{ font-size:clamp(26px, 3vw, 34px); }

@media (min-width:901px){
  .photo-frame-sticky{ position:sticky; top:100px; }
  .team-grid{ grid-template-columns:420px 1fr; }
}

.breadcrumb{ font-family:var(--mono); font-size:13px; letter-spacing:.06em; text-transform:uppercase; color:var(--steel-soft); margin-bottom:20px; }
.breadcrumb a{ color:var(--teal-deep); }

table.compare{ width:100%; border-collapse:collapse; margin-top:10px; }
table.compare th, table.compare td{ text-align:left; padding:16px 18px; border-bottom:1px solid var(--line); font-size:15.5px; }
table.compare th{ font-family:var(--mono); font-size:12.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--steel-soft); font-weight:500; }
table.compare td.hi{ color:var(--teal-deep); font-weight:600; }
table.compare tr:last-child td{ border-bottom:none; }
.table-scroll{ overflow-x:auto; }
@media (max-width:700px){ table.compare{ min-width:620px; } }
