:root {
  --tx: #dfdfdf;
  --tx2: #595959;
  --tx3: #292929;
  --tx-light: #dfdfdf1a;
  --bg: #000000;
  --bg-light: #ffffff20;

  --selection-bg: #ffffffc9;
  --selection-tx: #000000;

  --dark: #000000;
  --light: #FFFFFF;

  --cf: #EB0004;
  --cf-light: #eb0004b9;
  --cf-light2: #eb000410;
  --grid-lines: rgba(235, 0, 4, 0.20);

  --f-main: "Cascadia Code", monospace;
  
  --xx: rgba(0, 255, 0, 0.5);
  --xx2: rgba(93, 0, 255, 0.5);
  --xx3: rgba(255, 0, 0, 0.5);
  --xx4: rgba(255, 0, 255, 0.5);
  --xx5: rgba(255, 255, 0, 0.5);

  --side-padding: clamp(12px, 4vw, 42px);
  
  --border: 1px solid var(--tx2);
}

/* :root {
  --tx: #000000;
  --bg: #efefef;
  --bg-light: #00000020;
} */
/* #footer img {
  filter: invert();
} */

:root {
  --cf: #EB0004;
  --cf-light: #eb0004b9;
}

:root[data-theme="purple"] {
  --cf: #5135cd;
  --cf-light: #5135cdb9;
}

/* Optional blur scope during transitions */
.blur-transition main,
.blur-transition .content,
.blur-transition .home-3 {
  filter: blur(4px);
  transition: filter 250ms ease;
}

::-webkit-scrollbar {
  display: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::selection {
  background-color: var(--selection-bg);
  color: var(--selection-tx);
}

body {
  background-color: var(--bg);
  color: var(--tx);
  font-family: var(--f-main);
  cursor: default;
  overflow-x: hidden;
}

body > * {
  transition: filter 0.4s ease;
  cursor: crosshair;
}

body.blur-transition > * {
  filter: blur(8px);
}

img, svg, video {
  pointer-events: none;
  user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: none;
  background-color: transparent;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: normal;
}

.cf {
  color: var(--cf);
}

.tx2 {
  color: var(--tx2);
}

/* .hover-line-container:hover {
  --angle: 45deg;
  --line-thickness: 1px;
  --gap: 6px;
  --color: var(--tx3);
  background: repeating-linear-gradient(
    var(--angle),
    var(--color) 0,
    var(--color) var(--line-thickness),
    transparent var(--line-thickness),
    transparent var(--gap)
  );
} */

.section {
  padding: 0 var(--side-padding);
}

@keyframes loopX {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

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

#smooth-content {
  padding-top: 104px;
  max-width: 3600px;
  margin: 0 auto;
}

/* container unchanged except for animation hooks */
.custom-scrollbar {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 200px;
  max-width: 80vw;
  height: 20px;
  z-index: 1000;
  cursor: pointer;
  /* opacity: .4 !important; */
  transition: opacity 100ms ease;
  background-image: url("assets/dot-texture-bg.svg");
  
  --scrollbar-thumb-additional-grab-area: 12px;
}
/* .custom-scrollbar:hover { opacity: 1 !important; } */
.custom-scrollbar.is-bottom,
.custom-scrollbar.is-bottom:hover {
  opacity: 0 !important;
  pointer-events: none !important;
  user-select: none !important;
}

@keyframes scroll-track {
  from {
    width: 0;
  }
}
.hr-scrollbar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 1px;
  border: none;
  border-top: 2px dashed var(--tx2);
  z-index: -99;
  animation: scroll-track 1s forwards;
}

.scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: transparent;
  border: none;
  cursor: grab;
  touch-action: none;
  padding: 0 var(--scrollbar-thumb-additional-grab-area);
  margin-left: calc(-1 * var(--scrollbar-thumb-additional-grab-area));
}
.scrollbar-thumb:active { cursor: grabbing; }
@keyframes scroll-thumb {
  0% {
    opacity: 0;
  }
  80% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
.scrollbar-thumb::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  border-radius: 1em;
  z-index: 999;
  transform: translateX(-50%);
  background-color: var(--cf);
  animation: scroll-thumb 1.2s forwards;
  transition: scale 160ms ease;
}
.scrollbar-thumb:hover::before {
  scale: 1.2;
}

/*  */

.scrollbar-link {
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translate(-100%, -50%);
  text-transform: uppercase;
  font-size: 12px;
  mix-blend-mode: difference;
}

.hover-text-parent {
  position: relative;
}

.hover-text {
  color: var(--cf);
  text-transform: none;
  position: absolute;
  right: 30%;
  transform: translateY(100%);
  bottom: -8px;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition: opacity 100ms ease;
}

.nav-logo-container .hover-text {
  right: 0;
}

/* To work with #hint button */

/* Show all hover-text when hints are enabled */
body.hints-active .hover-text {
  opacity: 1 !important;
}

/* Keep existing hover behavior as default */
.hover-text-parent:hover .hover-text {
  opacity: 1;
}

.nav-toggle-btn-img path {
  fill: var(--tx2);
}

/* Button pressed state */
#hint[aria-pressed="true"] path {
  fill: var(--cf);
}

/*  */

@keyframes loopX {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/*  */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  gap: 16px;
  padding: 32px var(--side-padding);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 899;
}

header * {
  pointer-events: all;
}

.nav-logo-container {
  position: relative;
  display: block;
  pointer-events: initial;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--tx2);
  text-wrap: nowrap;
}

.kala-vector {
  height: 30px;
}

.header-nav-right {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

/*  */

#menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  z-index: 900;
  transition: opacity 0.2s ease;
}

/*  */

#menu-container {
  --menu-left: clamp(10px, 20vw, 30%);
  position: fixed;
  top: 50vh;
  right: var(--side-padding);
  left: auto;
  width: calc(100% - var(--side-padding) * 2);
  max-width: 1000px;
  will-change: transform;
  background: var(--light);
  color: var(--dark);
  box-shadow: 0 5px 10px rgba(0,0,0,0.35);
  z-index: 1001;
  visibility: hidden;
  padding: var(--side-padding);
  user-select: none;
}

html.menu-open, body.menu-open {
  overflow: hidden;
  overscroll-behavior: none;
}

#menu-container:after {
  content: "Click outside to close";
  display: inline-block;
  color: var(--tx);
  position: absolute;
  pointer-events: none;
  user-select: none;
  top: -8px;
  font-size: 14px;
  transform: translateY(-100%);
  right: 0;
}

.menu-logo-container {
  position: relative;
  display: block;
  pointer-events: initial;
  font-size: 14px;
  text-wrap: nowrap;
  width: fit-content;
}

.menu-email-text {
  font-style: italic;
  width: 100%;
  margin-top: 40px;
}
.menu-email {
  color: var(--cf);
}

.menu-email:hover {
  text-decoration: underline;
}

.menu-link-container {
  position: relative;
  width: fit-content;
  margin-left: var(--menu-left);
  margin-top: 140px;
}

/*  */

.menu-kala-form {
  display: flex;
  flex-direction: column;
  /* border: 1px dashed var(--tx2); */
  gap: 60px;
  margin-left: var(--menu-left);
  margin-top: 160px;
  font-size: 16px;
  position: relative;
}

.menu-kala-form label {
  display: block;
  width: 100%;
  font-size: 12px;
  margin-bottom: 4px;
  line-height: 1.4;
}

.menu-minimal-input {
  border: none;
  background: transparent;
  width: 100%;
  outline: none;
  font-size: 1em;
  padding: 6px 0;
  border-bottom: 1px dashed transparent;
  transition: background-color 160ms ease, border-color 160ms ease;
  padding: 6px 10px;
}

#menu-message {
  font-size: 1em;
}

.menu-minimal-input::placeholder {
  font-family: var(--f-main);
}

.menu-minimal-input:hover,
.menu-minimal-input:focus {
  border-color: var(--cf);
  background-color: var(--cf-light2);
}

.menu-options-group {
  display: flex;
  flex-wrap: wrap;
  column-gap: 30px;
  row-gap: 2px;
}

.menu-option {
  padding: 6px 10px;
  color: var(--tx2);
  cursor: pointer;
  user-select: none;
  transition: color 200ms ease, border-color 300ms ease, background-color 160ms ease;
  border-bottom: 1px dashed transparent;
}

.menu-option.selected,
.menu-option:hover {
  color: var(--cf);
  border-color: var(--cf);
  background-color: var(--cf-light2);
}

#menu-submit-btn {
  background: transparent;
  padding: 6px 0;
  cursor: pointer;
  width: fit-content;
  color: var(--cf);
  font-size: 1rem;
  text-underline-offset: 2px;
  transition: color 200ms ease;
}

#menu-submit-btn:hover {
  color: var(--cf);
  text-decoration: underline;
}

#menu-response {
  font-weight: normal !important;
  font-size: 14px;
  position: absolute;
  bottom: 0;
  left: 0;
  transform: translateY(1.4em);
}

.menu-footer-logo {
  height: 32px;
  width: auto;
  display: inline-block;
  margin-top: 140px;
  margin-right: 2px;
}

.kala-vector path,
.menu-footer-logo path,
.home-kala-logo path,
.home-2-kala-vector path,
.right-arrow path {
  fill: var(--cf);
}

.menu-copyright {
  font-size: 12px;
  text-transform: uppercase;
  display: inline-block;
}

/*  */

.social-link {
  display: block;
  line-height: 1.8;
  transition: color 100ms ease-out;
  width: fit-content;
  text-underline-offset: 2px;
}

.terms-and-conditions-link,
.privacy-policy-link {
  color: var(--tx2);
}

.social-link:hover {
  color: var(--cf);
  text-decoration: underline;
  font-style: italic;
}

/*  */

.nav-toggle-btn {
  position: relative;
}

.nav-toggle-btn-img {
  height: 14px;
}

.nav-toggle-btn-img path {
  fill: var(--tx2);
  transition: fill 200ms ease;
}

.nav-toggle-btn[aria-pressed="true"] .nav-toggle-btn-img path,
.nav-toggle-btn:hover .nav-toggle-btn-img path {
  fill: var(--cf);
}

#themeToggle path/* .themeToggle-circle */ {
  fill: var(--cf);
}

/*  */

footer {
  margin-top: 150px;
}

.footer-container {
  background-color: var(--bg);
}

.footer-container-1 {
  display: flex;
  flex-direction: row;
  margin-top: 12px;
}

.footer-container-1 > * {
  padding: var(--side-padding);
  border: var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--side-padding);
  justify-content: center;
  align-items: center;
}

.footer-container-1 > *:not(:first-child) {
  border-left: none;
}

.footer-links-title {
  font-size: 14px;
  color: var(--tx2);
}

.footer-kala-vector-container-wrapper {
  flex: 2;
}

.footer-kala-vector-container img {
  width: 100%;
  height: auto;
}

/*  */
.perspective-hover-container { 
  perspective: 900px; 
  perspective-origin: 50% 50%; 
}
.perspective-hover-element { 
  transform-style: preserve-3d; 
  transform-origin: 50% 50%; 
  will-change: transform; 
  transition: transform 160ms ease; 
}
/*  */

.footer-logo-container-2 {
  display: none;
}

.footer-links-2 {
  margin-top: 30px;
}

.footer-links-2 a {
  cursor: alias;
}

.footer-links-container {
  width: 100%;
  min-width: 370px;
  padding: var(--side-padding);
  display: block;
  flex: 1;
}

.footer-logo-container {
  flex: 1;
}

.footer-logo-container img {
  width: 100%;
  height: auto;
  max-height: 240px;
}

.footer-links-container ul {
  margin-top: 10px;
}

.footer-links-container ul li {
  border-bottom: 1px dashed var(--tx);
  font-size: 14px;
  list-style: none;
  transition: color 180ms ease;
  
  margin-top: 4px;
}

.footer-links-container ul li a {
  padding: 10px 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  transition: background-color 140ms ease, color 180ms ease, padding 100ms ease;
}

.footer-links-container ul li .right-arrow {
  height: .8em;
}

.footer-links-container ul li a:hover {
  color: var(--cf);
  background-color: var(--tx);
  padding: 10px 10px;
  font-style: italic;
}

.footer-links-container ul li a:hover .right-arrow {
  animation: rotate 300ms ease-in-out forwards;
  filter: grayscale(0) brightness(1);
}

@keyframes rotate {
  from {
    rotate: 0deg;
  }
  to {
    rotate: 360deg;
  }
}

@keyframes loopX-simplified {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.footer-container-2 {
  overflow: hidden;
  border: var(--border);
  background-image: url(assets/dot-texture-bg.svg);
  background-position: center;
  position: relative;
}

.footer-kala-text-vector-loop-container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: fit-content;
  padding: var(--side-padding) 0;
  animation: loopX-simplified 20s linear infinite;
}

.footer-kala-text-vector-loop-container img {
  height: clamp(200px, 26vw, 300px);
}

.footer-container-3 {
  display: flex;
  justify-content: space-between;
  padding: 20px 0;
  align-items: center;
  font-size: 14px;
  position: relative;
}

.footer-container-3 .footer-small-logo img {
  height: 36px;
}

.next-page {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: fit-content;
  transition: color 100ms ease;
  align-items: center;
}

.next-page .right-arrow {
  height: .9em;
  width: auto;
}

.next-page:hover {
  color: var(--cf);
}
.next-page:hover:hover .right-arrow {
  animation: rotate 300ms ease-in-out forwards;
}

.copyright {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 0 20px;
}

/*  */

.scroll-hint-loading {
  position: fixed;
  bottom: 14px;
  right: var(--side-padding);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.3s ease;
}

.scroll-hint-loading.active {
  opacity: 1;
  pointer-events: auto;
}

#scroll-hint-bar {
  position: relative;
  width: 120px;
  height: 1px;
  padding: 4px;
  border-radius: 1em;
  border: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.scroll-hint-bar-fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 4px;
  width: 0%;
  border: none;
  border-top: 2px dashed var(--tx);
  transition: width 0.2s ease;
}

@media (max-width: 1080px) {
  footer {
    margin-top: 120px;
  }
}
@media (max-width: 980px) {
  
  .footer-kala-vector-container-wrapper {
    border: none;
    padding: 0;
    gap: 0;
    flex-direction: row;
    position: relative;
    width: 100%;
  }
  .footer-kala-vector-container-wrapper > * {
    border: var(--border);
    padding: var(--side-padding);
    width: fit-content;
    border-bottom: none;
    overflow: hidden;
  }
  .footer-kala-vector-container img,
  .footer-logo-container-2 img {
    width: 100%;
  }
  .footer-logo-container-1 {
    display: none;
  }
  .footer-logo-container-2 {
    display: flex;
    border-left: none;
    align-items: center;
    justify-content: center;
    flex: 1;
  }
  .footer-kala-vector-container {
    flex: 3.35;
  }
  .footer-container-1 {
    flex-direction: column;
  }
  .footer-links-container {
    border-left: var(--border) !important;
  }
  .footer-links-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
  .footer-links-container a {
    gap: 20px;
  }
  .footer-links {
    width: 100%;
  }
  .footer-links-2 {
    margin-top: 0;
  }
}

@media (max-width: 746px) {
  #menu-container {
    right: 0;
    left: 0;
    width: 100%;
  }
}

@media (max-width: 500px) {
  .footer-container-3 {
    padding-top: 3em;
  }
  .copyright {
    width: 100%;
    padding: 0;
    top: 1em;
  }
}

@media (max-width: 410px) {
  .footer-links-container {
    min-width: auto;
    display: block;
  }
  .footer-links-2 {
    margin-top: 30px;
  }
}

/*  */

/* Disable hover styles on touch devices */
@media (hover: none) and (pointer: coarse) {
  .hover-text-parent:hover .hover-text {
    opacity: 0;
  }
}
/* Hide toggle on touch (coarse pointer) */
@media (hover: none), (pointer: coarse) {
  #smoothToggle { display: none; }
}