/* 
    scroll bar width from vizion;
    add shadows - maybe with animation
    more responsive scaling from vizion

*/

@use 'pitch';
@use 'products';
@use 'infographics';
@use 'bitcoin';
@use 'be-your-own';
@use 'powered-by';
@use 'support';
@use 'dev';
@use 'community';


body, .ScrollSmoother-wrapper {
  margin: 0;
  background: linear-gradient(0deg, var(--c-bkg), var(--c-bkg)),
    url("../../assets/images/bkg.jpg");
  background-blend-mode: color, normal;
  background-size: cover;
  background-attachment: fixed;
  width: 100vw;
}

main{
  display:flex;
  flex-direction: column;
  align-items: center;
}

section {
  --section-padding: 6vh;
  // min-height: calc(100vh - 2 * var(--section-padding));
  // padding: 0 var(--section-padding);
  // outline: 1px solid orange;
}

.subsection{
  
}

.line {
  padding: 1.8rem 0 1.4rem 0;
}

.line-primary path{
  stroke: var(--c-line-primary);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

.svg-primary{
  fill: var(--c-text-primary);
}

.svg-secondary{
  fill: var(--c-bkg);
}

[class*="section--"]{
  box-shadow: var(--c-shadow-1) 0 3rem 3rem;
}

.section--inverse{
  background-color: rgba(255,255,255,0.2);
  backdrop-filter: blur(1rem);
  h1, p {
    color: var(--c-bkg);
  }
  .svg-primary{
    fill: var(--c-bkg);
  }
  .svg-secondary{
    fill: var(--c-text-primary);
  }
}

.section--subtle{
  background-color: rgba(0,0,0,0.2);
  backdrop-filter: blur(1rem);
}

.section--bold{
  //background-color: rgba(239,75,99,0.2);
  background-color: rgba(255,255,255,0.8);
  --c-text-primary: black;
  backdrop-filter: blur(1rem);
}



.line svg{
  width: calc(100vw - (2 * 6rem));
  max-width: 50vw;
  max-height: 50vh;
}

nav {
  color: var(--c-text-primary);
}

#logo {
  transform: translateY(-5rem);
  opacity: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  svg {
    width: 15rem;
    margin-top: 0.6rem;
  }
  span{
    text-transform: uppercase;
    font-weight: 400;
    letter-spacing: .1ch;
  }
}

#hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

h1 {
  font-family: var(--f-hero);
  font-size: min(4.5rem,171px);
  text-transform: uppercase;
  line-height: 1;
  color: var(--c-text-primary);

  em {
    font-style: normal;
    color: var(--c-text-accent);
  }

  .img-inline {
    height: 1.4em;
    margin: -0.3em -0.1em -0.2em -0.1em;
    position: relative;
  }
}

aside > h1 {
  font-family: var(--f-bold);
  font-size: 7rem;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--c-text-primary);

  em {
    font-style: normal;
    color: var(--c-text-accent);
  }
}

h2 {
  font-family: var(--f-hero);
  font-size: 7rem;
  text-transform: uppercase;
  line-height: 1;
  color: var(--c-text-primary);

  em {
    font-style: normal;
    color: var(--c-text-accent);
  }

  .img-inline {
    height: 1.4em;
    margin: -0.3em -0.1em -0.2em -0.1em;
    position: relative;
  }
}

p {
  font-family: var(--f-accent);
  font-weight: 300;
  font-size: 1.2rem; // 1.3rem
  line-height: 1.4;
  color: var(--c-text-primary);
  max-width: min(50ch, 73vw);

  em {
    font-style: normal;
    color: var(--c-text-accent);
    font-weight: 600;
  }
}

a.btn {
  position: relative;
  padding: 0.4rem 2rem;
  transform: rotateX(10deg);
  color: var(--c-text-bright);
  border: 0;
  font-family: var(--f-accent);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 1.6rem;
  text-decoration: none;

  transform-style: preserve-3d;

  &:hover{
    transform: rotateX(30deg);
    &::before {
      box-shadow: inset 0 1rem 1rem -0.5rem var(--c-shadow-1);
    }
  }

  &::before {
    content: '';
    position: absolute;
    background-color: var(--c-text-accent);
    display: block;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: -1;
    transition: var(--t-simple);

  }
  &::after {
    content: '';
    position: absolute;
    background-color: var(--c-3d-shadow);
    display: block;
    left: 0;
    right: 0;
    height: 1rem;
    z-index: -1;
    transform: rotateX(90deg) translateY(2px);
    box-shadow: inset 0 0.3rem 0.5rem 0rem var(--c-shadow-1);
  }

  &.btn--subtle{
    color: #777777;
    font-size: 1.2rem;
    &::before {
      background-color: white;
    }
    &::after {
      background-color: #eee;
    }
  }
}

.nodes {
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.row {
  display: flex;
  gap: 5rem;
  align-items: stretch;
  justify-content: center;
}

.path-node {
  border: var(--b-primary);
  display: inline-block;
  height: 20rem;

  &.path-node-text {
    width: 30rem;
    display: flex;
    align-items: center;
    p {
      margin: 0;
      padding: 1.5rem;
    }
  }

  &.path-node-img img {
    height: 20rem;
    width: 20rem;
    aspect-ratio: 1;
    object-fit: cover;
  }
}

.pseudoservices {
  margin: 0;
  padding: 0;
  li {
    text-transform: uppercase;
  }
}

#bitcoin-to-be, #be-to-powered, #powered-to-support, #support-to-dev {
  transform: scaleX(-1);
}


$pastels: (red, pink) (blue, purple) (green, yellow)
  (#a1c4fd, #c2e9fb) (#f6d365, #fda085) (#ffecd2, #fcb69f);
$cube-edge: 4em;

body {
  margin: 0;
  height: 100vh;
  // perspective: 25em; maybe move from main.css?
  // background-color: linear-gradient();
}

[class*="cube"] {
  position: absolute;
}

.cube {
  top: 50%;
  left: 50%;
  transform-style: preserve-3d;
  font-size: 8vmin;
  animation: ani 8s ease-in-out infinite;

  &__face {
    margin: -0.5 * $cube-edge;
    width: $cube-edge;
    height: $cube-edge;
    backface-visibility: hidden;
    --i: 0;
    --j: 1;
    transform: rotate3d(var(--i), var(--j), 0, var(--a))
      translateZ(0.5 * $cube-edge);
    // interpolate because Sass apparently has issues with this
    background: #{"linear-gradient(var(--ga), var(--gs))"};

    &:nth-child(n + 5) {
      --i: 1;
      --j: 0;
    }

    @for $f from 0 to 6 {
      &:nth-child(#{$f + 1}) {
        --a: if($f < 4, $f, pow(-1, $f)) * 90deg;
        --ga: random(360) * 1deg;
        --gs: nth($pastels, $f + 1);
      }
    }
  }
}

@keyframes ani {
  from {
    transform: rotateY(2turn) rotateX(2turn);
  }
  to {
    transform: rotateY(1turn) rotateX(1turn);
  }
}

@media screen and (max-width: 500px) {
  #hero{
    margin-top: 25vh;
  }
  .line svg{
    max-height: 40vh;
  }
}
