/* Self-hosted fonts with absolute root paths for parity across all directory levels */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/cormorant-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/cormorant-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/cormorant-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/plexmono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/plexmono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ====================================================================
 * ChemVen Canonical Homepage Header, Navigation, Drawer & Footer
 * Sourced directly from index.html for site-wide parity
 * ==================================================================== */

:root {
  --headbg: rgba(6, 13, 31, 0.8);
  --headbg2: rgba(6, 13, 31, 0);
  --head: #F4EEE1;
  --navink: rgba(244, 238, 225, 0.78);
  --text-label: 0.6875rem;
  --footline: rgba(216, 180, 90, 0.16);
  --chipbg: rgba(216, 180, 90, 0.08);
  --cellbg: rgba(18, 18, 26, 0.7);
  --gold: #D8B45A;
  --gold-soft: #E9CE8F;
  --gold-dim: rgba(216, 180, 90, 0.35);
  --dim: rgba(244, 238, 225, 0.7);
  --faint: rgba(244, 238, 225, 0.42);
  --void: #060D1F;
  --void-2: #12121A;
  --panel: #161622;
  --line: rgba(216, 180, 90, 0.14);
  --font-display: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="day"], html[data-theme="day"] {
  --headbg: rgba(246, 241, 231, 0.96);
  --headbg2: rgba(246, 241, 231, 0);
  --head: #14141A;
  --navink: rgba(20, 20, 26, 0.78);
  --footline: rgba(0, 0, 0, 0.1);
  --chipbg: rgba(255, 255, 255, 0.65);
  --cellbg: rgba(251, 248, 241, 0.9);
  --gold: #A37E2C;
  --gold-soft: #8B6717;
  --gold-dim: rgba(163, 126, 44, 0.35);
  --dim: rgba(20, 20, 26, 0.72);
  --faint: rgba(20, 20, 26, 0.48);
  --void: #F6F1E7;
  --void-2: #EDE6D8;
  --panel: #FAF7F0;
  --line: rgba(0, 0, 0, 0.1);
}

/* ====================================================================
 * Site Header (.site-head)
 * ==================================================================== */
.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 600;
  background: linear-gradient(180deg, var(--headbg), var(--headbg2));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.site-head.ux-scrolled {
  background: var(--void);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  border-bottom: 1px solid var(--line);
}
.site-head .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 22px;
  pointer-events: none;
}
@media (min-width: 640px) {
  .site-head .row {
    padding: 20px 24px 26px;
  }
}
@media (min-width: 1024px) {
  .site-head .row {
    padding: 22px 3vw 28px;
  }
}
.site-head a, .site-head button, .main-nav, .main-nav .nav-group, .main-nav .nav-panel {
  pointer-events: auto;
}

/* ChemVen Glowing Wordmark */
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--head);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  transition: opacity 0.2s;
}
.wordmark:hover {
  opacity: 0.9;
  text-decoration: none;
}
.wordmark .dot {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: radial-gradient(circle at 50% 50%, #0A0A0F 0 22%, #E9CE8F 30%, var(--gold) 62%, #8A6D2F);
  box-shadow: 0 0 14px rgba(216, 180, 90, 0.8);
  flex: none;
  display: inline-block;
}
[data-theme="day"] .wordmark .dot {
  background: radial-gradient(circle at 50% 50%, #FFFFFF 0 22%, #D8B45A 30%, var(--gold) 62%, #7C5E14);
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Primary Desktop Navigation */
.main-nav {
  display: none;
  align-items: center;
  gap: 20px;
}
@media (min-width: 960px) {
  .main-nav { display: flex; }
}

.main-nav a {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navink);
  text-decoration: none;
  transition: color 0.2s;
}
.main-nav a:hover {
  color: var(--gold);
}

.main-nav .nav-group {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.main-nav .nav-group-btn {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navink);
  background: transparent;
  border: 0;
  padding: 8px 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
}
.main-nav .nav-group-btn:hover,
.main-nav .nav-group-btn:focus-visible,
.main-nav .nav-group.open .nav-group-btn {
  color: var(--gold);
}
.main-nav .nav-group-btn .nav-caret {
  font-size: 0.65em;
  line-height: 1;
  transition: transform 0.25s ease;
}
.main-nav .nav-group.open .nav-group-btn .nav-caret,
.main-nav .nav-group-btn[aria-expanded="true"] .nav-caret {
  transform: rotate(180deg);
}

/* Dropdown Flyout Panel */
.main-nav .nav-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 700;
  min-width: 220px;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}
.main-nav .nav-panel.nav-panel-right {
  left: auto;
  right: 0;
}
.main-nav .nav-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -16px;
  height: 16px;
  pointer-events: auto;
}
.main-nav .nav-group.open .nav-panel {
  display: flex;
}
@media (hover: hover) and (pointer: fine) {
  .main-nav .nav-group:hover .nav-panel,
  .main-nav .nav-group:focus-within .nav-panel {
    display: flex;
  }
}
.main-nav .nav-panel a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--dim);
}
.main-nav .nav-panel a:hover,
.main-nav .nav-panel a:focus-visible {
  color: var(--gold);
  background: rgba(216, 180, 90, 0.08);
  text-decoration: none;
}

/* Header Buttons: Burger, Search, Settings, Theme Toggle */
.nav-burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}
@media (min-width: 960px) {
  .nav-burger { display: none; }
}
.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--head);
  border-radius: 2px;
  transition: all 0.25s ease;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 0.2s ease;
  text-decoration: none;
}
.theme-toggle:hover {
  background: rgba(216, 180, 90, 0.1);
  border-color: var(--gold);
  color: var(--gold);
}

@media (max-width: 640px) {
  .site-head .row { padding: 12px 14px 16px; }
  .head-actions { gap: 8px; }
  .wordmark { font-size: 0.82rem; letter-spacing: 0.18em; }
}

/* ====================================================================
 * Mobile Drawer Navigation (.nav-drawer)
 * ==================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 910;
  width: min(340px, 86vw);
  background: var(--void-2);
  border-left: 1px solid var(--gold-dim);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.4);
  transform: translateX(105%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  letter-spacing: 0.25em;
  color: var(--head);
  font-weight: 700;
}
.drawer-title .dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: var(--gold);
}
.drawer-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dim);
  font-size: 1.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.drawer-close:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.drawer-nav {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dn-group {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin: 18px 0 6px;
  font-weight: 700;
}
.dn-group:first-child { margin-top: 0; }
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--dim);
  text-decoration: none;
  min-height: 44px;
  transition: all 0.15s ease;
}
.drawer-nav a:hover,
.drawer-nav a:focus-visible {
  color: var(--gold);
  background: rgba(216, 180, 90, 0.08);
  text-decoration: none;
}
.dn-idx {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--faint);
  min-width: 22px;
}

.drawer-foot {
  margin-top: auto;
  padding: 20px 22px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
}
.df-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
}
.df-links a {
  font-size: 0.8rem;
  color: var(--faint);
  text-decoration: none;
}
.df-links a:hover {
  color: var(--gold);
  text-decoration: underline;
}
.df-tag {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--gold-soft);
  margin: 0;
}

/* ====================================================================
 * Site Footer (.site-foot)
 * ==================================================================== */
.site-foot {
  position: relative;
  border-top: 1px solid var(--footline);
  background: var(--void);
  background-image:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(216, 180, 90, 0.05), transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 15%, rgba(30, 92, 74, 0.04), transparent 70%);
  padding: 44px 16px;
  display: block;
  color: var(--dim);
  margin-top: auto;
}
@media (min-width: 768px) {
  .site-foot {
    padding: 52px 6vw;
  }
}
[data-theme="day"] .site-foot {
  background-image:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(216, 180, 90, 0.12), transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 15%, rgba(30, 92, 74, 0.05), transparent 70%);
}
.foot-wrap {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.foot-band {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 36px 48px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.foot-brand {
  max-width: 480px;
  flex: 1 1 340px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  align-items: flex-start;
}
.site-foot .fm {
  color: var(--head);
  display: inline-flex;
  align-items: center;
  gap: 10px 12px;
  flex-wrap: wrap;
  text-decoration: none;
}
.foot-atom {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: rgba(216, 180, 90, 0.1);
  border: 1px solid rgba(216, 180, 90, 0.3);
  border-radius: 10px;
  color: var(--gold);
  box-shadow: 0 0 16px rgba(216, 180, 90, 0.15);
}
.foot-brand-name {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  color: var(--head);
}
.foot-domain {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-soft);
  background: var(--chipbg);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 999px;
}
.foot-desc {
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.4;
  margin: 0;
}
.foot-contact-box {
  display: inline-flex;
  align-items: center;
  gap: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  background: var(--cellbg);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 8px;
  flex-wrap: wrap;
  max-width: 100%;
}
.foot-contact-link {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}
.foot-contact-link:hover {
  text-decoration: underline;
}
.foot-contact-tag {
  color: var(--faint);
  font-size: 0.7rem;
}
.foot-social {
  margin-top: 6px;
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--faint);
}
.foot-social a {
  color: var(--gold);
  text-decoration: none;
}
.foot-social a:hover {
  text-decoration: underline;
}

/* Newsletter Component in Footer */
.cv5-news-foot {
  flex: 1 1 340px;
  max-width: 440px;
  background: var(--cellbg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
.cv5-news-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  background: rgba(216, 180, 90, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 8px;
}
.cv5-news-foot h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--head);
  margin: 4px 0 8px;
}
.cv5-news-foot p {
  font-size: 0.85rem;
  color: var(--dim);
  line-height: 1.5;
  margin: 0 0 14px;
}
.cv5-news-foot .cv5-news-sub {
  font-size: 0.75rem;
  color: var(--faint);
  margin-bottom: 12px;
}
.cv5-news-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cv5-news-form input {
  flex: 1;
  min-width: 180px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--head);
  font-size: 0.88rem;
}
.cv5-news-form button {
  background: var(--gold);
  color: #0A0A0F;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  min-height: 42px;
  transition: opacity 0.2s;
}
.cv5-news-form button:hover {
  opacity: 0.9;
}

/* 4 Columns of Navigation Links */
.foot-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 24px;
  padding: 32px 0 28px;
  border-top: 1px solid var(--line);
}
@media (max-width: 768px) {
  .foot-links { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
}
@media (max-width: 420px) {
  .foot-links { grid-template-columns: 1fr; }
}
.foot-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.foot-h {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.foot-col a {
  font-size: 0.86rem;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.15s ease;
  line-height: 1.5;
}
.foot-col a:hover {
  color: var(--gold);
  text-decoration: underline;
}

/* Legal Bottom Bar */
.foot-bar {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.foot-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
}
.foot-legal a {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--faint);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.foot-legal a:hover {
  color: var(--head);
  background: rgba(216, 180, 90, 0.08);
  text-decoration: none;
}
.foot-legal a {
  font-size: 0.78rem;
  color: var(--faint);
  text-decoration: none;
}
.foot-legal a:hover {
  color: var(--gold);
  text-decoration: underline;
}
.foot-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--faint);
}
.foot-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.foot-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}
.foot-top-btn:hover {
  background: rgba(216, 180, 90, 0.1);
  text-decoration: none;
}

/* Page Spacing Offset for Fixed Header */
body.has-site-head main {
  padding-top: clamp(84px, 12vw, 104px) !important;
}
