/* Lucida Clinical Research
   Layout: an open, document-like grid. Hairlines instead of cards, one figure in the hero,
   and a single dark band ("light reaching deep water") for the mission and vision. */

:root {
  /* Brand colors */
  --abyss: #072A31;      /* text, dark backgrounds */
  --deep: #0B5E66;       /* Phase I  - buttons, links */
  --teal: #0E8189;       /* Phase II */
  --lagoon: #13A5B3;     /* Phase III - graphics only on light */
  --cyan: #23C6DE;       /* Phase IV - highlights, text only on dark */
  --slate: #4A6369;      /* secondary text */
  --shallows: #E4F7FA;   /* tinted panels */
  --mist: #F2F7F8;       /* alternate sections */
  --line: #D6E5E8;       /* hairlines */
  --white: #FFFFFF;
  --muted-on-dark: #9FC3CA;

  --q1: var(--deep);  --q2: var(--teal);  --q3: var(--lagoon);  --q4: var(--cyan);
  --q1-dark: #12838C; --q2-dark: #17A2AE; --q3-dark: #22BCCB; --q4-dark: #4DD8EA;

  /* Type */
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Space */
  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --section: clamp(72px, 9vw, 128px);
  --header-h: 72px;
  --radius: 6px;

  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--white);
  color: var(--abyss);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--abyss);
  text-wrap: balance;
}
p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a {
  color: var(--deep);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
a:hover { color: var(--abyss); }

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

::selection { background: var(--cyan); color: var(--abyss); }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--abyss);
  color: var(--white);
}
.skip-link:focus { top: 12px; color: var(--white); }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Text roles ---------- */
.eyebrow {
  font: 500 .8125rem/1.3 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--deep);
}
.eyebrow-on-dark { color: var(--cyan); }

.mono-label {
  font: 500 .75rem/1.3 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate);
}

.lead {
  max-width: 36em;
  font-size: clamp(1.125rem, 1.05rem + .35vw, 1.3125rem);
  line-height: 1.6;
  color: var(--slate);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 48px;
  padding: .75em 1.35em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn-primary { background: var(--deep); color: var(--white); }
.btn-primary:hover { background: var(--abyss); color: var(--white); }
.btn-ghost { border-color: var(--deep); color: var(--deep); }
.btn-ghost:hover { background: var(--shallows); color: var(--abyss); }
.btn-sm { min-height: 40px; padding: .5em 1em; font-size: .9375rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}
.brand { flex: none; }
.brand img { width: 172px; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) {
  padding-block: 6px;
  border-bottom: 1px solid transparent;
  color: var(--abyss);
  font-size: .96875rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:not(.btn):hover { border-bottom-color: var(--teal); color: var(--deep); }

.nav-toggle { display: none; }

@media (max-width: 899px) {
  .brand img { width: 150px; }
  .site-nav { flex-wrap: wrap; justify-content: flex-end; gap: 6px 18px; }

  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--abyss);
    font: 500 .9375rem/1 var(--font-body);
    cursor: pointer;
  }
  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    display: block;
    width: 16px;
    height: 2px;
    background: currentColor;
    transition: transform .2s ease;
  }
  .nav-toggle-bars { position: relative; }
  .nav-toggle-bars::before,
  .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -5px; }
  .nav-toggle-bars::after { top: 5px; }
  .nav-open .nav-toggle-bars { background: transparent; }
  .nav-open .nav-toggle-bars::before { transform: translateY(5px) rotate(45deg); }
  .nav-open .nav-toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

  .js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px var(--gutter) 20px;
    border-bottom: 1px solid var(--line);
    background: var(--white);
    box-shadow: 0 18px 30px -24px rgba(7, 42, 49, .45);
  }
  .js .nav-open .site-nav { display: flex; }
  .js .site-nav a:not(.btn) { padding-block: 14px; border-bottom: 1px solid var(--line); }
  .js .site-nav a:not(.btn):hover { border-bottom-color: var(--line); }
  .js .site-nav .btn { margin-top: 16px; }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(40px, 6vw, 96px) clamp(64px, 8vw, 120px);
  background:
    radial-gradient(ellipse 55% 65% at 82% 38%, rgba(35, 198, 222, .13), transparent 70%),
    var(--white);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
}
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.hero h1 {
  font-size: clamp(2.75rem, 1.4rem + 4.8vw, 5.1rem);
  line-height: 1;
  letter-spacing: -.04em;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.definition {
  max-width: 36em;
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--slate);
  font-size: .9375rem;
}
.definition-word { margin-right: .45em; color: var(--abyss); font: 500 .9375rem var(--font-mono); }
.definition-pos { margin-right: .3em; font-style: italic; }

@media (max-width: 959px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Fig. 1: the phase mark */
.phase-fig {
  position: relative;
  display: grid;
  gap: 24px;
  margin: 0;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  background: var(--white);
}
.fig-label {
  position: absolute;
  top: 14px;
  left: 16px;
  font: 500 .75rem/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate);
}
.phase-mark { width: min(100%, 300px); margin: 18px auto 0; overflow: visible; }

.q { transform-box: fill-box; transition: opacity .25s ease; }
.q1 { fill: var(--q1); transform-origin: 0 0; }
.q2 { fill: var(--q2); transform-origin: 100% 0; }
.q3 { fill: var(--q3); transform-origin: 100% 100%; }
.q4 { fill: var(--q4); transform-origin: 0 100%; }

/* Phase I to IV grow in sequence on load. Transform only, so the mark is never hidden. */
@media (prefers-reduced-motion: no-preference) {
  .phase-mark .q { animation: q-grow .8s cubic-bezier(.2, .7, .2, 1) backwards; }
  .phase-mark .q2 { animation-delay: .12s; }
  .phase-mark .q3 { animation-delay: .24s; }
  .phase-mark .q4 { animation-delay: .36s; }
}
@keyframes q-grow {
  from { transform: scale(.82); }
  to   { transform: scale(1); }
}

/* Hovering or focusing a legend row isolates its quadrant */
.phase-fig:has([data-phase="1"]:is(:hover, :focus-visible)) .q:not(.q1),
.phase-fig:has([data-phase="2"]:is(:hover, :focus-visible)) .q:not(.q2),
.phase-fig:has([data-phase="3"]:is(:hover, :focus-visible)) .q:not(.q3),
.phase-fig:has([data-phase="4"]:is(:hover, :focus-visible)) .q:not(.q4) { opacity: .16; }

.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.legend li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius);
  transition: background-color .2s ease;
}
.legend li:hover, .legend li:focus-visible { background: var(--mist); }
.legend li:focus-visible { outline-offset: 0; }

.mini { flex: none; width: 22px; height: 22px; margin-top: 2px; }
.mini path { fill: var(--line); }
.legend [data-phase="1"] .on { fill: var(--q1); }
.legend [data-phase="2"] .on { fill: var(--q2); }
.legend [data-phase="3"] .on { fill: var(--q3); }
.legend [data-phase="4"] .on { fill: var(--q4); }

.legend-text { display: flex; flex-direction: column; color: var(--slate); font-size: .875rem; line-height: 1.4; }
.legend-text strong { color: var(--abyss); font: 600 .9375rem/1.4 var(--font-display); }
.legend-n { margin-top: 3px; color: var(--deep); font: 500 .75rem/1.4 var(--font-mono); letter-spacing: .02em; }

.phase-fig figcaption {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--slate);
  font-size: .8125rem;
  line-height: 1.5;
}

@media (max-width: 479px) {
  .legend { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Sections ---------- */
.band { padding-block: var(--section); }
.band-mist { background: var(--mist); }

.section-title {
  max-width: 24ch;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  line-height: 1.15;
  letter-spacing: -.025em;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
  margin-bottom: clamp(36px, 5vw, 56px);
}
.section-head h2 {
  font-size: clamp(2rem, 1.35rem + 2.4vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -.035em;
}
.section-lead { max-width: 40em; color: var(--slate); font-size: 1.125rem; }

.split {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: clamp(40px, 6vw, 96px);
}
.split > .section-head { margin-bottom: 0; }
@media (max-width: 899px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}

/* Principles */
.principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  margin-top: clamp(28px, 4vw, 44px);
}
.principle { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 2px solid var(--abyss); }
.principle .tag {
  color: var(--deep);
  font: 500 .75rem/1.3 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.principle h3 { font-size: 1.25rem; line-height: 1.25; letter-spacing: -.015em; }
.principle p:not(.tag) { color: var(--slate); font-size: 1rem; }

/* Services */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; }
.service {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-block: 28px 32px;
  border-top: 1px solid var(--line);
}
.service h3 { font-size: 1.25rem; line-height: 1.3; letter-spacing: -.015em; }
.service p { color: var(--slate); font-size: 1rem; }
.service .terms {
  margin-top: auto;
  padding-top: 6px;
  color: var(--deep);
  font: 500 .75rem/1.5 var(--font-mono);
  letter-spacing: .04em;
}

/* Stages */
.stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.stage { display: flex; flex-direction: column; gap: 10px; }
.stage-bar { display: block; width: 70%; height: 6px; margin-bottom: 14px; background: var(--q1); }
.stage:nth-child(2) .stage-bar { width: 80%; background: var(--q2); }
.stage:nth-child(3) .stage-bar { width: 90%; background: var(--q3); }
.stage:nth-child(4) .stage-bar { width: 100%; background: var(--q4); }
.stage .stage-no {
  color: var(--slate);
  font: 500 .75rem/1.3 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.stage h3 { font-size: 1.375rem; letter-spacing: -.02em; }
.stage p:not(.stage-no) { color: var(--slate); font-size: 1rem; }

/* Reasons */
.reason {
  display: grid;
  grid-template-columns: minmax(0, 13em) minmax(0, 1fr);
  gap: 8px 32px;
  padding-block: 22px;
  border-top: 1px solid var(--line);
}
.reason:last-child { border-bottom: 1px solid var(--line); }
.reason dt { font: 600 1.125rem/1.35 var(--font-display); letter-spacing: -.01em; }
.reason dd { color: var(--slate); }

/* About: mission and vision */
.about {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse 70% 60% at 80% -12%, rgba(35, 198, 222, .32), transparent 70%),
    linear-gradient(180deg, #08343C 0%, var(--abyss) 55%, #051F25 100%);
  color: var(--white);
}
.about::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -10%;
  right: -5%;
  width: 75%;
  height: 120%;
  background:
    linear-gradient(105deg, transparent 38%, rgba(35, 198, 222, .09) 44%, transparent 50%),
    linear-gradient(105deg, transparent 56%, rgba(35, 198, 222, .07) 60%, transparent 65%),
    linear-gradient(105deg, transparent 70%, rgba(77, 216, 234, .06) 73%, transparent 77%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  pointer-events: none;
}
.mv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 72px);
  margin-top: 36px;
}
.mv-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(159, 195, 202, .35);
}
.mv-label {
  color: var(--muted-on-dark);
  font: 500 .8125rem/1.3 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.mv-text {
  color: var(--white);
  font: 500 clamp(1.375rem, 1.1rem + 1vw, 1.875rem)/1.35 var(--font-display);
  letter-spacing: -.02em;
  text-wrap: pretty;
}
.about-note {
  max-width: 44em;
  margin-top: clamp(36px, 5vw, 56px);
  color: var(--muted-on-dark);
  font-size: 1rem;
}
.about-note em { color: var(--white); }

/* Contact */
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: clamp(24px, 4vw, 40px);
  background: var(--shallows);
}
.contact-card p + .mono-label { margin-top: 14px; }
.contact-email {
  border-bottom: 2px solid var(--cyan);
  color: var(--abyss);
  font: 600 clamp(1.25rem, 1rem + 1vw, 1.625rem)/1.3 var(--font-display);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact-email:hover { color: var(--deep); }
.contact-card .btn { margin-top: 18px; }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: clamp(56px, 7vw, 88px) 32px;
  background: var(--abyss);
  color: var(--muted-on-dark);
  font-size: .9375rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
}
.footer-brand img { width: 200px; }
.footer-brand p { margin-top: 16px; color: var(--white); font: 500 1.0625rem var(--font-display); }
.footer-nav, .footer-contact { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.site-footer .mono-label { margin-bottom: 4px; color: var(--muted-on-dark); }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); text-decoration: underline; }

.footer-base-wrap { margin-top: 56px; }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(159, 195, 202, .22);
  font-size: .875rem;
}
.phase-bar { display: flex; align-items: center; gap: 6px; }
.phase-bar span { display: block; height: 4px; }
.phase-bar span:nth-child(1) { width: 30px; background: var(--q1-dark); }
.phase-bar span:nth-child(2) { width: 35px; background: var(--q2-dark); }
.phase-bar span:nth-child(3) { width: 41px; background: var(--q3-dark); }
.phase-bar span:nth-child(4) { width: 46px; background: var(--q4-dark); }

/* ---------- Responsive grids ---------- */
@media (max-width: 1023px) {
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 959px) {
  .services, .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 799px) {
  .mv, .footer-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  .principles, .services, .stages { grid-template-columns: minmax(0, 1fr); }
  .reason { grid-template-columns: minmax(0, 1fr); }
  .hero .eyebrow { letter-spacing: .04em; }
}
@media (max-width: 479px) {
  .actions { width: 100%; }
  .actions .btn { width: 100%; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
