@property --glow-deg {
  syntax: "<angle>";  
  inherits: true;
  initial-value: 0deg;
}

@font-face {
  font-display: swap;
  font-family: 'Noto IKEA';
  font-style: italic;
  font-weight: 400;
  src: url(noto-ikea-400i.latin-ext.5f8f91ea.woff2) format("woff2");
  unicode-range:u + 0100-024f, u + 0259, u + 1e??, u + 2020, u + 20a0-20ab, u + 20ad-20cf, u + 2113, u + 2c60-2c7f, u + a720-a7ff
}

@font-face {
  font-display: swap;
  font-family: 'Noto IKEA';
  font-style: italic;
  font-weight: 400;
  src: url(noto-ikea-400i.latin.10395910.woff2) format("woff2");
  unicode-range:u + 00??, u + 0131, u + 0152-0153, u + 02bb-02bc, u + 02c6, u + 02da, u + 02dc, u + 2000-206f, u + 2074, u + 20ac, u + 2122, u + 2191, u + 2193, u + 2212, u + 2215, u + feff, u + fffd
}

@font-face {
  font-display: swap;
  font-family: 'Noto IKEA';
  font-style: italic;
  font-weight: 700;
  src: url(noto-ikea-700i.latin-ext.3637155a.woff2) format("woff2");
  unicode-range:u + 0100-024f, u + 0259, u + 1e??, u + 2020, u + 20a0-20ab, u + 20ad-20cf, u + 2113, u + 2c60-2c7f, u + a720-a7ff
}

@font-face {
  font-display: swap;
  font-family: 'Noto IKEA';
  font-style: italic;
  font-weight: 700;
  src: url(noto-ikea-700i.latin.29eb18bb.woff2) format("woff2");
  unicode-range:u + 00??, u + 0131, u + 0152-0153, u + 02bb-02bc, u + 02c6, u + 02da, u + 02dc, u + 2000-206f, u + 2074, u + 20ac, u + 2122, u + 2191, u + 2193, u + 2212, u + 2215, u + feff, u + fffd
}

@font-face {
  font-display: swap;
  font-family: 'Noto IKEA';
  font-style: normal;
  font-weight: 400;
  src: url(noto-ikea-400.latin-ext.edd421f4.woff2) format("woff2");
  unicode-range:u + 0100-024f, u + 0259, u + 1e??, u + 2020, u + 20a0-20ab, u + 20ad-20cf, u + 2113, u + 2c60-2c7f, u + a720-a7ff
}

@font-face {
  font-display: swap;
  font-family: 'Noto IKEA';
  font-style: normal;
  font-weight: 400;
  src: url(noto-ikea-400.latin.647e877d.woff2) format("woff2");
  unicode-range:u + 00??, u + 0131, u + 0152-0153, u + 02bb-02bc, u + 02c6, u + 02da, u + 02dc, u + 2000-206f, u + 2074, u + 20ac, u + 2122, u + 2191, u + 2193, u + 2212, u + 2215, u + feff, u + fffd
}

@font-face {
  font-display: swap;
  font-family: 'Noto IKEA';
  font-style: normal;
  font-weight: 700;
  src: url(noto-ikea-700.latin-ext.97f0d455.woff2) format("woff2");
  unicode-range:u + 0100-024f, u + 0259, u + 1e??, u + 2020, u + 20a0-20ab, u + 20ad-20cf, u + 2113, u + 2c60-2c7f, u + a720-a7ff
}

@font-face {
  font-display: swap;
  font-family: 'Noto IKEA';
  font-style: normal;
  font-weight: 700;
  src: url(noto-ikea-700.latin.d7277c39.woff2) format("woff2");
  unicode-range:u + 00??, u + 0131, u + 0152-0153, u + 02bb-02bc, u + 02c6, u + 02da, u + 02dc, u + 2000-206f, u + 2074, u + 20ac, u + 2122, u + 2191, u + 2193, u + 2212, u + 2215, u + feff, u + fffd
}

:root {
  --clr-white: #fff;
  --clr-black: #000;

  --clr-green: #3FB83E;
  --clr-blue: #4297FF;
  --clr-sand: #F1EBDD;
  --clr-sand-light: #F7F3EB;

  --ff-ikea: "Noto IKEA", "Noto Sans", system-ui, sans-serif;
  
  --fs-s: 0.75rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 2rem;
  --fs-2xl: 3rem;
  --fs-3xl: 4rem;

  --td-s: 400 0.75rem/1.3 var(--ff-ikea);
  --td-base: 400 1rem/1.4 var(--ff-ikea);
  --td-lg: 400 1.125rem/1.4 var(--ff-ikea);
  --td-xl: 700 2rem/1.2 var(--ff-ikea);
  --td-2xl: 700 3rem/1.2 var(--ff-ikea);
  --td-3xl: 700 4rem/1.2 var(--ff-ikea);

  font: 16px/1.4 var(--ff-ikea);
}


.turbo-progress-bar {
  height: 3px;
  background-color: #0058a3;
}



body {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100vh; 
  min-height: 100svh;  
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;  

  background-color: var(--clr-white);

  &:has(.results) {
    background-color: var(--clr-sand-light);
  }
}

.debug-score {
  position: fixed;
  font-size: var(--fs-s);
  right: 0;
  top: 0;
  padding: 1rem;
  background-color: var(--clr-white);
  z-index: 100;

  & dl {
    display: grid;
    grid-template-columns: max-content max-content;
    gap: 0 1ch;

    & dd {
      text-align: right;
    }
  }
}

button {
  cursor: pointer;
}

ul[class] {
  margin: 0;
  padding: 0;
  list-style: none;
}

form {
  margin: 0;
}

header {
  background-color: var(--clr-white);
  position: fixed;
  inset: 1rem 1rem auto 1rem;
  padding: 0.875rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0px 2px 2px 0px #0000000A;
  z-index: 100;

  > a {
    flex-grow: 1;
    max-width: 12.6875rem;
  }
}

.language-button {
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1;
  background-color: var(--clr-sand);
  border: none;
  border-radius: 50%;
  width: 2.25rem;
  cursor: pointer;

  svg {
    display: none;

    &:nth-child(1) {
      display: block;          
    }
  }

  &[aria-expanded="true"] {
    svg:nth-child(1) {
      display: none;
    }
    svg:nth-child(2) {
      display: block;    
    }
  }
}

#language-menu {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 90;
  background-color: var(--clr-sand);
  padding: calc(1rem + 4rem + 2rem) 1rem 1rem 1rem;

  & h2 {
    font: var(--td-xl);
    font-weight: 400;
    margin: 0 0 1rem 0;
  }

  & ul {
    font: var(--td-base);
    border-top: 1px solid var(--clr-black);
  }

  & li {
    border-bottom: 1px solid var(--clr-black);
    padding: 0.75rem 0;
    position: relative;
    min-height: 3.5rem;    
  }

  & a {
    text-decoration: none;
    color: var(--clr-black);
    display: flex;    
    align-items: center;
    min-height: 2rem;

    &.current {
      font-weight: 700;
    }
    
    &::after {
      content: "";
      position: absolute;
      right: 0;
      width: 2rem;
      aspect-ratio: 1;
      border-radius: 50%;
      background-color: var(--clr-green);
      background-image: url("ico-arrow-right.svg");
      background-repeat: no-repeat;
      background-position: 50% 50%;
    }
  }
}

main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  
  & article {
    flex: 0 0 auto;
    background-color: var(--clr-bg);
    flex-shrink: 0;
    text-align: center;
    padding: 1.5rem 1.5rem 1rem 1.5rem;


    & p {
      max-width: 32ch;
      margin: 0 auto 1.5rem auto;
    }

    & .cta + * {
      margin-top: 0.75rem;
    }
  }

  & h1, h2 {
    font: var(--td-xl);
    font-weight: 400;    
    margin: 0 auto 0.5rem auto;
  }

}

.start {
  --clr-bg: var(--clr-white);
  --clr-action: var(--clr-green);
}

.facts {
  --clr-bg: var(--clr-green);
  --clr-action: var(--clr-white);
}

.stage, .last_save {
  --clr-bg: var(--clr-sand-light);
  --clr-action: var(--clr-white);

  & .hero-container article {
    color: var(--clr-white);
    text-align: left;
  }
}

.results {
  --clr-action: var(--clr-green);
  margin-block-end: 1rem;
}


.good_answer {  
  & .hero-container {
    background-color: var(--clr-green);   
  }  
}

.bad_answer {  
  & .hero-container {
    background-color: var(--clr-blue);
  }
}

.good_answer, 
.bad_answer {

  --clr-bg: var(--clr-sand-light);
  --clr-action: var(--clr-sand-light);

  & .hero-container {    
    & svg {
      fill: var(--clr-white);
    }
  }

  & .hero-container article {
    font-size: var(--fs-xl);
    line-height: 1.2;
    text-align: left;
    font-weight: 400;

    & h2 {
      margin: 0;
      font-weight: 700;
    }
  }

  & .answers-container {
    background-color: var(--clr-white);
    font-size: var(--fs-s);
    line-height: 1.5;
    text-align: left;
    font-weight: 400;
    gap: 0;

    & div:has(.cta) {
      display: flex;
      margin-block-start: 3rem; 
    }

    & .cta {
      max-width: inherit;
      background-color: var(--clr-sand-light);
    }

    &:has(.cta.last_save) {
      font-size: var(--fs-xl);
      line-height: 1.2;
    }

    & h2 {
      font-size: var(--fs-s);
      line-height: 1.5;
      text-align: left;
      font-weight: 700;
      margin: 0;
    }

    & p {
      margin: 0;
      max-width: inherit;
    }
  }
}


.hero-container, .carousel {
  flex: 1 1 0; 
  min-height: 0;
}

.hero-container {
  display: grid;
  grid-template: 1fr / 1fr;
    
  & img, video {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-width: 0;
    min-height: 0;
  }

  & article {
    grid-area: 1 / 1;
    place-self: start start;
    z-index: 1;    
    background-color: transparent;
  }

  &:has(video) {
    color: var(--clr-white);
    
    & h2 {
      text-align: left;
      margin-top: 1em;
    }
  }


  & svg {
    grid-area: 1 / 1;
    place-self: end end;
    fill: var(--clr-bg, var(--clr-green));
  }

  & .hero-link {
    grid-area: 1 / 1;
    z-index: 2;
  }
}

form:has(.cta) {
  display: flex;

}

.cta {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  background-color: var(--clr-action, var(--clr-sand-light));
  background-image: url("ico-arrow-right.svg");
  background-repeat: no-repeat;
  background-position: 1rem 50%;
  border: none;
  font-size: var(--fs-base);
  max-width: 20rem;
  border-radius: 100vw;
  height: 3rem;
  margin: 0 auto;
  font-weight: 700;
  color: var(--clr-black);
  text-decoration: none;    
}

.share-container {
  display: flex;
  margin-block-end: 0.5rem;

  & .cta {
    background-color: transparent;
    border: 1px solid var(--clr-black);
  }
}

.play-time {  
  font: var(--td-s);
  display: inline-flex;
  gap: 0.4em;
  align-items: center;
}


.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  
  > li {
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;

    --clr-bg: var(--clr-green);
  
  }
}

.scroll-marker-group {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  background-color: var(--clr-bg);
  padding: 0 0 1rem 0;

  & button {
    appearance: none;
    border: none;
    width: 0.75rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background-color: var(--clr-white);
    transition: background-color 0.1s ease;

    &.current {
      background-color: var(--clr-black);
    }
  }
}

.stage-header-container {
  background-color: var(--clr-bg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stage-progress {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  justify-content: stretch;
  margin: 0;
  padding: 0;

  & li {
    flex-grow: 1;
    height: 0.25rem;
    border-radius: 100vw;
    background-color: var(--clr-white);
    &.done {
      background-color: var(--clr-green);
    }
  }
}

.stage-header {
  
  
  display: flex;  
  gap: 0.5rem;
  align-items: center;

  & h1 {
    font: var(--td-base);
    margin: 0;
  }
}

.stage-icon {
  width: 2.5rem;  
  aspect-ratio: 1;
  background-color: var(--clr-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-progress {
  font: var(--td-s);
  text-transform: uppercase;
  font-weight: 700;
}

@keyframes glow {
  from {
    --glow-deg: 0deg;
  }
  to {
    --glow-deg: 360deg;
  }
}

.answers-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;

  & form {
    display: flex;        
  }

  & button {
    text-align: left;
    appearance: none;
    border: 2px solid transparent;    
    flex-grow: 1;
    line-height: 1.25;
    background: var(--clr-white);
    border-radius: 100vw;
    font-weight: 700;
    padding: 1rem;
    box-sizing: border-box;

    &.chance {
      animation: glow 10s linear infinite;
      background: linear-gradient(var(--clr-white), var(--clr-white)) padding-box,
        linear-gradient(var(--glow-deg), var(--clr-blue), var(--clr-green), #74B2FF, var(--clr-green)) border-box;
    }
  }
}

dialog {
  border: none;
  border-radius: 0.5rem;
  width: 280px;
  max-width: 90%;
  padding: 0;

  & > * {
    padding: 0 1.25rem;
  }

  & > *:first-child {
    padding-block-start: 2rem;
  }
  & > *:last-child {
    padding-block-end: 2rem;
  }

  & h2 {
    padding-block-end: 2rem;
    margin: 0;
  }

  & svg {
    fill: var(--clr-white);
    rotate: 180deg;
  }
}

dialog::backdrop {
  background: rgba(0,0,0,.5);
}

.header-label {
  text-transform: uppercase;  
  font: var(--td-s);
  font-weight: 700;
  padding-block-end: 1rem;
}

.dialog-actions {
  background-color: var(--clr-green);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  
  & svg {
    align-self: stretch;
    width: 100%;
    height: auto;
  }

  & > div {
    display: flex;  
    gap: 0.5rem;  
  }

  & button {
    text-align: center;
    flex: 1;
  }
}

.results-header {
  background-color: var(--clr-green);
  padding: 2rem 1rem 3rem 1rem;

  strong {
    display: block;
  }
}

.results-tagline {
  display: grid;
  grid-template-columns: 1fr max-content;

  & svg {
    fill: var(--clr-green);
    rotate: 180deg;
  }

  &>div:first-child {
    align-self: center;
    font: var(--td-base);
    padding: 1rem 0 1rem 1rem;
  }
}

.impact {
  display: flex;
  flex-direction: column;
  margin: 1.5rem 1rem;
  font: var(--td-base);

  & + .impact {
    margin-block-start: 0;
  }
  
  & h3 {
    font: var(--td-base);
    font-weight: 700;
    margin: 0;
  } 

  & .icon {
    width: 40px;
    aspect-ratio: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: var(--clr-green);
    border-radius: 50%;
    margin-block-end: 0.25rem;
  }

  & details {
    border-width: 1px 0;
    border-color: var(--clr-black);
    border-style: solid;
    margin: 0.5rem 0;
    padding: 0.5rem 0;

    & summary {
      list-style: none;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 0.5rem;
    }

    h4 {
      font: var(--td-base);
      font-weight: 700;
      margin: 0;
    }

    & p {
      margin: 0.5rem 0;
    }

    & summary::-webkit-details-marker { display: none; }

    & .details-icon {
      width: 23px;
      aspect-ratio: 1;
      border-radius: 50%;
      border: 1px solid var(--clr-black);
      box-sizing: border-box;
      position: relative;
      &::before {
        content: "";
        height: 13px;
        width: 1px;
        left: 10px;
        top: 4px;
        position: absolute;
        background-color: var(--clr-black);
      }
      &::after {
        content: "";
        width: 13px;
        height: 1px;
        left: 4px;
        top: 10px;
        position: absolute;
        background-color: var(--clr-black);
      }
    }

    &[open] .details-icon::before {
      display: none;
    }
  }

}

.like-container {
  margin: 0 1rem 1.5rem 1rem;

  & h3 {
    font: var(--td-base);
    font-weight: 700;
    margin: 0 0 0.5rem 0;
  } 

  & > div {
    display: flex;
    gap: 0.5rem;
  }

  button {
    appearance: none;
    border-radius: 50%;
    width: 40px;
    aspect-ratio: 1;
    border: 1px solid var(--clr-black);
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;

    &.thumbs-down {
      & svg {
        rotate: 180deg;
      }
    }
  }
}

.newsletter-container {
  margin: 0 1rem 2rem 1rem;

  & p {
    margin: 0 0 1rem 0;
  }

  a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--clr-black);
    text-decoration: none;

    & span:has(svg) {
      background-color: var(--clr-green);
      width: 32px;
      height: 32px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
    }
  }
}

