@font-face {
font-family: "Affix";
font-style: normal;
font-weight: normal;
src: url('../fonts/Affix-Thin.woff2');
}

:root {
  --fontSize: 0.95rem;
  --lineHeight: 1.2rem;
  --textMargin: 0.6rem;
  --dotHeight: 0.6rem;
}

@media (max-width: 991px) {
  :root {
    --fontSize: 1rem;
    --lineHeight: 1.35rem;
  }
}

html, body {
  position: fixed;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: white;
}
a {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 0.02rem;
  text-underline-offset: 0.2rem;
}
strong {
  text-decoration: underline;
  text-decoration-thickness: 0.03rem;
  text-underline-offset: 0.3rem;
}
em {
  font-style: italic;
}

body {
  font-family: "Affix", monospace;
  font-size: var(--fontSize);
  line-height: var(--lineHeight);
  letter-spacing: 0.025rem;
}

#bg {
  position: fixed;
  height: 100vh;
  width: 100vw;
}

#info {
  display: none;
  position: fixed;
  top: calc(var(--textMargin) + 2 * var(--lineHeight));
  left: var(--textMargin);
  width: calc(100vw - var(--textMargin) * 2)
}
#info.visible {
  display: block;
}

#info div {
  background-color: white;
  border-top: 2px solid white;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  display: block;
}
#info2 {
  position: relative;
  top: calc(2 * var(--lineHeight));
}

#infoButton {
  cursor: pointer;
  text-decoration: none;
  position: fixed;
  top: var(--textMargin);
  left: var(--textMargin);
}

#filter {
  position: relative;
  top: var(--lineHeight);
  display: block;
}
.logo {
  width: 10rem;
  height: auto;
  position: relative;
  left: -0.1rem;
  border: 0.05rem solid black;
  background-color: white;
}

#logos {
  display: flex!important;
  flex-direction: row;
  align-items: flex-start;
  margin-top: 4rem;
  margin-left: 0.1rem;
  gap: 0.5rem;
}
.filterButton.active, #infoButton.active {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-thickness: 0.03rem;
    text-underline-offset: 0.3rem;
}
#infoButton:hover, #toggle:hover {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 0.03rem;
  text-underline-offset: 0.3rem;
}
.filterButton:hover, .dot:hover {
  cursor: pointer;
}

#toggle {
  position: absolute;
  top: var(--textMargin);
  right: var(--textMargin);
}

#caption {
  position: fixed;
  bottom: var(--textMargin);
  width: 100vw;
  text-align: center;
}

#flexContainer {
  height: 100dvh;
  padding-top: clamp(2rem, 12vh, 8.5rem);
  padding-bottom: clamp(2rem, 12vh, 9rem);
  padding-left: clamp(2.4rem, 7.5vw, 8.5rem);
  padding-right: clamp(2.4rem, 7.5vw, 8.5rem);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;  /* evenly distribute rows vertically */
  align-items: center;
}

.flexRow {
  display: flex;
  justify-content: space-between;  /* outer dots align to row edges */
  width: 100%;                     /* or set per-row with JS */
  min-height: var(--dotHeight); /* or whatever height works for your dots */
}
.dotSlot {
  flex: 0 0 auto;
  position: relative;
  width: var(--dotHeight); /* match your dot size + spacing */
  height: var(--dotHeight);
  display: flex;
  justify-content: center;
  align-items: center;
}

.border {
  border: 0.05rem solid white;
  mix-blend-mode: difference;
  box-sizing: border-box;
}

.dot {
  width: var(--dotHeight);
  background-color: rgba(255,255,255,0);
  transition: background-color 1s ease;
  height: var(--dotHeight);
  border-radius: 50%;
  visibility: visible;

  /* Calculate normalized position between 0 and 1 */
  /* Quadratic curve to shape the arc */
  transform: translateY(calc(
    var(--bend-dir) * var(--bend-amp) * 5vh * (
      1 - 4 * ( (var(--pos) / (var(--total) - 1)) - 0.5 ) * ( (var(--pos) / (var(--total) - 1)) - 0.5 )
    )
  ));
}

.dot.hovered,
.dot.locked {
  background-color: rgba(255, 255, 255, 1);
  transition: background-color 1s ease;
}

.ellipse {
  position: absolute;
  width: clamp(3rem, 7vw, 6rem);
  height: clamp(15vh, 25vw, 25vh);
  border-radius: 50%;
  top: 50dvh;
  transform: translateY(-50%);
}
.ellipse.left {
  left: 0.05rem;
}
.ellipse.right {
  right: 0.05rem;
}
.head {
  position: absolute;
  width: clamp(calc(100vw - 6rem), calc(100vw - 7vw), calc(100vw - 3rem));
  height: clamp(calc(100dvh - 10rem), calc(100dvh - 8vh), calc(100dvh - 6.3rem));
  border-radius: 50%;
  top: clamp(3rem, 4dvh, 5rem);
  left: clamp(1.5rem, 3.5vw, 3rem);
}
.triangle {
  display: none;
  position: absolute;
  top: 0.1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 22vw;
  height: clamp(5.5rem, 7.5dvh, 9.5rem);
  overflow: visible;
}

#T {
  position: absolute;
  top: 0.1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 22vw;
  height: clamp(5.5rem, 7.5dvh, 9.5rem);
  overflow: visible;
}
#T polygon {
      vector-effect: non-scaling-stroke;
      fill: white;            /* white fill inside */
      stroke: black;          /* black border */
      stroke-width: 0.03rem;      /* same thickness as other shapes */
    }

/* IMAGES */
#hoverPreview, #lockedPreview {
position: fixed;
width: 100vw;
height: 100vh;
top: 0;
left: 0;
display: flex;
flex-direction: column;
align-items: center;
pointer-events: none;
opacity: 0;
visibility: hidden;
transition: opacity 1s ease, visibility 1s ease;
}

#hoverPreview.show, #lockedPreview.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  overflow: hidden;
}

#hoverPreview.show img, #lockedPreview.show img {
  opacity: 1;
  visibility: visible;
}

#hoverPreview img, #lockedPreview img {
  height: 100%;
  width: 100%;
object-fit: contain;
max-height: clamp(calc(100dvh - 5rem), calc(100dvh - 4vh), calc(100dvh - 3.15rem));
max-width: 100vw;
vertical-align: middle;
opacity: 0;
transition: opacity 1s ease;
visibility: hidden;
}

#previewText, #lockedText {
  object-fit: contain;
  vertical-align: middle;
  display: none;
  overflow-y: auto;
  height: clamp(calc(100dvh - 5rem - 1.2rem), calc(100dvh - 4vh - 1.2rem), calc(100dvh - 3.15rem - 1.2rem));
  width: 35rem;
  padding: 0.7rem;
  color: #000;
  font-size: --fontSize: 0.95rem;
  line-height: --lineHeight: 1.2rem;
  white-space: pre-wrap; /* to preserve line breaks */
  background-color: white;
}
#previewText {
  z-index: 200;
}
#lockedText {
  z-index: 201;
}

.previewText {
  position: fixed;
  left: 0;
  bottom: 0;
  padding-bottom: 0;
  background-color: white;
  width: 100vw;
  height: clamp(3rem, 4dvh, 5rem);
  text-align: center;
  color: black;
  z-index: 100;
  transition: padding-bottom 0.3s ease;
}
.previewText.shift-text-up {
  padding-bottom: 20px;
  transition: padding-bottom 0.3s ease;
}

.previewText.shift-text-up-more {
  padding-bottom: 40px;
  transition: padding-bottom 0.3s ease;
}

#clippedCanvasWrapper {
  position: absolute;
  top: clamp(3rem, 4dvh, 5rem);
  left: clamp(1.5rem, 3.5vw, 3rem);
  width: clamp(calc(100vw - 6rem), calc(100vw - 7vw), calc(100vw - 3rem));
  height: clamp(calc(100dvh - 10rem), calc(100dvh - 8vh), calc(100dvh - 6.3rem));
  clip-path: ellipse(50% 50% at 50% 50%);
  -webkit-clip-path: ellipse(50% 50% at 50% 50%);
  z-index: 0; /* behind dots etc. */
  overflow: hidden;
}
#canvas {
  width: 100vw;
  height: 100vh;
  display: block;
}


/* Dark mode styles */
body.dark-mode,
body.dark-mode #info div,
body.dark-mode #info,
body.dark-mode #caption,
body.dark-mode #previewCaption,
body.dark-mode #lockedCaption,
body.dark-mode #previewText,
body.dark-mode #lockedText,
body.dark-mode .previewText {
  background-color: black;
  color: white;
}

body.dark-mode #infoButton {
  color: white;
}

body.dark-mode .border,
body.dark-mode .logo {
  border-color: white;
}

body.dark-mode #T polygon {
  fill: black;
  stroke: white;
}

body.dark-mode #info div {
  border-color: black;
}




/* small devices */
@media (max-width: 900px) {
  /* Shared border styling */
  .triangle polygon {
    stroke-width: 0.04rem;      /* same thickness as other shapes */
  }
  /* IMAGES */
  #lockedPreview {
  justify-content: center;
  height: 100dvh;
  }
  .dot {
    width: 0.6rem;
    height: 0.6rem;
  }
  .dot::before {
    content: "";
    position: absolute;
    top: -0.5rem;
    left: -0.5rem;
    right: -0.5rem;
    bottom: -0.5rem;
    border-radius: 50%;
  }
  #info {
    background-color: white;
    z-index: 100;
    height: calc(100dvh - (var(--textMargin) + 2 * var(--lineHeight)));
    overflow: scroll;
  }
  #previewText, #lockedText {
    width: calc(100vw - 1.4rem);
    margin-bottom: calc(var(--textMargin) + 2 * var(--lineHeight));
    margin-top: calc(var(--textMargin) + 2 * var(--lineHeight));
  }
  .previewText {
    bottom: 0.1rem;
  }
  .logo {
    width: 40vw;
    top: 3rem;
    padding-bottom: 2rem;
  }
}

@media (hover: none) {
  /* Touch devices - no hover capability */
  #hoverPreview {
    display: none !important; /* hide preview on touch */
  }
}
