/* base.css — reset, page background, shared typography, header, brand.
   Loaded by both index.html and font-generator.html. */

* {
  box-sizing: border-box;
}

/* The `hidden` attribute must always win over component display rules
   (e.g. .option-toggle { display: flex }), so SectionTabs can hide sections. */
[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

/* Smooth-scroll for in-page anchors (e.g. the CTA "Start creating" button
   jumping to #inputText). Gated behind no-preference so reduced-motion users
   get an instant jump instead of an animated scroll. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  background:
    radial-gradient(circle at 8% 6%, rgba(109, 76, 255, 0.1), transparent 25rem),
    radial-gradient(circle at 88% 10%, rgba(111, 125, 255, 0.12), transparent 30rem),
    linear-gradient(180deg, var(--page), var(--page-2));
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body-font);
  line-height: 1.5;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  text-align: left;
}

/* Dark page background layer (separate from the token overrides in tokens.css). */
body.dark,
body[data-theme="dark"] {
  background:
    radial-gradient(circle at 8% 6%, rgba(109, 76, 255, 0.22), transparent 25rem),
    radial-gradient(circle at 88% 10%, rgba(111, 125, 255, 0.18), transparent 30rem),
    linear-gradient(145deg, var(--page), var(--page-2));
  background-attachment: fixed;
  color: var(--ink);
}

button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}

.content,
.font-page .content {
  margin: 0 auto;
  max-width: 1500px;
  padding: 32px 38px 38px;
  width: 100%;
}

.app-shell {
  min-height: 100vh;
}

.site-header,
.header {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 26px;
  text-align: left;
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.brand-cube {
  background: #2b1f19 url("/assets/images/thumbnail-pfp.png") center / cover no-repeat;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(41, 31, 25, 0.18);
  height: 66px;
  image-rendering: pixelated;
  width: 66px;
}

.eyebrow {
  color: #30396f;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 3px;
  text-transform: uppercase;
}

h1,
h2 {
  line-height: 1.05;
  margin: 0;
}

h1 {
  border: 0;
  color: var(--ink);
  font-family: var(--body-font);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  margin: 0;
  text-shadow: none;
}

h2 {
  font-family: var(--body-font);
  font-size: 16px;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 16px;
  margin: 2px 0 0;
}

.top-actions,
.language-row,
.download-row,
.identity-row,
.motion-pad-row,
.stepper-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

a,
a:visited {
  color: var(--sky);
}

a:hover {
  color: var(--grass);
}

.font-generator-link {
  margin: 0;
}

.nav-menu {
  position: relative;
}

.nav-menu summary {
  list-style: none;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu summary::after {
  content: "▾";
  font-size: 12px;
}

.nav-menu[open] summary::after {
  content: "▴";
}

.nav-submenu {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  min-width: 180px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 1000;
}

.language-submenu {
  min-width: 240px;
}

.nav-submenu a {
  align-items: center;
  border-radius: 4px;
  color: var(--ink);
  display: flex;
  font-family: var(--body-font);
  font-weight: 700;
  min-height: 38px;
  padding: 8px 10px;
  text-decoration: none;
}

.nav-submenu a:hover {
  background: rgba(93, 223, 137, 0.16);
  color: var(--ink);
}

/* Rainbow text + its keyframe (the only live legacy rule, preserved here). */
.rainbow {
  animation: rainbow_animation 4s ease-in-out infinite;
  background: linear-gradient(to right, var(--grass), var(--sky), var(--gold), var(--redstone), var(--grass));
  background-clip: text;
  background-size: 400% 100%;
  color: transparent;
  -webkit-background-clip: text;
}

@keyframes rainbow_animation {
  0%,
  100% {
    background-position: 0 0;
  }
  50% {
    background-position: 100% 0;
  }
}
