/* =================================================================
   HMBLE Applications — Brawl Stars
   Premium esports landing / application portal
   ================================================================= */

:root {
  --background: #050505;
  --surface: #111111;
  --surface-light: #181818;
  --text: #ffffff;
  --muted: #a3a3a3;
  --accent: #f58220;
  --border: #2b2b2b;

  /* derived */
  --input-bg: #0b0b0b;
  --accent-soft: rgba(245, 130, 32, 0.12);
  --accent-glow: rgba(245, 130, 32, 0.35);
  --radius: 14px;
  --radius-lg: 22px;
  --header-h: 72px;
  --maxw: 1180px;
  --ease: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  --font-body: "Inter", Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", Arial, sans-serif;
}

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

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

body {
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 32px;
}

.section {
  padding-block: clamp(64px, 9vw, 130px);
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.98;
  font-size: clamp(2.1rem, 5.2vw, 3.7rem);
  margin-top: 16px;
}

.section-subtitle {
  color: var(--muted);
  max-width: 56ch;
  margin-top: 18px;
  font-size: 1.02rem;
}

.section-head {
  margin-bottom: clamp(36px, 5vw, 60px);
  max-width: 760px;
}

/* ---------- Buttons ---------- */
.btn {
  --pad-y: 13px;
  --pad-x: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--pad-y) var(--pad-x);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform var(--ease), background-color var(--ease),
    color var(--ease), border-color var(--ease), box-shadow var(--ease);
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: var(--accent);
  color: #050505;
  box-shadow: 0 0 0 rgba(245, 130, 32, 0);
}

.btn-primary:hover {
  box-shadow: 0 8px 30px var(--accent-glow), 0 0 0 1px var(--accent);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 22px rgba(245, 130, 32, 0.18);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 100;
  background: rgba(5, 5, 5, 0.65);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--ease), border-color var(--ease);
}

.site-header.scrolled {
  background: rgba(5, 5, 5, 0.88);
  border-bottom-color: #353535;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.32rem;
  letter-spacing: 0.16em;
  color: var(--text);
  text-transform: uppercase;
}

.logo img {
  height: 30px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  transition: color var(--ease);
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--ease);
}

.nav-link:hover {
  color: var(--text);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-cta {
  --pad-y: 10px;
  --pad-x: 20px;
  font-size: 0.82rem;
  margin-left: 6px;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(60px, 9vw, 110px));
  padding-bottom: clamp(70px, 9vw, 120px);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 55% at 78% 12%, rgba(245, 130, 32, 0.16), transparent 60%),
    radial-gradient(50% 50% at 8% 8%, rgba(245, 130, 32, 0.07), transparent 55%),
    radial-gradient(80% 80% at 50% 120%, rgba(120, 120, 120, 0.08), transparent 60%);
}

.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(72% 65% at 50% 35%, #000 40%, transparent 78%);
  -webkit-mask-image: radial-gradient(72% 65% at 50% 35%, #000 40%, transparent 78%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}

.hero-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 0.92;
  font-size: clamp(3rem, 9vw, 6.4rem);
  margin: 22px 0 0;
}

.hero-title .line {
  display: block;
}

.hero-title .accent-line {
  color: var(--accent);
  text-shadow: 0 0 40px rgba(245, 130, 32, 0.28);
}

.hero-subtitle {
  color: var(--muted);
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  max-width: 46ch;
  margin-top: 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero-metrics {
  display: flex;
  gap: 38px;
  margin-top: 48px;
  list-style: none;
  flex-wrap: wrap;
}

.hero-metrics li {
  display: flex;
  flex-direction: column;
}

.hero-metrics strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-metrics span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 2px;
}

/* Hero side card */
.hero-card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-light), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.hero-card-glow {
  position: absolute;
  top: -40%;
  right: -30%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  filter: blur(20px);
  opacity: 0.5;
  pointer-events: none;
}

.hero-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
}

.hero-card-tag {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-card-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.hero-card-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2s infinite;
}

.hero-card-emblem {
  margin: 22px 0 16px;
  filter: drop-shadow(0 0 16px rgba(245, 130, 32, 0.4));
}

.hero-card-emblem img {
  width: 66px;
  height: 66px;
  display: block;
}

.hero-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

.hero-card-stats {
  list-style: none;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}

.hero-card-stats li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.hero-card-stats span {
  color: var(--muted);
  letter-spacing: 0.02em;
}

.hero-card-stats strong {
  font-family: var(--font-display);
  font-weight: 600;
}

.hero-card-stats strong.ok {
  color: var(--accent);
}

/* ---------- Requirements ---------- */
.requirements {
  border-top: 1px solid var(--border);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px 32px;
  transition: border-color var(--ease), transform var(--ease),
    background-color var(--ease), box-shadow var(--ease);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, var(--accent-soft), transparent 55%);
  opacity: 0;
  transition: opacity var(--ease);
  pointer-events: none;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  background: var(--surface-light);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.card:hover::before {
  opacity: 1;
}

.card-index {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.28rem;
  margin: 20px 0 10px;
  letter-spacing: 0.01em;
}

.card-text {
  color: var(--muted);
  font-size: 0.96rem;
}

/* ---------- Apply / Form ---------- */
.apply {
  border-top: 1px solid var(--border);
}

.apply::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(60% 50% at 50% 0%, rgba(245, 130, 32, 0.06), transparent 60%);
}

.form-card {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 52px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.form-head {
  text-align: center;
  margin-bottom: 40px;
}

.form-head .eyebrow {
  justify-content: center;
}

.form-head .section-subtitle {
  margin-inline: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.field .req {
  color: var(--accent);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
  padding: 14px 16px;
  transition: border-color var(--ease), box-shadow var(--ease),
    background-color var(--ease);
  appearance: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #6a6a6a;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #3d3d3d;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.16);
  background: #0d0d0d;
}

/* invalid state appears only after a submit attempt */
.form-card.validated input:invalid,
.form-card.validated select:invalid,
.form-card.validated textarea:invalid {
  border-color: #ff4d4d;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 42px;
  cursor: pointer;
}

.field select option {
  background: var(--surface);
  color: var(--text);
}

.field textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.55;
}

.btn-submit {
  width: 100%;
  margin-top: 30px;
  --pad-y: 17px;
  font-size: 1rem;
  letter-spacing: 0.06em;
  animation: idle-glow 3.2s ease-in-out infinite;
}

.btn-submit:hover {
  animation: none;
}

.form-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 18px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--background);
  padding-top: clamp(48px, 6vw, 72px);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.footer-logo {
  height: 34px;
  width: auto;
  display: block;
}

.footer-tagline {
  color: var(--muted);
  margin-top: 8px;
  font-size: 0.95rem;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.footer-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-mail {
  font-size: 1.05rem;
  font-weight: 500;
  transition: color var(--ease);
}

.footer-mail:hover {
  color: var(--accent);
}

.footer-cta {
  --pad-y: 10px;
  --pad-x: 20px;
  font-size: 0.82rem;
  margin-top: 4px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 26px 34px;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-disclaimer {
  max-width: 52ch;
  text-align: right;
  opacity: 0.85;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 140%);
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--surface-light);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 13px 22px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 200;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 26px rgba(245, 130, 32, 0.16);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
  max-width: calc(100% - 40px);
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  flex-shrink: 0;
}

.toast.toast--err {
  border-color: #ff4d4d;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 26px rgba(255, 77, 77, 0.18);
}

.toast.toast--err .toast-dot {
  background: #ff4d4d;
  box-shadow: 0 0 12px rgba(255, 77, 77, 0.5);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Keyframes ---------- */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--accent-glow);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(245, 130, 32, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 130, 32, 0);
  }
}

@keyframes idle-glow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(245, 130, 32, 0);
  }
  50% {
    box-shadow: 0 8px 34px var(--accent-glow);
  }
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

/* Tablet */
@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-subtitle {
    margin-inline: auto;
  }

  .hero-actions,
  .hero-metrics {
    justify-content: center;
  }

  .hero-card {
    max-width: 460px;
    margin-inline: auto;
    width: 100%;
    text-align: left;
    order: -1;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 640px) {
  .container {
    padding-inline: 20px;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: rgba(8, 8, 8, 0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px 22px;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
  }

  .nav-link::after {
    display: none;
  }

  .nav-cta {
    margin: 12px 0 0;
    text-align: center;
    --pad-y: 13px;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding-top: calc(var(--header-h) + 48px);
  }

  .hero-title {
    font-size: clamp(2.6rem, 15vw, 3.6rem);
  }

  .hero-actions {
    width: 100%;
    flex-direction: column;
  }

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

  .hero-metrics {
    gap: 26px;
    margin-top: 38px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 26px;
  }

  .footer-contact {
    align-items: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-disclaimer {
    text-align: left;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
