/* ===================================================================
   Ocean Sun Theme — Base Styles
   Reset + global defaults
   =================================================================== */

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

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

body {
  font-family: var(--os-font-body);
  font-weight: var(--os-font-body-normal);
  font-size: var(--os-text-base);
  line-height: var(--os-leading-normal);
  color: var(--os-text-body);
  background-color: var(--os-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Headings ── */

h1, h2, h3 {
  font-family: var(--os-font-display);
  color: var(--os-text);
  line-height: var(--os-leading-tight);
}

h4, h5, h6 {
  font-family: var(--os-font-body);
  font-weight: var(--os-font-body-semibold);
  color: var(--os-text);
  line-height: var(--os-leading-snug);
}

h1 {
  font-size: var(--os-text-4xl);
  font-weight: var(--os-font-display-bold);
  letter-spacing: -0.5px;
}

h2 {
  font-size: var(--os-text-3xl);
  font-weight: var(--os-font-display-semibold);
}

h3 {
  font-size: var(--os-text-2xl);
  font-weight: var(--os-font-display-semibold);
}

h4 { font-size: var(--os-text-xl); }
h5 { font-size: var(--os-text-lg); }
h6 { font-size: var(--os-text-base); }

/* ── Links ── */

a {
  color: var(--os-primary);
  text-decoration: none;
  transition: color var(--os-transition-fast);
}

a:hover {
  color: var(--os-cta);
}

/* ── Images ── */

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

/* ── Lists ── */

ul, ol {
  padding-left: var(--os-space-6);
}

li {
  margin-bottom: var(--os-space-2);
}

/* ── Misc ── */

hr {
  border: none;
  border-top: 1px solid var(--os-border);
  margin: var(--os-space-8) 0;
}

::selection {
  background-color: var(--os-cta-light);
  color: var(--os-text);
}

/* ── Focus ── */

:focus-visible {
  outline: 2px solid var(--os-cta);
  outline-offset: 2px;
}

/* ── 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;
}

/* ── Scroll Reveal Animations ── */

.os-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.os-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered card entry — each child delays by 0.1s */
.os-reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.os-reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.os-reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0s; }
.os-reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.1s; }
.os-reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.2s; }
.os-reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.3s; }

/* Section header — slide up before cards */
.os-reveal .os-section-header {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.os-reveal.is-visible .os-section-header {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .os-reveal,
  .os-reveal-stagger > *,
  .os-reveal .os-section-header {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── Responsive typography ── */

@media (max-width: 768px) {
  h1 { font-size: var(--os-text-3xl); }
  h2 { font-size: var(--os-text-2xl); }
  h3 { font-size: var(--os-text-xl); }
}
