/* ==========================================================================
   AvatarKage — base.css
   Design tokens, reset, typography, buttons, form fields.
   Red/black theme (same palette as SpizzlBeatz).
   ========================================================================== */

:root {
  /* --- palette (from SpizzlBeatz) --- */
  --color-bg: #0a0a0a;
  --color-surface: #141414;
  --color-surface-hover: #1c1c1c;
  --color-border: #262626;
  --color-fg: #f5f5f5;
  --color-muted: #8a8a8a;
  --color-muted-dark: #5c5c5c;
  --color-accent: #e11d2e;
  --color-accent-hover: #c8172a;
  --color-accent-dim: #3a0d11;
  --color-ok: #3ecf8e;
  --color-danger: #ff5566;

  /* --- type --- */
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  /* --- shape --- */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-full: 999px;

  /* --- layout --- */
  --max-width: 1200px;
  --header-h: 64px;

  /* --- motion --- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: #2a2a2a var(--color-bg);
}

/* Scroll lock (sidebar + checkout overlay). --sbw stops the page jumping
   sideways when the desktop scrollbar disappears. */
html.is-locked { overflow: hidden; padding-right: var(--sbw, 0px); }
html.is-locked body { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

::selection { background: var(--color-accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.muted { color: var(--color-muted); }
.accent { color: var(--color-accent); }
[hidden] { display: none !important; }

/* --- icons ------------------------------------------------------------- */
.ico {
  width: 1.5rem; height: 1.5rem; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.ico--sm { width: 1.1rem; height: 1.1rem; }

/* Brand logos are SVG files used as masks so they inherit text colour. */
.brand-ico {
  display: inline-block; flex: none; width: 1.35rem; height: 1.35rem;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
          mask: var(--i) center / contain no-repeat;
}

/* --- buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 3rem; padding: 0.75rem 1.7rem; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius-full);
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-align: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease-out), box-shadow 0.25s, color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.98) translateY(0); }
.btn--primary { background: var(--color-accent); color: #fff; }
.btn--primary:hover { background: var(--color-accent-hover); box-shadow: 0 14px 30px -10px rgba(225, 29, 46, 0.7); }
.btn--ghost { background: var(--color-bg); border-color: var(--color-border); }
.btn--ghost:hover { background: var(--color-surface); border-color: var(--color-accent); box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.7); }
.btn--block { width: 100%; }
.btn--sm { min-height: 2.5rem; padding: 0.5rem 1.2rem; font-size: 0.92rem; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }

.link-arrow { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--color-muted); transition: color 0.2s; }
.link-arrow:hover { color: var(--color-fg); }

/* --- form fields ------------------------------------------------------- */
.field { display: grid; gap: 0.4rem; }
.field > label, .field__label { font-size: 0.9rem; font-weight: 500; color: #d6d6d6; }
.field__hint { font-size: 0.8rem; color: var(--color-muted); }
.input {
  width: 100%; padding: 0.9rem 1rem;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); font-size: 1rem; /* 16px stops iOS zoom */
  transition: border-color 0.2s, background 0.2s;
}
.input::placeholder { color: var(--color-muted-dark); }
.input:hover { border-color: #363636; }
.input:focus { outline: none; border-color: var(--color-accent); background: #171717; }
textarea.input { min-height: 6rem; resize: vertical; }
.field__error { display: none; font-size: 0.85rem; color: var(--color-danger); }
.field.has-error .input { border-color: var(--color-danger); }
.field.has-error .field__error { display: block; }

/* --- motion preference ------------------------------------------------- */
@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;
  }
}
