@import "tailwindcss" source(none);
@source "../src";
@import "tw-animate-css";
@plugin "@tailwindcss/typography";

@custom-variant dark (&:is([data-theme='dark'] *));

/*
 * Peptidewinkel — clinical / pharmaceutical design system.
 * Palette: Raw Umber #795315, Sandy Taupe #936B25, Pale Gold #FFD777,
 *          Thunder Black #2B2B2B, White #FFFFFF.
 * HSL channel tokens defined as `<H> <S>% <L>%`.
 */

@theme inline {
  --color-background: hsl(var(--background));
  --color-foreground: hsl(var(--foreground));
  --color-card: hsl(var(--card));
  --color-card-foreground: hsl(var(--card-foreground));
  --color-popover: hsl(var(--popover));
  --color-popover-foreground: hsl(var(--popover-foreground));
  --color-primary: hsl(var(--primary));
  --color-primary-foreground: hsl(var(--primary-foreground));
  --color-primary-hover: hsl(var(--primary-hover));
  --color-secondary: hsl(var(--secondary));
  --color-secondary-foreground: hsl(var(--secondary-foreground));
  --color-muted: hsl(var(--muted));
  --color-muted-foreground: hsl(var(--muted-foreground));
  --color-accent: hsl(var(--accent));
  --color-accent-foreground: hsl(var(--accent-foreground));
  --color-destructive: hsl(var(--destructive));
  --color-destructive-foreground: hsl(var(--destructive-foreground));
  --color-success: hsl(var(--success));
  --color-success-foreground: hsl(var(--success-foreground));
  --color-warning: hsl(var(--warning));
  --color-warning-foreground: hsl(var(--warning-foreground));
  --color-border: hsl(var(--border));
  --color-input: hsl(var(--input));
  --color-ring: hsl(var(--ring));
  --color-surface: hsl(var(--surface));
  --color-surface-alt: hsl(var(--surface-alt));
  --color-sidebar: hsl(var(--sidebar-background));
  --color-sidebar-foreground: hsl(var(--sidebar-foreground));
  --color-sidebar-primary: hsl(var(--sidebar-primary));
  --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));
  --color-sidebar-accent: hsl(var(--sidebar-accent));
  --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
  --color-sidebar-border: hsl(var(--sidebar-border));
  --color-sidebar-ring: hsl(var(--sidebar-ring));

  /* Clinical brand tokens — adapt to light/dark */
  --color-shell: hsl(var(--shell));
  --color-shell-foreground: hsl(var(--shell-foreground));
  --color-shell-muted: hsl(var(--shell-muted));
  --color-shell-border: hsl(var(--shell-border));
  --color-shell-elevated: hsl(var(--shell-elevated));
  --color-brand-gold: hsl(var(--brand-gold));
  --color-brand-gold-hi: hsl(var(--brand-gold-hi));
  --color-brand-gold-lo: hsl(var(--brand-gold-lo));
  --color-brand-gold-contrast: hsl(var(--brand-gold-contrast));

  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);

  --font-sans: Manrope, Inter, system-ui, sans-serif;
  --font-display: Sora, "Space Grotesk", Inter, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

}

:root {
  /* Light — clinical white surfaces with gold accents */
  --background: 0 0% 100%;
  --foreground: 0 0% 17%;            /* Thunder Black */
  --card: 0 0% 100%;
  --card-foreground: 0 0% 17%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 17%;
  --primary: 38 60% 36%;             /* Sandy Taupe #936B25 */
  --primary-foreground: 0 0% 100%;
  --primary-hover: 37 70% 28%;       /* Raw Umber */
  --secondary: 37 70% 28%;           /* Raw Umber #795315 */
  --secondary-foreground: 0 0% 100%;
  --muted: 42 50% 96%;
  --muted-foreground: 0 0% 35%;
  --accent: 42 100% 73%;             /* Pale Gold #FFD777 */
  --accent-foreground: 0 0% 17%;
  --destructive: 0 72% 45%;
  --destructive-foreground: 0 0% 100%;
  --success: 145 55% 35%;
  --success-foreground: 0 0% 100%;
  --warning: 38 92% 50%;
  --warning-foreground: 0 0% 17%;
  --border: 38 25% 88%;
  --input: 38 25% 88%;
  --ring: 38 60% 36%;
  --radius: 0.625rem;                /* slightly tighter, pharma feel */
  --surface: 42 40% 98%;
  --surface-alt: 42 40% 94%;

  --sidebar-background: 0 0% 100%;
  --sidebar-foreground: 0 0% 17%;
  --sidebar-primary: 38 60% 36%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 42 40% 94%;
  --sidebar-accent-foreground: 0 0% 17%;
  --sidebar-border: 38 25% 88%;
  --sidebar-ring: 38 60% 36%;

  /* Clinical shell — header/footer/drawer surfaces (light) */
  --shell: 40 33% 97%;               /* warm clinical cream */
  --shell-elevated: 40 25% 94%;
  --shell-foreground: 0 0% 12%;
  --shell-muted: 0 0% 38%;
  --shell-border: 38 20% 84%;
  --brand-gold: 38 60% 36%;          /* Sandy Taupe — readable on light */
  --brand-gold-hi: 38 70% 45%;
  --brand-gold-lo: 37 70% 28%;
  /* Text on gold buttons/badges: white reads better on the dark light-mode gold
     (4.8:1 vs 4.3:1 for black). Dark mode uses the bright gold, so it flips. */
  --brand-gold-contrast: 0 0% 100%;

  /* Brand gradients */
  --gradient-gold: linear-gradient(135deg, #795315 0%, #936B25 35%, #FFD777 70%, #936B25 100%);
  --gradient-gold-soft: linear-gradient(135deg, #936B25 0%, #FFD777 100%);
  --gradient-clinical: linear-gradient(180deg, #2B2B2B 0%, #1a1a1a 100%);

  --shadow-gold: 0 10px 30px -12px rgb(147 107 37 / 0.35);
  --shadow-gold-soft: 0 4px 14px -4px rgb(147 107 37 / 0.25);
}

[data-theme="dark"] {
  /* Dark — thunder black with luminous gold */
  --background: 0 0% 8%;             /* near Thunder Black */
  --foreground: 42 30% 92%;
  --card: 0 0% 11%;
  --card-foreground: 42 30% 92%;
  --popover: 0 0% 11%;
  --popover-foreground: 42 30% 92%;
  --primary: 42 100% 73%;            /* Pale Gold */
  --primary-foreground: 0 0% 12%;
  --primary-hover: 38 90% 65%;
  --secondary: 38 60% 46%;           /* Sandy Taupe brightened */
  --secondary-foreground: 0 0% 12%;
  --muted: 0 0% 14%;
  --muted-foreground: 42 15% 65%;
  --accent: 38 60% 36%;
  --accent-foreground: 42 30% 92%;
  --destructive: 0 65% 55%;
  --destructive-foreground: 0 0% 100%;
  --success: 145 50% 50%;
  --success-foreground: 0 0% 12%;
  --warning: 38 92% 60%;
  --warning-foreground: 0 0% 12%;
  --border: 0 0% 18%;
  --input: 0 0% 18%;
  --ring: 42 100% 73%;
  --surface: 0 0% 10%;
  --surface-alt: 0 0% 14%;

  --sidebar-background: 0 0% 8%;
  --sidebar-foreground: 42 30% 92%;
  --sidebar-primary: 42 100% 73%;
  --sidebar-primary-foreground: 0 0% 12%;
  --sidebar-accent: 0 0% 14%;
  --sidebar-accent-foreground: 42 30% 92%;
  --sidebar-border: 0 0% 18%;
  --sidebar-ring: 42 100% 73%;

  /* Clinical shell — header/footer/drawer surfaces (dark) */
  --shell: 0 0% 2%;                  /* near-black #050505 */
  --shell-elevated: 0 0% 4%;         /* #0A0A0A */
  --shell-foreground: 0 0% 100%;
  --shell-muted: 0 0% 70%;
  --shell-border: 0 0% 14%;          /* subtle dark hairline */
  --brand-gold: 38 70% 64%;          /* #E5B85F */
  --brand-gold-hi: 42 100% 73%;      /* #FFD777 */
  --brand-gold-lo: 37 60% 36%;       /* #936B25 */
  /* Bright gold here, so near-black text instead of white. */
  --brand-gold-contrast: 0 0% 8%;
}

@layer base {
  * {
    border-color: hsl(var(--border));
  }
  body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  /* Clinical 1px gold hairline below section H2s where opted-in */
  .clinical-rule {
    position: relative;
    padding-bottom: 0.75rem;
  }
  .clinical-rule::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 56px;
    height: 1px;
    background: var(--gradient-gold-soft);
  }
}

@layer components {
  .wc-content {
    color: hsl(var(--foreground) / 0.82);
    line-height: 1.75;
    overflow-wrap: anywhere;
  }

  .wc-content > *:first-child { margin-top: 0; }
  .wc-content > *:last-child { margin-bottom: 0; }

  .wc-content p,
  .wc-content ul,
  .wc-content ol,
  .wc-content blockquote,
  .wc-content table,
  .wc-content figure {
    margin-block: 1rem;
  }

  .wc-content h2,
  .wc-content h3,
  .wc-content h4 {
    color: hsl(var(--foreground));
    font-weight: 800;
    line-height: 1.2;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
  }

  .wc-content h2 { font-size: 1.5rem; }
  .wc-content h3 { font-size: 1.25rem; }
  .wc-content h4 { font-size: 1.125rem; }

  .wc-content ul,
  .wc-content ol {
    padding-left: 1.5rem;
  }

  .wc-content ul { list-style: disc; }
  .wc-content ol { list-style: decimal; }

  .wc-content li {
    margin-block: 0.375rem;
    padding-left: 0.125rem;
  }

  .wc-content strong,
  .wc-content b {
    color: hsl(var(--foreground));
    font-weight: 700;
  }

  .wc-content a {
    color: hsl(var(--primary));
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }

  .wc-content blockquote {
    border-left: 3px solid hsl(var(--primary));
    background: hsl(var(--surface));
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    padding: 1rem 1.25rem;
  }

  .wc-content table {
    width: 100%;
    border-collapse: collapse;
  }

  .wc-content th,
  .wc-content td {
    border: 1px solid hsl(var(--border));
    padding: 0.75rem 1rem;
    text-align: left;
  }

  .wc-content th {
    background: hsl(var(--surface));
    color: hsl(var(--foreground));
    font-weight: 700;
  }
}

/* In the components layer so utilities like max-w-md can narrow it. */
@layer components {
  .container {
    width: 100%;
    margin-inline: auto;
    padding-inline: 1rem;
    max-width: 80rem;
  }
  @media (min-width: 768px) {
    .container { padding-inline: 2rem; }
  }
}

@layer utilities {


  .text-display { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; }
  .font-mono { font-family: var(--font-mono); }

  .gradient-primary { background-image: var(--gradient-gold); }
  .gradient-gold-soft { background-image: var(--gradient-gold-soft); }
  .gradient-clinical { background-image: var(--gradient-clinical); }

  .text-gradient-primary {
    background-image: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .shadow-gold { box-shadow: var(--shadow-gold); }
  .shadow-glow { box-shadow: var(--shadow-gold); }
  .shadow-glow-soft { box-shadow: var(--shadow-gold-soft); }
  .shadow-card { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04), 0 1px 3px 0 rgb(0 0 0 / 0.06); }
  .shadow-card-hover { box-shadow: 0 10px 30px -12px rgb(0 0 0 / 0.18); }

  .focus-ring:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
    border-radius: 0.5rem;
  }

  .glass-card-premium {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-xl);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04);
    transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
  }
  .glass-card-premium:hover {
    border-color: hsl(var(--primary) / 0.4);
    box-shadow: var(--shadow-gold-soft);
    transform: translateY(-2px);
  }

  /* Lab-style monospaced label badge */
  .lab-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.25rem 0.55rem;
    border: 1px solid hsl(var(--primary) / 0.5);
    color: hsl(var(--primary));
    border-radius: 0.375rem;
    background: hsl(var(--primary) / 0.06);
  }

  /* Subtle molecular grid backdrop (use sparingly on hero only) */
  .bg-molecule-grid {
    background-image:
      radial-gradient(circle at 1px 1px, rgb(255 215 119 / 0.10) 1px, transparent 0);
    background-size: 28px 28px;
  }

  /* Precision-lab bento tile */
  .bento-tile {
    position: relative;
    overflow: hidden;
    border-radius: 2rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    transition: border-color 400ms ease, transform 400ms ease, box-shadow 400ms ease;
  }
  .bento-tile:hover {
    border-color: hsl(var(--primary) / 0.45);
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold-soft);
  }

  /* Hairline that grows on hover */
  .rule-grow {
    display: inline-block;
    height: 1px;
    width: 2.5rem;
    background: currentColor;
    transition: width 300ms ease;
  }
  .group:hover .rule-grow { width: 4.5rem; }
}






/* Hide Weglot's default floating switcher — we use a custom one in the header */
.country-selector,
.wg-drop,
[class*="weglot-container"]:not(.weglot-inline) {
  display: none !important;
}


/* Kennisbank / Peptidewijzer */
@keyframes kb-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: kb-rise 0.55s cubic-bezier(0.32,0.72,0,1) both; }
.prose-pa h2 { font-weight: 900; font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 0.75rem; line-height: 1.15; color: hsl(var(--foreground)); }
.prose-pa h3 { font-weight: 700; font-size: 1.125rem; margin-top: 1.5rem; margin-bottom: 0.5rem; color: hsl(var(--foreground)); }
.prose-pa p { color: hsl(var(--muted-foreground)); line-height: 1.75; margin-bottom: 1rem; }
.prose-pa ul { list-style: disc; padding-left: 1.25rem; color: hsl(var(--muted-foreground)); margin-bottom: 1rem; }
.prose-pa li { margin-bottom: 0.35rem; line-height: 1.6; }

/*
 * Shop filter switch (Op voorraad / In de aanbieding / Uitgelicht).
 *
 * Plain CSS on purpose: `.gradient-primary` is a hand-written class in the
 * utilities layer, and Tailwind only generates variants for the utilities it
 * creates itself. A class such as `peer-checked:gradient-primary` therefore
 * never reached the stylesheet and the switch stayed grey when it was on.
 * Styling the track from `input.peer:checked` always ships, in both themes.
 */
.pw-switch {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 2.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background-color: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.pw-switch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  background-color: hsl(var(--card));
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  transform: translateY(-50%);
  transition: transform 200ms ease;
}

.peer:checked ~ .pw-switch {
  background-image: var(--gradient-gold);
  border-color: hsl(var(--brand-gold));
  box-shadow: var(--shadow-gold-soft);
}

.peer:checked ~ .pw-switch::after {
  transform: translate(1rem, -50%);
}

.peer:focus-visible ~ .pw-switch {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

/*
 * Conversion motion.
 *
 * Small, purposeful animations that answer "did that work?" and pull the eye
 * one step further down the funnel (product -> cart -> checkout). Everything
 * here is a transform or an opacity, so it stays on the compositor, and the
 * reduced-motion block at the end of this file turns it off for anyone who
 * asked for that.
 */
.pw-sheen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.pw-sheen::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 22%, rgb(255 255 255 / 0.55) 50%, transparent 78%);
  animation: pw-sheen 620ms ease-out;
}

@keyframes pw-sheen {
  to { transform: translateX(120%); }
}

/* The header cart badge punches when the count goes up. */
.pw-cart-pop {
  animation: pw-cart-pop 620ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pw-cart-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.45); }
  60% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

/* Ring that radiates off the cart icon on the same beat. */
.pw-cart-ring::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 9999px;
  border: 2px solid hsl(var(--brand-gold));
  animation: pw-cart-ring 620ms ease-out;
  pointer-events: none;
}

@keyframes pw-cart-ring {
  0% { opacity: 0.75; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(1.6); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Spinners are a status indicator rather than decoration, so they keep turning. */
  *:not(.animate-spin) {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
