/* Hunchball landing page. Colour tokens follow the Angular app (src/client/src/styles.css). */

:root {
  color-scheme: light;

  --font-sans:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans',
    sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';

  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.141 0.005 285.823);
  --card: oklch(1 0 0);
  --primary: oklch(0.527 0.154 150.069);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.967 0.001 286.375);
  --muted: oklch(0.967 0.001 286.375);
  --muted-foreground: oklch(0.552 0.016 285.938);
  --accent: oklch(0.962 0.044 156.743);
  --accent-foreground: oklch(0.448 0.119 151.328);
  --warning: oklch(0.666 0.179 58.318);
  --warning-bg: oklch(0.962 0.059 95.617);
  --border: oklch(0.92 0.004 286.32);
  --ring: oklch(0.723 0.219 149.579);

  --section-alt: oklch(0.985 0.006 155);
  --hero-glow: oklch(0.9 0.09 152 / 0.55);
  --pitch-line: oklch(0.527 0.154 150.069 / 0.09);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.05), 0 8px 24px -8px oklch(0 0 0 / 0.12);
  --shadow-lg: 0 24px 60px -20px oklch(0.3 0.08 150 / 0.35);
  --phone-frame: oklch(0.21 0.006 285.885);
}

:root.dark {
  color-scheme: dark;

  --background: oklch(0.141 0.005 285.823);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.21 0.006 285.885);
  --primary: oklch(0.67 0.16 150);
  --primary-foreground: oklch(0.266 0.065 152.934);
  --secondary: oklch(0.274 0.006 286.033);
  --muted: oklch(0.274 0.006 286.033);
  --muted-foreground: oklch(0.705 0.015 286.067);
  --accent: oklch(0.32 0.06 152);
  --accent-foreground: oklch(0.962 0.044 156.743);
  --warning: oklch(0.828 0.189 84.429);
  --warning-bg: oklch(0.35 0.07 70 / 0.5);
  --border: oklch(1 0 0 / 10%);
  --ring: oklch(0.627 0.194 149.214);

  --section-alt: oklch(0.17 0.01 160);
  --hero-glow: oklch(0.45 0.12 150 / 0.35);
  --pitch-line: oklch(0.67 0.16 150 / 0.08);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 8px 24px -8px oklch(0 0 0 / 0.6);
  --shadow-lg: 0 24px 60px -20px oklch(0 0 0 / 0.8);
  --phone-frame: oklch(0.32 0.006 285.885);
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
ol,
ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-inline: 1.5rem;
  }
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-lg {
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background: color-mix(in oklch, var(--primary) 88%, black);
}

:root.dark .btn-primary:hover {
  background: color-mix(in oklch, var(--primary) 88%, white);
}

.btn-ghost {
  color: var(--foreground);
}

.btn-ghost:hover {
  background: var(--secondary);
}

.btn-outline {
  border-color: var(--border);
  background: var(--card);
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--secondary);
}

.btn-on-primary {
  background: white;
  color: oklch(0.448 0.119 151.328);
}

.btn-on-primary:hover {
  background: oklch(0.962 0.044 156.743);
}

.btn-outline-on-primary {
  border-color: oklch(1 0 0 / 0.55);
  color: white;
}

.btn-outline-on-primary:hover {
  background: oklch(1 0 0 / 0.12);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--secondary);
}

.icon-btn .icon {
  width: 1.1rem;
  height: 1.1rem;
}

.icon-sun,
:root.dark .icon-moon {
  display: none;
}

:root.dark .icon-sun {
  display: block;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--background) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

.main-nav {
  display: none;
  gap: 0.25rem;
  margin-left: 1rem;
}

.main-nav a {
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.main-nav a:hover {
  background: var(--secondary);
  color: var(--foreground);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.toggles {
  display: flex;
  gap: 0.35rem;
}

/* On small phones the theme/language toggles live in the footer. */
.header-actions .toggles {
  display: none;
  margin-right: 0.35rem;
}

@media (max-width: 379px) {
  .header-actions .btn {
    padding-inline: 0.6rem;
  }
  .brand span {
    font-size: 1rem;
  }
}

@media (min-width: 640px) {
  .header-actions .toggles {
    display: flex;
  }
}

@media (min-width: 960px) {
  .main-nav {
    display: flex;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: 3rem 4rem;
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto auto;
  width: 60rem;
  height: 40rem;
  z-index: -2;
  background: radial-gradient(closest-side, var(--hero-glow), transparent);
}

/* Subtle pitch markings behind the hero (wide screens only, so they never cross the text). */
.hero-pitch {
  display: none;
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 78% 50%, transparent 9.5rem, var(--pitch-line) 9.5rem, var(--pitch-line) calc(9.5rem + 2px), transparent calc(9.5rem + 2px)),
    linear-gradient(90deg, transparent calc(78% - 1px), var(--pitch-line) calc(78% - 1px), var(--pitch-line) calc(78% + 1px), transparent calc(78% + 1px));
  mask-image: linear-gradient(to bottom, black 60%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent);
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 960px) {
  .hero {
    padding-block: 5rem 6rem;
  }
  .hero-pitch {
    display: block;
  }
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
  }
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--accent-foreground);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--accent);
}

h1 {
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.highlight {
  color: var(--primary);
}

.lead {
  max-width: 36rem;
  margin-top: 1.25rem;
  color: var(--muted-foreground);
  font-size: 1.125rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.cta-row .btn {
  flex: 1 1 100%;
}

@media (min-width: 480px) {
  .cta-row .btn {
    flex: 0 0 auto;
  }
}

.cta-row-center {
  justify-content: center;
}

.hero-points {
  display: grid;
  gap: 0.5rem;
  margin-top: 2rem;
  font-size: 0.95rem;
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hero-points .icon {
  width: 1.1rem;
  height: 1.1rem;
  padding: 0.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-foreground);
  stroke-width: 3;
}

/* ---------- Hero mockup ---------- */

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  padding-block: 1rem 2rem;
  user-select: none;
}

.phone {
  position: relative;
  width: min(100%, 18.5rem);
  padding: 0.6rem;
  border-radius: 2.4rem;
  background: var(--phone-frame);
  box-shadow: var(--shadow-lg);
  transform: rotate(-2deg);
}

.phone-notch {
  position: absolute;
  top: 0.95rem;
  left: 50%;
  width: 5rem;
  height: 1.1rem;
  translate: -50% 0;
  border-radius: 999px;
  background: var(--phone-frame);
  z-index: 1;
}

.phone-screen {
  min-height: 30rem;
  padding: 2.4rem 0.85rem 1rem;
  border-radius: 1.9rem;
  background: var(--background);
}

.app-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 800;
}

.app-bar img {
  border-radius: 5px;
}

.app-title {
  margin-top: 0.9rem;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-day {
  margin: 0.15rem 0 0.6rem;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.match-card {
  margin-bottom: 0.6rem;
  padding: 0.6rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
}

.match-card.missing {
  border-color: color-mix(in oklch, var(--warning) 55%, transparent);
}

.match-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  color: var(--muted-foreground);
  font-size: 0.62rem;
  font-weight: 600;
}

.badge-time {
  color: var(--accent-foreground);
}

.badge-warn {
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--warning-bg);
  color: var(--warning);
}

:root:not(.dark) .badge-warn {
  color: oklch(0.47 0.137 46.201);
}

.match-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto 1fr;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 600;
}

.team {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-away {
  text-align: right;
}

.score-box {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--background);
  font-size: 0.85rem;
  font-weight: 800;
}

.score-box.filled {
  border-color: color-mix(in oklch, var(--primary) 50%, transparent);
  background: var(--accent);
  color: var(--accent-foreground);
}

.missing .score-box {
  border-style: dashed;
  border-color: color-mix(in oklch, var(--warning) 70%, transparent);
}

.dash {
  color: var(--muted-foreground);
}

.float-card {
  position: absolute;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}

.leaderboard-card {
  right: 0;
  bottom: 0;
  width: 12.5rem;
  padding: 0.8rem 0.9rem;
}

.float-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.float-title .icon {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--primary);
}

.leaderboard-card li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.35rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
}

.leaderboard-card li.me {
  background: var(--accent);
  color: var(--accent-foreground);
  font-weight: 700;
}

.rank {
  display: grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  color: oklch(0.25 0.03 80);
}

.gold {
  background: oklch(0.85 0.15 88);
}

.silver {
  background: oklch(0.87 0.01 260);
}

.bronze {
  background: oklch(0.76 0.1 55);
}

.name {
  flex: 1;
}

.pts {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.points-card {
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem 0.55rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  animation-delay: -3s;
}

.points-plus {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.6rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 800;
}

@keyframes float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -8px;
  }
}

@media (max-width: 479px) {
  .leaderboard-card {
    right: -0.25rem;
    width: 11rem;
  }
  .points-card {
    left: -0.25rem;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: 4rem;
}

@media (min-width: 960px) {
  .section {
    padding-block: 6rem;
  }
}

.section-alt {
  border-block: 1px solid var(--border);
  background: var(--section-alt);
}

.section-head {
  max-width: 40rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}

h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h3 {
  font-size: 1.075rem;
  font-weight: 700;
  line-height: 1.3;
}

.section-lead {
  margin-top: 1rem;
  color: var(--muted-foreground);
  font-size: 1.05rem;
}

/* Steps */

.steps {
  display: grid;
  gap: 1rem;
  counter-reset: step;
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

.step {
  position: relative;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
}

.step-num {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 1.1rem;
  font-weight: 800;
}

.step p,
.feature p {
  margin-top: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

/* Features */

.feature-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.feature {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  transition:
    border-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}

.feature:hover {
  border-color: color-mix(in oklch, var(--primary) 45%, var(--border));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  background: var(--accent);
  color: var(--accent-foreground);
}

/* Scoring */

.scoring-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 960px) {
  .scoring-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

.example {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 0.95rem;
}

.points-list {
  display: grid;
  gap: 0.75rem;
}

.points-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
}

.points-list div {
  display: grid;
}

.points-list span:not(.pts-badge) {
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.pts-badge {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 0.8rem;
  font-size: 1.35rem;
  font-weight: 800;
}

.pts-5 {
  background: var(--primary);
  color: var(--primary-foreground);
}

.pts-3 {
  background: oklch(0.5 0.12 150);
  color: oklch(0.985 0 0);
}

:root:not(.dark) .pts-3 {
  background: oklch(0.65 0.14 150);
  color: oklch(0.2 0.05 150);
}

.pts-2 {
  background: var(--accent);
  color: var(--accent-foreground);
}

.pts-0 {
  background: var(--muted);
  color: var(--muted-foreground);
}

/* Competitions */

.comp-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  max-width: 48rem;
  margin-inline: auto;
}

.comp-list li {
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.95rem;
  font-weight: 600;
}

.comp-list li:first-child {
  border-color: color-mix(in oklch, var(--primary) 50%, transparent);
  background: var(--accent);
  color: var(--accent-foreground);
}

.comp-list .comp-more {
  border-style: dashed;
  background: transparent;
  color: var(--muted-foreground);
  font-weight: 500;
}

/* Final CTA */

.cta-panel {
  position: relative;
  overflow: hidden;
  padding: 3rem 1.5rem;
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at 100% 0%, oklch(1 0 0 / 0.14), transparent 45%),
    linear-gradient(135deg, oklch(0.527 0.154 150.069), oklch(0.43 0.12 152));
  color: white;
  text-align: center;
}

.cta-panel::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9rem;
  width: 18rem;
  height: 18rem;
  translate: -50% 0;
  border: 2px solid oklch(1 0 0 / 0.12);
  border-radius: 999px;
  pointer-events: none;
}

.cta-panel h2 {
  max-width: 34rem;
  margin-inline: auto;
}

.cta-panel p {
  max-width: 32rem;
  margin: 1rem auto 0;
  opacity: 0.92;
  font-size: 1.05rem;
}

.cta-panel .cta-row {
  position: relative;
  z-index: 1;
}

@media (min-width: 640px) {
  .cta-panel {
    padding: 4rem 2rem;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-small {
  font-size: 1rem;
}

.brand-small img {
  border-radius: 6px;
}

.footer-note {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

@media (max-width: 639px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
