/* Celium Clinical Data — Base Styles */
:root {
  /* Misty forest palette */
  --brand-50:  #eef6f2;
  --brand-100: #e0eee7;
  --brand-200: #c6e0d3;
  --brand-300: #a6cbbb;
  --brand-400: #7fb69e;
  --brand-500: #5a9f86;
  --brand-600: #2e6b5c; /* primary */
  --brand-700: #1e4b41;
  --accent-500: #7fb069; /* moss */
  --bg: #f7faf8;
  --text: #0e1a16;
  --muted: #546963;
  --border: #dfe8e3;
  --surface: #ffffff;
  --shadow: 0 14px 32px rgba(18, 52, 41, 0.14);
  --shadow-lg: 0 28px 64px rgba(18, 52, 41, 0.18);
  --radius: 14px;
  --overlay-hero: rgba(255,255,255,0.5);
  --grain-color: rgba(14,26,22,0.045);
  --theme-chrome: #2e6b5c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1100px, 92%); margin: 0 auto; }
.narrow { width: min(800px, 92%); margin: 0 auto; }
.center { text-align: center; }
.tiny { font-size: 12px; color: var(--muted); padding: 1rem 0; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; border-radius: 6px; z-index: 1000; box-shadow: var(--shadow); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
.lead { font-size: 1.125rem; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.btn { display: inline-block; padding: .75rem 1rem; border-radius: 10px; border: 1px solid var(--border); font-weight: 600; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--brand-600); }

.grid-2 { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.v-center { align-items: center; }
.span-all { grid-column: 1 / -1; }

@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1.2fr .8fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Header / Nav */
.site-header { position: sticky; top: 0; background: rgba(255,255,255,.75); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); z-index: 10; box-shadow: 0 6px 16px rgba(18,52,41,0.05); }
.nav { display: flex; align-items: center; justify-content: space-between; padding: .6rem 0; position: relative; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--text); }
.brand img { height: 90px; width: auto; border-radius: 0; }
.brand-footer img { height: 64px; width: auto; border-radius: 0; }
.nav-menu { display: flex; align-items: center; gap: 1rem; }
.nav-menu a { padding: .5rem .6rem; border-radius: 8px; color: var(--text); }
.nav-menu a.active { background: var(--brand-100); }
.theme-toggle { display:inline-flex; align-items:center; gap:.4rem; padding:.45rem .6rem; border-radius:8px; border:1px solid var(--border); background: var(--surface); color: var(--text); cursor:pointer; }
.theme-toggle svg { width:20px; height:20px; display:block; stroke: currentColor; fill: none; }
.icon-sun { display:inline; }
.icon-moon { display:none; }
.nav-toggle { display: inline-flex; background: transparent; border: 0; padding: .4rem; border-radius: 8px; color: var(--text); }
.nav-toggle:hover { background: rgba(0,0,0,0.04); }

@media (max-width: 800px) {
  .nav-menu { position: absolute; top: calc(100% + 8px); right: 0; background: #ffffff; border: 1px solid var(--border); border-radius: 12px; padding: .5rem; box-shadow: var(--shadow); display: none; flex-direction: column; min-width: 220px; transform-origin: top right; transform: scale(.98); opacity: 0; transition: opacity .2s ease, transform .2s ease; }
  .nav-menu.open { display: flex; opacity: 1; transform: scale(1); }
}

@media (max-width: 640px) {
  .hero .copy-panel { padding: 1rem; background: rgba(255,255,255,0.86); margin-bottom: -48px; padding-bottom: calc(1rem + 48px); }
}
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0f1513;
  --text: #e7efe9;
  --muted: #a7b5ae;
  --border: #24312d;
  --surface: #15211e;
  --overlay-hero: rgba(10,16,14,0.45);
  --grain-color: rgba(255,255,255,0.04);
  --theme-chrome: #0f1513;
}
[data-theme="dark"] a { color: var(--brand-300); }
[data-theme="dark"] .site-header { background: rgba(16,24,21,0.75); box-shadow: 0 6px 16px rgba(0,0,0,0.35); }
[data-theme="dark"] .nav-menu { background: #121b18; border-color: #1e2a26; }
[data-theme="dark"] .hero .copy-panel { background: rgba(15,21,19,0.62); }
[data-theme="dark"] .theme-toggle { background: #121b18; color: var(--text); border-color: #1e2a26; }
[data-theme="dark"] .btn-ghost { color: var(--brand-300); border-color: rgba(127,182,158,0.25); background: rgba(46,107,92,0.18); }
[data-theme="dark"] .btn-ghost:hover { background: rgba(46,107,92,0.26); }
[data-theme="dark"] .site-footer { background: linear-gradient(180deg, #0f1513, #101a17); }
[data-theme="dark"] .icon-sun { display:none; }
[data-theme="dark"] .icon-moon { display:inline; }

@media (max-width: 480px) {
  .brand img { height: 72px; }
  .brand-footer img { height: 56px; }
}

/* Hero */
.hero { padding: 4rem 0 2.5rem; position: relative; overflow: hidden; background:
    radial-gradient(var(--grain-color) 1px, rgba(14,26,22,0) 1.6px),
    linear-gradient(var(--overlay-hero), var(--overlay-hero)),
    url('../img/forest.png') center/cover no-repeat,
    radial-gradient(1200px 600px at 90% -60%, rgba(127,182,158,0.20), transparent 60%),
    radial-gradient(900px 500px at 10% -50%, rgba(46,107,92,0.18), transparent 55%),
    linear-gradient(180deg, #ffffff, var(--brand-50));
  background-size: 3px 3px, auto, cover, auto, auto, auto;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: calc(50% + var(--px, 0px)) calc(0px + var(--py, 0px));
}
.hero .edge { position: absolute; left: 50%; transform: translateX(-50%); width: 120%; pointer-events: none; background: var(--bg); z-index: 3; }
.hero .edge-top { top: -50px; height: 100px; border-bottom-left-radius: 50% 100%; border-bottom-right-radius: 50% 100%; box-shadow: 0 18px 36px rgba(0,0,0,0.06); }
.hero .edge-bottom { bottom: -50px; height: 100px; border-top-left-radius: 50% 100%; border-top-right-radius: 50% 100%; box-shadow: 0 -18px 36px rgba(0,0,0,0.04); }
/* Layering: backgrounds under edges, text above edges */
.hero > .container { position: relative; }
.hero .copy-panel, .hero-card { position: relative; border-radius: var(--radius); padding: 1.25rem; background: transparent; border: 0; }
.hero .copy-panel::before, .hero-card::before { content: ""; position: absolute; inset: 0; border-radius: var(--radius); border: 1px solid var(--border); background: rgba(255,255,255,0.78); box-shadow: var(--shadow); -webkit-backdrop-filter: saturate(140%) blur(8px); backdrop-filter: saturate(140%) blur(8px); z-index: 2; }
.hero .copy-panel { margin-bottom: -72px; padding-bottom: calc(1.25rem + 72px); }
.panel-content { position: relative; z-index: 4; }
.hero .actions { margin-top: 1.25rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-card { }
.hero .copy-panel { }
.hero .copy-panel h1, .hero .copy-panel .lead { color: var(--text); }
.hero .copy-panel .actions { margin-top: 1rem; justify-content: center; }
.hero::before, .hero::after { content: ""; position: absolute; inset: -20% -10% auto -10%; height: 60%; pointer-events: none; filter: blur(30px); opacity: .6; background:
  radial-gradient(500px 300px at 10% 30%, rgba(127,182,158,.20), transparent 60%),
  radial-gradient(400px 260px at 80% 20%, rgba(46,107,92,.14), transparent 55%);
  animation: mist-drift 60s linear infinite;
}
.hero::after { inset: auto -10% -25% -10%; height: 70%; filter: blur(36px); opacity: .5; animation-duration: 75s; animation-direction: reverse; }
.checklist { margin: 0 0 .5rem 1.25rem; }
.checklist li { margin-bottom: .25rem; }

.page-hero { padding: 3rem 0 1rem; background:
  radial-gradient(var(--grain-color) 1px, rgba(14,26,22,0) 1.6px),
  linear-gradient(var(--overlay-hero), var(--overlay-hero)),
  url('../img/forest.png') center/cover no-repeat,
  radial-gradient(800px 400px at 0% -20%, rgba(46,107,92,0.15), transparent 60%),
  linear-gradient(180deg, #ffffff, var(--brand-50));
  background-size: 3px 3px, auto, cover, auto, auto;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: calc(50% + var(--px, 0px)) calc(0px + var(--py, 0px));
}

/* Sections */
.section { padding: 3rem 0; }
.section.alt { background:
  radial-gradient(700px 380px at 100% -30%, rgba(95,160,134,0.10), transparent 60%),
  #f9fbfa; }
.section .section-header { margin-bottom: 1.25rem; }

.cards .card, .card, .panel, .form, .photo-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); background-image: radial-gradient(rgba(14,26,22,0.05) 1px, rgba(14,26,22,0) 1.8px); background-size: 3px 3px; }
.panel { background: var(--surface); }
.card:hover, .panel:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); transition: transform .18s ease, box-shadow .18s ease; }

/* Hero text contrast helpers */
.hero h1 { text-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.hero .lead { text-shadow: 0 1px 2px rgba(0,0,0,0.10); }

/* Service icons */
.icon { width: 28px; height: 28px; stroke: var(--brand-700); stroke-width: 2; fill: none; display: inline-block; vertical-align: middle; margin-right: .5rem; }
.card:hover .icon { stroke: var(--brand-600); }
.icon path { stroke-dasharray: 120; stroke-dashoffset: 0; transition: stroke-dashoffset .6s ease, stroke .2s ease; }
.card:hover .icon path { stroke-dashoffset: 6; }

/* Badges */
.badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .55rem; border: 1px solid var(--border); border-radius: 999px; background: #ffffffaa; box-shadow: var(--shadow); font-size: .85rem; color: var(--brand-700); }
.badge .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--brand-500); box-shadow: 0 0 0 2px #fff inset; }

.bullets { margin: .5rem 0 .5rem 1.25rem; }
.bullets li { margin: .3rem 0; }

.photo-card img { border-radius: 12px; width: 100%; height: auto; object-fit: cover; }

/* About page portrait: edge-fade blend */
.photo-fade { background: transparent; border: 0; padding: 0; box-shadow: none; }
.photo-fade img {
  width: 100%; height: auto; display: block; border-radius: 0;
  -webkit-mask-image: radial-gradient(100% 80% at 50% 40%, #000 68%, transparent 100%);
  mask-image: radial-gradient(100% 80% at 50% 40%, #000 68%, transparent 100%);
}
.signature-wrap { margin-top: .5rem; text-align: center; }
.signature {
  font-family: "Brush Script MT", "Segoe Script", "Lucida Handwriting", "Snell Roundhand", cursive;
  font-size: clamp(1.8rem, 2.6vw, 3rem);
  line-height: 1;
  color: var(--brand-700);
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
  display: inline-block;
  transform: rotate(-3deg);
  transform-origin: 50% 60%;
}
[data-theme="dark"] .signature { color: var(--brand-300); text-shadow: 0 1px 0 rgba(0,0,0,0.5); }

/* Forms */
.form .field { margin-bottom: .9rem; }
.form label { display: block; font-weight: 600; margin-bottom: .35rem; }
.form input, .form textarea, .form select { width: 100%; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 10px; font: inherit; background: var(--surface); color: var(--text); }
.form ::placeholder { color: var(--muted); }
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--brand-300); border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(46,107,92,0.12); }
.form .inline { display: flex; align-items: center; gap: .5rem; }

/* Common elements */
hr { border: 0; height: 1px; background: var(--border); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0 1rem; background: linear-gradient(180deg, #ffffff, #f5faf7); }
.footer-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
.brand-footer { font-weight: 800; }

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
}

/* Utilities */
.cta { background:
  radial-gradient(900px 480px at 80% -40%, rgba(46,107,92,0.14), transparent 60%),
  linear-gradient(180deg, #ffffff, var(--brand-50)); }
@media (prefers-color-scheme: dark) {
  [data-theme="dark"] .cta { background:
    radial-gradient(900px 480px at 80% -40%, rgba(127,182,158,0.10), transparent 60%),
    linear-gradient(180deg, #101a17, #0f1513); }
}
.center .btn { margin-top: .5rem; }
.copy h2 { margin-top: 1.25rem; }
.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; }

/* Buttons */
.btn-primary {
  background: linear-gradient(180deg, var(--brand-600), var(--brand-700));
  border-color: var(--brand-700);
  box-shadow: 0 6px 14px rgba(30,75,65,0.25);
}
.btn-primary:hover { filter: none; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(30,75,65,0.28); transition: transform .15s ease, box-shadow .15s ease; }
.btn-primary:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(30,75,65,0.22); }
.btn-ghost { color: var(--brand-700); border-color: rgba(46,107,92,0.25); background: rgba(127,182,158,0.06); }
.btn-ghost:hover { background: rgba(127,182,158,0.12); }

/* Reveal animations */
.will-reveal { opacity: 0; transform: translateY(16px); }
.reveal-in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.21,.95,.36,.99); }

/* Keyframes */
@keyframes mist-drift {
  0% { transform: translate3d(-2%, 0, 0) scale(1); }
  50% { transform: translate3d(2%, -1%, 0) scale(1.02); }
  100% { transform: translate3d(-2%, 0, 0) scale(1); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .will-reveal { opacity: 1; transform: none; }
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0f1513;
  --text: #e7efe9;
  --muted: #a7b5ae;
  --border: #24312d;
  --surface: #15211e;
  --overlay-hero: rgba(10,16,14,0.45);
  --grain-color: rgba(255,255,255,0.04);
  --theme-chrome: #0f1513;
}
[data-theme="dark"] a { color: var(--brand-300); }
[data-theme="dark"] .site-header { background: rgba(16,24,21,0.75); box-shadow: 0 6px 16px rgba(0,0,0,0.35); border-bottom-color: #1e2a26; }
[data-theme="dark"] .nav-menu { background: #121b18; border-color: #1e2a26; }
[data-theme="dark"] .nav-menu a.active { background: rgba(127,182,158,0.18); }
[data-theme="dark"] .theme-toggle { background: #121b18; color: var(--text); border-color: #1e2a26; }
[data-theme="dark"] .btn-ghost { color: var(--brand-300); border-color: rgba(127,182,158,0.25); background: rgba(46,107,92,0.18); }
[data-theme="dark"] .btn-ghost:hover { background: rgba(46,107,92,0.26); }
[data-theme="dark"] .site-footer { background: linear-gradient(180deg, #0f1513, #101a17); }
[data-theme="dark"] .icon-sun { display:none; }
[data-theme="dark"] .icon-moon { display:inline; }
[data-theme="dark"] .badge { background: rgba(15,21,19,0.6); color: var(--brand-100); border-color: #1e2a26; }
[data-theme="dark"] .badge .dot { box-shadow: 0 0 0 2px rgba(21,33,30,0.8) inset; }
[data-theme="dark"] .icon { stroke: var(--brand-300); }
[data-theme="dark"] .card:hover .icon { stroke: var(--brand-200); }
[data-theme="dark"] .section.alt { background: linear-gradient(180deg, #101816, #0f1513); }
[data-theme="dark"] .hero .copy-panel::before,
[data-theme="dark"] .hero-card::before { background: rgba(15,21,19,0.62); border-color: #1e2a26; }
[data-theme="dark"] .nav-toggle { color: #ffffff; }
[data-theme="dark"] .nav-toggle:hover { background: rgba(255,255,255,0.08); }
/* Ensure dark-mode logo visibility (black -> white) */
[data-theme="dark"] .brand img,
[data-theme="dark"] .brand-footer img { filter: brightness(0) invert(1) contrast(1.05); transition: filter .2s ease; }
/* Contact section surfaces in dark mode */
[data-theme="dark"] .form,
[data-theme="dark"] .contact-side,
[data-theme="dark"] .card.contact-side { background: var(--surface); border-color: #1e2a26; color: var(--text); }
[data-theme="dark"] .form label { color: var(--text); }
[data-theme="dark"] .form input,
[data-theme="dark"] .form textarea,
[data-theme="dark"] .form select { background: #101a17; border-color: #25332f; color: var(--text); }
[data-theme="dark"] .form ::placeholder { color: #92a39c; }



