/* EcoFamilyStore, preview build styles
   Palette, type, and motion rules per design spec.
   No external fonts, no CDNs. */

:root {
  --cream: #FBF7F2;
  --blush: #F3DCD3;
  --charcoal: #3A3532;
  --terracotta: #C1694F;       /* decorative only, fails 4.5:1 on cream */
  --terracotta-deep: #A8543C;  /* text/button safe */
  --sage: #7A8B6F;             /* decorative only, fails 4.5:1 on cream */
  --sage-deep: #5E6E54;        /* text/button safe */
  --white: #FFFFFF;

  --font-display: "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --max-content: 72rem;
  --max-text: 42rem;

  --motion-fast: 200ms;
  --motion-med: 300ms;
  --motion-slow: 400ms;
  --ease: cubic-bezier(0.33, 1, 0.68, 1);

  --radius-lg: 1.5rem;
  --radius-md: 1rem;
  --radius-sm: 0.5rem;

  --shadow-soft: 0 1px 2px rgba(58, 53, 50, 0.04), 0 8px 24px rgba(58, 53, 50, 0.08);
  --shadow-soft-hover: 0 2px 4px rgba(58, 53, 50, 0.06), 0 16px 36px rgba(58, 53, 50, 0.12);
}

/* Reduced-motion switch: set custom properties used by transitions to 0,
   and short-circuit the reveal animation in one place. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0ms;
    --motion-med: 0ms;
    --motion-slow: 0ms;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--terracotta-deep);
}

/* Visible focus ring on every interactive element, always on,
   not gated behind :focus-visible, per spec. */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus {
  outline: 3px solid var(--terracotta-deep);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: var(--charcoal);
  color: var(--white);
  padding: 0 1.25rem;
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin: 0 0 0.75rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: normal;
  color: var(--charcoal);
  margin: 0 0 0.5rem;
}

h1 {
  font-size: clamp(2.25rem, 5vw + 1rem, 3.75rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.3;
}

p {
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.125rem;
  max-width: var(--max-text);
}

/* ---------- Layout shells ---------- */

.wrap {
  max-width: var(--max-content);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

section {
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.bg-cream { background: var(--cream); }
.bg-blush { background: var(--blush); }
.bg-white { background: var(--white); }

/* sage-deep on blush measures 4.17:1, under the 4.5 floor for small bold
   text (verified by script, not eyeballed); charcoal keeps the eyebrow
   readable wherever the blush section background is in play. */
.bg-blush .eyebrow {
  color: var(--charcoal);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 247, 242, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid rgba(58, 53, 50, 0.08);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.375rem;
  color: var(--charcoal);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
}

.wordmark:hover {
  color: var(--terracotta-deep);
}

.wordmark .mark {
  color: var(--sage-deep);
}

nav.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.9rem;
  color: var(--charcoal);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  border-radius: var(--radius-sm);
  position: relative;
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.55rem;
  height: 2px;
  background: var(--terracotta-deep);
  opacity: 0;
  transition: opacity var(--motion-fast) var(--ease);
}

.nav-list a:hover::after,
.nav-list a:focus::after {
  opacity: 1;
}

.nav-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 1px solid rgba(58, 53, 50, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 47.9375rem) {
  .nav-toggle {
    display: inline-flex;
  }

  nav.primary-nav .nav-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--cream);
    border-bottom: 1px solid rgba(58, 53, 50, 0.08);
    padding: 0.5rem 1.5rem 1rem;
    gap: 0;
  }

  nav.primary-nav[data-open="true"] .nav-list {
    display: flex;
  }

  .nav-list a {
    width: 100%;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(3.5rem, 10vw, 7rem);
  padding-bottom: clamp(3.5rem, 10vw, 7rem);
}

.hero-wash {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2rem;
  max-width: 46rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 0.5rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.5rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--motion-fast) var(--ease),
              transform var(--motion-fast) var(--ease),
              box-shadow var(--motion-fast) var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: background-color 1ms linear;
  }
}

.btn-primary {
  background: var(--terracotta-deep);
  color: var(--white);
}

.btn-primary:hover {
  background: #944a35;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(168, 84, 60, 0.25);
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary:hover {
    transform: none;
  }
}

.btn-secondary {
  background: transparent;
  color: var(--charcoal);
  border-color: rgba(58, 53, 50, 0.25);
}

.btn-secondary:hover {
  background: rgba(58, 53, 50, 0.06);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .btn-secondary:hover {
    transform: none;
  }
}

.btn-card {
  background: var(--sage-deep);
  color: var(--white);
  width: 100%;
}

.btn-card:hover {
  background: #4d5b44;
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .btn-card:hover {
    transform: none;
  }
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--motion-slow) var(--ease),
              transform var(--motion-slow) var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* JS not available fallback: content stays visible */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

/* ---------- Promise band ---------- */

.promise {
  border-top: 1px solid rgba(58, 53, 50, 0.08);
  border-bottom: 1px solid rgba(58, 53, 50, 0.08);
}

.promise-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1.1fr 1fr;
  align-items: start;
}

@media (max-width: 47.9375rem) {
  .promise-grid {
    grid-template-columns: 1fr;
  }
}

.promise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.promise-list li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.promise-list .icon {
  flex: none;
  width: 28px;
  height: 28px;
  color: var(--sage-deep);
  margin-top: 0.15rem;
}

.promise-list strong {
  display: block;
  font-family: var(--font-body);
  color: var(--charcoal);
}

.promise-list span {
  color: var(--charcoal);
  opacity: 0.85;
  font-size: 0.9375rem;
}

/* ---------- Category rows ---------- */

.category-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.category-head p {
  margin: 0;
  max-width: 34rem;
  color: var(--charcoal);
  opacity: 0.85;
}

.product-grid {
  /* Flexbox instead of grid auto-fit: a 3-item row on a 2-column-width
     viewport used to leave the 3rd card stranded in an empty grid cell
     (grid reserves the column once any row uses it). Flex-wrap plus
     justify-content: center lets an orphaned last card center itself
     on its own line instead, and max-width keeps 2-item rows from
     stretching into oversized cards that broke rhythm with 3-item rows. */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 1 15.5rem;
  min-width: 15.5rem;
  max-width: 24rem;
  transition: box-shadow var(--motion-med) var(--ease);
}

.product-card:hover,
.product-card:focus-within {
  box-shadow: var(--shadow-soft-hover);
}

.product-media {
  background: var(--blush);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-media svg {
  width: 58%;
  height: 58%;
  color: var(--terracotta-deep);
  transition: transform var(--motion-slow) var(--ease);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--motion-slow) var(--ease);
}

.product-card:hover .product-media svg,
.product-card:focus-within .product-media svg,
.product-card:hover .product-media img,
.product-card:focus-within .product-media img {
  transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
  .product-card:hover .product-media svg,
  .product-card:focus-within .product-media svg,
  .product-card:hover .product-media img,
  .product-card:focus-within .product-media img {
    transform: none;
  }
}

.product-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.product-body h3 {
  margin-bottom: 0;
}

.product-material {
  font-size: 0.875rem;
  color: var(--sage-deep);
  letter-spacing: 0.02em;
  margin: 0;
}

.product-price {
  font-size: 0.9375rem;
  color: var(--charcoal);
  opacity: 0.85;
  margin: 0 0 0.5rem;
}

.product-body .btn-card {
  margin-top: auto;
}

/* ---------- About / imagery note section ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 47.9375rem) {
  .split {
    grid-template-columns: 1fr;
  }
}

.scene {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.scene svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid rgba(58, 53, 50, 0.1);
  background: var(--white);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2.5rem;
}

.footer-grid h3 {
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--sage-deep);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.footer-grid p,
.footer-grid a {
  font-size: 0.9375rem;
  color: var(--charcoal);
}

.footer-grid a {
  color: var(--terracotta-deep);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--motion-fast) var(--ease);
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
}

.footer-grid a:hover,
.footer-grid a:focus {
  text-decoration-color: currentColor;
}

@media (prefers-reduced-motion: reduce) {
  .footer-grid a {
    text-decoration-color: currentColor;
  }
}

.footer-bottom {
  border-top: 1px solid rgba(58, 53, 50, 0.1);
  margin-top: 3rem;
  padding-top: 1.5rem;
  font-size: 0.8125rem;
  opacity: 0.75;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

/* ---------- Preview notice ---------- */

.preview-banner {
  background: var(--charcoal);
  color: var(--white);
  font-size: 0.8125rem;
  text-align: center;
  padding: 0.6rem 1rem;
  line-height: 1.5;
}

.preview-banner strong {
  color: var(--white);
}
