/* TEBH Weekly Pickem — mobile-first, no framework, no build step.
   Most people arrive from an email on a phone, so the phone layout is the
   base and the desktop layout is the enhancement. */

:root {
  --navy: #0b1f3a;
  --navy-soft: #16325a;
  --gold: #f0b429;
  --gold-deep: #c8901a;
  --ink: #14203a;
  --muted: #5b6b85;
  --line: #dfe5ef;
  --bg: #f4f6fa;
  --card: #ffffff;
  --ok: #1a7f52;
  --err: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 8px 24px rgba(11, 31, 58, .08);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  /* iOS Safari: keep content clear of the notch and home indicator */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ---------------------------------------------------------------- header */

.masthead {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #fff;
  padding: 28px 20px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Faint yard-line motif. Purely decorative, hidden from assistive tech. */
.masthead::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg, transparent 0 38px, rgba(255, 255, 255, .05) 38px 40px);
  pointer-events: none;
}

.masthead h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.masthead .kicker {
  margin: 0 0 6px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}

.masthead .sub {
  margin: 10px auto 0;
  max-width: 34rem;
  font-size: .98rem;
  color: #c8d4e8;
}

/* ------------------------------------------------------------------ shell */

main { max-width: 34rem; margin: 0 auto; padding: 20px 16px 56px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  margin-top: -20px;
  position: relative;
  z-index: 1;
}

/* Only pull the FIRST card up under the masthead. `.card + .card` was
   overriding that negative margin on every state, so the intended overlap
   silently disappeared everywhere except the initial paint. */
.card:not(:first-of-type) { margin-top: 16px; }

h2 { margin: 0 0 6px; font-size: 1.24rem; letter-spacing: -.01em; }
p  { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
.lede { color: var(--muted); }

/* ------------------------------------------------------------------- form */

.field { margin-bottom: 14px; }

label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--navy);
}

.optional { font-weight: 400; color: var(--muted); }

textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 16px;          /* stops iOS zooming the viewport on focus */
  font-family: inherit;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  resize: vertical;
  transition: border-color .12s ease, box-shadow .12s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--navy-soft);
  box-shadow: 0 0 0 3px rgba(22, 50, 90, .13);
}

input[type="text"], input[type="email"], input[type="tel"] {
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  /* 16px minimum stops iOS Safari zooming the viewport on focus */
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease;
}

input:focus {
  outline: none;
  border-color: var(--navy-soft);
  box-shadow: 0 0 0 3px rgba(22, 50, 90, .13);
}

input[aria-invalid="true"] { border-color: var(--err); }

.row { display: flex; gap: 10px; }
.row .field { flex: 1; margin-bottom: 14px; }

button {
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--gold);
  color: #221a04;
  /* NOT the `font:` shorthand. A CSS-wide keyword like `inherit` is only legal
     as a property's entire value, never as one component of a shorthand, so
     `font: 700 1rem/1 inherit` is invalid and the browser drops the whole
     declaration - leaving every button in the default system button font. */
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background .12s ease, transform .06s ease;
  /* stop double-tap zoom eating the first tap on iOS */
  touch-action: manipulation;
}

button:hover:not(:disabled) { background: var(--gold-deep); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .6; cursor: not-allowed; }

.fineprint { margin-top: 12px; font-size: .78rem; color: var(--muted); }

/* --------------------------------------------------------------- messages */

.msg {
  padding: 11px 13px;
  border-radius: 10px;
  font-size: .9rem;
  margin-bottom: 14px;
}

.msg.error { background: #fdecea; color: var(--err); border: 1px solid #f5c6c2; }
.msg.ok    { background: #e8f5ef; color: var(--ok);  border: 1px solid #bfe3d2; }

/* ----------------------------------------------------------------- states */

/* The signup form is visible by default, so the page is never a blank white
   rectangle if app.js fails to load or throws before it can reveal a state.
   Once app.js runs it takes over and toggles .is-active itself. */
[data-state] { display: none; }
[data-state].is-active { display: block; }
[data-state="signup"] { display: block; }
[data-state="signup"]:not(.is-active).js-managed { display: none; }

/* Available to screen readers, invisible on screen. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.badge {
  display: inline-block;
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 10px;
}

.steps { margin: 14px 0 0; padding-left: 20px; color: var(--muted); font-size: .92rem; }
.steps li { margin-bottom: 7px; }
.steps li:last-child { margin-bottom: 0; }

.spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #221a04;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -2px;
  margin-right: 7px;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  button:active:not(:disabled) { transform: none; }
}

/* ----------------------------------------------------------------- footer */

footer {
  text-align: center;
  padding: 26px 18px 34px;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.6;
}

footer a { color: var(--muted); }
footer a:hover { color: var(--navy); }

/* ------------------------------------------------------------ rules page */

.prose { max-width: 40rem; }
.prose h2 { margin-top: 26px; }
.prose ol, .prose ul { padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.back { display: inline-block; margin-bottom: 14px; font-size: .88rem; color: var(--navy); }

@media (min-width: 640px) {
  .masthead { padding: 44px 20px 48px; }
  .masthead h1 { font-size: 2.1rem; }
  .card { padding: 28px 26px; }
}
