/* ==========================================================================
   Gildjam Match Puzzle - base: tokens, reset, typography, header, shared ornaments
   Mobile-first: base rules target <= 768px, min-width queries enhance upward.
   ========================================================================== */

:root {
  /* Dark umber grounds */
  --ink-deep: #140c08;
  --umber: #1f140d;
  --umber-raised: #2b1c12;
  --umber-edge: #3a2717;

  /* Metals */
  --sand: #efe0bf;          /* body text */
  --sand-muted: #c9b48e;    /* secondary text */
  --gold: #d9b36a;          /* headings accents, ornaments */
  --gold-bright: #ecd193;
  --bronze: #a8743f;        /* borders, engraving */
  --bronze-deep: #6e4724;

  /* Candy jewel accents (used sparingly) */
  --berry: #e86a8a;
  --mint: #7fd6b9;
  --grape: #b48ce0;

  --font-display: "Trajan Pro", "Cinzel", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: "Gill Sans", "Gill Sans MT", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

  --header-h: 48px;
  --radius: 10px;
  --relief-shadow: inset 0 1px 0 rgba(236, 209, 147, 0.18), inset 0 -2px 6px rgba(0, 0, 0, 0.55), 0 10px 24px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--sand);
  background-color: var(--umber);
  /* Aged relief texture: faint diamond lattice + vignette */
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(217, 179, 106, 0.10), transparent 60%),
    repeating-linear-gradient(45deg, rgba(168, 116, 63, 0.05) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-45deg, rgba(168, 116, 63, 0.05) 0 1px, transparent 1px 22px);
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}

p { margin: 0 0 1em; }

a { color: var(--gold-bright); }
a:hover,
a:active { color: #fff3d6; }

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ink-deep);
  font-weight: 700;
  border-radius: 6px;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.section-head { text-align: center; max-width: 640px; margin: 0 auto 32px; }
.section-head--left { text-align: left; margin-left: 0; }
.section-title { font-size: 26px; margin-bottom: 12px; }
.section-lead { color: var(--sand-muted); margin: 0; }

/* ---------- Sticky header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(20, 12, 8, 0.92);
  border-bottom: 1px solid var(--umber-edge);
  box-shadow: 0 1px 0 rgba(217, 179, 106, 0.12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  color: var(--gold-bright);
}
.brand__icon { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--bronze); }
.brand__name { font-family: var(--font-display); font-size: 17px; letter-spacing: 0.12em; text-transform: uppercase; }

.site-nav { display: none; }

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink-deep);
  text-decoration: none;
  background: linear-gradient(160deg, var(--gold-bright), #b98a4a);
  border: 1px solid var(--bronze-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: filter 0.2s ease, transform 0.2s ease;
}
.header-cta:hover,
.header-cta:active { color: var(--ink-deep); filter: brightness(1.08); }
.header-cta:active { transform: translateY(1px); }
.header-cta__icon { width: 22px; height: 22px; }
.header-cta__label { display: none; }

/* ---------- Gilded corner ornaments (shared by plaques) ---------- */
.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--gold);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
}
.corner::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--gold-bright);
  transform: rotate(45deg);
}
.corner--tl { top: 8px; left: 8px; border-top-width: 2px; border-left-width: 2px; }
.corner--tr { top: 8px; right: 8px; border-top-width: 2px; border-right-width: 2px; }
.corner--bl { bottom: 8px; left: 8px; border-bottom-width: 2px; border-left-width: 2px; }
.corner--br { bottom: 8px; right: 8px; border-bottom-width: 2px; border-right-width: 2px; }
.corner--tl::after { top: 4px; left: 4px; }
.corner--tr::after { top: 4px; right: 4px; }
.corner--bl::after { bottom: 4px; left: 4px; }
.corner--br::after { bottom: 4px; right: 4px; }

/* ---------- Candy gems (CSS-only jelly icons) ---------- */
.gem {
  --gem: var(--berry);
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  /* Fallback for browsers without color-mix() */
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.85) 0 12%, transparent 30%), var(--gem);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.85) 0 12%, transparent 30%),
    radial-gradient(circle at 50% 60%, var(--gem), color-mix(in srgb, var(--gem) 55%, #000) 95%);
  box-shadow: 0 0 0 2px var(--gold), 0 3px 6px rgba(0, 0, 0, 0.5);
}
.gem--berry { --gem: var(--berry); }
.gem--mint { --gem: var(--mint); }
.gem--grape { --gem: var(--grape); }
.gem--gold { --gem: var(--gold-bright); }
.gem--square { border-radius: 7px; }
.gem--diamond { border-radius: 5px; transform: rotate(45deg) scale(0.86); }
.gem--drop { border-radius: 50% 50% 50% 8%; transform: rotate(-45deg); }
.gem--heart { border-radius: 50% 50% 12% 50%; transform: rotate(45deg) scale(0.9); }

@media (min-width: 768px) {
  :root { --header-h: 64px; }
  .container { padding: 0 32px; }
  .brand__icon { width: 36px; height: 36px; }
  .brand__name { font-size: 19px; }

  .site-nav { display: flex; gap: 8px; margin-left: auto; }
  .site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    font-family: var(--font-display);
    font-size: 14px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--sand);
    border-bottom: 2px solid transparent;
  }
  .site-nav a:hover,
  .site-nav a:active { color: var(--gold-bright); border-bottom-color: var(--bronze); }

  .header-cta { width: auto; border-radius: 8px; padding: 0 18px; }
  .header-cta__label { display: inline; font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; }

  .section-title { font-size: 34px; }
}
