/* =========================================================
   Dr. Eleanor Whitfield — Chemistry Consultancy
   Design tokens, layout, components, animations.
   ========================================================= */

:root {
  --c-bg:        #f6f8fb;
  --c-surface:   #ffffff;
  --c-ink:       #0f1b2d;
  --c-ink-soft:  #41506b;
  --c-muted:     #7a8aa3;
  --c-line:      #e4ebf3;

  --c-brand:     #0b6e6e;   /* deep teal — lab glass */
  --c-brand-2:   #1aa39a;   /* aqua highlight */
  --c-accent:    #d4a017;   /* brass / periodic gold */
  --c-danger:    #b3261e;

  --grad-hero:   radial-gradient(1200px 600px at 80% -10%, rgba(26,163,154,0.18), transparent 60%),
                 radial-gradient(900px 500px at -10% 110%, rgba(212,160,23,0.14), transparent 60%),
                 linear-gradient(180deg, #0f2a36 0%, #0b1e28 100%);

  --shadow-sm:   0 1px 2px rgba(15,27,45,0.06), 0 1px 1px rgba(15,27,45,0.04);
  --shadow-md:   0 8px 24px rgba(15,27,45,0.08), 0 2px 6px rgba(15,27,45,0.05);
  --shadow-lg:   0 24px 60px rgba(15,27,45,0.18);

  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   22px;

  --container:   1180px;
  --t-fast:      160ms ease;
  --t-med:       320ms cubic-bezier(.2,.7,.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--c-ink);
  background: var(--c-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 .5em;
  color: var(--c-ink);
}
h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1em; color: var(--c-ink-soft); }
a  { color: var(--c-brand); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-brand-2); }
img { max-width: 100%; display: block; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--c-ink);
}
.brand .mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c-brand), var(--c-brand-2));
  color: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.02em;
}
.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 10px 14px;
  color: var(--c-ink-soft);
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-links a:hover { background: rgba(11,110,110,0.08); color: var(--c-brand); }
.nav-links a.active {
  background: rgba(11,110,110,0.12);
  color: var(--c-brand);
}
.nav-cta { margin-left: 8px; }

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  padding: 8px;
  cursor: pointer;
}
.menu-toggle span {
  display: block; width: 24px; height: 2px; background: var(--c-ink);
  margin: 5px 0; border-radius: 2px; transition: transform var(--t-fast);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--c-brand), var(--c-brand-2));
  color: #fff;
  box-shadow: 0 6px 18px rgba(11,110,110,0.28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(11,110,110,0.32); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-line);
}
.btn-ghost:hover { background: #fff; border-color: var(--c-brand); color: var(--c-brand); }
.btn-accent {
  background: linear-gradient(135deg, #e3b020, var(--c-accent));
  color: #2a1f00;
  box-shadow: 0 6px 18px rgba(212,160,23,0.28);
}
.btn-accent:hover { transform: translateY(-1px); color: #2a1f00; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #eaf5f5;
  background: var(--grad-hero);
  isolation: isolate;
}
.hero::before {
  /* faint hex grid */
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(60deg, rgba(255,255,255,0.04) 25%, transparent 25.5%, transparent 50%, rgba(255,255,255,0.04) 50.5%, rgba(255,255,255,0.04) 75%, transparent 75.5%, transparent);
  background-size: 28px 48px;
  opacity: 0.35;
  z-index: 0;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 96px 0 112px;
}
.hero h1 { color: #fff; }
.hero p.lead {
  font-size: 1.15rem;
  color: #cfe3e3;
  max-width: 540px;
}
.hero .eyebrow {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #b4e3df;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 42px;
  max-width: 540px;
}
.hero-stats .stat {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  backdrop-filter: blur(6px);
}
.hero-stats .num {
  font-family: 'Fraunces', serif;
  font-size: 1.7rem;
  color: #fff;
  font-weight: 600;
}
.hero-stats .lbl { font-size: 0.82rem; color: #a9c8c8; }

/* Hero visual — animated molecule */
.molecule {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 460px;
  margin-left: auto;
}
.molecule svg { width: 100%; height: 100%; overflow: visible; }
.molecule .atom { transform-origin: center; transform-box: fill-box; }
.molecule .a-rot {
  animation: rotate-slow 28s linear infinite;
  transform-origin: 50% 50%;
}
.molecule .a-pulse { animation: pulse 3.2s ease-in-out infinite; }
.molecule .a-pulse.delay-1 { animation-delay: .6s; }
.molecule .a-pulse.delay-2 { animation-delay: 1.2s; }
.molecule .a-pulse.delay-3 { animation-delay: 1.8s; }

@keyframes rotate-slow { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(26,163,154,0)); }
  50%      { transform: scale(1.06); filter: drop-shadow(0 0 12px rgba(26,163,154,0.55)); }
}
@media (prefers-reduced-motion: reduce) {
  .a-rot, .a-pulse, .reveal { animation: none !important; transition: none !important; }
}

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section.tight { padding: 56px 0; }
.section.alt { background: #fff; border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); }
.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
}
.section-head .kicker {
  color: var(--c-brand);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.section-head p { color: var(--c-ink-soft); }

/* ---------- Cards / Grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(11,110,110,0.25);
}
.card .icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(11,110,110,0.12), rgba(26,163,154,0.15));
  color: var(--c-brand);
  margin-bottom: 14px;
}
.card h3 { margin-bottom: 8px; }
.tag {
  display: inline-block;
  background: rgba(11,110,110,0.08);
  color: var(--c-brand);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 6px; margin-bottom: 6px;
}

/* ---------- Portfolio / Achievement list ---------- */
.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 18px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--c-brand-2), transparent);
}
.timeline li {
  position: relative;
  padding: 0 0 28px 56px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 11px; top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--c-brand);
  box-shadow: 0 0 0 4px rgba(11,110,110,0.12);
}
.timeline .year {
  font-family: 'Fraunces', serif;
  color: var(--c-brand);
  font-weight: 600;
}

/* ---------- Testimonials ---------- */
.quote {
  background: linear-gradient(180deg, #ffffff, #f8fbfb);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}
.quote::before {
  content: "“";
  position: absolute;
  top: -10px; left: 18px;
  font-family: 'Fraunces', serif;
  font-size: 4rem;
  color: var(--c-brand-2);
  line-height: 1;
}
.quote p { color: var(--c-ink); font-size: 1.02rem; font-style: italic; }
.quote .who {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
}
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-brand), var(--c-brand-2));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}
.who .name { font-weight: 600; color: var(--c-ink); line-height: 1.1; }
.who .role { font-size: 0.85rem; color: var(--c-muted); }

/* ---------- Pricing ---------- */
.pricing { display: grid; gap: 24px; grid-template-columns: repeat(2, 1fr); align-items: stretch; }
.plan {
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.plan.featured {
  border-color: rgba(11,110,110,0.3);
  box-shadow: var(--shadow-lg);
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(26,163,154,0.10), transparent 60%),
    #fff;
}
.plan .badge {
  position: absolute; top: 16px; right: 16px;
  background: var(--c-accent); color: #2a1f00;
  font-size: 0.72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.plan .price {
  font-family: 'Fraunces', serif;
  font-size: 2.6rem;
  color: var(--c-ink);
  margin: 8px 0 0;
}
.plan .price small { font-size: 1rem; color: var(--c-muted); font-family: 'Inter', sans-serif; font-weight: 500; }
.features { list-style: none; padding: 0; margin: 20px 0; }
.features li {
  padding: 8px 0 8px 28px;
  position: relative;
  color: var(--c-ink-soft);
  border-bottom: 1px dashed var(--c-line);
}
.features li:last-child { border-bottom: 0; }
.features li::before {
  content: "";
  position: absolute; left: 0; top: 14px;
  width: 16px; height: 16px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b6e6e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center / contain;
}
.features li.x::before {
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3261e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>") no-repeat center / contain;
  opacity: .55;
}
.plan .cta { margin-top: auto; }

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--c-ink);
}
.field input, .field select, .field textarea {
  font: inherit;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--c-line);
  background: #fff;
  color: var(--c-ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 4px rgba(11,110,110,0.12);
}
.field textarea { min-height: 140px; resize: vertical; }
.field .err {
  font-size: 0.82rem;
  color: var(--c-danger);
  display: none;
}
.field.invalid input,
.field.invalid select,
.field.invalid textarea { border-color: var(--c-danger); }
.field.invalid .err { display: block; }

.form-msg {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  display: none;
}
.form-msg.ok { display:block; background: rgba(26,163,154,0.10); color: #0a4d4a; border: 1px solid rgba(26,163,154,0.25); }
.form-msg.err { display:block; background: rgba(179,38,30,0.08); color: #6c1813; border: 1px solid rgba(179,38,30,0.25); }

/* ---------- Footer ---------- */
.site-footer {
  background: #0b1e28;
  color: #b9cdd1;
  padding: 64px 0 28px;
  margin-top: 80px;
}
.site-footer h4 { color: #fff; font-size: 1.05rem; }
.site-footer a { color: #cfe3e3; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { padding: 4px 0; font-size: 0.95rem; }
.legal {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-between;
  font-size: 0.85rem; color: #8aa1a6;
  flex-wrap: wrap; gap: 10px;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms ease, transform 600ms cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; padding: 64px 0 80px; }
  .molecule { max-width: 360px; margin: 0 auto; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .pricing { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .menu-toggle { display: block; }
  .nav-links {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column;
    background: #fff;
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-line);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-cta { display: none; }
  .grid-3, .grid-2, .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
}
