/*
 * This is a manifest file that'll be compiled into application.css.
 */

/* Ensure the HTML hidden attribute always wins over author display rules */
[hidden] { display: none !important; }

:root {
  --bg: #faf9f7;
  --fg: #0a0a0a;
  --fg-secondary: rgba(10, 10, 10, 0.4);
  --fg-tertiary: rgba(10, 10, 10, 0.1);
  --accent: #c8102e;
  --rule: 1px solid rgba(10, 10, 10, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141210;
    --fg: #dedad4;
    --fg-secondary: rgba(222, 218, 212, 0.4);
    --fg-tertiary: rgba(222, 218, 212, 0.22);
    --accent: #e8192c;
    --rule: 1px solid rgba(222, 218, 212, 0.1);
  }
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3.5rem 2rem 1.25rem;
  gap: 0;
}

/* ── Site Nav ──────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2rem;
  z-index: 100;
}

.nav-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg-secondary);
  position: relative;
  padding-top: 0.75rem;
}

.nav-link--active {
  color: var(--fg);
}

.nav-link--active::before {
  content: '◆';
  font-size: 0.35rem;
  color: var(--accent);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* Remove browser default form/button styling around Sign out */
.site-nav form {
  display: contents;
}

.site-nav form button {
  background: none;
  border: none;
  margin: 0;
  cursor: pointer;
}

/* ── Marquee Plate ─────────────────────────────────────── */
.site-header {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.marquee-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-top: 2px solid var(--fg);
  border-bottom: 2px solid var(--fg);
  border-left: var(--rule);
  border-right: var(--rule);
  padding: 0.4rem 2rem;
  position: relative;
}

.marquee-plate::before,
.marquee-plate::after {
  content: '◆';
  font-size: 0.35rem;
  color: var(--fg-secondary);
  position: absolute;
}
.marquee-plate::before { left: 0.55rem; }
.marquee-plate::after  { right: 0.55rem; }

.marquee-plate__text {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 0.6875rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-variation-settings: 'opsz' 9, 'WONK' 1;
}

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 0.92;
  font-variation-settings: 'opsz' 144, 'WONK' 1;
  max-width: 5ch;
}

.tagline {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--fg-secondary);
}

.comparison-count {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--fg-secondary);
  margin-top: -0.5rem;
}

/* ── CTA ───────────────────────────────────────────────── */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  background: var(--fg);
  color: var(--bg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.5rem 1.75rem;
  border: 1px solid var(--fg);
  transition: background 0.15s, color 0.15s;
}

.cta-button:hover {
  background: transparent;
  color: var(--fg);
}

.cta-button:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

/* ── Rankings ──────────────────────────────────────────── */
.rankings {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 480px;
  margin-top: 2.5rem;
}

.rankings-eyebrow {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-secondary);
  padding-bottom: 0.5rem;
  border-bottom: var(--rule);
  width: 100%;
  text-align: center;
}

.rankings-list {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.rankings-list--results {
  margin-top: 2rem;
}

.ranking-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: var(--rule);
}

.rank-num {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  min-width: 2.25rem;
  text-align: right;
  color: var(--fg-tertiary);
  letter-spacing: -0.04em;
  font-variation-settings: 'opsz' 72, 'WONK' 1;
  font-variant-numeric: tabular-nums;
}

.ranking-item:first-child .rank-num {
  color: var(--accent);
}

.rank-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1.2;
  font-variation-settings: 'opsz' 36, 'WONK' 0;
}

/* ── Flash Alert ───────────────────────────────────────── */
[role="alert"] {
  position: fixed;
  top: 4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--fg-tertiary);
  padding: 0.5rem 1.25rem;
  white-space: nowrap;
  pointer-events: none;
  animation: flash-in-out 4s ease forwards;
}

@keyframes flash-in-out {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  72%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Rank Page ─────────────────────────────────────────── */
.h1--accent {
  color: var(--accent);
}

.rank-slot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rank-slot label {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 700;
  font-style: italic;
  font-variation-settings: 'opsz' 72, 'WONK' 1;
  color: var(--fg-secondary);
  min-width: 1.5rem;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.rank-form-footer {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  background: var(--accent);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  padding: 0.5rem 2.25rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.submit-btn:hover {
  background: transparent;
  color: var(--accent);
}

.submit-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.rank-year {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.5875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--fg-secondary);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  align-self: center;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--fg-tertiary);
  flex-shrink: 0;
}

/* ── Rank: sortable list ──────────────────────────────── */
.rank-list {
  list-style-position: outside;
  padding-left: 2.75rem;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 480px;
}

.rank-list ::marker {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-style: italic;
  font-variation-settings: 'opsz' 72, 'WONK' 1;
  color: var(--fg-secondary);
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(222, 218, 212, 0.38);
  background: transparent;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 500;
  font-style: italic;
  font-variation-settings: 'opsz' 36, 'WONK' 0;
  line-height: 1.25;
  color: var(--fg);
  cursor: grab;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.rank-item:hover {
  border-color: rgba(222, 218, 212, 0.65);
  background: rgba(222, 218, 212, 0.03);
}

.rank-item:active { cursor: grabbing; }

.rank-item:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.drag-handle {
  color: var(--fg-tertiary);
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  pointer-events: none;
}

.rank-item-title {
  flex: 1;
  min-width: 0;
}

.sortable-chosen { border-color: var(--accent); }
.sortable-ghost  { opacity: 0.35; background: rgba(232, 25, 44, 0.06); }

/* ── Ranking Progress ─────────────────────────────────── */
.ranking-progress {
  width: 100%;
  max-width: 480px;
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ranking-progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.ranking-progress__count {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-secondary);
  font-variant-numeric: tabular-nums;
}

.ranking-progress__pct {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 0.875rem;
  font-weight: 700;
  font-style: italic;
  color: var(--fg-secondary);
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'opsz' 36, 'WONK' 1;
}

.ranking-progress__bar {
  width: 100%;
  height: 3px;
  background: var(--fg-tertiary);
  overflow: hidden;
}

.ranking-progress__fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
  min-width: 0;
}

/* ─── Auth Forms ─────────────────────────────────────────── */

.auth-form {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.auth-heading {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: clamp(2.5rem, 8vw, 3.75rem);
  line-height: 1.1;
  padding-bottom: 0.2em;
  overflow: visible;
  margin-bottom: 2rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

.form-field label {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-secondary);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
}

.form-field input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--fg-secondary);
  padding: 0.5rem 0;
  color: var(--fg);
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}

.form-field input:focus {
  border-bottom-color: var(--accent);
}

.form-submit {
  margin-top: 1.75rem;
  text-align: center;
}

.form-submit .cta-button {
  width: 100%;
}

.auth-alt {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--fg-secondary);
  text-align: center;
}

.auth-alt__link {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.15s;
}

.auth-alt__link:hover {
  color: var(--accent);
}

/* Error messages — no bullet points */
.error-list {
  list-style: none;
  padding: 0.75rem 1rem;
  margin: 0 0 1.5rem;
  border-left: 2px solid var(--accent);
  background: rgba(200, 16, 46, 0.06);
}

.error-list li {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
  padding: 0;
}

/* ── Results Page ──────────────────────────────────────── */
.template-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-secondary);
  margin-top: -0.25rem;
}

.results-actions {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  background: transparent;
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--fg-tertiary);
  padding: 0.5rem 1.75rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.copy-btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.copy-btn:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

/* ── Profile Page ──────────────────────────────────────── */
.profile-section {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2rem;
}

.section-heading {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-secondary);
  padding-bottom: 0.5rem;
  border-bottom: var(--rule);
  width: 100%;
  text-align: center;
  margin-bottom: 1rem;
}

.ranking-item--session {
  justify-content: space-between;
  width: 100%;
}

.session-date {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--fg-secondary);
  letter-spacing: 0.04em;
  margin-left: auto;
  padding-right: 1rem;
}

.empty-state {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--fg-secondary);
  text-align: center;
}
