/* ============================================================
   The Calm Mama Co — Reset, Custom Properties, Base, Utilities
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --bg:          #FBF8F3;
  --peony:       #E8C4C0;
  --ice:         #C8DCE8;
  --gold:        #B8975A;
  --gold-dark:   #9E7D47;
  --text:        #2C2417;
  --text-light:  #6B5D4F;
  --white:       #FFFFFF;
  --border:      #E8E0DA;

  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Lato', 'Helvetica Neue', Arial, sans-serif;

  --nav-height:  72px;
  --max-width:   1160px;

  --space-xs:  0.375rem;
  --space-sm:  0.75rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;
  --space-3xl: 9rem;

  --radius: 1px;
  --transition: 0.2s ease;
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas {
  display: block;
  max-width: 100%;
}

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

ul, ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

p:not(:last-child) {
  margin-bottom: var(--space-md);
}

/* --- Base Typography --- */
h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 5vw, 3.875rem);
  font-weight: 400;
  line-height: 1.12;
  color: var(--text);
  letter-spacing: 0.01em;
}

h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3.5vw, 2.625rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.375rem, 2.5vw, 1.875rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--text);
}

h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text);
}

h5 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-sm {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-xs {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-2xl) 0;
}

.section-sm {
  padding: var(--space-xl) 0;
}

.section-lg {
  padding: var(--space-3xl) 0;
}

.bg-white  { background-color: var(--white); }
.bg-bg     { background-color: var(--bg); }
.bg-peony  { background-color: var(--peony); }
.bg-ice    { background-color: var(--ice); }
.bg-dark   { background-color: var(--text); }

/* --- Text Utilities --- */
.text-center { text-align: center; }
.text-light  { color: var(--text-light); }
.text-gold   { color: var(--gold); }
.text-white  { color: var(--white); }

.italic { font-style: italic; }

/* Overline: small uppercase label above headings */
.overline {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-sm);
}

/* Gold rule accent */
.gold-line {
  width: 36px;
  height: 1px;
  background-color: var(--gold);
  margin: var(--space-md) auto;
}
.gold-line--left {
  margin-left: 0;
}

/* Tag / category badge */
.tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 0.2rem 0.6rem;
}

/* Image placeholder */
.img-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg);
}
.img-placeholder--hero   { aspect-ratio: 16 / 7; }
.img-placeholder--square { aspect-ratio: 1 / 1; }
.img-placeholder--tall   { aspect-ratio: 3 / 4; }
.img-placeholder--card   { aspect-ratio: 4 / 3; }
.img-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Grid helpers */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* Flex helpers */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Selection */
::selection {
  background: var(--peony);
  color: var(--text);
}

/* Body lock for open nav */
body.nav-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .section    { padding: var(--space-xl) 0; }
  .section-lg { padding: var(--space-2xl) 0; }
}

@media (max-width: 480px) {
  :root { --space-lg: 1.25rem; }
  h1 { font-size: 2.25rem; }
}

/* --- Hero Rotating Tagline --- */
.hero-rotating {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--text);
}

.hero-rotating__words {
  display: block;
  position: relative;
  height: 1.2em;
}

.hero-rotating__word {
  display: block;
  position: absolute;
  inset-inline: 0;
  font-style: italic;
  color: var(--gold);
  opacity: 0;
  animation: rotate-word 5.6s infinite;
}

.hero-rotating__word:nth-child(1) { animation-delay: 0s; }
.hero-rotating__word:nth-child(2) { animation-delay: 0.8s; }
.hero-rotating__word:nth-child(3) { animation-delay: 1.6s; }
.hero-rotating__word:nth-child(4) { animation-delay: 2.4s; }
.hero-rotating__word:nth-child(5) { animation-delay: 3.2s; }
.hero-rotating__word:nth-child(6) { animation-delay: 4.0s; }
.hero-rotating__word:nth-child(7) { animation-delay: 4.8s; }

@keyframes rotate-word {
  0%    { opacity: 0; }
  1.8%  { opacity: 1; }
  12.5% { opacity: 1; }
  14.3% { opacity: 0; }
  100%  { opacity: 0; }
}
