/* =========================================================================
   Dondon Studio — Base / reset / typography
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

html {
  background: var(--color-bg);
  color: var(--color-white);
  font-family: var(--font-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-white);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.6;
}

#app {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.1;
}

p { margin: 0 0 1em; }

a { color: inherit; text-decoration: none; }

img, video, canvas, svg { max-width: 100%; display: block; }

input, button, select, textarea { font-family: inherit; }

::selection { background: var(--color-accent); color: #fff; }

/* Focus visibility for keyboard users (accessibility) */
:focus-visible {
  outline: 2px solid var(--color-accent-lt);
  outline-offset: 2px;
}

/* ─── Typography utilities ──────────────────────────────────────────────── */
.eyebrow {
  font-size: 0.65rem;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--color-faint);
}

.display-text {
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.card-title {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.body-light { font-weight: 300; line-height: 1.7; }

.muted { color: var(--color-muted); }
.faint { color: var(--color-faint); }

.center { text-align: center; }

/* ─── Layout helpers ────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-wide { max-width: var(--container-wide); }

.page {
  flex: 1 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) 0;
}

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Motion: route + stagger transitions ───────────────────────────────── */
/* Each route swap replaces the single child of <main id="main">, so this
   gentle fade plays automatically on every navigation. */
@keyframes route-in { from { opacity: 0; } to { opacity: 1; } }
#main > * { animation: route-in .28s ease both; }

/* Opt-in staggered rise for card grids — add class "stagger" to the grid. */
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: rise-in .5s var(--ease-tab) both; }
.stagger > *:nth-child(1) { animation-delay: .03s; }
.stagger > *:nth-child(2) { animation-delay: .08s; }
.stagger > *:nth-child(3) { animation-delay: .13s; }
.stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .23s; }
.stagger > *:nth-child(6) { animation-delay: .28s; }
.stagger > *:nth-child(n+7) { animation-delay: .32s; }

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Touch / mobile niceties ───────────────────────────────────────────── */
/* Kill the grey tap-flash on iOS/Android for a cleaner feel. */
a, button, .btn, .card, summary { -webkit-tap-highlight-color: transparent; }

/* Keep in-page anchors clear of the sticky header when jumped to. */
:target { scroll-margin-top: calc(var(--nav-h) + 1rem); }

/* ─── Responsive typography & spacing ───────────────────────────────────── */
@media (max-width: 720px) {
  body { line-height: 1.55; }
  .container { padding: 0 1.15rem; }
  .page { padding: clamp(1.75rem, 7vw, 3rem) 0; }
  .stack-lg > * + * { margin-top: var(--sp-5); }
}
@media (max-width: 460px) {
  .container { padding: 0 1rem; }
  .display-text { font-size: clamp(2rem, 9vw, 2.8rem); letter-spacing: 0; }
  .section-title { font-size: clamp(1.45rem, 6vw, 2rem); }
}
