/*
  EDIFICE — Design-system tokens
  ==============================
  Canonical `--edifice-*` scale and semantic aliases, ported verbatim from the
  Edifice Website design system. Nothing in the theme should redefine these;
  theme.css maps its short local aliases (--bg, --ink, --gold) from them.
*/

:root{
  /* Navy — primary */
  --edifice-navy-50:#f4f7fb; --edifice-navy-100:#e4ecf6; --edifice-navy-200:#c4d6ee;
  --edifice-navy-300:#94b4db; --edifice-navy-400:#5988c5; --edifice-navy-500:#2e5f9e;
  --edifice-navy-600:#1b4174; --edifice-navy-700:#102e56; --edifice-navy-800:#0b2341;
  --edifice-navy-900:#071931; --edifice-navy-950:#040f20;

  /* Gold — accent, used sparingly (target ~5% of any screen) */
  --edifice-gold-50:#fcf8ee; --edifice-gold-100:#f8eed8; --edifice-gold-200:#f0ddb7;
  --edifice-gold-300:#e8cb92; --edifice-gold-400:#e2bd79; --edifice-gold-500:#d2a456;
  --edifice-gold-600:#be8837; --edifice-gold-700:#996829; --edifice-gold-800:#7a501f;
  --edifice-gold-900:#5b3815; --edifice-gold-950:#3b220c;

  /* Stone — warm neutral */
  --edifice-stone-0:#ffffff; --edifice-stone-50:#fbfaf9; --edifice-stone-100:#f5f3f0;
  --edifice-stone-200:#e9e6e2; --edifice-stone-300:#d6d2cd; --edifice-stone-400:#b4aea7;
  --edifice-stone-500:#928b81; --edifice-stone-600:#746c63; --edifice-stone-700:#5a5249;
  --edifice-stone-800:#3f3831; --edifice-stone-900:#29231e; --edifice-stone-950:#181410;

  /* Status — muted and earthy so it never fights the brand palette */
  --edifice-status-success:#3f7d58; --edifice-status-success-bg:#e9f2ec;
  --edifice-status-error:#ad4340;   --edifice-status-error-bg:#f9ecec;
  --edifice-status-warning:#a8791f; --edifice-status-warning-bg:#f8f0df;
  --edifice-status-info:var(--edifice-navy-600); --edifice-status-info-bg:var(--edifice-navy-50);

  /* ---- Semantic aliases: light ("presentation mode") ---- */
  --edifice-surface-page:var(--edifice-stone-50);
  --edifice-surface-card:var(--edifice-stone-0);
  --edifice-surface-sunken:var(--edifice-stone-100);
  --edifice-surface-dark:var(--edifice-navy-800);
  --edifice-surface-overlay:rgba(7,25,49,.55);

  --edifice-text-primary:var(--edifice-navy-900);
  --edifice-text-secondary:var(--edifice-stone-600);
  --edifice-text-muted:var(--edifice-stone-500);
  --edifice-text-accent:var(--edifice-gold-700);   /* AA-safe gold on light */
  --edifice-text-on-dark:var(--edifice-stone-50);
  --edifice-text-on-dark-muted:var(--edifice-navy-200);
  --edifice-text-on-accent:var(--edifice-navy-950);

  --edifice-accent:var(--edifice-gold-500);
  --edifice-accent-hover:var(--edifice-gold-600);
  --edifice-primary:var(--edifice-navy-800);
  --edifice-primary-hover:var(--edifice-navy-700);

  --edifice-border-default:var(--edifice-stone-200);
  --edifice-border-strong:var(--edifice-stone-300);
  --edifice-border-accent:var(--edifice-gold-400);
  --edifice-border-on-dark:rgba(232,203,146,.22);
  --edifice-focus-ring:var(--edifice-gold-400);
}

/*
  ---- Drawing mode ----
  The site's second skin: not a naive inversion but a working-drawing state.
  Grounds go navy, every line-art fill becomes gold stroke, and dimension
  annotations become visible. Set data-theme="dark" on the root element.
*/
:root[data-theme="dark"]{
  --edifice-surface-page:var(--edifice-navy-900);
  --edifice-surface-card:var(--edifice-navy-800);
  --edifice-surface-sunken:var(--edifice-navy-800);
  --edifice-surface-dark:var(--edifice-navy-950);

  --edifice-text-primary:#f2efe9;
  --edifice-text-secondary:#8fa3bd;
  --edifice-text-muted:#6f83a0;
  --edifice-text-accent:var(--edifice-gold-500);
  --edifice-text-on-dark:var(--edifice-stone-50);

  --edifice-border-default:rgba(232,203,146,.22);
  --edifice-border-strong:rgba(232,203,146,.34);
  --edifice-primary:var(--edifice-gold-500);
  --edifice-primary-hover:var(--edifice-gold-400);
}

/* Same swap for viewers whose OS asks for dark and who have not chosen a
   mode on this site. Guarded with :not([data-theme="light"]) so an explicit
   light choice always wins. */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --edifice-surface-page:var(--edifice-navy-900);
    --edifice-surface-card:var(--edifice-navy-800);
    --edifice-surface-sunken:var(--edifice-navy-800);
    --edifice-surface-dark:var(--edifice-navy-950);

    --edifice-text-primary:#f2efe9;
    --edifice-text-secondary:#8fa3bd;
    --edifice-text-muted:#6f83a0;
    --edifice-text-accent:var(--edifice-gold-500);
    --edifice-text-on-dark:var(--edifice-stone-50);

    --edifice-border-default:rgba(232,203,146,.22);
    --edifice-border-strong:rgba(232,203,146,.34);
    --edifice-primary:var(--edifice-gold-500);
    --edifice-primary-hover:var(--edifice-gold-400);
  }
}

:root{
  --edifice-font-serif:'Playfair Display', Georgia, 'Times New Roman', serif;
  --edifice-font-sans:'Poppins', 'Helvetica Neue', Arial, sans-serif;

  --edifice-tracking-tight:-0.02em;
  --edifice-tracking-normal:0em;
  --edifice-tracking-wide:0.04em;
  --edifice-tracking-wider:0.08em;
  --edifice-tracking-widest:0.18em;

  --edifice-leading-none:1;
  --edifice-leading-tight:1.1;
  --edifice-leading-snug:1.3;
  --edifice-leading-normal:1.55;
  --edifice-leading-relaxed:1.75;

  --edifice-size-xs:0.75rem;   --edifice-size-sm:0.875rem; --edifice-size-base:1rem;
  --edifice-size-md:1.125rem;  --edifice-size-lg:1.25rem;  --edifice-size-xl:1.5rem;
  --edifice-size-2xl:1.875rem; --edifice-size-3xl:2.25rem; --edifice-size-4xl:3rem;
  --edifice-size-5xl:3.75rem;  --edifice-size-6xl:4.5rem;  --edifice-size-7xl:5.5rem;

  /* Semantic styles */
  --edifice-display-1-family:var(--edifice-font-serif);
  --edifice-display-1-size:var(--edifice-size-7xl);
  --edifice-display-1-weight:700;
  --edifice-display-1-leading:var(--edifice-leading-tight);
  --edifice-display-1-tracking:var(--edifice-tracking-tight);

  --edifice-h1-family:var(--edifice-font-serif);
  --edifice-h1-size:var(--edifice-size-4xl);
  --edifice-h1-weight:600;

  --edifice-h2-family:var(--edifice-font-serif);
  --edifice-h2-size:var(--edifice-size-3xl);
  --edifice-h2-weight:600;

  --edifice-eyebrow-family:var(--edifice-font-sans);
  --edifice-eyebrow-size:var(--edifice-size-xs);
  --edifice-eyebrow-weight:500;
  --edifice-eyebrow-tracking:var(--edifice-tracking-widest);

  --edifice-body-family:var(--edifice-font-sans);
  --edifice-body-size:var(--edifice-size-base);
  --edifice-body-leading:var(--edifice-leading-normal);

  --edifice-label-family:var(--edifice-font-sans);
  --edifice-label-size:var(--edifice-size-sm);
  --edifice-label-weight:500;
  --edifice-label-tracking:var(--edifice-tracking-wider);
}

:root{
  /* Easing */
  --edifice-ease-out:cubic-bezier(.22,1,.36,1); /* @kind other */
  --edifice-ease-in-out:cubic-bezier(.76,0,.24,1); /* @kind other */
  --edifice-ease-linear:linear; /* @kind other */

  /* Duration */
  --edifice-duration-fast:.3s; /* @kind other */
  --edifice-duration-base:.45s; /* @kind other */
  --edifice-duration-slow:.9s; /* @kind other */
  --edifice-duration-page:1s; /* @kind other */

  /* Stagger between sibling reveals */
  --edifice-stagger:60ms; /* @kind other */

  /* Ambient — kept below perception until the reader stops */
  --edifice-grain-opacity:.05; /* @kind other */
  --edifice-grain-cycle:9s; /* @kind other */
  --edifice-marquee-cycle:30s; /* @kind other */
}
