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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s var(--ease-out), color 0.5s var(--ease-out);
}

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

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--accent);
}

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

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

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

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

/* ---------- Shared primitives ---------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-light);
}

.display {
  font-family: var(--serif);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 0.95;
}

.section-title {
  font-family: var(--serif);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.04;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
}

.lede {
  color: var(--ink-light);
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  max-width: 48ch;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* Dynamic film-grain noise overlay for glass surfaces */
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.5;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--ink);
  color: var(--bg);
  transition: transform 0.28s var(--ease-spring), box-shadow 0.28s var(--ease-out),
    background 0.2s ease, opacity 0.2s ease;
  will-change: transform;
}
.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  color: var(--bg);
}
.btn:active {
  transform: translateY(0) scale(0.99);
}
.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease-spring);
}
.btn:hover svg {
  transform: translateX(4px);
}

.btn--accent {
  background: var(--accent);
  color: #fff;
}
.btn--accent:hover {
  box-shadow: 0 10px 30px var(--accent-veil);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
}
.btn--ghost:hover {
  background: var(--glass-strong);
  box-shadow: none;
  color: var(--ink);
}

.btn--sm {
  padding: 9px 18px;
  font-size: 0.78rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline-strong);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-light);
  background: transparent;
  transition: all 0.22s var(--ease-out);
  white-space: nowrap;
}
.chip:hover {
  color: var(--ink);
  border-color: var(--ink-faint);
}
.chip[data-on='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* ---------- Scroll reveal ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal='in'] {
  opacity: 1;
  transform: none;
}

/* Reveal with no animation — used when the viewer cannot see the entrance
   anyway (background tab), where a frozen transition would strand content
   at opacity 0. */
[data-reveal='instant'] {
  opacity: 1;
  transform: none;
  transition: none;
}

@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;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--hairline-strong);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ink-faint);
  background-clip: content-box;
}

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