/* ==========================================================================
   TANSY GROUP — css/main.css
   Site-wide foundation: design tokens, base elements, layout and motion.
   Loaded on every page first.
   ========================================================================== */

/* 1. Fonts ----------------------------------------------------------------
   Self-hosted variable fonts (SIL OFL 1.1 — licences beside the files), so
   text renders the same offline and no third-party font service is used.
   Manrope: headings. Inter: body text and UI.                               */

@font-face {
  font-family: "Manrope";
  src: url("../assets/fonts/manrope/Manrope-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Tokens -------------------------------------------------------------------- */

:root {
  color-scheme: light;
  /* Brand palette */
  --c-purple: #450763;
  --c-purple-deep: #2F0445;
  --c-purple-soft: #6A2C88;
  --c-pink: #EE658D;
  --c-pink-ink: #A8325A;      /* accessible pink for small text on light grounds */
  --c-ivory: #F7F3EF;
  --c-ivory-deep: #EFE7E0;
  --c-white: #FFFFFF;
  --c-charcoal: #29252D;
  --c-muted: #5E5664;
  --c-line: rgba(41, 37, 45, 0.14);
  --c-line-strong: rgba(41, 37, 45, 0.28);
  --c-line-light: rgba(247, 243, 239, 0.2);
  --c-text-light: rgba(247, 243, 239, 0.82);
  /* Typography — local fonts first, system fonts as fallback */
  --f-heading: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);   /* lead text 17–19px */
  --fs-h4: clamp(1.125rem, 1.07rem + 0.2vw, 1.25rem);    /* small titles 18–20px */
  --fs-h3: clamp(1.25rem, 1.15rem + 0.35vw, 1.5rem);     /* card headings 20–24px */
  --fs-h2: clamp(1.625rem, 1.4rem + 0.8vw, 2rem);        /* section headings 26–32px */
  --fs-h1: clamp(2.125rem, 1.7rem + 1.4vw, 2.75rem);     /* page headings 34–44px */
  --fs-hero: clamp(2.375rem, 1.6rem + 2.8vw, 3.75rem);   /* home hero 38–60px */
  /* Spacing & layout */
  --container: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(4.5rem, 3rem + 6vw, 8rem);
  --header-h: 84px;
  --radius-s: 3px;
  --radius-m: 6px;
  --shadow-soft: 0 24px 60px -32px rgba(47, 4, 69, 0.35);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 2. Base ------------------------------------------------------------------ */

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: 1.6;
  color: var(--c-charcoal);
  background-color: var(--c-ivory);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-menu-open {
  overflow: hidden;
}

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

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

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

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

h1,
h2,
h3 {
  font-family: var(--f-heading);
  font-weight: var(--fw-bold);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--c-purple);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }

h2 { font-size: var(--fs-h2); }

h3 { font-size: var(--fs-h3); font-weight: var(--fw-semibold); line-height: 1.25; letter-spacing: -0.01em; }

h4 {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  line-height: 1.35;
  color: var(--c-charcoal);
}

p {
  text-wrap: pretty;
}

em {
  font-style: italic;
}

:focus-visible {
  outline: 2px solid var(--c-pink);
  outline-offset: 3px;
}

.on-dark :focus-visible {
  outline-color: var(--c-white);
}

::selection {
  background: var(--c-pink);
  color: var(--c-purple-deep);
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--c-purple);
  color: var(--c-white);
  font-weight: 600;
  border-radius: var(--radius-s);
}

.skip-link:focus {
  top: 1rem;
}

/* 3. Layout ---------------------------------------------------------------- */

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section--white { background: var(--c-white); }

.section--ivory { background: var(--c-ivory); }

.section--sand { background: var(--c-ivory-deep); }

.section--purple,
.section--deep {
  color: var(--c-text-light);
}

.section--purple { background: var(--c-purple); }

.section--deep { background: var(--c-purple-deep); }

.section--purple h2,
.section--purple h3,
.section--deep h2,
.section--deep h3 {
  color: var(--c-white);
}

.section--tight { padding-block: clamp(3rem, 2rem + 4vw, 5rem); }

.split {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 4.5rem);
  align-items: center;
}

.stack > * + * { margin-top: 1.25rem; }

/* 11. Motion --------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .status__dot::after {
    display: none;
  }
}

/* Responsive ---------------------------------------------------------------- */

@media (max-width: 1020px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 72px;
  }
}
