/* =========================================
   THEME VARIABLES
   ========================================= */
:root,
[data-theme="midnight"] {
  --bg: #070707;
  --fg: #f4f4f4;
  --muted: #555555;
  --accent: #ffffff;
  --glow: rgba(255, 255, 255, 0.03);
  --grid: rgba(255, 255, 255, 0.05);
}

[data-theme="bone"] {
  --bg: #e4e5e0;
  --fg: #0a0a0a;
  --muted: #888888;
  --accent: #000000;
  --glow: rgba(0, 0, 0, 0.05);
  --grid: rgba(0, 0, 0, 0.06);
}

[data-theme="acid"] {
  --bg: #0b0c10;
  --fg: #ccff00; /* Neon Lime */
  --muted: #4a4e69;
  --accent: #ff00ff; /* Neon Pink */
  --glow: rgba(204, 255, 0, 0.1);
  --grid: rgba(204, 255, 0, 0.08);
}

/* STRICT 100VH LOCK */
html,
body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg);
  color: var(--fg);
  font-family: "Space Mono", monospace;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.6s ease, color 0.6s ease;
}

@media (hover: hover) and (pointer: fine) {
  body,
  a,
  button,
  input,
  textarea {
    cursor: none !important;
  }
}

/* =========================================
   IMMERSIVE BACKGROUND EFFECTS
   ========================================= */
.noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.06;
  background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.75" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

.ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80vw;
  height: 80vh;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
  transition: background 0.6s ease;
}

.ui-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 0;
  pointer-events: none;
  transition: background-image 0.6s ease;
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  z-index: 10000;
  pointer-events: none;
}
.cursor-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  transition: background-color 0.6s ease;
}
.cursor-outline {
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 1px solid var(--muted);
}
@media (hover: none) and (pointer: coarse) {
  .cursor-dot,
  .cursor-outline {
    display: none !important;
  }
}

/* =========================================
   ABSOLUTE 4-CORNER LAYOUT 
   ========================================= */
#app-frame {
  position: relative;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  z-index: 1;
}

.corner {
  position: absolute;
  z-index: 10;
  max-width: 420px;
}
.top-left {
  top: 2.5rem;
  left: 2.5rem;
}
.top-right {
  top: 2.5rem;
  right: 2.5rem;
  text-align: right;
}
.bottom-left {
  bottom: 2.5rem;
  left: 2.5rem;
}
.bottom-right {
  bottom: 2.5rem;
  right: 2.5rem;
  text-align: right;
}

.label {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  transition: color 0.6s ease;
}
.corner p {
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}
.top-right p {
  font-size: 0.75rem;
  margin: 0 0 0.25rem 0;
}

ul.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
}
ul.vertical {
  flex-direction: column;
  gap: 0.5rem;
}
ul.horizontal {
  gap: 1.5rem;
  flex-wrap: wrap;
}
ul.align-right {
  justify-content: flex-end;
}
ul.nav-list a {
  color: var(--fg);
  text-decoration: none;
  font-family: "Syne", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  transition: color 0.3s;
}
ul.nav-list a:hover {
  color: var(--muted);
}

/* Theme Button */
.theme-btn {
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--fg);
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  padding: 0.5rem 1rem;
  letter-spacing: 0.1em;
  border-radius: 20px;
  transition: all 0.3s ease;
}
.theme-btn:hover {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

/* =========================================
   KINETIC MARQUEE (Fills empty space)
   ========================================= */
.marquee-container {
  position: absolute;
  top: 50%;
  left: -10vw;
  width: 120vw;
  transform: translateY(-50%) rotate(-5deg); /* Slanted agency look */
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.15; /* Subtle background texture */
}

.marquee-track {
  display: flex;
  white-space: nowrap;
  animation: marquee 20s linear infinite;
  font-family: "Syne", sans-serif;
  font-size: clamp(3rem, 6vw, 6rem);
  font-weight: 800;
  color: transparent;
  -webkit-text-stroke: 1px var(--fg);
}
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-33.33%);
  }
}

/* =========================================
   MASSIVE HERO TEXT
   ========================================= */
.hero-block {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 100%;
  pointer-events: none;
  z-index: 2;
  perspective: 1000px;
}
.hero-text {
  font-family: "Syne", sans-serif;
  font-size: clamp(4rem, 16vw, 15rem);
  font-weight: 800;
  line-height: 0.85;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition: color 0.6s ease;
}
.hero-text.outline {
  color: transparent;
  -webkit-text-stroke: 1px var(--muted);
  transition: -webkit-text-stroke 0.6s ease;
}

/* =========================================
   FORM OVERLAY
   ========================================= */
.hire-me-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 50;
  perspective: 1500px;
  display: none;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}
.hire-me-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
}
.hire-me-container.active .hire-me-inner {
  transform: rotateY(180deg);
}
.hire-me-front,
.hire-me-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}
.hire-me-back {
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
}
#contact-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}
#contact-form h2 {
  color: white;
  font-family: "Syne", sans-serif;
  font-size: 3rem;
  margin: 0 0 2rem 0;
  line-height: 1;
}
#contact-form input,
#contact-form textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid #555;
  padding: 1rem 0;
  font-family: "Space Mono", monospace;
  font-size: 0.85rem;
  color: white;
  outline: none;
  transition: border-color 0.3s;
  margin-bottom: 1rem;
  border-radius: 0;
  -webkit-appearance: none;
}
#contact-form input:focus,
#contact-form textarea:focus {
  border-bottom-color: white;
}
#contact-form textarea {
  height: 60px;
  resize: none;
}
#contact-form button[type="submit"] {
  background: white;
  color: black;
  padding: 1rem;
  margin-top: 1rem;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  border: none;
  transition: 0.3s;
}
#contact-form button[type="submit"]:hover {
  background: #888;
  color: white;
}
.close-btn {
  background: none !important;
  color: #888 !important;
  border: 1px solid #888 !important;
  padding: 0.8rem;
  margin-top: 1rem;
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
}
.close-btn:hover {
  border-color: white !important;
  color: white !important;
}

/* =========================================
   MOBILE RESPONSIVENESS
   EDITORIAL POSTER GRID
   ========================================= */

/* Hidden on desktop */
.hud-frame {
  display: none;
}

/* =========================================
   MOBILE — 768px AND BELOW
   ========================================= */

@media screen and (max-width: 768px) {
  /* -----------------------------------------
       GLOBAL MOBILE SAFETY
       ----------------------------------------- */

  html,
  body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  /* -----------------------------------------
       MAIN FRAME
       ----------------------------------------- */

  #app-frame {
    position: relative;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    min-height: 100dvh;
    height: auto;

    display: grid;

    grid-template-columns:
      minmax(0, 1fr)
      minmax(0, 1fr);

    grid-template-rows:
      auto
      auto
      minmax(220px, 1fr)
      auto;

    gap: clamp(1rem, 4vw, 1.5rem);

    padding: clamp(1rem, 5vw, 1.5rem);

    overflow-x: hidden;
    overflow-y: visible;
  }

  /* -----------------------------------------
       RESET DESKTOP POSITIONING
       ----------------------------------------- */

  .corner {
    position: static !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    transform: none !important;

    width: auto;
    max-width: 100%;
    min-width: 0;
  }

  /* =========================================
       TOP RIGHT
       ========================================= */

  .top-right {
    grid-column: 1 / -1;
    grid-row: 1;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    gap: 1rem;

    text-align: right;
  }

  .hide-mobile {
    display: block;

    margin-top: 0 !important;

    min-width: 0;
    max-width: 100%;
  }

  .hide-mobile p {
    margin: 0 0 0.25rem;

    font-size: clamp(0.55rem, 2vw, 0.7rem);

    line-height: 1.3;
  }

  .theme-btn {
    flex-shrink: 0;

    padding: 0.45rem 0.75rem;

    font-size: clamp(0.6rem, 2vw, 0.7rem);

    line-height: 1;

    white-space: nowrap;
  }

  /* =========================================
       TOP LEFT / ABOUT
       ========================================= */

  .top-left {
    grid-column: 1 / -1;
    grid-row: 2;

    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .top-left p {
    display: block;

    width: 100%;
    max-width: 600px;

    margin: 0;

    font-size: clamp(0.8rem, 3.5vw, 1rem);

    line-height: 1.5;

    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  /* =========================================
       HERO CONTAINER
       ========================================= */

  .hero-block {
    position: static !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    transform: none !important;

    grid-column: 1 / -1;
    grid-row: 3;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: stretch;

    box-sizing: border-box;

    overflow: visible;
  }

  /* =========================================
       HERO TEXT
       ========================================= */

  .hero-text {
    display: block;

    /*
         * IMPORTANT:
         * Never use max-content here.
         */
    width: 100%;
    max-width: 100%;
    min-width: 0;

    box-sizing: border-box;

    margin: 0;
    padding: 0;

    /*
         * Safe responsive size.
         */
    font-size: clamp(3.2rem, 14vw, 8rem);

    line-height: 0.82;

    /*
         * Tight spacing allows the whole
         * word to remain inside the viewport.
         */
    letter-spacing: -0.065em;

    white-space: nowrap;

    overflow: visible;

    /*
         * Prevent transforms from creating
         * unexpected horizontal overflow.
         */
    transform: none !important;
  }

  /* =========================================
       OMESH
       ========================================= */

  .hero-text:not(.outline) {
    width: 100%;
    max-width: 100%;

    align-self: flex-start;

    text-align: left;
  }

  /* =========================================
       RABHA
       ========================================= */

  .hero-text.outline {
    width: 100%;
    max-width: 100%;

    align-self: flex-end;

    text-align: right;
  }

  /* =========================================
       BOTTOM LEFT
       ========================================= */

  .bottom-left {
    grid-column: 1 / 2;
    grid-row: 4;

    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  /* =========================================
       BOTTOM RIGHT
       ========================================= */

  .bottom-right {
    grid-column: 2 / 3;
    grid-row: 4;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    text-align: right;
  }

  /* =========================================
       NAVIGATION
       ========================================= */

  ul.vertical {
    display: flex;

    flex-direction: column;

    gap: 0.35rem;

    margin: 0;
    padding: 0;
  }

  ul.horizontal {
    display: flex;

    flex-direction: column;

    gap: 0.35rem;

    justify-content: flex-end;

    align-items: flex-end;

    margin: 0;
    padding: 0;
  }

  ul.nav-list {
    margin: 0;
    padding: 0;
  }

  ul.nav-list a {
    display: inline-block;

    font-size: clamp(0.7rem, 3.5vw, 0.9rem);

    line-height: 1.2;

    white-space: nowrap;
  }

  .label {
    margin-bottom: 0.6rem;

    font-size: clamp(0.55rem, 2.5vw, 0.7rem);

    line-height: 1;
  }

  /* =========================================
       MARQUEE
       ========================================= */

  .marquee-container {
    position: absolute;

    width: 100%;
    max-width: 100%;

    top: 55%;

    opacity: 0.2;

    pointer-events: none;

    transform: translateY(-50%) rotate(-8deg);

    overflow: hidden;

    z-index: -1;
  }

  .marquee-track {
    font-size: clamp(2.5rem, 10vw, 4rem);

    line-height: 1;

    white-space: nowrap;
  }
}

/* =========================================
   SMALL PHONES
   480px AND BELOW
   ========================================= */

@media screen and (max-width: 480px) {
  #app-frame {
    grid-template-rows:
      auto
      auto
      minmax(190px, 1fr)
      auto;

    gap: 1rem;

    padding: 1rem;
  }

  /* -----------------------------------------
       TOP
       ----------------------------------------- */

  .top-right {
    gap: 0.75rem;

    align-items: center;
  }

  .hide-mobile p {
    font-size: 0.55rem;
  }

  .theme-btn {
    padding: 0.4rem 0.65rem;

    font-size: 0.6rem;
  }

  /* -----------------------------------------
       ABOUT
       ----------------------------------------- */

  .top-left p {
    font-size: 0.82rem;

    line-height: 1.45;
  }

  /* -----------------------------------------
       HERO
       ----------------------------------------- */

  .hero-text {
    /*
         * Smaller size for narrow screens.
         * This is the important overflow fix.
         */
    font-size: 13.5vw;

    line-height: 0.84;

    letter-spacing: -0.06em;

    width: 100%;
    max-width: 100%;
  }

  /* -----------------------------------------
       NAVIGATION
       ----------------------------------------- */

  ul.nav-list a {
    font-size: 0.72rem;
  }

  .label {
    font-size: 0.55rem;

    margin-bottom: 0.5rem;
  }

  /* -----------------------------------------
       MARQUEE
       ----------------------------------------- */

  .marquee-container {
    top: 52%;

    opacity: 0.15;
  }

  .marquee-track {
    font-size: 2.5rem;
  }
}

/* =========================================
   VERY SMALL PHONES
   360px AND BELOW
   ========================================= */

@media screen and (max-width: 360px) {
  #app-frame {
    padding: 0.8rem;

    gap: 0.8rem;
  }

  /* -----------------------------------------
       ABOUT
       ----------------------------------------- */

  .top-left p {
    font-size: 0.75rem;

    line-height: 1.4;
  }

  /* -----------------------------------------
       HERO
       ----------------------------------------- */

  .hero-text {
    /*
         * Extra safe for 320–360px devices.
         */
    font-size: 12.5vw;

    line-height: 0.85;

    letter-spacing: -0.055em;

    width: 100%;
    max-width: 100%;
  }

  /* -----------------------------------------
       BUTTON
       ----------------------------------------- */

  .theme-btn {
    padding: 0.35rem 0.5rem;

    font-size: 0.55rem;
  }

  /* -----------------------------------------
       NAV
       ----------------------------------------- */

  ul.nav-list a {
    font-size: 0.65rem;
  }
}

/* =========================================
   LANDSCAPE PHONES
   ========================================= */

@media screen and (max-width: 768px) and (orientation: landscape) {
  #app-frame {
    min-height: 100dvh;

    grid-template-columns:
      minmax(0, 1fr)
      minmax(0, 1fr);

    grid-template-rows:
      auto
      minmax(150px, 1fr)
      auto;

    gap: 1rem;

    padding: 1rem;
  }

  /* -----------------------------------------
       TOP
       ----------------------------------------- */

  .top-right {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  /* -----------------------------------------
       ABOUT
       ----------------------------------------- */

  .top-left {
    grid-column: 1 / 2;
    grid-row: 2;

    align-self: center;
  }

  .top-left p {
    font-size: 0.75rem;

    line-height: 1.4;
  }

  /* -----------------------------------------
       HERO
       ----------------------------------------- */

  .hero-block {
    grid-column: 2 / 3;
    grid-row: 2;

    justify-content: center;
  }

  .hero-text {
    width: 100%;
    max-width: 100%;

    /*
         * Landscape has much less height,
         * so use viewport width carefully.
         */
    font-size: 10vw;

    line-height: 0.82;

    letter-spacing: -0.06em;
  }

  /* -----------------------------------------
       BOTTOM
       ----------------------------------------- */

  .bottom-left {
    grid-column: 1 / 2;
    grid-row: 3;
  }

  .bottom-right {
    grid-column: 2 / 3;
    grid-row: 3;
  }

  /* -----------------------------------------
       MARQUEE
       ----------------------------------------- */

  .marquee-container {
    display: none;
  }
}

/* =========================================
   SHORT LANDSCAPE
   ========================================= */

@media screen and (max-width: 768px) and (orientation: landscape) and (max-height: 600px) {
  #app-frame {
    padding: 0.7rem 1rem;

    gap: 0.7rem;
  }

  .top-left p {
    display: none;
  }

  .hero-text {
    font-size: 8vw;

    line-height: 0.82;
  }

  .marquee-container {
    display: none;
  }
}

/* =========================================
   EXTRA SMALL HEIGHT
   ========================================= */

@media screen and (max-height: 600px) and (orientation: portrait) {
  .hero-block {
    min-height: 170px;
  }

  .hero-text {
    font-size: 12vw;
  }

  .marquee-container {
    opacity: 0.1;
  }
}
