/* ============================================
   CranioPlan – Global Stylesheet
   Palette: bone white / navy blue / gray / black
   ============================================ */

:root {
  --bone: #F0EEE6;
  --bone-2: #E6E2D3;
  --paper: #FAF9F0;
  --navy: #14223F;
  --navy-2: #1B2A4E;
  --navy-3: #2C3E6B;
  --gray: #6B7280;
  --gray-2: #9CA3AF;
  --line: #D8D3C4;
  --black: #141414;
  --max: 1280px;
  --pad: clamp(20px, 4vw, 64px);
  --radius: 4px;
  --serif: "Fraunces", "Tiempos Headline", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--bone);
  color: var(--black);
  line-height: 1.55;
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; height: auto; }

a { color: inherit; text-decoration: none; transition: opacity .2s ease, color .2s ease; }
a:hover { opacity: .72; }

h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--navy);
  line-height: 1.08;
}

h1 { font-size: clamp(40px, 7vw, 88px); }
h2 { font-size: clamp(30px, 4.4vw, 56px); }
h3 { font-size: clamp(22px, 2.2vw, 30px); }
h4 { font-size: clamp(18px, 1.6vw, 22px); letter-spacing: -0.01em; }

p { font-size: clamp(15px, 1.1vw, 17px); color: #1F2937; }
p + p { margin-top: 1em; }

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

.section { padding: clamp(60px, 9vw, 140px) 0; }
.section--tight { padding: clamp(40px, 6vw, 90px) 0; }

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy);
  font-weight: 500;
  display: inline-block;
  margin-bottom: 20px;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--navy);
  vertical-align: middle;
  margin-right: 10px;
  transform: translateY(-2px);
}

/* ========= NAV ========= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(240, 238, 230, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.brand img { height: 44px; width: auto; display: block; }
.brand__name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
  white-space: nowrap;
  /* --collapse is driven by scroll in JS: 0 = full, 1 = collapsed to Ω */
}
.brand__part {
  display: inline-block;
  overflow: hidden;
  max-width: calc((1 - var(--collapse, 0)) * 6ch);
  opacity: calc(1 - var(--collapse, 0) * 1.15);
  /* JS lerps the --collapse value every frame, so no CSS transition here */
  will-change: max-width, opacity, transform;
}
.brand__part--prefix { transform: translateX(calc(var(--collapse, 0) * 8px)); }
.brand__part--suffix { transform: translateX(calc(var(--collapse, 0) * -8px)); }
.brand__omega {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15em;
  line-height: 1;
  display: inline-block;
}
@media (prefers-reduced-motion: reduce) {
  .brand__part { transition: none; }
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
  list-style: none;
}
.nav__links a {
  font-size: 14px;
  color: var(--navy);
  font-weight: 500;
  padding: 8px 0;
  position: relative;
}
.nav__links a.active::after,
.nav__links a:hover::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: var(--navy);
}
/* Ensure the CTA button in the nav keeps its own typography/colour */
.nav__links a.btn {
  color: var(--bone);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}
.nav__links a.btn:hover { color: var(--bone); }
.nav__links a.btn::after { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: var(--bone);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--black); border-color: var(--black); opacity: 1; }
.btn--ghost {
  background: transparent;
  color: var(--navy);
}
.btn--ghost:hover { background: var(--navy); color: var(--bone); }
.btn--lg { padding: 16px 30px; font-size: 15px; }
.btn__arrow { transition: transform .2s ease; }
.btn:hover .btn__arrow { transform: translateX(3px); }

.nav__toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 40px; height: 40px;
  cursor: pointer;
  color: var(--navy);
}
.nav__toggle svg { width: 24px; height: 24px; }

/* ========= HERO ========= */
.hero {
  padding: clamp(60px, 10vw, 150px) 0 clamp(50px, 8vw, 110px);
  position: relative;
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.hero h1 {
  max-width: 14ch;
}
.hero h1 em {
  font-style: italic;
  color: var(--navy-3);
}
.hero__sub {
  font-size: clamp(16px, 1.25vw, 19px);
  color: #1F2937;
  max-width: 42ch;
  margin-top: 28px;
}
.hero__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 36px;
}
.hero__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: clamp(16px, 2vw, 32px);
  overflow: visible;
}
.hero__mark img {
  width: 100%;
  max-width: 520px;
  height: auto;
  object-fit: contain;
  /* Starts at 2.5× at scroll top, shrinks to 1× as --collapse goes 0 → 1 */
  transform: scale(calc(2.5 - 1.5 * var(--collapse, 0)));
  transform-origin: center center;
  will-change: transform;
}

/* ========= MARQUEE / SOFTWARES ========= */
.marquee {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
  overflow: hidden;
}
.marquee__label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
  text-align: center;
  margin-bottom: 18px;
}
.marquee__track {
  display: flex;
  align-items: center;
  gap: clamp(40px, 5vw, 80px);
  animation: scroll 38s linear infinite;
  width: max-content;
}
.marquee__track img {
  height: 38px;
  width: auto;
  opacity: 0.72;
  filter: grayscale(1) contrast(1.05);
  transition: opacity .25s ease, filter .25s ease;
}
.marquee__track img:hover { opacity: 1; filter: none; }
@keyframes scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========= SECTION HEADINGS ========= */
.section__head {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(24px, 4vw, 60px);
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 70px);
}
.section__head p { color: #374151; max-width: 48ch; }

/* ========= SERVICE GRID ========= */
.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.service {
  padding: 36px 32px 44px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: background .25s ease;
}
.service:hover { background: var(--bone-2); }
.service__num {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--gray);
  letter-spacing: 0.04em;
}
.service h3 {
  font-size: clamp(21px, 1.7vw, 26px);
  max-width: 18ch;
}
.service p {
  font-size: 15px;
  color: #374151;
}
.service__tag {
  margin-top: auto;
  padding-top: 18px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  font-weight: 500;
}

/* ========= SPLIT / ABOUT ========= */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 90px);
  align-items: center;
}
.split__text h2 { max-width: 16ch; }
.split__text p { margin-top: 22px; color: #374151; max-width: 52ch; }
.split__image {
  position: relative;
  aspect-ratio: 4/5;
  background: var(--navy);
  overflow: hidden;
  border-radius: var(--radius);
}
.split__image img {
  width: 100%; height: 100%; object-fit: cover;
  mix-blend-mode: luminosity;
  opacity: 0.92;
}
.split__image::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(20,34,63,0.15), rgba(20,34,63,0.45));
  pointer-events: none;
}

/* ========= BIG QUOTE / VISION ========= */
.vision {
  background: var(--navy);
  color: var(--bone);
  padding: clamp(70px, 10vw, 150px) 0;
}
.vision h2 {
  color: var(--bone);
  font-size: clamp(28px, 3.6vw, 48px);
  max-width: 24ch;
  line-height: 1.2;
}
.vision h2 em { color: #C8D3EE; font-style: italic; }
.vision__foot {
  margin-top: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.vision__foot span {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-2);
}

/* ========= STEPS ========= */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.step {
  padding: 40px 28px 46px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.step:last-child { border-right: 0; }
.step__num {
  font-family: var(--serif);
  font-size: 48px;
  color: var(--navy);
  display: block;
  margin-bottom: 18px;
}
.step h4 { margin-bottom: 10px; }
.step p { font-size: 15px; color: #374151; }

/* ========= GALLERY ========= */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}
.gallery__item {
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bone-2);
  border-radius: var(--radius);
}
.gallery__item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.gallery__item:hover img { transform: scale(1.04); }
.g-span-6 { grid-column: span 6; }
.g-span-4 { grid-column: span 4; }
.g-span-8 { grid-column: span 8; }
.g-span-12 { grid-column: span 12; }

/* ========= PAGE HEADER ========= */
.page-hero {
  padding: clamp(80px, 10vw, 140px) 0 clamp(50px, 7vw, 90px);
  border-bottom: 1px solid var(--line);
}
.page-hero h1 { font-size: clamp(44px, 6.6vw, 84px); max-width: 18ch; }
.page-hero p { margin-top: 26px; max-width: 56ch; font-size: clamp(16px, 1.2vw, 19px); color: #374151; }

/* ========= CONTENT BLOCKS ========= */
.content-block {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(32px, 5vw, 80px);
  padding: clamp(50px, 6vw, 80px) 0;
  border-bottom: 1px solid var(--line);
}
.content-block:last-child { border-bottom: 0; }
.content-block__label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray);
  font-weight: 500;
}
.content-block h3 { max-width: 22ch; margin-bottom: 18px; }
.content-block p { color: #374151; max-width: 60ch; }
.content-block p + p { margin-top: 14px; }
.content-block ul {
  margin-top: 18px;
  padding-left: 0;
  list-style: none;
}
.content-block ul li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  font-size: 15px;
}
.content-block ul li:last-child { border-bottom: 1px solid var(--line); }
.content-block ul li::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--navy);
  border-radius: 50%;
  margin-top: 8px;
  flex-shrink: 0;
}

/* ========= DATA REQUIREMENTS CARDS ========= */
.req-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.req-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.req-card h4 {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.req-card h4::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--navy);
  display: inline-block;
}
.req-card ul { list-style: none; margin-top: 14px; }
.req-card li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: #374151;
}
.req-card li:first-child { border-top: 0; }
.req-card li strong { color: var(--navy); font-weight: 500; }

.guide-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}
.guide-strip img { border-radius: var(--radius); aspect-ratio: 3/2; object-fit: cover; border: 1px solid var(--line); background: var(--paper); }

/* ========= DOWNLOADS ========= */
.downloads-list {
  list-style: none;
  margin-top: 40px;
  border-top: 1px solid var(--line);
}
.dl-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 24px;
  align-items: center;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  transition: background .2s ease;
}
.dl-row:hover { background: var(--paper); }
.dl-row__num {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--gray);
  min-width: 40px;
}
.dl-row__title { }
.dl-row__title strong { display: block; font-family: var(--serif); font-size: 20px; color: var(--navy); font-weight: 400; margin-bottom: 4px; }
.dl-row__title span { font-size: 13px; color: var(--gray); }
.dl-row__meta { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray); }
.dl-row__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--navy);
  border-radius: 999px;
  font-size: 13px;
  color: var(--navy);
  font-weight: 500;
  background: transparent;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.dl-row__btn:hover { background: var(--navy); color: var(--bone); opacity: 1; }

/* ========= FORMS ========= */
.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 40px;
}
.form__group { display: flex; flex-direction: column; gap: 8px; }
.form__group--full { grid-column: 1 / -1; }
.form label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
  font-weight: 500;
}
.form input, .form select, .form textarea {
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 15px;
  color: var(--black);
  transition: border-color .2s ease, background .2s ease;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--navy);
  background: #fff;
}
.form textarea { min-height: 150px; resize: vertical; font-family: var(--sans); }
.form__submit { grid-column: 1 / -1; justify-self: start; margin-top: 8px; }

/* ========= CONTACT ========= */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(32px, 5vw, 80px);
}
.contact-info { display: flex; flex-direction: column; gap: 28px; }
.contact-info__block {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.contact-info__block span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 8px;
}
.contact-info__block p { font-family: var(--serif); font-size: 22px; color: var(--navy); }
.contact-info__block a { color: var(--navy); }

/* ========= CTA STRIP ========= */
.cta-strip {
  padding: clamp(60px, 8vw, 110px) 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cta-strip__inner {
  display: grid;
  grid-template-columns: 1.3fr auto;
  gap: 40px;
  align-items: center;
}
.cta-strip h2 { max-width: 20ch; }

/* ========= FOOTER ========= */
.footer {
  background: var(--black);
  color: var(--bone);
  padding: clamp(50px, 6vw, 80px) 0 30px;
}
.footer__top {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 50px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.footer__brand { max-width: 32ch; }
.footer__brand img { height: 40px; margin-bottom: 18px; filter: brightness(0) invert(1); }
.footer__brand p { font-size: 14px; color: #B6BECC; }
.footer h5 {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9CA3AF;
  margin-bottom: 16px;
  font-weight: 500;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer ul a { font-size: 14px; color: var(--bone); }
.footer__bottom {
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: #8B94A6;
}

/* ========= UTILITIES ========= */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .8s ease, transform .8s ease;
}
.fade-in.is-visible { opacity: 1; transform: translateY(0); }

/* ========= RESPONSIVE ========= */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .section__head { grid-template-columns: 1fr; }
  .services { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step { border-bottom: 1px solid var(--line); }
  .content-block { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .cta-strip__inner { grid-template-columns: 1fr; }
  .g-span-6, .g-span-4, .g-span-8 { grid-column: span 12; }
  .guide-strip { grid-template-columns: 1fr; }
  .req-grid { grid-template-columns: 1fr; }
  .dl-row { grid-template-columns: auto 1fr; }
  .dl-row__meta, .dl-row__btn { grid-column: 2; justify-self: start; }
  .dl-row__btn { margin-top: 6px; }

  .nav__links {
    position: absolute;
    top: 100%; right: 0; left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bone);
    border-top: 1px solid var(--line);
    padding: 8px var(--pad) 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .nav__links.is-open { max-height: 520px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
  .nav__links li { border-top: 1px solid var(--line); }
  .nav__links li:first-child { border-top: 0; }
  .nav__links a { display: block; padding: 14px 0; font-size: 15px; }
  .nav__links .btn { margin-top: 12px; justify-content: center; }
  .nav__toggle { display: inline-flex; align-items: center; justify-content: center; }
}

@media (max-width: 600px) {
  .services { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr; }
  .hero__mark { min-height: 0; margin-top: 20px; }
}
