/* ============================================================
   CROWN & CORE - BASE / RESET
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow-x: hidden;
}

img, picture, svg, video { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-3);
  letter-spacing: 0.005em;
  overflow-wrap: break-word;
  /* Never auto-hyphenate display type: it renders "oper-ating" mid-headline.
     Long words still wrap via overflow-wrap; see the narrow-screen exception. */
  hyphens: manual;
  text-wrap: balance;
}

/* German compounds ("Urteilsvermögen") can outrun a narrow phone at display
   sizes, where a hyphen beats a hard mid-word break. Only there. */
@media (max-width: 480px) {
  h1, h2 { hyphens: auto; }
}

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { margin: 0; padding: 0; list-style: none; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* ---- Focus states (accessibility) ---- */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--accent);
  color: var(--paper-text);
}

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--space-8);
  position: relative;
}

@media (max-width: 767px) {
  .section { padding-block: var(--space-7); }
}

.section--tight { padding-block: var(--space-6); }

.section--dark {
  background: var(--charcoal);
  color: var(--paper-text);
}

.section--panel {
  background: var(--paper-2);
}

.hidden { display: none !important; }

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--space-3);
  z-index: var(--z-modal);
  display: inline-flex;
  align-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: 1.05rem 2rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  transition: top var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.skip-link:focus {
  top: var(--space-3);
}
.skip-link:hover {
  background: var(--accent-text);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
