/* ==========================================================================
   Base reset + typography + utility layout tokens.
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img, svg, video { max-width: 100%; display: block; height: auto; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--accent); }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.6em;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }

p { margin: 0 0 1em; color: var(--text-secondary); }

ul, ol { margin: 0 0 1em; padding-left: 1.2rem; }
li { margin-bottom: 0.35rem; }

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link,
.sr-only {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 1000;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.6rem 1rem;
  background-color: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  box-shadow: var(--shadow-md);
  outline: 2px solid var(--bg-primary);
  outline-offset: 2px;
}

main:focus { outline: none; }

/* Layout helpers */
.container {
  width: 100%;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (max-width: 360px) {
  .container { padding-left: 1rem; padding-right: 1rem; }
  body { font-size: 15px; }
}

.section {
  display: block;
  width: 100%;
  scroll-margin-top: 96px;
}

/* [hidden] must always win over the .section display rule above
   (admin can toggle sections off at runtime via content-bridge.js). */
.section[hidden] { display: none !important; }

/* CLS prevention — reserve space for sections populated via fetch loader.
   Matches only while host is empty; once innerHTML is injected, real height takes over. */
#sec-01:empty { min-height: 68px; }
#sec-02:empty { min-height: 720px; }
#sec-03:empty, #sec-04:empty, #sec-05:empty, #sec-06:empty,
#sec-07:empty, #sec-07b:empty, #sec-08:empty, #sec-09:empty,
#sec-11:empty { min-height: 600px; }
#sec-10:empty { min-height: 280px; }

@media (max-width: 768px) {
  #sec-02:empty { min-height: 900px; }
  #sec-03:empty, #sec-04:empty, #sec-05:empty, #sec-06:empty,
  #sec-07:empty, #sec-07b:empty, #sec-08:empty, #sec-09:empty,
  #sec-11:empty { min-height: 720px; }
}

main > .section {
  padding-top: clamp(3rem, 6vw, 5.5rem);
  padding-bottom: clamp(3rem, 6vw, 5.5rem);
  background-color: var(--bg-primary);
}

main > .section:nth-of-type(even) {
  background-color: var(--bg-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.btn--primary {
  background-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background-color: var(--accent-hover); color: #fff; }

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn--ghost:hover { background-color: var(--bg-elevated); }

/* Utility */
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-title h2 { margin-bottom: 0.5rem; }
.section-title p { max-width: 680px; margin: 0 auto; }

/* Loader error */
.load-error {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  background-color: var(--accent-soft);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

/* Image placeholder (used where product images would live) */
.img-placeholder {
  position: relative;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 30% 30%, var(--accent-soft), transparent 60%),
    linear-gradient(135deg, var(--bg-elevated), var(--bg-secondary));
  border: 1px solid var(--border);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.img-placeholder::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Scroll progress bar (top of viewport) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: transparent;
  z-index: 95;
  pointer-events: none;
}
.scroll-progress__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
  box-shadow: 0 0 10px var(--accent);
}

/* Scroll-to-top button */
.scroll-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background-color: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: var(--shadow-md);
  z-index: 90;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.scroll-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
