/* =============================================================
   CSS Custom Properties
   ============================================================= */
:root {
  /* Brand palette */
  --color-anthracite:    #1A1A1A;
  --color-dark-grey:     #A4A4A4;
  --color-light-grey:    #EAEAEA;
  --color-neon-green:    #53F770;
  --color-neon-dark:     #35C752;  /* hover / pressed */

  /* Semantic aliases */
  --color-primary:       var(--color-neon-green);
  --color-primary-dark:  var(--color-neon-dark);
  --color-primary-text:  var(--color-anthracite); /* text ON a neon-green bg */

  --color-bg:            var(--color-light-grey);
  --color-surface:       #FFFFFF;
  --color-dark-bg:       var(--color-anthracite);

  --color-text:          var(--color-anthracite);
  --color-text-muted:    var(--color-dark-grey);
  --color-border:        #D0D0D0;

  /* Score colours — unchanged */
  --color-good:          #16a34a;
  --color-good-bg:       #dcfce7;
  --color-good-border:   #86efac;
  --color-average:       #d97706;
  --color-average-bg:    #fef3c7;
  --color-average-border:#fcd34d;
  --color-poor:          #dc2626;
  --color-poor-bg:       #fee2e2;
  --color-poor-border:   #fca5a5;

  --font:         'Funnel Display', system-ui, -apple-system, sans-serif;

  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    18px;
  --radius-full:  9999px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:    0 4px 12px rgba(0,0,0,.1);
  --shadow-lg:    0 12px 36px rgba(0,0,0,.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* =============================================================
   Page
   ============================================================= */
.page { display: flex; flex-direction: column; min-height: 100vh; }

/* =============================================================
   Header
   ============================================================= */
.header {
  background: var(--color-dark-bg);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 0 24px;
}

.header__inner {
  max-width: 780px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header__logo-link {
  display: flex;
  align-items: center;
  opacity: .85;
  transition: opacity .15s;
}

.header__logo-link:hover { opacity: 1; }

.header__logo {
  height: 24px;
  width: auto;
  display: block;
}

/* =============================================================
   Hero
   ============================================================= */
.hero {
  background: var(--color-dark-bg);
  padding: 96px 24px 88px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Top gradient stripe — neon green accent line */
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, transparent, var(--color-neon-green), transparent);
  pointer-events: none;
}

/* Subtle green radial glow from the top */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 45% at 50% -5%, rgba(83,247,112,.14) 0%, transparent 65%);
  pointer-events: none;
}

.hero__container {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero__eyebrow {
  display: inline-block;
  margin-bottom: 24px;
  padding: 5px 16px;
  background: var(--color-neon-green);
  color: var(--color-anthracite);
  border-radius: var(--radius-full);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.hero__title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.12;
  letter-spacing: -.03em;
  margin-bottom: 24px;
}

.hero__title-highlight {
  color: var(--color-neon-green);
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--color-dark-grey);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.75;
}

/* =============================================================
   Analyzer
   ============================================================= */
.analyzer {
  padding: 72px 24px 80px;
}

.analyzer__container {
  max-width: 640px;
  margin: 0 auto;
}

.analyzer__heading {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -.025em;
  margin-bottom: 8px;
}

.analyzer__description {
  font-size: .95rem;
  color: var(--color-text-muted);
  margin-bottom: 36px;
}

/* URL list */
.analyzer__url-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

/* URL row */
.analyzer__url-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.analyzer__url-badge {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-anthracite);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.analyzer__url-input {
  flex: 1;
  height: 50px;
  padding: 0 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-family: var(--font);
  font-size: .95rem;
  color: var(--color-text);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.analyzer__url-input::placeholder { color: var(--color-dark-grey); }

.analyzer__url-input:focus {
  border-color: var(--color-neon-green);
  box-shadow: 0 0 0 3px rgba(83,247,112,.18);
}

.analyzer__url-input--error {
  border-color: var(--color-poor);
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

.analyzer__remove-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-poor-bg);
  color: var(--color-poor);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.analyzer__remove-btn:hover { background: var(--color-poor-border); }

.analyzer__remove-btn--hidden {
  visibility: hidden;
  pointer-events: none;
}

/* Add URL button */
.analyzer__add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: transparent;
  font-family: var(--font);
  font-size: .875rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
  margin-bottom: 32px;
}

.analyzer__add-btn:hover {
  border-color: var(--color-neon-green);
  color: var(--color-anthracite);
  background: rgba(83,247,112,.08);
}

.analyzer__add-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Footer row */
.analyzer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.analyzer__hint {
  font-size: .8rem;
  color: var(--color-text-muted);
}

.analyzer__submit-btn {
  height: 50px;
  padding: 0 36px;
  background: var(--color-neon-green);
  color: var(--color-anthracite);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: background .18s, transform .1s, box-shadow .18s;
  box-shadow: 0 2px 10px rgba(83,247,112,.35);
}

.analyzer__submit-btn:hover {
  background: var(--color-neon-dark);
  box-shadow: 0 4px 16px rgba(83,247,112,.45);
}

.analyzer__submit-btn:active { transform: scale(.98); }

.analyzer__submit-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* =============================================================
   Loader
   ============================================================= */
.loader {
  display: none;
  padding: 72px 24px;
  text-align: center;
}

.loader--visible { display: block; }

.loader__inner { display: inline-block; }

.loader__spinner {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 28px;
}

.loader__ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-radius: 50%;
  animation: ring-spin 1.4s cubic-bezier(.5,0,.5,1) infinite;
}

.loader__ring:nth-child(1) { border-top-color: var(--color-neon-green); animation-delay: -.45s; }
.loader__ring:nth-child(2) { border-top-color: var(--color-neon-dark);  animation-delay: -.3s;  }
.loader__ring:nth-child(3) { border-top-color: var(--color-dark-grey);  animation-delay: -.15s; }

@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.loader__headline {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.loader__note {
  font-size: .875rem;
  color: var(--color-text-muted);
}

/* =============================================================
   Results
   ============================================================= */
.results {
  padding: 0 24px 80px;
}

.results__container {
  max-width: 780px;
  margin: 0 auto;
}

.results__header {
  margin-bottom: 24px;
}

.results__title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.025em;
  margin-bottom: 6px;
}

.results__meta {
  font-size: .875rem;
  color: var(--color-text-muted);
}

/* Tabs */
.results__tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 28px;
}

.results__tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.results__tab:hover:not(.results__tab--active) {
  background: var(--color-light-grey);
  color: var(--color-text);
}

.results__tab--active {
  background: var(--color-neon-green);
  color: var(--color-anthracite);
}

/* Failed list */
.results__failed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.results__failed-item {
  padding: 12px 16px;
  background: var(--color-poor-bg);
  border: 1px solid var(--color-poor-border);
  border-radius: var(--radius-md);
  font-size: .875rem;
  color: #991b1b;
}

/* Cards */
.results__grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Error banner */
.results__error-banner {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 20px;
  background: var(--color-poor-bg);
  border: 1px solid var(--color-poor-border);
  border-radius: var(--radius-md);
  color: #991b1b;
  font-size: .9rem;
  font-weight: 500;
}

/* =============================================================
   Result Card
   ============================================================= */
.result-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}

.result-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Rank modifiers — gold/silver/bronze preserved */
.result-card--rank-1 {
  border-color: #fbbf24;
  background: linear-gradient(140deg, #fffbeb 0%, #ffffff 55%);
}

.result-card--rank-2 {
  border-color: #94a3b8;
  background: linear-gradient(140deg, #f8fafc 0%, #ffffff 55%);
}

.result-card--rank-3 {
  border-color: #d97706;
  background: linear-gradient(140deg, #fff7ed 0%, #ffffff 55%);
}

/* Rank column */
.result-card__rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding-top: 2px;
}

.result-card__rank-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-light-grey);
  border: 2px solid var(--color-border);
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-card--rank-1 .result-card__rank-badge { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.result-card--rank-2 .result-card__rank-badge { background: #94a3b8; border-color: #94a3b8; color: #fff; }
.result-card--rank-3 .result-card__rank-badge { background: #cd7c4f; border-color: #cd7c4f; color: #fff; }

.result-card__rank-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.result-card--rank-1 .result-card__rank-label { color: #b45309; }
.result-card--rank-2 .result-card__rank-label { color: #475569; }
.result-card--rank-3 .result-card__rank-label { color: #92400e; }

/* Body */
.result-card__body { flex: 1; min-width: 0; }

.result-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.result-card__info { flex: 1; min-width: 0; }

.result-card__url {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  word-break: break-all;
  margin-bottom: 4px;
  transition: color .15s;
}

.result-card__url:hover { color: var(--color-anthracite); text-decoration: underline; }

.result-card__source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  color: var(--color-text-muted);
}

/* Score circle */
.result-card__score-block { text-align: center; flex-shrink: 0; }

.result-card__score {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

.result-card__score--good    { color: var(--color-good);    border-color: var(--color-good);    background: var(--color-good-bg);    }
.result-card__score--average { color: var(--color-average); border-color: var(--color-average); background: var(--color-average-bg); }
.result-card__score--poor    { color: var(--color-poor);    border-color: var(--color-poor);    background: var(--color-poor-bg);    }

.result-card__score-label {
  margin-top: 5px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
}

/* Metrics row */
.result-card__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

/* =============================================================
   Metric
   ============================================================= */
.metric { display: flex; flex-direction: column; gap: 2px; }

.metric__label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
}

.metric__value {
  font-size: .9rem;
  font-weight: 600;
  color: var(--color-text);
}

/* =============================================================
   CTA
   ============================================================= */
.cta {
  margin-top: auto;
  background: var(--color-dark-bg);
  padding: 96px 24px 104px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Top gradient stripe mirroring the hero */
.cta::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, transparent, var(--color-neon-green), transparent);
  pointer-events: none;
}

.cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 65% 50% at 50% 110%, rgba(83,247,112,.12) 0%, transparent 65%);
  pointer-events: none;
}

.cta__container {
  max-width: 580px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.cta__tag {
  display: inline-block;
  margin-bottom: 24px;
  padding: 5px 14px;
  background: var(--color-neon-green);
  color: var(--color-anthracite);
  border-radius: var(--radius-full);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.cta__title {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -.03em;
  line-height: 1.18;
  margin-bottom: 20px;
}

.cta__body {
  font-size: 1.05rem;
  color: var(--color-dark-grey);
  line-height: 1.8;
  margin-bottom: 40px;
}

.cta__btn {
  display: inline-flex;
  align-items: center;
  height: 54px;
  padding: 0 40px;
  background: var(--color-neon-green);
  color: var(--color-anthracite);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.01em;
  box-shadow: 0 2px 12px rgba(83,247,112,.35);
  transition: background .18s, transform .1s, box-shadow .18s;
}

.cta__btn:hover {
  background: var(--color-neon-dark);
  transform: translateY(-1px);
  box-shadow: 0 5px 20px rgba(83,247,112,.45);
}

.cta__btn:active { transform: scale(.98) translateY(0); }

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 600px) {
  .result-card {
    flex-direction: column;
    padding: 20px;
    gap: 16px;
  }

  .result-card__rank {
    flex-direction: row;
    gap: 10px;
  }

  .result-card__top {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .result-card__score-block {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .result-card__score-label { margin-top: 0; }

  .analyzer__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .analyzer__submit-btn { width: 100%; justify-content: center; }

  .hero    { padding: 72px 20px 64px; }
  .analyzer { padding: 56px 20px 64px; }
}
