/* International Wire — fee quiz (build F). Native CSS nesting, id-based layout, @starting-style entrance. */

@font-face { font-family: "Face One"; src: url("graphics/type/face-1.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Face Two"; src: url("graphics/type/face-2.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --text: #201e1e; --navy: #0b1e4e; --red: #ed5257; --red-2: #df434a; --grey: #737373;
  --beige: #f4efea; --beige-2: #f6f1ed; --ivory: #fffcfa; --smoke: #f5f5f5; --line: #dedede;
  font-family: "Face One", Arial, sans-serif; color: var(--text); background: #fff;
  font-synthesis: none; -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; &.frozen { overflow: hidden; } }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }

/* Entrance: elements with .rise fade in from 24px below; --wait sets the delay. */
.rise {
  opacity: 1; translate: 0 0;
  transition: opacity .75s ease, translate .75s cubic-bezier(.2, .7, .15, 1);
  transition-delay: var(--wait, 0ms);
  @starting-style { opacity: 0; translate: 0 24px; }
}

.go {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: var(--red); color: #fff;
  font-weight: 500; text-align: center; text-decoration: none;
  transition: background-color .24s ease, transform .24s ease, box-shadow .24s ease;
  &:hover { background: var(--red-2); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(237, 82, 87, .18); }
  &:active { transform: translateY(0); box-shadow: none; }
  &:disabled { background: #b8b8b8; cursor: not-allowed; box-shadow: none; transform: none; }
}

#frame { max-width: 1920px; margin: 0 auto; }

img.spot {
  position: absolute; width: 2699.75px; height: 2391.71px; max-width: none; pointer-events: none;
  mix-blend-mode: multiply; transform: rotate(14.59deg);
  &:nth-of-type(1) { left: 580px; top: -1600px; }
  &:nth-of-type(2) { left: 155px; top: 430px; }
}

#masthead {
  display: flex; align-items: center; justify-content: space-between;
  width: calc(100% - 200px); max-width: 1720px; height: 88px; margin: 0 auto; padding: 0 20px;
  & > a { color: var(--navy); font-size: 23px; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; }
  & nav { display: flex; align-items: center; gap: 24px; }
  & .label { color: var(--text); font-family: "Face Two", Arial, sans-serif; font-size: 16px; text-decoration: none; }
  & .go { min-width: 107px; height: 40px; padding: 0 12px; font-size: 16px; font-weight: 400; letter-spacing: -.02em; }
}

#intro {
  position: relative; width: calc(100% - 200px); max-width: 1720px; height: 952px; margin: 0 auto;
  overflow: hidden; border-radius: 24px; background: var(--beige); isolation: isolate;
  clip-path: inset(0 round 24px); will-change: transform;
  & > img.meter {
    position: absolute; z-index: 1; top: 135px; left: 1298px; width: 420px; height: 630px; max-width: none;
    object-fit: cover; transform: rotate(6.55deg); pointer-events: none;
  }
}
#pitch {
  position: absolute; z-index: 2; top: 252px; left: 120px; width: 760px;
  & h1 { margin: 0; font-size: 80px; line-height: 1.17; font-weight: 600; letter-spacing: -.025em; }
  & p { max-width: 740px; margin: 22px 0 0; font-size: 29px; line-height: 1.25; font-weight: 400; }
  & .go { width: 250px; height: 56px; margin-top: 58px; font-size: 18px; }
}
#offer {
  position: absolute; z-index: 3; top: 150px; left: 890px; display: flex; flex-direction: column;
  width: 570px; height: 635px; padding: 41px 39px 45px; overflow: hidden;
  border: 1px solid rgba(222, 199, 191, .32); border-radius: 28px; background: var(--ivory);
  & small { display: block; margin: 0 0 32px; color: var(--red); font-size: 18px; font-weight: 500; }
  & h2 { margin: 0; font-size: 40px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
  & p { margin: 38px 0 0; font-size: 22px; line-height: 1.25; }
  & .go { width: 260px; height: 56px; margin-top: auto; flex: 0 0 auto; font-size: 18px; }
}

#colophon {
  width: calc(100% - 200px); max-width: 1720px; height: 350px; margin: 210px auto 0;
  & hr { height: 1px; margin: 0; border: 0; background: var(--line); }
  & > a { display: inline-block; margin-top: 49px; color: var(--navy); font-size: 32px; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; }
  & > div { display: flex; justify-content: space-between; gap: 24px; margin-top: 47px; font-size: 17px; }
  & p { margin: 0; color: var(--grey); }
  & nav { display: flex; gap: 18px; padding-right: 10px; white-space: nowrap; }
  & nav a { color: inherit; text-decoration: none; &:hover, &:focus-visible { text-decoration: underline; } }
}

/* Quiz: every step is already in the markup; main.js only toggles [hidden]. */
#quiz {
  position: fixed; z-index: 10; inset: 0; display: flex; align-items: center; justify-content: center;
  overflow-y: auto; padding: 24px 16px;
  &[hidden] { display: none; }
  & > i { position: fixed; inset: 0; background: rgba(0, 0, 0, .48); animation: dim .3s ease both; }
  & > section {
    position: relative; width: min(760px, 100%); height: auto; max-height: calc(100dvh - 48px); overflow-y: auto;
    border-radius: 24px; background: #fff; box-shadow: 0 16px 60px rgba(0, 0, 0, .1);
    animation: raise .35s cubic-bezier(.2, .75, .2, 1) both;
  }
  & .x {
    position: absolute; z-index: 2; top: 24px; right: 28px; width: 40px; height: 40px; padding: 0; border: 0;
    border-radius: 50%; background: transparent; color: var(--grey); font-size: 31px; line-height: 1; opacity: 0;
    transition: opacity .2s ease, background-color .2s ease;
    &:focus-visible { opacity: 1; }
    &:hover { background: var(--smoke); }
  }
  & [data-step] {
    transition: opacity .3s cubic-bezier(.2, .7, .15, 1), transform .3s cubic-bezier(.2, .7, .15, 1);
    &[hidden] { display: none; }
    &.out { opacity: 0; transform: translateY(-12px); transition-duration: .18s; transition-timing-function: ease-in; }
    &.in { opacity: 0; transform: translateY(14px); transition: none; }
  }
  & .ask {
    display: flex; flex-direction: column; padding: 54px 52px 50px;
    & > p:first-child { margin: 0; color: var(--grey); font-size: 20px; font-weight: 500; }
    & h2 { margin: 30px 0 0; font-size: 42px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
    & [role="group"] { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin-top: 38px; }
    & [role="group"] > button {
      width: 100%; min-height: 72px; padding: 18px 20px; border: 2px solid transparent; border-radius: 14px;
      background: var(--smoke); color: var(--text); text-align: left; font-size: 20px; font-weight: 500; line-height: 1.2;
      transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
      &:hover { background: #fce6e5; transform: translateY(-2px); }
      &:active, &.picked { border-color: var(--red); background: #fff2f1; transform: none; }
    }
    & > p:last-child { margin: auto 0 0; padding-top: 30px; color: var(--grey); font-size: 16px; }
  }
  & .final {
    padding: 60px 52px;
    & h2 { margin: 0; font-size: 40px; line-height: 1.18; font-weight: 600; letter-spacing: -.02em; }
    & > p { margin: 26px 0 0; font-size: 23px; line-height: 1.3; }
    & form { margin-top: 40px; }
    & label { display: block; margin-bottom: 10px; font-size: 16px; font-weight: 500; }
    & input {
      display: block; width: 100%; height: 58px; padding: 0 18px; border: 1px solid #c7c7c7; border-radius: 12px;
      background: #fff; color: var(--text); font-size: 18px; transition: border-color .2s ease, box-shadow .2s ease;
      &::placeholder { color: var(--grey); opacity: 1; }
      &:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(237, 82, 87, .12); }
    }
    & form .go { width: 360px; max-width: 100%; height: 54px; margin-top: 20px; font-size: 18px; }
    & form p { margin: 12px 0 0; color: var(--grey); font-size: 15px; &[hidden] { display: none; } }
  }
}
@keyframes dim { from { opacity: 0; } to { opacity: 1; } }
@keyframes raise { from { opacity: 0; transform: translateY(24px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1599px) and (min-width: 901px) {
  #masthead, #colophon { width: calc(100% - 80px); }
  #colophon { height: 350px; margin-top: 12vw; }
  #intro {
    width: calc(100% - 80px); height: min(952px, 59vw); min-height: 630px;
    & > img.meter { top: 14%; left: 75.5%; width: 24.5%; height: 66%; }
  }
  #pitch {
    top: 26.5%; left: 7%; width: 43%;
    & h1 { font-size: clamp(46px, 4.16vw, 80px); }
    & p { font-size: clamp(19px, 1.5vw, 29px); }
    & .go { margin-top: 6%; }
  }
  #offer {
    top: 15.8%; left: 51.7%; width: 33.2%; height: 66.7%; padding: 2.4% 2.3% 2.6%; border-radius: 24px;
    & small { margin-bottom: 6%; font-size: clamp(13px, 1vw, 18px); }
    & h2 { font-size: clamp(27px, 2.08vw, 40px); }
    & p { margin-top: 8%; font-size: clamp(16px, 1.15vw, 22px); }
  }
}

@media (max-height: 900px) and (min-width: 901px) {
  #quiz .ask {
    padding: 58px 64px 48px;
    & h2 { margin-top: 25px; font-size: 40px; }
    & [role="group"] { gap: 14px 24px; margin-top: 35px; }
    & [role="group"] > button { min-height: 72px; padding: 16px 20px; font-size: 20px; }
    & > p:last-child { margin-top: 32px; padding: 0; font-size: 16px; }
  }
  #quiz .final {
    padding-top: 70px;
    & h2 { font-size: 40px; }
    & > p { margin-top: 28px; font-size: 23px; }
    & form { margin-top: 40px; }
    & label { font-size: 16px; }
    & input { height: 60px; font-size: 18px; }
    & form .go { height: 54px; margin-top: 20px; font-size: 18px; }
    & form p { font-size: 16px; }
  }
}

@media (max-width: 900px) {
  #masthead {
    width: 100%; max-width: none; height: 64px; padding: 0 20px;
    & > a { font-size: 18px; }
    & nav { gap: 0; }
    & .label { display: none; }
    & .go { width: 110px; min-width: 110px; height: 36px; font-size: 15px; font-weight: 500; }
  }
  #intro {
    width: calc(100% - 32px); max-width: 600px; height: auto; min-height: 880px; margin-top: 12px;
    padding: 65px 24px 50px; border-radius: 18px; background: var(--beige-2); clip-path: inset(0 round 18px);
    & > img { display: none; }
  }
  #pitch {
    position: relative; top: auto; left: auto; width: 100%;
    & h1 { font-size: 36px; line-height: 43px; letter-spacing: -.025em; }
    & p { max-width: 400px; margin-top: 60px; font-size: 18px; line-height: 1.25; }
    & .go { width: 215px; height: 46px; margin-top: 34px; font-size: 15px; }
  }
  #offer {
    position: relative; top: auto; left: auto; width: calc(100% + 16px); min-height: 410px; height: auto;
    margin: 39px -8px 0; padding: 26px 20px 14px; border: 0; border-radius: 16px; background: #fff;
    & small { margin-bottom: 27px; font-size: 13px; }
    & h2 { font-size: 30px; line-height: 1.18; & br { display: none; } }
    & p { margin-top: 29px; font-size: 18px; line-height: 1.25; }
    & .go { width: 220px; height: 46px; margin-top: auto; font-size: 15px; }
  }
  #colophon {
    width: 100%; height: auto; min-height: 174px; margin: 0; padding: 27px 20px 22px;
    & hr { display: none; }
    & > a { margin: 0; font-size: 18px; }
    & > div { display: block; margin-top: 17px; font-size: 12px; }
    & nav { gap: 11px; margin-top: 32px; padding: 0; color: var(--text); font-size: 13px; }
  }
  #quiz {
    padding: 16px;
    & > section { flex: 0 0 auto; width: min(100%, 500px); min-height: 0; max-height: calc(100dvh - 32px); border-radius: 18px; }
    & .x { top: 14px; right: 14px; width: 32px; height: 32px; font-size: 26px; }
    & .ask {
      min-height: 0; padding: 56px 24px 28px;
      & > p:first-child { font-size: 15px; }
      & h2 { margin-top: 20px; font-size: 26px; line-height: 1.17; letter-spacing: -.02em; }
      & [role="group"] { grid-template-columns: 1fr; gap: 12px; margin-top: 28px; }
      & [role="group"] > button { min-height: 56px; padding: 14px 16px; border-radius: 10px; font-size: 17px; }
      & > p:last-child { padding-top: 20px; font-size: 14px; }
    }
    & .final {
      min-height: 0; padding: 56px 24px 32px;
      & h2 { font-size: 29px; line-height: 1.17; }
      & > p { margin-top: 20px; font-size: 18px; line-height: 1.24; }
      & form { margin-top: 32px; }
      & label { margin-bottom: 10px; font-size: 15px; }
      & input { height: 54px; padding: 0 13px; border-radius: 8px; font-size: 17px; }
      & form .go { width: 100%; height: 52px; margin-top: 20px; font-size: 16px; }
      & form p { margin-top: 12px; font-size: 14px; }
    }
  }
}

@media (max-width: 370px) {
  #masthead { padding: 0 16px; & > a { font-size: 16px; } }
  #intro { padding: 55px 20px 40px; }
  #pitch { & h1 { font-size: 32px; line-height: 1.18; } & p { margin-top: 46px; } }
  #offer { width: calc(100% + 8px); margin-left: -4px; margin-right: -4px; & h2 { font-size: 27px; } & p { font-size: 17px; } }
  #quiz { padding-left: 10px; padding-right: 10px; & .ask, & .final { padding-left: 20px; padding-right: 20px; } }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
