:root {
  --anim-duration: 1s;
  --not-black: #1e1e1e;
  --bg-colour: #dfddd1;
  --text-colour: #848484;
  --overlay-bgColour: #1b1b1b;
  --menu-text-color: #e9e9de;
  --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

@font-face {
  font-family: "Helvetica";
  src: url("../fonts/helvetica.ttf");
}

@font-face {
  font-family: "Khula";
  src: url("../fonts/Jaldi-Bold.ttf");
  src: url("../fonts/Jaldi-Regular.ttf");
}

@font-face {
  font-family: "Harabara";
  src: url("../fonts/harabara.otf");
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-colour);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a:link, a:visited {
  font-size: 15px;
  font-family: 'Khula';
  text-decoration: none;
  color: var(--text-colour);
}

/* ============================================
   GENERATIVE ART BACKGROUND CONTAINER
   ============================================ */
#generative-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  filter: blur(0.5px);
}

#generative-bg canvas,
#generative-bg iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Chromatic aberration overlay */
#generative-bg::before,
#generative-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.03;
}

#generative-bg::before {
  background: linear-gradient(90deg, rgba(255,0,0,1) 0%, transparent 50%);
  transform: translateX(-2px);
}

#generative-bg::after {
  background: linear-gradient(90deg, transparent 50%, rgba(0,255,255,1) 100%);
  transform: translateX(2px);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
div.main {
  margin: auto;
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 1;
}

.main {
  transition: 0.5s;
}

/* ============================================
   LOGO BOX - Fluid responsive sizing
   ============================================ */
div.logoBox {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--not-black);
  position: fixed;
  top: -100px;
  left: clamp(15px, 3vw, 30px);
  width: clamp(50px, 7vw, 85px);
  height: clamp(50px, 7vw, 85px);
  z-index: 1000;
  transition: background-color 0.4s var(--transition-smooth);
}

.imgLogo {
  opacity: 0;
  width: clamp(45px, 6vw, 75px);
  height: auto;
  transition: fill 0.4s var(--transition-smooth);
}

/* Logo inversion when menu is open */
.menu-open div.logoBox {
  background-color: var(--bg-colour);
}

.menu-open .imgLogo {
  fill: var(--not-black) !important;
}

/* ============================================
   MENU TOGGLE BUTTON - Fluid responsive
   ============================================ */
div.menuOpen {
  position: fixed;
  right: clamp(15px, 3vw, 30px);
  top: -100px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menuOpen a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.nav-icon {
  --box-size: clamp(28px, 3.5vw, 36px);
  width: var(--box-size);
  height: var(--box-size);
  position: relative;
  cursor: pointer;
  background-color: var(--not-black);
  box-sizing: border-box;
}

.nav-icon div {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-colour);
  border-radius: 1px;
  height: 2px;
  width: 60%;
  transition: all 0.3s var(--transition-smooth);
}

.nav-icon div:nth-child(1) { top: 30%; }
.nav-icon div:nth-child(2) { top: 50%; transform: translateX(-50%) translateY(-50%); }
.nav-icon div:nth-child(3) { bottom: 30%; }

/* Menu open state - hamburger to X */
.nav-icon.open {
  background-color: transparent;
}

.nav-icon.open div:nth-child(1) {
  top: 50%;
  transform: translateX(-50%) translateY(-50%) rotate(45deg);
  background-color: var(--bg-colour);
}

.nav-icon.open div:nth-child(2) {
  opacity: 0;
  transform: translateX(-50%) scaleX(0);
}

.nav-icon.open div:nth-child(3) {
  bottom: auto;
  top: 50%;
  transform: translateX(-50%) translateY(-50%) rotate(-45deg);
  background-color: var(--bg-colour);
}

/* Cross Mark (legacy - keeping for compatibility) */
div.crossMark {
  position: relative;
  font-size: 25px;
  color: white;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s var(--transition-smooth);
}

div.crossMark:hover {
  transform: rotate(90deg);
}

.toggleImg {
  opacity: 0;
}

/* ============================================
   BACK CHEVRON - Fluid responsive
   ============================================ */
.backChevron {
  position: fixed;
  bottom: clamp(20px, 4vh, 50px);
  left: clamp(15px, 3vw, 50px);
  font-size: clamp(28px, 5vw, 54px);
  color: var(--menu-text-color);
  cursor: pointer;
  opacity: 0;
  z-index: 1001;
  transition: opacity 0.3s var(--transition-smooth),
              transform 0.3s var(--transition-smooth);
  font-family: 'Helvetica', sans-serif;
  font-weight: 200;
}

.backChevron:hover {
  transform: translateX(-8px);
}

.backChevron.visible {
  opacity: 1;
}

/* ============================================
   TITLE / CENTER CONTENT - Fluid responsive
   ============================================ */
div.titleTableBox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 23;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: clamp(100px, 14vh, 180px);
  padding-left: clamp(40px, 6vw, 120px);
  padding-right: clamp(40px, 6vw, 120px);
}

.titleTableBox {
  font-family: 'Harabara';
  text-align: left;
  font-weight: normal;
  color: black;
}

.titleTableBox table {
  width: auto;
  height: auto;
  border-collapse: collapse;
}

.titleTableBox td {
  padding: clamp(5px, 1vw, 15px);
}

div.centerTableBox {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.centerTableBox svg {
  width: 100%;
  max-width: clamp(200px, 50vw, 650px);
  height: auto;
}

/* Block ASCII Logo Styles - Fluid responsive */
.block-logo {
  font-family: 'Menlo', 'Monaco', 'Consolas', 'Lucida Console', 'Courier New', monospace;
  color: var(--not-black);
  text-align: left;
  margin: 0;
  line-height: 1.0;
  /* Fluid font size based on viewport */
  font-size: clamp(6px, 1.2vw, 16px);
  white-space: pre;
  letter-spacing: -0.02em;
  opacity: 0.85;
}

/* Corner marker boxes - Fluid sizing */
div.topLeftMarkerBox,
div.topRightMarkerBox,
div.bottomRightMarkerBox,
div.bottomLeftMarkerBox {
  position: relative;
  width: clamp(18px, 4vw, 50px);
  height: clamp(10px, 2.2vw, 28px);
}

div.topLeftMarkerBox svg,
div.topRightMarkerBox svg,
div.bottomRightMarkerBox svg,
div.bottomLeftMarkerBox svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   LOADING BOX
   ============================================ */
div.loadingBox {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-colour);
  border-top-color: var(--not-black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   MENU OVERLAY - RADIAL WIPE TRANSITION
   ============================================ */
div.overlayTintBox {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: var(--overlay-bgColour);
  visibility: hidden;
  z-index: 500;

  /* Flexbox for menu layout */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(80px, 12vh, 160px) clamp(15px, 5vw, 100px) clamp(60px, 10vh, 140px) clamp(20px, 6vw, 120px);

  /* Radial clip-path - starts invisible */
  clip-path: circle(0% at var(--wipe-x, 95%) var(--wipe-y, 3%));
  -webkit-clip-path: circle(0% at var(--wipe-x, 95%) var(--wipe-y, 3%));
}

/* Menu open animation - radial wipe with bounce */
.menuOpen-anim {
  animation: radialWipeIn 0.6s var(--transition-bounce) forwards;
}

/* Menu close animation */
.menuClose-anim {
  animation: radialWipeOut 0.4s var(--transition-smooth) forwards;
}

@keyframes radialWipeIn {
  0% {
    clip-path: circle(0% at var(--wipe-x, 95%) var(--wipe-y, 3%));
    -webkit-clip-path: circle(0% at var(--wipe-x, 95%) var(--wipe-y, 3%));
  }
  100% {
    clip-path: circle(150% at var(--wipe-x, 95%) var(--wipe-y, 3%));
    -webkit-clip-path: circle(150% at var(--wipe-x, 95%) var(--wipe-y, 3%));
  }
}

@keyframes radialWipeOut {
  0% {
    clip-path: circle(150% at var(--wipe-x, 95%) var(--wipe-y, 3%));
    -webkit-clip-path: circle(150% at var(--wipe-x, 95%) var(--wipe-y, 3%));
  }
  100% {
    clip-path: circle(0% at var(--wipe-x, 95%) var(--wipe-y, 3%));
    -webkit-clip-path: circle(0% at var(--wipe-x, 95%) var(--wipe-y, 3%));
    visibility: hidden;
  }
}

/* ============================================
   MENU ITEMS - Fluid responsive, left aligned
   ============================================ */
.menuItems {
  position: relative;
  opacity: 0;
  cursor: pointer;
  margin: clamp(5px, 1.5vh, 20px) 0;
}


.menuText {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: bold;
  font-size: clamp(70px, 15vh, 150px);
  letter-spacing: -0.03em;
  color: #E9E9DE;
  line-height: 0.85;
  -webkit-text-stroke: 1px transparent;
  transition: color 0.8s ease, -webkit-text-stroke 0.8s ease;
}

.menuItems:hover .menuText {
  color: transparent;
  -webkit-text-stroke: 1px #E9E9DE;
}

.menuImg {
  height: clamp(50px, 12vh, 130px);
  width: auto;
  display: block;
  transition: fill 0.3s var(--transition-smooth);
}

/* Normalize menu SVG visual heights - compensate for different viewBox ratios */
/* Base height ~103 units, blog has 130 units so needs 1.26x scale */
.reelMenu .menuImg { height: clamp(50px, 12vh, 130px); }
.labMenu .menuImg { height: clamp(50px, 12vh, 130px); }
.codeMenu .menuImg { height: clamp(50px, 12vh, 130px); }
.blogMenu .menuImg { height: clamp(63px, 15.1vh, 164px); } /* Scaled up 1.26x to match visual height */
.emailMenu .menuImg { height: clamp(50px, 12vh, 130px); }

.menuImg:hover {
  fill: var(--bg-colour);
}

/* ============================================
   CIRCLE CURSOR
   ============================================ */
.circle {
  position: fixed;
  border: 2px solid var(--not-black);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease, width 0.2s ease, height 0.2s ease;
  mix-blend-mode: difference;
}

.circle.visible {
  opacity: 0.6;
}

.circle.clicking {
  width: 30px;
  height: 30px;
}

/* Hide on touch devices */
@media (hover: none) and (pointer: coarse) {
  .circle {
    display: none !important;
  }
}

/* ============================================
   IFRAME / LIGHTBOX
   ============================================ */
div.iframeBox {
  display: none;
  position: absolute;
  right: 0px;
  bottom: 0px;
  z-index: 600;
}

/* ============================================
   FORM STYLES
   ============================================ */
input[type=text], select {
  font-size: 12px;
  font-family: 'Khula';
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

input[type=submit] {
  font-size: 12px;
  font-family: 'Khula';
  width: 100%;
  background-color: #629c5f;
  color: white;
  padding: 14px 20px;
  margin: 8px 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

textarea {
  font-size: 12px;
  font-family: 'Khula';
  width: 100%;
  height: 150px;
  padding: 12px 20px;
  box-sizing: border-box;
  border: 2px solid #ccc;
  border-radius: 4px;
  background-color: #f8f8f8;
  resize: none;
}

/* ============================================
   FEATHERLIGHT
   ============================================ */
body .featherlight .featherlight-content {
  border-radius: 5px;
}

/* ============================================
   LAB BOX
   ============================================ */
div.labBox {
  position: absolute;
  margin: 0 auto;
  width: 80%;
}

.container {
  width: 100%;
}

.caption {
  bottom: 0px;
}

#wrapper td {
  vertical-align: middle;
  text-align: center;
}

.centereddiv {
  background-color: #000;
  position: absolute;
  width: 650px;
  height: 100px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden !important;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .menuOpen,
  .overlayTintBox,
  .loadingBox,
  #generative-bg {
    display: none !important;
  }
}

/* ============================================
   PAGE TRANSITIONS
   Note: All transitions should be animated and seamless
   ============================================ */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--not-black);
  z-index: 10000;
  transform: translateX(-100%);
  transition: transform 0.5s var(--transition-smooth);
}

.page-transition.active {
  transform: translateX(0);
}

.page-transition.exit {
  transform: translateX(100%);
}

/* ============================================
   EMAIL PAGE
   ============================================ */
body.email-page {
  background-color: var(--not-black);
  overflow-y: auto;
}

.email-container {
  max-width: 600px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 100px) clamp(20px, 5vw, 60px);
  opacity: 0;
}

.email-back {
  position: fixed;
  top: clamp(20px, 4vh, 40px);
  left: clamp(20px, 4vw, 40px);
  font-size: clamp(40px, 8vw, 80px);
  color: #E9E9DE;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.3s var(--transition-smooth), opacity 0.3s ease;
  z-index: 100;
}

.email-back:hover {
  transform: translateX(-5px);
  opacity: 0.7;
}

.email-title {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: bold;
  font-size: clamp(60px, 12vw, 120px);
  letter-spacing: -0.03em;
  color: #E9E9DE;
  line-height: 0.85;
  margin: 0 0 clamp(30px, 6vh, 60px) 0;
}

.email-form {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4vh, 35px);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(12px, 2vw, 14px);
  color: #E9E9DE;
  opacity: 0.6;
  text-transform: lowercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(233, 233, 222, 0.3);
  padding: 12px 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(16px, 3vw, 20px);
  color: #E9E9DE;
  outline: none;
  transition: border-color 0.3s ease;
  width: 100%;
  resize: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-bottom-color: #E9E9DE;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(233, 233, 222, 0.3);
}

.form-group textarea {
  border: 1px solid rgba(233, 233, 222, 0.3);
  padding: 12px;
  min-height: 150px;
}

.form-group textarea:focus {
  border-color: #E9E9DE;
}

.submit-btn {
  align-self: flex-start;
  background: transparent;
  border: 1px solid #E9E9DE;
  color: #E9E9DE;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: bold;
  font-size: clamp(14px, 2.5vw, 18px);
  padding: clamp(12px, 2vh, 18px) clamp(30px, 5vw, 50px);
  cursor: pointer;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  transition: background-color 0.4s ease, color 0.4s ease, transform 0.2s ease;
  position: relative;
}

.submit-btn:hover {
  background-color: #E9E9DE;
  color: var(--not-black);
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn .btn-loading {
  display: none;
}

.submit-btn.loading .btn-text {
  display: none;
}

.submit-btn.loading .btn-loading {
  display: inline;
}

.submit-btn.loading {
  opacity: 0.7;
  cursor: wait;
}

.form-message {
  margin-top: 20px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(14px, 2.5vw, 16px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.form-message.visible {
  opacity: 1;
}

.form-message.success {
  color: #8fbf8f;
}

.form-message.error {
  color: #bf8f8f;
}
