/* ==========================================================================
   STYX Naturcosmetic — design system
   Plain CSS, no build step. Loaded by every page.
   Tokens synthesize the 2026 redesign (green / Outfit) with the brand's
   heritage serif (Cormorant Garamond) for display headings.
   ========================================================================== */

:root {
  /* Palette */
  --bg:          #FAFAF7;   /* page background */
  --bg-tint:     #EFF2E8;   /* pale green section tint */
  --ink:         #22301C;   /* dark green — primary text, dark sections */
  --ink-deep:    #1A2415;   /* footer */
  --green:       #6FA83F;   /* accent — buttons, links, eyebrows */
  --green-dark:  #58862F;   /* hover state on accent */
  --green-light: #A5CE7C;   /* accents on dark backgrounds */
  --green-pale:  #C9E3AE;   /* pale accent on dark backgrounds */
  --muted:       #5A6650;   /* secondary text */
  --line:        #E4E6DC;   /* borders, rules */
  --card:        #FFFFFF;

  /* Type */
  --font-ui:      'Outfit', system-ui, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;

  /* Shape */
  --r-pill: 999px;
  --r-card: 20px;
  --r-media: 14px;

  /* Layout */
  --container: 1200px;
  --gutter: 48px;

  /* Elevation (hover only — surfaces are flat by default) */
  --shadow-hover: 0 12px 32px rgba(34, 48, 28, 0.10);
}

/* ── Base ──────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--green); }

h1, h2, .display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(42px, 6vw, 68px); }
h2 { font-size: clamp(32px, 4.2vw, 46px); }

h3, h4 { font-family: var(--font-ui); font-weight: 600; margin: 0; }
h3 { font-size: 21px; }

p { margin: 0; text-wrap: pretty; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Uppercase green eyebrow above headings */
.eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 12px;
}
.on-dark .eyebrow { color: var(--green-light); }

.lead { font-size: 19px; color: var(--muted); }
.on-dark .lead { color: rgba(250, 250, 247, 0.82); }

.muted { color: var(--muted); }

/* ── Buttons & pills ───────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1;
  padding: 16px 32px;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--ink); color: var(--bg); }

.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--green); color: #fff; }

.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }

/* ghost variant for dark sections */
.on-dark .btn-ghost { border-color: rgba(250, 250, 247, 0.45); color: var(--bg); }
.on-dark .btn-ghost:hover { border-color: var(--bg); background: rgba(250, 250, 247, 0.1); color: var(--bg); }

.pill {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg-tint);
  border: none;
  border-radius: var(--r-pill);
  padding: 10px 20px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease;
}
.pill:hover { background: var(--green-pale); }
.pill.is-active { background: var(--ink); color: var(--bg); }

/* ── Cards ─────────────────────────────────────────────────────────────── */

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
a.card:hover { border-color: var(--green); box-shadow: var(--shadow-hover); }

.card-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-link { color: var(--green); font-weight: 600; font-size: 15.5px; }

/* Product packshot: contained on white with breathing room —
   flatters modest photo quality; never crop or full-bleed packshots.
   The image is absolutely positioned inside the padded square rather than
   sized as a flex child: iOS Safari ignores `min-width:0` on a flex-item
   image and lets it overflow to its intrinsic width (shoved left, clipped
   on the right). Absolute positioning sizes it explicitly, so it can never
   overflow in any browser. */
.media-product {
  background: #fff;
  aspect-ratio: 1;
  position: relative;
}
.media-product img {
  position: absolute;
  top: 12%;
  left: 12%;
  width: 76%;
  height: 76%;
  object-fit: contain;
}

/* Atmosphere media: cropped cover + green tint pulls uneven photos
   into the palette; use for moods and section imagery, not packshots. */
.media-atmo { position: relative; overflow: hidden; background: var(--bg-tint); }
.media-atmo img { width: 100%; height: 100%; object-fit: cover; }
.media-atmo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(34, 48, 28, 0.18), rgba(34, 48, 28, 0.02));
  pointer-events: none;
}

/* ── Sections ──────────────────────────────────────────────────────────── */

.section { padding: 96px 0; }
.section-tint { background: var(--bg-tint); }
.section-dark { background: var(--ink); color: var(--bg); }

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

/* ── Top bar ───────────────────────────────────────────────────────────── */

.topbar {
  background: var(--ink);
  color: var(--green-pale);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.topbar-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
  flex-wrap: wrap;
}
.topbar a { color: inherit; text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar .dot { opacity: 0.45; }

/* ── Header ────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-logo img { height: 48px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 32px; }
.site-nav a {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--green); }
.site-nav a.is-active { color: var(--green); }
.site-nav .btn { padding: 12px 26px; font-size: 16px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--ink);
}
.nav-toggle svg { display: block; }

/* ── Footer ────────────────────────────────────────────────────────────── */

.site-footer { background: var(--ink-deep); color: rgba(250, 250, 247, 0.68); font-size: 15.5px; }
.site-footer a { color: rgba(250, 250, 247, 0.85); text-decoration: none; }
.site-footer a:hover { color: var(--green-light); }

.footer-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px var(--gutter) 48px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}
.footer-brand p { max-width: 340px; margin-top: 16px; }
.footer-logo { height: 40px; width: auto; filter: brightness(0) invert(0.96); opacity: 0.92; }

.footer-col h4 {
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.footer-legal { border-top: 1px solid rgba(250, 250, 247, 0.12); }
.footer-legal-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 14px;
  color: rgba(250, 250, 247, 0.5);
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  :root { --gutter: 32px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  :root { --gutter: 20px; }
  .section { padding: 64px 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr; gap: 36px; }

  .site-logo img { height: 40px; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 0 16px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 13px var(--gutter); font-size: 17px; }
  .site-nav .btn { margin: 10px var(--gutter) 0; text-align: center; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .topbar .topbar-claim { display: none; }
}

/* ── Accessibility ─────────────────────────────────────────────────────── */

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible, .pill:focus-visible { border-radius: var(--r-pill); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
