/* Domanggo design system
   Palette: black #0B0E11 + Robin Neon lime #CCFF00
   Type: Outfit (display) + DM Sans (body)
   Signature: full-bleed 3D board, centered hero copy
*/

:root {
  --lime: #CCFF00;
  --lime-soft: rgba(204, 255, 0, 0.12);
  --lime-line: rgba(204, 255, 0, 0.32);

  --ink: #0B0E11;
  --ink-2: #12151a;
  --ink-3: #1a1e24;
  --ink-4: #242a32;

  --text: #eef1f2;
  --text-2: #a3a8ad;
  --text-3: #6d7278;

  --line: rgba(238, 241, 242, 0.1);
  --line-2: rgba(238, 241, 242, 0.16);

  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: "DM Sans", system-ui, sans-serif;

  --fs-xs: clamp(0.7rem, 0.68rem + 0.15vw, 0.78rem);
  --fs-sm: clamp(0.85rem, 0.82rem + 0.2vw, 0.95rem);
  --fs-base: clamp(1rem, 0.96rem + 0.25vw, 1.08rem);
  --fs-lg: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  --fs-xl: clamp(2.2rem, 1.4rem + 3.2vw, 3.75rem);

  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  --nav-h: 64px;
  --max: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t: 180ms;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

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

button,
input {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  background: var(--lime);
  color: var(--ink);
  font-weight: 600;
  border-radius: var(--r-sm);
}

.skip:focus {
  top: 1rem;
}

/* —— Brand (stacked above hero title) —— */
.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
}

.brand--hero {
  margin-bottom: var(--space-5);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--lime);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-mark svg {
  width: 20px;
  height: 24px;
  display: block;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  letter-spacing: -0.03em;
  color: var(--text);
}

/* —— Stage (full viewport) —— */
.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: center;
  overflow: hidden;
  background: var(--ink);
}

.stage-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#board {
  display: block;
  width: 100%;
  height: 100%;
}

.stage-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 48%, rgba(12, 15, 12, 0.55) 0%, rgba(12, 15, 12, 0.28) 45%, rgba(12, 15, 12, 0.45) 100%),
    linear-gradient(180deg, rgba(12, 15, 12, 0.5) 0%, transparent 28%, transparent 72%, rgba(12, 15, 12, 0.55) 100%);
}

.stage-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.03;
  background-image:
    linear-gradient(var(--text) 1px, transparent 1px),
    linear-gradient(90deg, var(--text) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 15%, transparent 70%);
}

/* —— Hero copy (centered) —— */
.hero {
  position: relative;
  z-index: 2;
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 4.5rem 0 3rem;
  display: flex;
  justify-content: center;
  text-align: center;
}

.hero-panel {
  max-width: 38rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise 700ms var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-panel {
    animation: none;
  }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: var(--space-5);
  text-wrap: balance;
}

.hero h1 span {
  color: var(--lime);
}

.hero-lead {
  max-width: 30rem;
  font-size: var(--fs-lg);
  color: var(--text-2);
  margin: 0 auto var(--space-6);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.3rem;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease), color var(--t) var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--lime);
  color: var(--ink);
}

.btn-primary:hover {
  background: #d6ff2a;
}

.btn-ghost {
  background: rgba(18, 21, 26, 0.65);
  border-color: var(--line-2);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  border-color: rgba(238, 241, 242, 0.28);
  background: rgba(26, 30, 36, 0.85);
}

.btn-ghost svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* —— Modal —— */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 6, 0.78);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: var(--ink-3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: rise 280ms var(--ease) both;
}

.modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 1.4rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.modal-kicker {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--lime);
  margin-bottom: 0.45rem;
}

.modal-card h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.45rem;
}

.modal-card > p {
  color: var(--text-2);
  font-size: var(--fs-sm);
  margin-bottom: 1.2rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.field label {
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-weight: 500;
}

.field input {
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--ink);
  color: var(--text);
}

.field input::placeholder {
  color: var(--text-3);
}

.field input:focus {
  outline: none;
  border-color: rgba(204, 255, 0, 0.55);
}

.field-error {
  color: #f0a59c;
  font-size: var(--fs-xs);
  min-height: 1.1em;
}

.field-error:empty {
  display: none;
}

/* —— Toast —— */
.toast[hidden] {
  display: none !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 60;
  transform: translateX(-50%) translateY(10px);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: calc(100% - 2rem);
  padding: 0.85rem 1.15rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--lime-line);
  background: var(--ink-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
  pointer-events: none;
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  flex-shrink: 0;
}

/* —— 404 —— */
.page-404 {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 5rem 1.25rem 3rem;
}

.page-404 h1 {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 6.5rem);
  color: var(--lime);
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.page-404 h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.page-404 p {
  color: var(--text-2);
  max-width: 26rem;
  margin: 0 auto 1.5rem;
}

/* —— Mobile —— */
@media (max-width: 640px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .stage-veil {
    background:
      radial-gradient(ellipse 90% 70% at 50% 45%, rgba(12, 15, 12, 0.5) 0%, rgba(12, 15, 12, 0.65) 100%),
      linear-gradient(180deg, rgba(12, 15, 12, 0.55) 0%, transparent 30%, rgba(12, 15, 12, 0.6) 100%);
  }
}
