:root{
    --ease: cubic-bezier(.22,.8,.32,1);
    --gold: #3f4328;
    --font-body: "Diatype", sans-serif;
    --font-title: "Cormorant", serif;
    --font-heading: var(--font-title);
  }

  * { box-sizing: border-box; }

  html, body{
  overflow-x: clip;
}
  html, body{
    margin:0;
    background: #000;
    font-family: var(--font-body);
  }

  h1, h2, h3, h4, h5, h6{
    font-family: var(--font-heading);
  }

  /* ---------- demo page sections (alternating themes so you can see the nav react) ---------- */
  .section{
    min-height: 100dvh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding: 0 24px;
  }
  .section[data-theme="dark"]{ background:#0a0a0a; color:#f5f3ee; }
  .section[data-theme="light"]{ background:#f3efe6; color:#141210; }
  .section-copy{ max-width: 560px; text-align:center; }
  .section-copy .eyebrow{
    display:block;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 14px;
    font-weight: 700;
  }
  .section-copy h1{
    font-size: clamp(28px, 5vw, 44px);
    letter-spacing: -0.02em;
    margin: 0 0 12px;
  }
  .section-copy p{ opacity:0.7; line-height:1.7; }

  /* ---------- Card Nav ---------- */
  :host {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.card-nav-wrap {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, calc(100% - 32px));
  z-index: 100;
}

.card-nav {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);

  /* theme tokens — dark bar is the default (used over light sections) */
  --surface: rgba(18, 18, 18, 0.55);
  --surface-2: rgba(27, 27, 27, 0.6);
  --border: rgba(255, 255, 255, 0.12);
  --ink: #f5f3ee;
  --muted: #948f83;
  --accent: white;
  --scrim-top: rgba(0, 0, 0, 0.15);
  --scrim-bottom: rgba(0, 0, 0, 0.85);
  --panel-ink: #f5f3ee;
  --panel-muted: #cfcabd;

  background: var(--surface);
  border: 1px solid var(--border);
}

/* light bar — used when the section behind the nav is dark */
.card-nav.theme-light {
  --surface: rgba(246, 243, 236, 0.6);
  --surface-2: rgba(255, 255, 255, 0.65);
  --ink: #16140f;
  --muted: #71695a;
  --border: rgba(0, 0, 0, 0.08);
  --accent: #3f4328;
  --scrim-top: rgba(255, 255, 255, 0.1);
  --scrim-bottom: rgba(20, 17, 10, 0.82);
  --panel-ink: #f5f3ee;
  --panel-muted: #d8d3c5;
}

/* hero bar — transparent over the white hero section, dark text/icons for contrast */
.card-nav.theme-hero {
  --surface: transparent;
  --surface-2: rgba(20, 17, 10, 0.06);
  --ink: #16140f;
  --muted: #6b6459;
  --border: transparent;
  --accent: #3f4328;
  --scrim-top: rgba(255, 255, 255, 0.1);
  --scrim-bottom: rgba(20, 17, 10, 0.82);
  --panel-ink: #f5f3ee;
  --panel-muted: #d8d3c5;
  box-shadow: none;
}

.card-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 12px 0 20px;
}

.cn-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body, "Diatype"), sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  user-select: none;
  transition: color 0.4s var(--ease), opacity 0.2s ease;
}

.cn-logo:hover {
  opacity: 0.85;
}

.cn-logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  object-fit: cover;
  display: block;
}

.cn-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cn-cta {
  appearance: none;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  padding: 9px 18px;
  border-radius: 10px;
  height: 44px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.4s var(--ease);
  white-space: nowrap;
}
.cn-cta:hover {
  background: var(--accent);
  color: #fff;
}

.cn-toggle {
  appearance: none;
  border: none;
  background: var(--surface-2);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 0.4s var(--ease);
}
.cn-toggle .bar {
  position: absolute;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}
.cn-toggle .bar:nth-child(1) {
  transform: translateY(-4px);
}
.cn-toggle .bar:nth-child(2) {
  transform: translateY(4px);
}

.card-nav.open .cn-toggle .bar:nth-child(1) {
  transform: translateY(0) rotate(45deg);
}
.card-nav.open .cn-toggle .bar:nth-child(2) {
  transform: translateY(0) rotate(-45deg);
}

/* content panel */
.cn-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s var(--ease);
}
.card-nav.open .cn-panel {
  grid-template-rows: 1fr;
}
.cn-panel-inner {
  min-height: 0;
  overflow: hidden;
}

.cn-panel-content {
  padding: 22px 20px 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}

/* Link columns — flat surface fill, no image background */
.cn-col {
  position: relative;
  min-height: 190px;
  border-radius: 12px;
  padding: 16px 16px 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.cn-col-inner {
  position: relative;
  z-index: 1;
}

.card-nav.open .cn-col {
  opacity: 1;
  transform: translateY(0);
}
.card-nav.open .cn-col:nth-child(1) { transition-delay: 0.08s; }
.card-nav.open .cn-col:nth-child(2) { transition-delay: 0.15s; }
.card-nav.open .cn-col:nth-child(3) { transition-delay: 0.22s; }
.card-nav.open .cn-col:nth-child(4) { transition-delay: 0.29s; }

.cn-col-label {
  font-family: var(--font-body, "Diatype"), sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--panel-ink);
  margin-bottom: 10px;
}

.cn-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--panel-ink);
  text-decoration: none;
  font-size: 14.5px;
  padding: 5px 0;
}
.cn-link span.arrow,
.cn-link svg.testimonial-arrow {
  color: var(--panel-muted);
  width: 14px;
  height: 14px;
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
  transform: rotate(0deg);
}
.cn-link:hover {
  color: #fff;
}
.cn-link:hover svg.testimonial-arrow {
  color: var(--gold);
  transform: translate(3px, -3px);
}

/* Product-update column — 4th column: image + title + description + CTA */
.cn-col-update {
  justify-content: flex-start;
  padding: 0;
  background: var(--surface-2);
}

.cn-update-img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  display: block;
}

.cn-update-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.cn-update-title {
  margin: 0;
  font-family: var(--font-title, "Cormorant"), serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--panel-ink);
}

.cn-update-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--panel-muted);
  flex: 1;
}

.cn-update-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
}
.cn-update-cta svg.testimonial-arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.25s var(--ease);
}
.cn-update-cta:hover svg.testimonial-arrow {
  transform: translate(3px, -3px);
}

@media (max-width: 900px) {
  .cn-panel-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .cn-panel-content {
    grid-template-columns: 1fr;
  }
  .cn-cta {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-nav *,
  .card-nav {
    transition: none !important;
  }
}