/* ==========================================================================
   Wing Off 2026 — design tokens + shared neubrutalist system
   See /DESIGN.md for the full rationale behind every token here.
   ========================================================================== */

:root {
  /* Colors */
  --ink: #131110;
  --paper: #FFF9EC;
  --bone: #F4EFE1;
  --yolk: #FFC700;
  --yolk-deep: #E6A500;
  --hot: #D42717;
  --hot-deep: #9E170A;
  --char: #0B0B0C;
  --char-line: #2A2724;

  /* This page's field + ink (voting = yolk ground, admin.css repoints these) */
  --field: var(--yolk);
  --field-deep: var(--yolk-deep);
  --on-field: var(--ink);

  /* Spacing */
  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-md: 20px;
  --sp-lg: 32px;
  --sp-xl: 56px;

  /* Borders + shadows */
  --line: 3px;
  --line-thick: 4px;
  --shadow-x: 6px;
  --shadow-y: 6px;

  /* Type */
  --font-display: 'Archivo Black', 'Arial Black', sans-serif;
  --font-body: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--field);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

/* ==========================================================================
   Type
   ========================================================================== */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 9vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
  margin: 0;
}

.headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  line-height: 1;
  margin: 0;
}

.label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
}

.body-text {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.4;
  margin: 0;
}

.body-text.muted {
  opacity: 0.72;
}

/* ==========================================================================
   Layout
   ========================================================================== */

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

.screen {
  display: none;
  min-height: 100vh;
  padding-top: var(--sp-xl);
  padding-bottom: calc(var(--sp-xl) + 84px); /* clears sticky action bar */
}

.screen.active {
  display: block;
}

.stack > * + * {
  margin-top: var(--sp-md);
}

.stack-lg > * + * {
  margin-top: var(--sp-lg);
}

/* ==========================================================================
   Title toggle — tap swaps which line is the shouted Display line and
   which is the small Label eyebrow. Reuses the standard focus-ring device.
   ========================================================================== */

.title-toggle {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.title-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--hot);
}

/* ==========================================================================
   Hazard stripe banner
   ========================================================================== */

.hazard {
  height: 22px;
  background: repeating-linear-gradient(
    45deg,
    var(--ink) 0 18px,
    var(--yolk) 18px 36px
  );
  border-bottom: var(--line-thick) solid var(--ink);
}

/* ==========================================================================
   Cards / tiles
   ========================================================================== */

.card {
  background: var(--paper);
  border: var(--line) solid var(--ink);
  padding: var(--sp-lg);
  box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--ink);
}

.card.tight {
  padding: var(--sp-md);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  border: var(--line) solid var(--ink);
  padding: 18px 28px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--ink);
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--ink);
}

.btn:active,
.btn.is-pressed {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--ink), 0 0 0 3px var(--paper), 0 0 0 6px var(--hot);
}

.btn-primary {
  background: var(--hot);
  color: var(--paper);
  border-color: var(--ink);
}

.btn-primary:active,
.btn-primary.is-pressed {
  background: var(--hot-deep);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  cursor: not-allowed;
  background: var(--bone);
  color: color-mix(in srgb, var(--ink) 45%, transparent);
  box-shadow: none;
  transform: none;
  border-color: var(--ink);
}

.btn-ghost {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}

.btn-ghost:hover {
  transform: none;
  box-shadow: none;
  text-decoration: underline;
}

/* ==========================================================================
   Inputs
   ========================================================================== */

.field-label {
  display: block;
  margin-bottom: var(--sp-xs);
}

.input {
  display: block;
  width: 100%;
  border: var(--line) solid var(--ink);
  background: var(--paper);
  padding: 16px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
  box-shadow: none;
  transition: box-shadow 90ms ease-out, border-color 90ms ease-out;
}

.input::placeholder {
  color: var(--ink);
  opacity: 0.4;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.input:focus {
  outline: none;
  border-color: var(--hot);
  box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--ink);
}

.field-error {
  display: none;
  margin-top: var(--sp-xs);
  color: var(--hot-deep);
}

.field-error.visible {
  display: block;
}

.hint-note {
  display: none;
  margin-top: var(--sp-xs);
  opacity: 0.72;
}

.hint-note.visible {
  display: block;
}

.banner-warning {
  display: none;
  background: var(--hot);
  color: var(--paper);
  border-bottom: var(--line-thick) solid var(--ink);
  padding: var(--sp-sm) var(--sp-md);
}

.banner-warning.visible {
  display: block;
}

/* ==========================================================================
   Progress stub
   ========================================================================== */

.progress-stub {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 20px 10px 18px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}

.progress-stub .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yolk);
}

/* ==========================================================================
   Rank badge (signature component)
   ========================================================================== */

.rank-badge {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 999px;
  background: var(--yolk);
  border: var(--line) solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
}

@keyframes stamp-in {
  0% { transform: rotate(-6deg) scale(1.15); }
  100% { transform: rotate(0deg) scale(1); }
}

.rank-badge.stamping {
  animation: stamp-in 120ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@media (prefers-reduced-motion: reduce) {
  .rank-badge.stamping {
    animation: none;
  }
  .btn, .tile {
    transition: none;
  }
}

/* ==========================================================================
   Ballot tiles
   ========================================================================== */

.pool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-sm);
}

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 76px;
  padding: var(--sp-sm);
  background: var(--paper);
  border: var(--line) solid var(--ink);
  box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--ink);
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.1;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}

.tile:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.tile:active,
.tile.is-pressed {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--ink);
}

.tile:focus-visible,
.ranked-row:focus-visible {
  outline: none;
  box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--ink), 0 0 0 3px var(--paper), 0 0 0 6px var(--hot);
}

.ranked-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  min-height: 4px;
}

.ranked-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  background: var(--bone);
  border: var(--line) solid var(--ink);
  padding: var(--sp-sm) var(--sp-md);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ranked-row .headline {
  font-size: 1.25rem;
  flex: 1;
}

.ranked-row .remove-hint {
  opacity: 0.5;
}

.empty-hint {
  padding: var(--sp-md);
  text-align: center;
  border: var(--line) dashed var(--ink);
  opacity: 0.55;
}

/* ==========================================================================
   Sticky action bar
   ========================================================================== */

.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  padding-bottom: max(var(--sp-sm), env(safe-area-inset-bottom));
  background: var(--field);
  border-top: var(--line-thick) solid var(--ink);
  z-index: 10;
}

.action-bar .btn:not(.btn-primary) {
  flex: 0 0 auto;
}

.action-bar .btn-primary {
  flex: 1;
}

/* ==========================================================================
   Review screen
   ========================================================================== */

.review-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-md);
}

.review-picks {
  margin-top: var(--sp-xs);
}

.review-picks span {
  display: block;
}

/* ==========================================================================
   Utility
   ========================================================================== */

.center {
  text-align: center;
}

/* Every .spice usage sits directly on bare Yolk (never inside a Paper
   card), where --hot alone falls short of AA contrast — --hot-deep is the
   one that reads clean there while still living in the red family. */
.spice {
  color: var(--hot-deep);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
