/* Royalust Wellness: tokens, base type, shared chrome (header, footer, buttons, toast).
   Page-specific layout lives in home.css and legal.css. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-garamond-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-garamond-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-garamond-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/jost-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/jost-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Surfaces */
  --pearl: #fcfaf7;
  --ivory: #f5f0e8;
  --white: #ffffff;

  /* Ink, tinted from the logo's lilac so text never reads as flat grey */
  --ink: #2e2733;
  --ink-2: #5c5363;
  --ink-3: #6e6573;

  /* Accents from the logo: champagne gold and lilac */
  --champagne: #c4a46c;
  --champagne-soft: #e4d3b4;
  --gold: #7e602d;
  --lilac: #8e6fa3;
  --lilac-wash: #ece3f1;

  --line: #e6ddd0;
  --shadow-soft: 0 22px 44px -28px rgba(62, 44, 30, 0.32);

  /* Type */
  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Avenir Next", "Segoe UI", sans-serif;

  --step-h1: clamp(2.45rem, 1.55rem + 3.7vw, 4.4rem);
  --step-h2: clamp(2.05rem, 1.5rem + 2.2vw, 3.15rem);
  --step-h3: clamp(1.45rem, 1.3rem + 0.5vw, 1.7rem);
  --step-lede: clamp(1.1rem, 1.04rem + 0.3vw, 1.25rem);
  --step-body: 1.0625rem;
  --step-small: 0.9rem;

  /* Space */
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(88px, 11vw, 168px);
  /* Jost's ch is wider than its average letter: 54ch renders about 72 characters */
  --measure: 54ch;
  --wide: 1200px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
  scrollbar-color: var(--champagne-soft) var(--pearl);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--pearl);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-body);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  caret-color: var(--lilac);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-h1);
  line-height: 1.06;
  letter-spacing: -0.015em;
}

h2 {
  font-size: var(--step-h2);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--step-h3);
  font-weight: 500;
  line-height: 1.2;
}

p,
li {
  margin: 0;
  text-wrap: pretty;
}

p + p {
  margin-top: 1.1em;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

/* Browser surfaces carry the palette too */
::selection {
  background: var(--lilac-wash);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 3px;
  border-radius: 3px;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--pearl);
}
::-webkit-scrollbar-thumb {
  background: var(--champagne-soft);
  border-radius: 10px;
  border: 2px solid var(--pearl);
}

a {
  color: inherit;
}

.text-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--champagne);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.text-link:hover {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--pearl);
  font-size: var(--step-small);
  text-decoration: none;
  border-radius: 999px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

.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;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 30px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--pearl);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease,
    box-shadow 0.3s ease;
}

.btn:hover {
  background: #463c4d;
  border-color: #463c4d;
  box-shadow: 0 14px 28px -18px rgba(46, 39, 51, 0.6);
}

.btn:active {
  background: #231d27;
}

.btn--small {
  min-height: 42px;
  padding: 9px 18px;
  font-size: 0.875rem;
  white-space: nowrap;
}

.btn--quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--champagne);
}

.btn--quiet:hover {
  background: var(--white);
  border-color: var(--gold);
  color: var(--ink);
  box-shadow: none;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Only shown once JS has loaded, so it never sits on the page as a dead control */
.needs-js {
  display: none !important;
}

.js .needs-js {
  display: inline-flex !important;
}

/* Small secondary control, e.g. Copy address */
.copy-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: 500 0.875rem/1.2 var(--sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.copy-btn:hover {
  border-color: var(--champagne);
  background: var(--pearl);
}

.copy-btn svg {
  width: 16px;
  height: 16px;
}

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

.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 22px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  border-radius: 6px;
}

.brand__mark {
  width: 40px;
  height: auto;
}

.brand__word {
  width: 104px;
  height: auto;
}

@media (min-width: 721px) {
  .brand__mark {
    width: 44px;
  }
  .brand__word {
    width: 116px;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 34px);
}

.site-nav__link {
  font-size: 0.95rem;
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.site-nav__link:hover {
  color: var(--ink);
  border-bottom-color: var(--champagne);
}

@media (max-width: 720px) {
  .site-nav__link {
    display: none;
  }
}

@media (max-width: 380px) {
  .brand {
    gap: 8px;
  }
  .brand__word {
    width: 92px;
  }
  .brand__mark {
    width: 34px;
  }
  .site-header .btn--small {
    padding: 9px 14px;
  }
}

/* The narrowest phones keep the name and the invitation on one line */
@media (max-width: 359px) {
  .brand__mark {
    display: none;
  }
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--pearl);
}

.site-footer__inner {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 56px var(--gutter) 64px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 24px 40px;
}

.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  border-radius: 6px;
}

.site-footer__brand img:first-child {
  width: 34px;
}

.site-footer__brand img:last-child {
  width: 96px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 28px;
  list-style: none;
  font-size: var(--step-small);
}

.site-footer__links a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.site-footer__links a:hover {
  color: var(--ink);
  border-bottom-color: var(--champagne);
}

.site-footer__links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--champagne);
}

.site-footer__legal {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--ink-3);
}

@media (max-width: 720px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 48px;
  }
  .site-footer__links {
    justify-content: flex-start;
    flex-direction: column;
    gap: 2px;
  }
  .site-footer__links a {
    display: inline-block;
    padding: 10px 0;
  }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--pearl);
  font-size: 0.95rem;
  box-shadow: 0 18px 36px -20px rgba(46, 39, 51, 0.7);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity 0.2s linear;
    transform: translate(-50%, 0);
  }
}
