/* Pages by David — Layout & Reset */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

main {
  position: relative;
}

main::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--texture-noise-light);
  pointer-events: none;
  z-index: 9998;
}

[data-theme="dark"] main::after {
  background-image: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
}

/* Dark mode smooth transition */
body,
.hero {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Hero entrance animation */
@keyframes heroReveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero__content {
  animation: heroReveal 0.6s ease both;
}

.hero__mockup {
  animation: heroReveal 0.6s ease 0.2s both;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease, background-color 0.3s ease, color 0.3s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-button);
  font-weight: var(--font-weight-medium);
}

.skip-link:focus {
  top: 8px;
}

/* Screen-reader only */
.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;
}

/* Focus indicators */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn:focus-visible {
  box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-accent);
  outline: none;
}

/* Focus rings on dark backgrounds need higher contrast */
.section--dark :focus-visible {
  outline-color: var(--color-text-on-dark);
}

.section--dark .btn:focus-visible {
  box-shadow: 0 0 0 2px var(--color-dark), 0 0 0 4px var(--color-text-on-dark);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Section containers */
.section {
  padding: var(--spacing-section) 24px;
}

.section--page-top {
  padding-top: calc(var(--nav-height) + 64px);
  background-color: var(--color-dark);
  color: var(--color-text-on-dark);
  position: relative;
}

.section--page-top > * {
  position: relative;
  z-index: 1;
}

.section--page-top::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--texture-noise);
  pointer-events: none;
  z-index: 0;
}

.section--page-top .section__subtitle {
  color: var(--color-text-muted-on-dark);
}

.section--page-top .eyebrow {
  color: var(--color-gold);
}

.section--dark {
  background-color: var(--color-dark);
  color: var(--color-text-on-dark);
  position: relative;
}

.section--dark > * {
  position: relative;
  z-index: 1;
}

.section--dark::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--texture-noise);
  pointer-events: none;
  z-index: 0;
}

.section--alt {
  background-color: var(--color-bg-alt);
}

[data-theme="dark"] .section--alt {
  background-color: var(--color-bg);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Text utilities */
.text-center {
  text-align: center;
}

.eyebrow {
  font-size: var(--font-size-eyebrow);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.section__title {
  font-size: var(--font-size-h2);
  margin-bottom: 16px;
}

.section__title span {
  color: var(--color-gold);
}

.section__subtitle {
  font-size: var(--font-size-body-lg);
  color: var(--color-text-muted);
  max-width: 600px;
}

.section--dark .section__subtitle {
  color: var(--color-text-muted-on-dark);
}

.text-center .section__subtitle {
  margin-left: auto;
  margin-right: auto;
}
