/* ==========================================================================
   ALCHEMY ATRIUM NEXUS  |  shared stylesheet for every page
   Edit the TOKENS block first: colours, fonts, sizes, spacing, buttons.
   ========================================================================== */

/* ==========================================================================
   1. TOKENS
   ========================================================================== */
:root {

  /* ---- Colour: 60 / 30 / 10 rule, taken from the logo ------------------ */
  /* 60%  MAIN       deep night violet (logo background)                    */
  --color-main:            #1c0a27;
  --color-main-soft:       #2a1239;   /* inputs, loading placeholders        */
  /* 30%  SECONDARY  royal purple (logo wings)                              */
  --color-secondary:       #461a58;
  --color-secondary-soft:  #6c3a86;   /* borders and lines on secondary      */
  /* 10%  HIGHLIGHT  gold and orange (logo emblem and flame)                */
  --color-highlight:        #ffb52e;
  --color-highlight-strong: #f5821f;  /* hover and pressed state             */
  /* Text */
  --color-text:            #f4edfb;
  --color-text-muted:      #cdbbe0;
  --color-text-on-highlight: #1c0a27; /* text that sits on gold              */
  /* Status colour (form errors only, kept out of the 60/30/10 split)        */
  --color-error:           #ff9d9d;

  /* ---- Fonts (system fonts: no downloads, no tracking) ------------------ */
  --font-display: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --font-body:    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* To use a licensed brand font, add an @font-face rule and put its name
     first in the lists above. */

  /* ---- Type scale -------------------------------------------------------- */
  --fs-body:   1.0625rem;
  --fs-small:  0.9rem;
  --fs-h1:     clamp(1.9rem, 1.2rem + 3vw, 3rem);
  --fs-h2:     clamp(1.65rem, 1.2rem + 1.8vw, 2.5rem);
  --fs-h3:     1.3rem;
  --lh-body:   1.65;
  --lh-heading: 1.15;
  --fw-heading: 700;
  --letter-spacing-heading: 0.005em;

  /* ---- Layout and spacing ------------------------------------------------ */
  --width-content: 72rem;
  --width-text:    38rem;     /* keeps lines under about 70 characters       */
  --space-section: clamp(3.5rem, 2rem + 6vw, 6.5rem);
  --space-gutter:  clamp(1.25rem, 4vw, 2.5rem);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;

  /* ---- Breakpoints (for reference: CSS variables cannot be used inside
          @media rules, so change the numbers in section 11 to match) ------ */
  --bp-tablet: 60rem;   /* about 960px  */
  --bp-phone:  40rem;   /* about 640px  */

  /* ---- Shapes ------------------------------------------------------------ */
  --radius-button: 999px;
  --radius-panel:  0.75rem;
  --radius-input:  0.5rem;
  --border-width:  1px;

  /* ---- Buttons ----------------------------------------------------------- */
  --btn-pad-y:   0.8rem;
  --btn-pad-x:   1.6rem;
  --btn-font-size: 1rem;
  --btn-font-weight: 700;
  --btn-border-width: 2px;
  --btn-small-pad-y: 0.5rem;
  --btn-small-pad-x: 1.1rem;
  --btn-small-font-size: 0.9rem;

  /* ---- Links and focus --------------------------------------------------- */
  --color-link: var(--color-highlight);
  --focus-ring: 3px solid var(--color-highlight);

  /* ---- Motion ------------------------------------------------------------ */
  --transition: 160ms ease;
}

/* ==========================================================================
   2. BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 6.5rem; }

body {
  margin: 0;
  background: var(--color-main);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-heading);
  line-height: var(--lh-heading);
  letter-spacing: var(--letter-spacing-heading);
  margin: 0 0 var(--space-2);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 var(--space-2); }
ul { margin: 0; padding: 0; }

a { color: var(--color-link); text-underline-offset: 0.2em; }
a:hover { color: var(--color-highlight-strong); }

:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }

img { max-width: 100%; }

.skip-link {
  position: absolute; left: var(--space-2); top: -4rem;
  background: var(--color-highlight); color: var(--color-text-on-highlight);
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-input);
  font-weight: 700; z-index: 30;
}
.skip-link:focus { top: var(--space-1); }

/* ==========================================================================
   3. LAYOUT HELPERS
   ========================================================================== */
.wrap {
  width: 100%;
  max-width: calc(var(--width-content) + 2 * var(--space-gutter));
  margin-inline: auto;
  padding-inline: var(--space-gutter);
}

/* Section backgrounds: main is the default; secondary is the alternate band */
.section            { padding-block: var(--space-section); background: var(--color-main); }
.section--secondary { background: var(--color-secondary); }
.section--flush-top { padding-top: 0; }

.section__intro     { max-width: var(--width-text); }
.muted              { color: var(--color-text-muted); }

.split {
  display: grid;
  gap: var(--space-4) clamp(2rem, 6vw, 5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  align-items: start;
}

/* Text pages: privacy, terms, thank-you, 404 */
.prose { max-width: var(--width-text); }
.prose h2 { font-size: 1.45rem; margin-top: var(--space-4); }
.prose ul { padding-left: 1.2rem; margin-bottom: var(--space-2); }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--color-highlight); }
.prose .updated { color: var(--color-text-muted); font-size: var(--fs-small); }

/* ==========================================================================
   4. BUTTONS
   ========================================================================== */
.btn {
  display: inline-block;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border: var(--btn-border-width) solid transparent;
  border-radius: var(--radius-button);
  font: inherit;
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}
.btn--primary { background: var(--color-highlight); color: var(--color-text-on-highlight); }
.btn--primary:hover { background: var(--color-highlight-strong); color: var(--color-text-on-highlight); }
.btn--ghost { border-color: var(--color-highlight); color: var(--color-text); }
.btn--ghost:hover { background: var(--color-highlight); color: var(--color-text-on-highlight); }
.btn--small { padding: var(--btn-small-pad-y) var(--btn-small-pad-x); font-size: var(--btn-small-font-size); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

/* Loading state: shown while a button is working */
.btn.is-loading { pointer-events: none; opacity: 0.9; }
.btn.is-loading::before {
  content: "";
  display: inline-block; width: 1em; height: 1em; margin-right: 0.6em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -0.15em;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   5. COOKIE NOTICE, HEADER AND NAVIGATION
   ========================================================================== */
/* Informational only: the site sets no cookies, so nothing needs consent and
   nothing is stored to remember a dismissal. If you ever add cookies or
   analytics that use them, replace this with a consent banner. */
.notice {
  background: var(--color-secondary);
  border-bottom: var(--border-width) solid var(--color-secondary-soft);
  font-size: var(--fs-small);
}
.notice .wrap { padding-block: 0.55rem; }
.notice p { margin: 0; color: var(--color-text-muted); }
.notice strong { color: var(--color-text); }

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--color-main);
  border-bottom: var(--border-width) solid var(--color-secondary);
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: var(--space-1) var(--space-3);
  padding-block: 0.7rem;
}
.wordmark {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  color: var(--color-text); text-decoration: none; letter-spacing: 0.02em;
}
.wordmark:hover { color: var(--color-text); }
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; }
.wordmark img { border-radius: 50%; display: block; }
.site-header nav { margin-left: auto; }
.nav { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); list-style: none; }
.nav a { color: var(--color-text-muted); text-decoration: none; font-size: var(--fs-small); font-weight: 600; padding-block: 0.25rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-highlight); }

/* Breadcrumbs (shown on inner pages) */
.breadcrumb { margin-bottom: var(--space-3); font-size: var(--fs-small); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; list-style: none; margin: 0; padding: 0; color: var(--color-text-muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 0.6rem; color: var(--color-secondary-soft); }
.breadcrumb [aria-current="page"] { color: var(--color-text); }

/* ==========================================================================
   6. HERO
   ========================================================================== */
.hero { padding-top: var(--space-2); padding-bottom: var(--space-section); }

/* The logo sits on a loading placeholder and fades into the page so its
   edges never show. Height is capped so the buttons stay near the top. */
.hero__logo {
  margin: 0 auto;
  width: min(100%, 62rem, calc(42vh * 1.793));
  width: min(100%, 62rem, calc(42svh * 1.793));
  aspect-ratio: 5499 / 3067;
  background: linear-gradient(100deg, var(--color-main-soft) 30%, var(--color-secondary) 50%, var(--color-main-soft) 70%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 20%, #000 80%, transparent),
                      linear-gradient(to bottom, transparent, #000 10%, #000 86%, transparent);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to right, transparent, #000 20%, #000 80%, transparent),
                      linear-gradient(to bottom, transparent, #000 10%, #000 86%, transparent);
          mask-composite: intersect;
}
.hero__logo img { display: block; width: 100%; height: auto; }
@keyframes shimmer { to { background-position: -200% 0; } }

.hero__text { max-width: 46rem; margin: var(--space-3) auto 0; text-align: center; }
.hero__text .btn-row { justify-content: center; }
.hero__lead { color: var(--color-text-muted); font-size: 1.15rem; }

/* ==========================================================================
   7. PILLARS: plain text blocks with a gold rule
   ========================================================================== */
.pillars {
  display: grid; gap: var(--space-4) clamp(2rem, 6vw, 4rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  list-style: none; margin-top: var(--space-4);
}
.pillar { border-top: 3px solid var(--color-highlight); padding-top: var(--space-2); }
.pillar p { color: var(--color-text-muted); max-width: 30rem; }

/* ==========================================================================
   8. PANELS (expandable platform groups)
   ========================================================================== */
.panels { display: grid; gap: var(--space-2); }
.panel {
  background: var(--color-secondary);
  border: var(--border-width) solid var(--color-secondary-soft);
  border-radius: var(--radius-panel);
}
.panel summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-display); font-size: var(--fs-h3); font-weight: var(--fw-heading);
}
.panel summary::-webkit-details-marker { display: none; }
.panel summary::after {
  content: "+"; flex: none; width: 2rem; height: 2rem; line-height: 1.8rem; text-align: center;
  border: 2px solid var(--color-highlight); border-radius: 50%;
  color: var(--color-highlight); font-family: var(--font-body); font-size: 1.25rem; font-weight: 700;
}
.panel[open] summary::after { content: "\2212"; }
.panel__body { padding: 0 var(--space-3) var(--space-3); color: var(--color-text-muted); }
.panel__body ul { padding-left: 1.2rem; }
.panel__body li { margin-bottom: 0.6rem; }
.panel__body li::marker { color: var(--color-highlight); }

.status {
  margin-top: var(--space-3);
  padding-left: var(--space-2);
  border-left: 3px solid var(--color-highlight);
  color: var(--color-text-muted);
}

/* ==========================================================================
   9. FORM, CONTACT DETAILS AND FORM ERROR STATES
   ========================================================================== */
.form { display: grid; gap: var(--space-2); }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.field input, .field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--color-main-soft);
  color: var(--color-text);
  border: var(--border-width) solid var(--color-secondary-soft);
  border-radius: var(--radius-input);
  font: inherit;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field textarea:focus { outline: var(--focus-ring); outline-offset: 1px; border-color: var(--color-highlight); }

/* Error state */
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--color-error); border-width: 2px; }
.field__error { margin: 0.4rem 0 0; color: var(--color-error); font-size: var(--fs-small); font-weight: 600; }
.form__alert {
  margin: 0; padding: 0.75rem 1rem;
  background: var(--color-main-soft);
  border: 2px solid var(--color-error); border-radius: var(--radius-input);
}
.form__alert[hidden], .field__error[hidden] { display: none; }

.form .btn { justify-self: start; }
.form__note { font-size: var(--fs-small); color: var(--color-text-muted); margin: 0; }
.form__note--spaced { margin-top: var(--space-2); }

.contact-list { list-style: none; display: grid; gap: var(--space-3); }
.contact-list h3 { margin-bottom: 0.25rem; font-size: 1.1rem; }
.contact-list p { margin: 0; color: var(--color-text-muted); }
.social { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); list-style: none; margin-top: var(--space-1); }

/* ==========================================================================
   10. FOOTER AND STICKY MOBILE BUTTONS
   ========================================================================== */
.site-footer { background: var(--color-secondary); padding-block: var(--space-4); border-top: var(--border-width) solid var(--color-secondary-soft); }
.footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-3); }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); list-style: none; }
.footer__contact { margin: 0; color: var(--color-text-muted); }
.site-footer .legal { margin: 0 0 var(--space-2); font-size: var(--fs-small); color: var(--color-text-muted); }
.entities { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); padding-top: var(--space-2); border-top: var(--border-width) solid var(--color-secondary-soft); }
.entities li { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }

.sticky-cta { display: none; }

/* ==========================================================================
   11. RESPONSIVE BREAKPOINTS AND ACCESSIBILITY
   ========================================================================== */

/* Tablet and below: 60rem */
@media (max-width: 60rem) {
  .site-header .wrap { gap: var(--space-1) var(--space-2); }
  .nav { gap: var(--space-1) var(--space-2); }
}

/* Phone: 40rem */
@media (max-width: 40rem) {
  body { padding-bottom: 5rem; }                       /* room for the sticky buttons */
  .site-header .wrap { padding-block: 0.5rem; }
  .site-header nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .nav { flex-wrap: nowrap; white-space: nowrap; gap: var(--space-3); }
  .header-cta { display: none; }                       /* the sticky buttons take over */
  .btn-row .btn { flex: 1 1 100%; }
  .form .btn { justify-self: stretch; }
  .sticky-cta {
    display: flex; gap: var(--space-1);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    padding: 0.7rem var(--space-gutter) calc(0.7rem + env(safe-area-inset-bottom));
    background: var(--color-main);
    border-top: var(--border-width) solid var(--color-secondary-soft);
  }
  .sticky-cta .btn { flex: 1; padding-inline: 0.75rem; }
}

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