/* ============================================================================
   Ritual.Industries — Shared Brand / Design System
   Served once at https://ritual.industries/brand/brand.css
   Every project links this file. Single source of truth. Update here → all
   projects reflect it. Values are the canonical brand tokens from the live site.
   ========================================================================== */

:root {
  /* Color */
  --bg: #fff2f2;          /* soft red-tinted paper */
  --red: #ED1C24;         /* the one decisive brand red */
  --red-dark: #c7141b;    /* hover/pressed red */
  --text: #333333;        /* warm charcoal ink */
  --text-light: #555555;  /* secondary ink */
  --line: rgba(51, 51, 51, 0.14);   /* hairline borders */

  /* Type */
  --font-display: 'Helvetica Neue', Helvetica, Arial, sans-serif;  /* wordmark / headings */
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;       /* body / UI */

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

  /* Shape */
  --radius: 22px;         /* cards / modals */
  --radius-pill: 999px;   /* buttons / tags / nav pills */
}

/* ---------- Base reset + defaults ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--red); color: var(--bg); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 3px; }
img, svg { display: block; }

/* ---------- Typography helpers ---------- */
.ri-display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.ri-eyebrow { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); font-weight: 600; }
.ri-dot { color: var(--red); }   /* the brand trailing-period device */

/* ---------- Buttons ---------- */
.ri-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-size: 15px; font-weight: 500;
  border-radius: var(--radius-pill); padding: 13px 30px; cursor: pointer;
  border: 1px solid transparent; transition: all .25s var(--ease);
}
.ri-btn-primary { background: var(--red); color: #fff; }
.ri-btn-primary:hover { background: var(--red-dark); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(237,28,36,0.32); }
.ri-btn-primary:active { transform: translateY(0); }
.ri-btn-ghost { background: none; color: var(--text); border-color: rgba(51,49,48,0.22); }
.ri-btn-ghost:hover { border-color: var(--text); background: rgba(51,51,51,0.04); }

/* ---------- Inputs ---------- */
.ri-input {
  font-family: var(--font-body); font-size: 15px; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.ri-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(237,28,36,0.14); }

/* ---------- Modal / scrim (shared pattern from the live site) ---------- */
.ri-scrim {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(40,28,28,0.46);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s var(--ease);
}
.ri-scrim.open { opacity: 1; visibility: visible; }
.ri-modal {
  background: var(--bg); width: min(560px, 100%); max-height: 86vh; overflow-y: auto;
  border-radius: var(--radius); padding: clamp(28px, 4vw, 44px); position: relative;
  box-shadow: 0 30px 80px rgba(40,20,20,0.28); border: 1px solid var(--line);
  transform: translateY(14px) scale(0.985); transition: transform .32s var(--ease);
}
.ri-scrim.open .ri-modal { transform: none; }
.ri-modal .ri-close {
  position: absolute; top: 18px; right: 18px; width: 38px; height: 38px;
  border-radius: 50%; border: 1px solid var(--line); background: none;
  cursor: pointer; font-size: 18px; color: var(--text);
  display: flex; align-items: center; justify-content: center; transition: background .2s var(--ease);
}
.ri-modal .ri-close:hover { background: rgba(51,51,51,0.06); }
.ri-modal h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px,4vw,34px); letter-spacing: -0.02em; margin-bottom: 16px; line-height: 1.04; }
.ri-modal p { font-size: 16px; line-height: 1.62; color: var(--text-light); margin-bottom: 14px; }
.ri-modal p strong { color: var(--text); font-weight: 600; }

/* ---------- Animated underline link (nav / back links) ---------- */
.ri-ulink { position: relative; }
.ri-ulink::after {
  content: ""; position: absolute; left: 0; bottom: -3px; height: 1.5px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .28s var(--ease);
}
.ri-ulink:hover::after { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
