/* Base: reset, typography, shared utilities. */

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

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

body {
  min-height: 100svh;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

ul,
ol {
  list-style: none;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.12;
  color: var(--color-text-primary);
  text-wrap: balance;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

.glass {
  background: var(--color-surface);
  background: color-mix(in srgb, var(--color-surface) 70%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--color-border);
}

/* Entrance animation — elements tagged [data-reveal] fade in once they enter
   the viewport (see js/core/reveal.js). Hiding only applies after JS boots,
   so a failed script never leaves content invisible. */
.reveal-active [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
}

.reveal-active [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Built-in 404 / bootstrap error page. */
.not-found {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(80px, 14vh, 140px) clamp(20px, 5vw, 48px);
}

.not-found__code {
  font-family: var(--font-heading);
  font-size: clamp(64px, 12vw, 140px);
  font-weight: 600;
  line-height: 1;
  color: var(--color-text-secondary);
  opacity: 0.35;
}

.not-found__title {
  margin-top: 16px;
  font-size: clamp(20px, 4vw, 28px);
}

.not-found__text {
  margin-top: 12px;
  max-width: 56ch;
  color: var(--color-text-secondary);
}

.not-found__link {
  margin-top: 36px;
  display: inline-block;
  padding: 12px 34px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.not-found__link:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Shown only when JavaScript is disabled (<noscript>). */
.no-js-message {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px;
  text-align: center;
  background: var(--color-bg);
}

.no-js-message__title {
  font-family: var(--font-heading);
  font-size: 24px;
}

.no-js-message__text {
  max-width: 48ch;
  color: var(--color-text-secondary);
}

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

  .reveal-active [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
