/* styles.css — JL Kruger Homepage
   tags: homepage typography nav buttons shimmer responsive */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
/* Palette + layout custom properties live in /css/tokens.css, generated from
   Toolbox/Python/variables.yaml and linked before this file. Edit colours there.
   Layout primitives (stack/center/grid/hero) live in /css/layout.css. */

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }


/* ── Body ────────────────────────────────────────────────────────────────── */
body {
  margin: 0;
  padding: 0;
  background: #010403; /* #sky handles the gradient; this is a dark fallback */
  color: var(--light);
  font-family: 'Overlock', 'Noto Sans Symbols 2', 'Noto Emoji', serif;
  font-size: var(--step-0);     /* fluid 16→18 px; no static override */
  line-height: var(--lh);
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  min-block-size: 100svh;       /* fill without clipping; page scrolls past this */
  display: flex;
  flex-direction: column;
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { margin: 0; hyphens: none; }

h1 {
  font-family: 'Tagesschrift', 'Noto Sans Symbols 2', 'Noto Emoji', serif;
  color: var(--fire);
  font-size: var(--step-2);
  line-height: 1.15;
  letter-spacing: 0.02em;
}
h2 {
  font-family: 'Tagesschrift', 'Noto Sans Symbols 2', 'Noto Emoji', cursive;
  color: var(--meadow);
  font-size: var(--step-2);
  line-height: 1.15;
  letter-spacing: 0.04em;
}
h3 {
  font-family: 'Walter Turncoat', 'Noto Sans Symbols 2', 'Noto Emoji', cursive;
  color: var(--rust);
  font-size: var(--step-0);
  line-height: 1.25;
  letter-spacing: 0.04em;
}
h4, h5, h6 {
  font-family: 'Walter Turncoat', 'Noto Sans Symbols 2', 'Noto Emoji', cursive;
  color: var(--forest);
}
blockquote { color: var(--sun); }

a            { color: var(--meadow); text-decoration: none; }
a:hover      { color: var(--fire); }
a:visited    { color: var(--pigment); }

.special {
  font-family: 'Protest Revolution', 'Noto Sans Symbols 2', 'Noto Emoji', sans-serif;
  color: var(--sun);
  font-size: var(--step-2);    
  letter-spacing: 0.03em;
}

/* ── Sticky nav ──────────────────────────────────────────────────────────── */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(1, 4, 3, 0.88);
  /* keep blur modest — heavy blur + rAF loop = dropped frames */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0.9rem 2rem;
  display: flex;
  justify-content: center;
  /* border via shimmer-nav SVG line in index.html rather than border-image */
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(to right, rgba(7,55,32,0) 0%, rgba(14,77,14,.44) 16.7%, rgba(94,154,14,.88) 33.3%, rgba(242,198,42,1) 50%, rgba(235,117,19,.88) 66.7%, rgba(105,25,13,.44) 83.3%, rgba(7,55,32,0) 100%) 1;
  flex-shrink: 0; /* don't shrink in the flex column */
}

/* shimmer-nav separator line rendered via inline SVG in markup;
   fallback: a static semi-transparent rule */
.nav-separator {
  width: 100%;
  height: 2px;
  display: block;
  flex-shrink: 0;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1.5em;
}

.nav-links {
  font-family: 'Walter Turncoat', 'Noto Sans Symbols 2', 'Noto Emoji', cursive;
  font-size: var(--step-2);     /* ~1.44→1.76 rem; replaces clamp(1.4rem,2vw,2.1rem) */
}
.nav-links a        { color: var(--light); opacity: 0.85; }
.nav-links a:hover  { color: var(--fire);  opacity: 1; }

/* ── Starfield canvas — see css/layers.css (centralized) ─────────────────── */

/* ── Hero column text alignment ──────────────────────────────────────────── */
/* Mobile-first: every hero column centres its text. At the 52rem page rung the
   side columns split to left / right; the centre column keeps the centring set
   on .hero-col.bento-center in layout.css (specificity 0,2,0 beats the desktop
   .hero-col rule below, so it is untouched). */
.hero-col { text-align: center; }
@media (min-width: 52rem) {
  .hero-col              { text-align: left; }
  .hero-col.bento-right  { text-align: right; }
  /* Desktop hero copy is short display text in a 3-col bento, not long-form
     prose — tighten from the 1.5 body rhythm to 1.25. Mobile (single column)
     keeps 1.5, and content/hub pages are unaffected (this is .hero-scoped). */
  .hero p { line-height: 1.25; }
}

/* ── Button component ────────────────────────────────────────────────────── */
.media-btn-wrap {
  position: relative;
  display: inline-flex;
  height: 2.4rem;
}
.media-btn-border {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.media-btn-rect {
  fill: transparent;
  stroke: url(#shimmer-org-h);
  stroke-width: 1.5;
  transition: fill 0.25s ease;
}
.media-btn-wrap:hover .media-btn-rect { fill: var(--light); }
.media-btn-wrap:hover .media-btn      { color: var(--pigment); }

.media-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;   /* centre label when the button is stretched */
  width: 100%;               /* fill the wrap: full-width stacked / shared row */
  height: 100%;
  padding: 0 1.4em;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: var(--light);
  font-family: 'Walter Turncoat', 'Noto Sans Symbols 2', 'Noto Emoji', cursive;
  font-size: var(--step-0);    /* replaces clamp(0.9rem,1.1vw,1.1rem) */
  cursor: pointer;
  transition: color 0.25s ease;
  white-space: nowrap;
  position: relative;
  text-decoration: none;
}

/* Desktop row: each button grows from its content width to share the row so
   the group spans the page. flex-basis:auto (not 0) keeps every track at least
   as wide as its label — no nowrap overflow — while flex-grow distributes the
   slack. On mobile the wrap stays full-width (parent column, align-items:stretch). */
@media (min-width: 52rem) {
  .hero-actions .media-btn-wrap { flex: 1 1 auto; }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .media-btn-rect,
  .media-btn,
  .card-border-rect { transition: none !important; }
}

/* ── Bento center assets ─────────────────────────────────────────────────── */
.logo-wrap {
  width: 100%;
  max-width: 100%;
  will-change: opacity;
}
.logo-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

/* logo wrapped in a shimmer-nav link — keep intrinsic size + centering */
.logo-link {
  display: inline-block;
  line-height: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
/* Homepage logo: scale the SVG to the column (it carries an intrinsic 904px
   width). CSS sizing — never the invalid height="auto" SVG attribute.
   The deliberate >100% overscale (below) makes the SVG wider than its column,
   so it must be centred by axis, not by flow/flex justification (an over-wide
   flex item escapes to the end instead of centring). left:50% + translateX
   pins the SVG's centre to the column's centre at every width, so the overscale
   bleeds symmetrically on both sides. */
.bento-center .logo-link {
  display: block;
  width: 100%;
}
#logo-svg {
  width: min(132%, 30rem);
  height: auto;
  display: block;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

.thumbnail-wrap {
  width: clamp(100px, 8vh, 120px);
  height: auto;
  margin: 1.5rem auto;
}
.thumb-border {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.critter-wrap {
  width: clamp(80px, 8vh, 140px);
  height: auto;
  margin: 0 auto;
  will-change: opacity;
}
.critter-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Homepage decorative critter — matches the old 120×120 inline scale */
.decor-critter {
  width: 120px;
  height: 120px;
  margin: 1.5rem auto;
}
.decor-critter svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Buttons: shine default → shimmer + fill on hover ────────────────────── */
/* Override from styles.css base — shine stroke at rest */
.media-btn-rect {
  fill: transparent;
  stroke: url(#shine-org-h);
  stroke-width: 1.5;
  transition: fill 0.25s ease;
  /* Note: stroke cannot transition between url() values via CSS —
     the swap is instant; only fill animates */
}
.media-btn-wrap:hover .media-btn-rect,
.media-btn-wrap:focus-within .media-btn-rect {
  stroke: url(#shimmer-org-h);
  fill: var(--light);
}
.media-btn-wrap:hover .media-btn,
.media-btn-wrap:focus-within .media-btn {
  color: var(--pigment);
}
