/* base.css, reset, typography, buttons, layout scaffolding, motion utilities.
   Tokens live in tokens.css; this file only consumes them. */

* { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  width: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--sans);
  /* A gentle radial "studio" wash, like the app backdrops. */
  background:
    radial-gradient(120% 90% at 50% -10%, var(--bg) 40%, var(--bg-2) 100%) fixed,
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .4s ease, color .4s ease;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
}

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

:not(pre) > code {
  font-family: var(--mono); font-size: .86em;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: color-mix(in srgb, var(--accent-deep) 76%, var(--text));
  padding: .12em .45em; border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

section { padding: clamp(4rem, 10vw, 7.5rem) 1.5rem; position: relative; }
.wrap { max-width: 1120px; margin: 0 auto; width: 100%; }
.center { text-align: center; }
.alt { background: color-mix(in srgb, var(--accent) 5%, var(--bg-2)); }
.muted { color: var(--text-2); }

h1, h2, h3, h4 {
  font-family: var(--round);
  letter-spacing: -0.02em; line-height: 1.05; text-wrap: balance; font-weight: 800;
}

.eyebrow {
  font-family: var(--mono); font-size: .8rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-deep); margin-bottom: 1rem;
}

.section-head { max-width: 680px; margin: 0 auto clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { font-size: clamp(2.1rem, 5vw, 3.3rem); }
.section-head p { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-2); margin-top: 1rem; }

/* Buttons, puffy clay pills */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--round);
  font-size: 1rem; font-weight: 700; padding: .78rem 1.5rem;
  border-radius: 980px; border: 1px solid transparent; cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s, box-shadow .25s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 42%, transparent);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 52%, transparent); }
.btn-ghost { background: var(--card); color: var(--accent-deep); border-color: var(--border); box-shadow: var(--card-shadow); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }

/* Clay chips, small pill facts (feature belts, hero notes) */
.chips { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  font: 600 .85rem var(--round); color: var(--text);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 980px; padding: .48rem 1rem;
  box-shadow: var(--card-shadow);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s;
}
.chip:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: var(--clay-shadow); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.chip .dot.d-warm { background: var(--warm); }
.chip .dot.d-good { background: var(--good); }
.chip .dot.d-rose { background: var(--bad); }

/* Circular theme reveal (View Transitions API), JS animates the clip-path */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 9999; }
#theme-toggle { view-transition-name: macon-theme-toggle; }
::view-transition-group(macon-theme-toggle) { z-index: 10000; }
::view-transition-old(macon-theme-toggle) { animation: tt-out .5s cubic-bezier(.4, 0, .2, 1) both; }
::view-transition-new(macon-theme-toggle) { animation: tt-in  .5s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes tt-out { to   { transform: rotate(-170deg) scale(.4); opacity: 0; } }
@keyframes tt-in  { from { transform: rotate(170deg)  scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* Scroll reveal, elements get .reveal from js/reveal.js, .in when visible */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); will-change: opacity, transform; }
.js .reveal.in { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.js .hero-anim { opacity: 0; animation: fadeUp .9s cubic-bezier(.2, .7, .2, 1) forwards; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal, .js .hero-anim { opacity: 1 !important; transform: none !important; }
}
