/* ---------------------------------------------------------
   Self-hosted faces (RSK-006 — no third-party font CDN).
   Cormorant Garamond and EB Garamond, both SIL Open Font
   License 1.1; see public/fonts/OFL-*.txt, which must travel
   with these files (OFL 1.1 §2).
   unicode-range is preserved from the upstream CDN css2
   response so latin-ext is fetched only when a page actually
   renders a character in that range.
--------------------------------------------------------- */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-500-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-500-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-600-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-600-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-500-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-500-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* ---------------------------------------------------------
   Setu Kundali — theme tokens
   All colors are CSS variables so the theme panel can
   rewrite them live and persist choices to localStorage.
--------------------------------------------------------- */
:root {
  --color-bg: #0f0e0c;
  --color-surface: #17150f;
  --color-primary: #c9a24d;
  --color-secondary: #8f7250;
  --color-text: #f3ecdd;
  --color-text-muted: #a89c86;
  --color-border: #3a3226;

  /* Chart geometry is content, not chrome, so it does not borrow
     --color-border (1.45:1 on --color-surface — DEF-010). Strokes that carry
     meaning have to clear SC 1.4.11's 3:1: this is 3.39:1 on --color-surface
     and 3.59:1 on --color-bg. Deliberately absent from THEME_VARS in
     script.js — the randomizer must not be able to erase the lattice. */
  --color-chart-stroke: #756954;

  /* The focus ring is a guarantee, not a preference (RSK-027, Arkadios's
     ruling A). #resetTheme is the escape hatch from a bad theme, but reaching
     it by keyboard requires seeing where focus is — so a recovery path that
     depends on a themeable token is not a recovery path. Same category as
     --color-chart-stroke above: deliberately absent from THEME_VARS.

     Both values here are DESIGN DEFAULTS and also the seed the solve starts
     from — script.js re-derives them against the live palette, holding hue and
     saturation and moving only lightness. Pinning the ring instead used to
     force every background 3:1 clear of gold, which cost the light half of the
     palette; deriving holds the same guarantee from the other end and also
     covers hand-picked backgrounds, which pinning never could.
     8.05:1 on the default --color-bg, and never below 3:1 on any other. */
  --color-focus: #c9a24d;

  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'EB Garamond', Georgia, serif;

  --radius: 2px;
  --transition: 220ms ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
}

/* Visible keyboard focus (DEF-002 / WCAG 2.4.7). :focus-visible only, so
   pointer users do not get rings on click.

   This resolved var(--color-primary) until RSK-027. Primary is themeable, and
   73.6% of "Randomize All" clicks drove it under 3:1 — the ring that closed
   DEF-002 was being erased by roughly three clicks in four, and it persisted.
   --color-focus is the same value but outside THEME_VARS, so the indicator
   survives any theme. Primary stays themeable for everything else. */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Skip link (DEF-005) — off-screen until focused, then pinned top-left. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1.1rem;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0;
}

a { color: inherit; }

.text-link {
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-primary);
  transition: opacity var(--transition);
}
.text-link:hover { opacity: 0.75; }

/* Faint starfield backdrop for a luxe, celestial feel */
.stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 10% 20%, var(--color-primary) 0%, transparent 60%),
    radial-gradient(1px 1px at 80% 10%, var(--color-text-muted) 0%, transparent 60%),
    radial-gradient(1px 1px at 60% 70%, var(--color-primary) 0%, transparent 60%),
    radial-gradient(1px 1px at 30% 85%, var(--color-text-muted) 0%, transparent 60%),
    radial-gradient(1px 1px at 90% 55%, var(--color-primary) 0%, transparent 60%),
    radial-gradient(1px 1px at 45% 40%, var(--color-text-muted) 0%, transparent 60%);
  opacity: 0.35;
  transition: opacity var(--transition);
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-text);
}

.brand-glyph {
  color: var(--color-primary);
  font-size: 1.4rem;
  line-height: 1;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.06em;
}

.site-nav { display: flex; align-items: center; }

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.98rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-family: var(--font-body);
  position: relative;
  padding-bottom: 4px;
  transition: color var(--transition);
}

.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0%;
  height: 1px;
  background: var(--color-primary);
  transition: width var(--transition);
}

.nav-menu a:hover {
  color: var(--color-text);
}
.nav-menu a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 1px;
  background: var(--color-text);
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition), color var(--transition);
}
.theme-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.theme-btn-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: conic-gradient(
    var(--color-primary), var(--color-secondary), var(--color-text-muted), var(--color-primary)
  );
  display: inline-block;
}

/* ---------------- Hero ---------------- */
.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 7.5rem 2rem 5rem;
  text-align: center;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.78rem;
  /* muted, not secondary: secondary is 4.31:1 and fails AA for small text
     (DEF-007). The token is kept for borders, where 3:1 applies. */
  color: var(--color-text-muted);
  margin: 0 0 1.2rem;
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  color: var(--color-primary);
}

.hero-subtitle {
  margin: 1.6rem auto 0;
  max-width: 560px;
  color: var(--color-text-muted);
  font-size: 1.15rem;
}

.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2.6rem auto;
  max-width: 260px;
}
.hero-divider span:not(.hero-divider-glyph) {
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
.hero-divider-glyph {
  color: var(--color-primary);
  font-size: 0.9rem;
}

.hero-cta {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.85rem 2.2rem;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.hero-cta:hover {
  background: var(--color-primary);
  color: var(--color-bg);
}

/* ---------------- Sections ---------------- */
.section {
  padding: 5.5rem 2rem;
  border-top: 1px solid var(--color-border);
}
.section.alt { background: var(--color-surface); }

.section-inner {
  max-width: 1080px;
  margin: 0 auto;
}
.section-inner.narrow { max-width: 640px; }
.section-inner.center { text-align: center; }

.section-title {
  font-size: 2rem;
  color: var(--color-text);
  margin-bottom: 1.2rem;
}
.section-title.center { text-align: center; }

.section-text {
  color: var(--color-text-muted);
  font-size: 1.08rem;
}

.offerings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.offering-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 2.2rem 1.8rem;
  text-align: center;
  border-radius: var(--radius);
  transition: border-color var(--transition), transform var(--transition);
}
.offering-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
}

.offering-glyph {
  display: inline-block;
  font-size: 1.8rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.offering-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.7rem;
}

.offering-card p {
  color: var(--color-text-muted);
  font-size: 0.98rem;
  margin: 0;
}

/* Under-construction callout */
.construction {
  background: var(--color-surface);
}

.construction-badge {
  display: inline-block;
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--color-secondary);
  /* border keeps secondary (non-text, 3:1); text does not (DEF-007). */
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.4rem;
}

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2.2rem 2rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ---------------- Theme Customizer Panel ---------------- */
.theme-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 49;
}
.theme-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.theme-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 360px;
  max-width: 92vw;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  padding: 1.8rem;
  z-index: 50;
  transform: translateX(100%);
  /* visibility, not transform alone: transform leaves the panel's 16+ controls
     in the tab order and in the a11y tree while off-screen (DEF-001). */
  visibility: hidden;
  /* visibility is stepped, not eased, and the delay is asymmetric (DEF-015).
     Transitioning it over --transition left the panel computed `hidden` for
     the whole 220ms, so openPanel()'s focus() was a no-op no matter how many
     frames it waited. Delaying the step until the slide-out finishes keeps
     the close animation; opening applies it at 0s so focus lands. */
  transition: transform var(--transition), visibility 0s linear var(--transition);
  overflow-y: auto;
}
.theme-panel.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform var(--transition), visibility 0s linear 0s;
}

.theme-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.theme-panel-header h2 {
  font-size: 1.5rem;
  color: var(--color-primary);
}

.theme-panel-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  transition: color var(--transition);
}
.theme-panel-close:hover { color: var(--color-primary); }

.theme-panel-hint {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0.4rem 0 1.6rem;
}

.theme-fields {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.theme-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.theme-field-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.theme-field-label span.name {
  font-size: 0.92rem;
  color: var(--color-text);
}
.theme-field-label span.value {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-family: monospace;
  text-transform: uppercase;
}

.theme-field-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-field-controls input[type="color"] {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  overflow: hidden;
}
.theme-field-controls input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.theme-field-controls input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }

.dice-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}
.dice-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: rotate(-12deg);
}

.theme-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 2rem;
}

.theme-action-btn {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.theme-action-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.theme-action-btn.primary {
  background: var(--color-primary);
  color: var(--color-bg);
  border-color: var(--color-primary);
}
.theme-action-btn.primary:hover {
  opacity: 0.88;
  color: var(--color-bg);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1.5rem 2rem;
    gap: 1.2rem;
    display: none;
  }
  .nav-menu.open { display: flex; }

  .theme-btn span.theme-btn-label { display: none; }
}

@media (max-width: 560px) {
  .header-inner { padding: 1rem 1.2rem; }
  .theme-btn { font-size: 0; padding: 0.6rem; gap: 0; }
  .theme-btn-swatch { width: 16px; height: 16px; }
  .hero { padding: 5.5rem 1.4rem 3.5rem; }
  .section { padding: 4rem 1.4rem; }
}
