/* ============================================
   BASE — Reset, body, grid background, typography
   ============================================ */

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--brown);
  background-color: var(--bg-cream);
  /* Ruled-line grid background — faint horizontal lines like notebook paper */
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 31px,
      rgba(73, 62, 38, 0.06) 31px,
      rgba(73, 62, 38, 0.06) 32px
    );
  background-size: 100% 32px;
  overflow-x: hidden;
}

/* --- Typography defaults --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--brown);
}

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

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

ul, ol {
  list-style: none;
}

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

/* --- Focus-visible outlines (keyboard-only) --- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Utility: container --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* --- Section spacing --- */
section {
  padding: var(--space-3xl) 0;
  position: relative;
}

section[id] {
  scroll-margin-top: 80px;
}

/* --- Badge (inline pill) --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}

.badge--orange {
  background: var(--accent-orange);
  color: var(--white);
}

.badge--olive {
  background: var(--olive);
  color: var(--white);
}

.badge--pink {
  background: var(--pink-light);
  color: var(--accent-orange);
}

.badge--gold {
  background: var(--gold);
  color: var(--white);
}

.badge--outline {
  background: transparent;
  border: 1.5px solid var(--beige);
  color: var(--brown);
}

/* --- Decorative star sparkle --- */
.star {
  display: inline-block;
  color: var(--gold);
  font-size: 1.2em;
}

/* --- CTA Button (golden gradient) --- */
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  min-height: 48px;
  background: var(--grad-gold);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--gold);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cta-btn .arrow {
  transition: transform 0.3s var(--ease-out);
}

.cta-btn:hover .arrow {
  transform: translateX(3px);
}

/* --- Section header with star decorations --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.section-header__line {
  flex: 1;
  height: 1px;
  background: var(--beige);
  max-width: 120px;
}

.section-header__title {
  font-family: var(--font-serif);
  font-size: var(--fs-h1);
  font-style: italic;
  color: var(--gold);
}

/* --- Flowing intro text (used in About & Work intros) --- */
.flowing-text {
  font-family: var(--font-sans);
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  line-height: 1.6;
  color: var(--brown);
  max-width: 800px;
}

.flowing-text em {
  font-style: italic;
  font-weight: 700;
}

.flowing-text .inline-img {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  vertical-align: middle;
  margin: 0 4px;
}

.inline-img--warm { background: #FDE8C8; }
.inline-img--cool { background: #E8EAD6; }
.inline-img--yellow { background: #FFF8E1; }

/* --- Scroll reveal base state (below-the-fold content) --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-expo), transform 0.8s var(--ease-expo);
}

.reveal.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Stagger children */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.15s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.2s; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 0.25s; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 0.3s; }

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

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
