/* ==========================================================================
   Love Counter — main.css
   Design system: variables, reset, base typography, layout primitives.
   Theme: Rose & Deep Plum (romantic, elegant, high contrast).
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Primary palette */
  --plum: #2A1128;          /* deep plum, primary dark surface */
  --plum-2: #3E1B3A;        /* raised plum */
  --wine: #6D214F;          /* rich wine accent */
  --rose: #E7477E;          /* primary rose */
  --rose-deep: #C42B67;     /* rose pressed / links on light */
  --rose-soft: #FDE7EE;     /* soft rose tint surface */
  --blush: #FBF3F6;         /* page background blush */
  --ink: #211019;           /* near-black warm ink */
  --white: #FFFFFF;

  /* Supporting */
  --rose-mist: #F7DDE7;     /* muted rose surface */
  --muted: #6E5763;         /* muted warm gray text */
  --success: #1E7A5A;
  --error: #C0223B;
  --border: #EAD4DD;        /* soft rose border */

  /* Semantic assignments */
  --bg-page: var(--blush);
  --bg-surface: var(--white);
  --bg-dark: var(--plum);
  --text-body: var(--ink);
  --text-heading: var(--plum);
  --text-muted: var(--muted);
  --text-on-dark: #FCE8F0;
  --accent: var(--rose);
  --link: var(--rose-deep);
  --link-hover: var(--wine);

  /* Type families */
  --font-display: "Playfair Display", "Georgia", "Times New Roman", serif;
  --font-body: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Fluid type scale */
  --fs-hero: clamp(2.3rem, 1.5rem + 3.4vw, 4.1rem);
  --fs-h1: clamp(2rem, 1.35rem + 2.6vw, 3.1rem);
  --fs-h2: clamp(1.55rem, 1.15rem + 1.6vw, 2.35rem);
  --fs-h3: clamp(1.22rem, 1.05rem + 0.75vw, 1.55rem);
  --fs-h4: clamp(1.05rem, 1rem + 0.35vw, 1.22rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-lead: clamp(1.05rem, 1rem + 0.45vw, 1.28rem);

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Shadows (warm-tinted) */
  --shadow-sm: 0 1px 2px rgba(42, 17, 40, 0.06), 0 1px 3px rgba(42, 17, 40, 0.08);
  --shadow-md: 0 6px 18px rgba(109, 33, 79, 0.10), 0 2px 6px rgba(42, 17, 40, 0.06);
  --shadow-lg: 0 18px 42px rgba(109, 33, 79, 0.16), 0 6px 12px rgba(42, 17, 40, 0.08);
  --shadow-rose: 0 10px 30px rgba(231, 71, 126, 0.28);

  /* Layout */
  --container: 1180px;
  --container-narrow: 780px;
  --header-h: 68px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 200ms;
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Keeps any in-page anchor clear of the sticky header instead of
     landing underneath it. */
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
}

/* Belt-and-braces for browsers that ignore scroll-padding on the root. */
[id] { scroll-margin-top: calc(var(--header-h) + 1.25rem); }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text-body);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

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

[hidden] { display: none !important; }

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

button { cursor: pointer; }

ul, ol { padding-left: 1.25rem; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--link-hover); }

/* ---------- Headings ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-heading);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p { max-width: 68ch; }

/* ---------- Focus keyword accent ----------
   "Love Counter" is wrapped in <span class="kw"> so the brand reads as an
   accent everywhere it appears. */
.kw {
  color: var(--rose-deep);
  font-weight: inherit;
  white-space: nowrap;
}
.section--dark .kw,
.calc-hero .kw,
.hero .kw { color: var(--rose); }

.kw-link {
  color: var(--rose-deep);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.kw-link:hover,
.kw-link:focus-visible { color: var(--wine); text-decoration: none; }
.section--dark .kw-link,
.calc-hero .kw-link,
.page-hero .kw-link,
.hero .kw-link { color: var(--rose); }
.section--dark .kw-link:hover,
.calc-hero .kw-link:hover,
.page-hero .kw-link:hover,
.hero .kw-link:hover { color: var(--white); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--plum);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
  color: var(--white);
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(3rem, 6vw, 5.5rem); }
.section--tight { padding-block: clamp(2rem, 4vw, 3rem); }
/* Consecutive tight sections read as one block, so collapse the seam
   instead of stacking two full paddings on top of each other. */
.section--tight + .section--tight { padding-top: 0; }

.section--sand { background: var(--rose-soft); }
.section--rose-mist { background: var(--rose-mist); }
.section--dark {
  background:
    radial-gradient(120% 120% at 85% -10%, rgba(231, 71, 126, 0.22), transparent 60%),
    linear-gradient(160deg, var(--plum) 0%, var(--plum-2) 60%, var(--wine) 130%);
  color: var(--text-on-dark);
}
.section--dark h1,
.section--dark h2,
.section--dark h3 { color: var(--white); }
.section--dark p { color: var(--text-on-dark); }

/* Section headings */
.section-head { margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.section-head--center {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
}
.section-head--center .section-intro { margin-inline: auto; }

.section-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose-deep);
  margin-bottom: 0.6rem;
}
.section--dark .section-eyebrow { color: var(--rose); }

.section-title { margin-bottom: 0.5rem; }
.section-intro {
  font-size: var(--fs-lead);
  color: var(--text-muted);
  max-width: 60ch;
}
.section--dark .section-intro { color: var(--text-on-dark); }

/* Grid */
.grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Flow (vertical rhythm) */
.flow > * + * { margin-top: 1.1em; }

/* Utility */
.text-center { text-align: center; }
/* p is capped at 68ch, so in a centred block it must also be centred or the
   text sits visibly left of the axis it is meant to align to. */
.text-center p,
.text-center > * { margin-inline: auto; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; }

/* Breadcrumbs */
.breadcrumbs { padding-block: 1rem 0; font-size: var(--fs-small); }
.breadcrumbs ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-muted);
}
.breadcrumbs li { display: flex; align-items: center; gap: 0.5rem; }
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: var(--border);
}
.breadcrumbs a { color: var(--rose-deep); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--text-muted); }

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