/* ==========================================================================
   SearchSpace — global stylesheet
   ========================================================================== */

:root {
  /* Palette */
  --color-white: #ffffff;
  --color-bg: #f7f9fc;
  --color-surface: #ffffff;

  --color-navy-900: #0a1930;
  --color-navy-800: #102243;
  --color-blue-700: #1f4fa3;
  --color-blue-600: #2563c9;
  --color-blue-500: #3b82f6;
  --color-blue-100: #e5edfb;
  --color-blue-50: #f1f6fd;

  --color-orange-600: #d9550c;
  --color-orange-500: #f2711c;
  --color-orange-100: #fde7d6;

  --color-text: #16233b;
  --color-text-muted: #55627a;
  --color-border: #e2e8f2;

  --color-success: #1a8f5c;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* Layout */
  --max-width: 1160px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(10, 25, 48, 0.06);
  --shadow-md: 0 6px 20px rgba(10, 25, 48, 0.08);
  --transition: 150ms ease;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 16px;
}

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

a {
  color: var(--color-blue-600);
  text-decoration: none;
}

a:hover {
  color: var(--color-blue-700);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-sans);
  color: var(--color-navy-900);
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2.25rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

code {
  font-family: var(--font-mono);
  background: var(--color-blue-50);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------------------
   Header / Nav
   -------------------------------------------------------------------------- */

.site-header {
  background: var(--color-navy-900);
  border-bottom: 1px solid var(--color-navy-800);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-white);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.site-header__brand:hover {
  color: var(--color-white);
  opacity: 0.9;
}

.site-header__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--color-orange-500);
  color: var(--color-white);
  font-size: 0.85rem;
  font-weight: 800;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-header__links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header__links a {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
  font-size: 0.95rem;
}

.site-header__links a:hover {
  color: var(--color-white);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
    color var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--color-orange-500);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--color-orange-600);
  color: var(--color-white);
}

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

.btn--outline:hover {
  border-color: var(--color-blue-500);
  color: var(--color-blue-600);
}

.btn--on-dark {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--color-white);
}

.btn--on-dark:hover {
  background: var(--color-orange-500);
  border-color: var(--color-orange-500);
  color: var(--color-white);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  background: linear-gradient(180deg, var(--color-navy-900) 0%, var(--color-navy-800) 100%);
  color: var(--color-white);
  padding: 72px 0 56px;
}

.hero__inner {
  max-width: 760px;
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-orange-500);
  margin-bottom: 14px;
}

.hero h1 {
  color: var(--color-white);
  font-size: 2.75rem;
  margin-bottom: 18px;
}

.hero p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.15rem;
  max-width: 620px;
}

.hero__actions {
  display: flex;
  gap: 14px;
  margin-top: 28px;
}

.hero__stats {
  display: flex;
  gap: 40px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero__stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-white);
}

.hero__stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
  padding: 56px 0;
}

.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.section__header p {
  color: var(--color-text-muted);
  margin: 4px 0 0;
}

/* --------------------------------------------------------------------------
   Competition grid & cards
   -------------------------------------------------------------------------- */

.competition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.competition-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: box-shadow var(--transition), border-color var(--transition),
    transform var(--transition);
  height: 100%;
}

.competition-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-blue-500);
  transform: translateY(-2px);
}

.competition-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-blue-100);
  color: var(--color-blue-700);
  white-space: nowrap;
}

.badge--open {
  background: #e4f6ee;
  color: var(--color-success);
}

.badge--closed {
  background: #f1f2f5;
  color: var(--color-text-muted);
}

.badge--orange {
  background: var(--color-orange-100);
  color: var(--color-orange-600);
}

.competition-card__company {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.competition-card h3 {
  margin-bottom: 10px;
}

.competition-card h3 a {
  color: var(--color-navy-900);
}

.competition-card h3 a:hover {
  color: var(--color-blue-600);
}

.competition-card p.excerpt {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}

.competition-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
}

.competition-card__meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.competition-card__meta-label {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.competition-card__meta-value {
  font-weight: 700;
  color: var(--color-navy-900);
}

.competition-card__meta-value--prize {
  color: var(--color-orange-600);
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Two-column layout (how-it-works)
   -------------------------------------------------------------------------- */

.page-header {
  padding: 48px 0 8px;
  text-align: center;
}

.page-header p {
  color: var(--color-text-muted);
  max-width: 620px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
}

.two-column__col {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.two-column__col--competitors {
  border-top: 4px solid var(--color-blue-500);
}

.two-column__col--companies {
  border-top: 4px solid var(--color-orange-500);
}

.two-column__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.two-column__col--competitors .two-column__label {
  color: var(--color-blue-600);
}

.two-column__col--companies .two-column__label {
  color: var(--color-orange-600);
}

.step-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  counter-reset: step;
}

.step-list li {
  counter-increment: step;
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--color-border);
}

.step-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.step-list li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-blue-100);
  color: var(--color-blue-700);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.two-column__col--companies .step-list li::before {
  background: var(--color-orange-100);
  color: var(--color-orange-600);
}

.step-list h4 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.step-list p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Competition page (single reading layout)
   -------------------------------------------------------------------------- */

.competition-hero {
  background: var(--color-navy-900);
  color: var(--color-white);
  padding: 40px 0 32px;
}

.competition-hero__crumb {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: block;
}

.competition-hero__crumb a {
  color: rgba(255, 255, 255, 0.6);
}

.competition-hero__crumb a:hover {
  color: var(--color-white);
}

.competition-hero__badges {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.competition-hero h1 {
  color: var(--color-white);
  margin-bottom: 10px;
  font-size: 2.1rem;
}

.competition-hero__company {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1rem;
  margin-bottom: 0;
}

.competition-stat-bar {
  background: var(--color-navy-800);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.competition-stat-bar__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.competition-stat {
  color: var(--color-white);
}

.competition-stat__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 4px;
}

.competition-stat__value {
  font-size: 1.2rem;
  font-weight: 700;
}

.competition-stat__value--prize {
  color: var(--color-orange-500);
}

.competition-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 40px;
  padding: 40px 0 72px;
  align-items: start;
}

.competition-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.competition-content section + section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}

.competition-content h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
}

.competition-content h2 .section-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-blue-100);
  color: var(--color-blue-700);
  font-size: 0.8rem;
  font-weight: 700;
}

.prize-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 20px 0 0;
}

.prize-item {
  background: var(--color-blue-50);
  border: 1px solid var(--color-blue-100);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.prize-item--top {
  background: var(--color-orange-100);
  border-color: var(--color-orange-100);
}

.prize-item__rank {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.prize-item__value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-navy-900);
}

.prize-item--top .prize-item__value {
  color: var(--color-orange-600);
}

.prize-item__note {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.fact-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.fact-table tr {
  border-top: 1px solid var(--color-border);
}

.fact-table tr:first-child {
  border-top: none;
}

.fact-table th,
.fact-table td {
  text-align: left;
  padding: 10px 0;
  vertical-align: top;
  font-size: 0.95rem;
}

.fact-table th {
  width: 40%;
  color: var(--color-text-muted);
  font-weight: 600;
}

.submission-box {
  background: var(--color-navy-900);
  color: var(--color-white);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 20px;
}

.submission-box code {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-white);
}

.submission-box ul {
  margin-bottom: 0;
}

.submission-box a {
  color: var(--color-orange-500);
}

.competition-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.sidebar-card h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.sidebar-card .btn {
  width: 100%;
  margin-top: 8px;
}

.sidebar-fact {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.sidebar-fact:first-of-type {
  border-top: none;
}

.sidebar-fact__label {
  color: var(--color-text-muted);
}

.sidebar-fact__value {
  font-weight: 700;
  color: var(--color-navy-900);
  text-align: right;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--color-navy-900);
  color: rgba(255, 255, 255, 0.6);
  padding: 32px 0;
  margin-top: 40px;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.75);
}

.site-footer a:hover {
  color: var(--color-white);
}

.site-footer__links {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .two-column {
    grid-template-columns: 1fr;
  }

  .competition-layout {
    grid-template-columns: 1fr;
  }

  .competition-sidebar {
    position: static;
  }

  .hero h1 {
    font-size: 2.1rem;
  }

  .hero__stats {
    flex-wrap: wrap;
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .site-header__links {
    display: none;
  }

  .competition-content {
    padding: 24px;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }
}
