/* Iowa Democrats: video splash page (index and 404). Mobile first: phone
   styles are the base, wider screens are layered on below. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --forest: #02350B;
  --navy: #082735;
  --blue: #104E70;
  --cream: #FFF7DB;
  --lime: #B2B730;
  --lime-hover: #C5CA47;
  --orange: #F16623;
  --orange-hover: #FF7D3D;
  --muted: #D6D3BC;
  --gutter: 16px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--forest);
  color: var(--cream);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
}

a {
  color: var(--cream);
}

a:hover {
  color: var(--lime);
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--lime);
  color: var(--forest);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
  outline: 3px solid var(--cream);
  outline-offset: 2px;
}

.skip:hover {
  color: var(--forest);
}

/* ---------- Color band (decorative, 7 stripes) ---------- */

.band {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  height: 14px;
  flex: none;
}

.band span {
  display: block;
}

.b1 { background: #B2B730; }
.b2 { background: #FFF7DB; }
.b3 { background: #F16623; }
.b4 { background: #104E70; }
.b5 { background: #9BA00E; }
.b6 { background: #082735; }
.b7 { background: #4E6B0C; }

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

.top {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px var(--gutter) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
}

.mark {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 850;
  font-stretch: 62%;
  font-size: 26px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .01em;
}

.mark svg {
  flex: none;
  color: var(--lime);
}

.mark-iowa {
  color: var(--lime);
}

.date {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 750;
  font-stretch: 80%;
  font-size: 15px;
}

.dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: .3; }
}

/* ---------- Layout ---------- */

.main {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 18px var(--gutter) 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

/* ---------- Headline ---------- */

.head {
  margin: 0 0 16px;
}

.h1 {
  margin: 0;
  font-weight: 850;
  font-stretch: 62%;
  line-height: .9;
}

.h1-pre {
  display: block;
  margin: 0 0 4px;
  color: var(--lime);
  font-weight: 750;
  font-stretch: 80%;
  font-size: 21px;
  line-height: 1.2;
}

/* One line on phones (≈12vw fits "President Obama" in the column), so the
   video starts higher up. */
.h1-name {
  display: block;
  font-size: clamp(34px, 12vw, 64px);
  text-transform: uppercase;
  text-wrap: balance;
}

/* ---------- Step tabs (lower-third style) ---------- */

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 12px 5px 5px;
  background: var(--orange);
  color: var(--navy);
  font-weight: 850;
  font-stretch: 75%;
  font-size: 17px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.tab-n {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: var(--navy);
  color: var(--cream);
  font-size: 15px;
  letter-spacing: 0;
}

.tab-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Video ---------- */

.watch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Keeps the whole 4:5 video on a phone's first screen: its width follows the
   viewport height, minus room for the header and headline above it. */
.player {
  width: min(100%, calc((100vh - 220px) * .8));
  min-width: min(100%, 260px);
  background: var(--navy);
  border-top: 4px solid var(--orange);
}

@supports (height: 100svh) {
  .player {
    width: min(100%, calc((100svh - 220px) * .8));
  }
}

.frame {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #000;
}

@supports not (aspect-ratio: 1) {
  .frame::before {
    content: "";
    display: block;
    padding-top: 125%;
  }
}

.frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Watch progress (decorative; the player has its own accessible controls). */
.meter {
  padding: 10px 12px 12px;
}

.meter-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 8px;
  font-weight: 800;
  font-stretch: 75%;
  font-size: 16px;
  line-height: 1.2;
}

.meter-time {
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}

.segs {
  display: flex;
  gap: 3px;
  height: 8px;
}

.seg {
  flex: 1;
  overflow: hidden;
  background: rgba(255, 247, 219, .16);
}

.seg i {
  display: block;
  height: 100%;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s linear;
}

/* ---------- Make a plan ---------- */

.plan,
.give {
  margin-top: 28px;
  scroll-margin-top: 16px;
}

.tab-plan {
  background: var(--cream);
  color: var(--navy);
}

.panel-plan {
  border-top-color: var(--cream);
}

.plan-h2 {
  margin: 0;
  font-weight: 850;
  font-stretch: 62%;
  font-size: clamp(30px, 8.6vw, 40px);
  line-height: .95;
  text-wrap: balance;
}

.vote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  margin-top: 16px;
  padding: 0 20px;
  background: var(--cream);
  color: var(--navy);
  font-weight: 850;
  font-stretch: 75%;
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .02em;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.vote svg {
  flex: none;
}

.vote:hover {
  background: var(--lime);
  color: var(--forest);
}

.vote:active {
  transform: translateY(2px);
}

.vote:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}

/* ---------- Donate ---------- */

.tab-give {
  background: var(--lime);
  color: var(--forest);
}

.tab-give .tab-n {
  background: var(--forest);
}

.panel {
  background: var(--navy);
  border-top: 4px solid var(--lime);
  padding: 20px 16px 22px;
}

.thanks {
  margin: 0 0 8px;
  color: var(--lime);
  font-weight: 750;
  font-stretch: 80%;
  font-size: 20px;
  line-height: 1.2;
}

.give-h2 {
  margin: 0;
  font-weight: 850;
  font-stretch: 62%;
  font-size: clamp(38px, 11vw, 52px);
  line-height: .92;
  text-wrap: balance;
}

.give-copy {
  margin: 12px 0 20px;
  max-width: 44ch;
}

.amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.amounts li {
  display: flex;
}

.amount {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  padding: 0 6px;
  background: var(--lime);
  color: var(--forest);
  font-weight: 850;
  font-stretch: 70%;
  font-size: 32px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.amount:hover {
  background: var(--lime-hover);
  color: var(--forest);
}

.amount:active {
  transform: translateY(2px);
}

.amount:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 3px;
}

.cur {
  font-size: .6em;
  vertical-align: .5em;
  margin-right: 1px;
}

.amount-other {
  background: transparent;
  color: var(--cream);
  box-shadow: inset 0 0 0 2px var(--cream);
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.amount-other:hover {
  background: var(--cream);
  color: var(--navy);
}

.give-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* After the video ends: step 1 checks off, then the IWillVote button and
   the amounts pop in turn. */
.is-watched .watch .tab {
  background: var(--lime);
  color: var(--forest);
}

.is-watched .watch .tab-n {
  background: var(--forest);
}

.is-watched .vote,
.is-watched .amount {
  animation: pop .5s cubic-bezier(.2, .8, .2, 1) both;
}

.is-watched .amounts li:nth-child(1) .amount { animation-delay: .12s; }
.is-watched .amounts li:nth-child(2) .amount { animation-delay: .18s; }
.is-watched .amounts li:nth-child(3) .amount { animation-delay: .24s; }
.is-watched .amounts li:nth-child(4) .amount { animation-delay: .30s; }
.is-watched .amounts li:nth-child(5) .amount { animation-delay: .36s; }
.is-watched .amounts li:nth-child(6) .amount { animation-delay: .42s; }

@keyframes pop {
  0% { transform: scale(.9); }
  60% { transform: scale(1.05); }
  100% { transform: none; }
}

/* ---------- 404 ---------- */

/* Single column at every width (overrides the two-column .main below). */
.main.lost {
  max-width: 760px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: none;
  grid-template-areas: none;
  align-content: center;
  justify-items: start;
}

.lost-copy {
  margin: 18px 0 28px;
  max-width: 40ch;
  font-size: 19px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 24px;
  background: var(--lime);
  color: var(--forest);
  font-weight: 850;
  font-stretch: 75%;
  font-size: 24px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.btn:hover {
  background: var(--lime-hover);
  color: var(--forest);
}

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

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

.foot {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px var(--gutter) 40px;
  border-top: 1px solid rgba(255, 247, 219, .22);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

/* The legal "paid for by" notice, set apart in a box. */
.foot-paid {
  margin: 0;
  max-width: 62ch;
  padding: 8px 12px;
  border: 2px solid var(--cream);
}

.foot-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.foot-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--cream);
  text-underline-offset: 3px;
}

.foot-legal a:hover {
  color: var(--lime);
}

.foot-legal a:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 2px;
}

/* ---------- Breakpoints ---------- */

/* Tablets, laptops and landscape phones: video on the left, headline and
   steps 2 and 3 on the right. The video column's width follows the viewport
   height so the whole video stays on screen. */
@media (min-width: 720px) {
  :root { --gutter: 32px; }

  .top { padding-top: 20px; }

  .main {
    --video-w: clamp(240px, calc((100vh - 230px) * .8), min(46vw, 560px));
    max-width: 1200px;
    padding-top: 28px;
    grid-template-columns: var(--video-w) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "watch head"
      "watch plan"
      "watch give";
    column-gap: clamp(28px, 4vw, 64px);
    align-items: start;
  }

  .head { grid-area: head; margin-bottom: 24px; }
  .watch { grid-area: watch; }
  .plan { grid-area: plan; margin-top: 0; }
  .give { grid-area: give; margin-top: 24px; }

  .player { width: 100%; min-width: 0; }

  .h1-name { font-size: clamp(52px, 6.4vw, 96px); }
  .h1-pre { font-size: clamp(21px, 2.2vw, 28px); }

  .panel { padding: 24px 24px 26px; }

  .give-h2 { font-size: clamp(36px, 3.6vw, 52px); }
  .plan-h2 { font-size: clamp(28px, 2.8vw, 38px); }
}

@supports (height: 100svh) {
  @media (min-width: 720px) {
    .main {
      --video-w: clamp(240px, calc((100svh - 230px) * .8), min(46vw, 560px));
    }
  }
}

@media (min-width: 1100px) {
  .panel { padding: 30px 32px 32px; }
  .amount { min-height: 72px; font-size: 36px; }
  .amount-other { font-size: 26px; }
  .foot { padding-bottom: 48px; }
}

/* Windows high contrast: backgrounds are dropped, so outline the tiles. */
@media (forced-colors: active) {
  .amount,
  .vote,
  .btn {
    border: 2px solid LinkText;
  }

  .tab {
    border: 2px solid CanvasText;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dot,
  .is-watched .vote,
  .is-watched .amount {
    animation: none;
  }

  .seg i,
  .vote,
  .amount {
    transition: none;
  }
}
