/* Mobile Responsive Styles - UltraHeavy */

/* Tablet and below */
@media (max-width: 768px) {
  /* Navigation */
  .phantom-header {
    padding: 1rem;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
  }
  
  .phantom-header.revealed {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  }
  
  .constellation-nav {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }
  
  .nav-home {
    display: none; /* Hide home glyph on mobile */
  }
  
  .nav-nodes {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    background: var(--color-shadow);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 1rem;
  }
  
  .nav-node {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .nav-node:last-child {
    border-bottom: none;
  }
  
  .nav-link {
    font-size: 1rem;
    padding: 1.2rem;
    display: block;
    width: 100%;
    text-align: center;
    background: transparent;
    transition: background var(--transition-base);
  }
  
  .nav-link:active {
    background: rgba(0, 255, 136, 0.1);
  }
  
  /* Hide cipher codes on mobile */
  .nav-link .cipher {
    display: none;
  }
  
  /* Show text content directly */
  .nav-link::after {
    display: none; /* Hide the CSS ::after */
  }
  
  /* Homepage */
  .hero-void {
    margin: 2rem 0;
  }
  
  .brand-glyph {
    font-size: clamp(2rem, 8vw, 3.5rem);
    letter-spacing: 0.1em;
  }
  
  .tagline-cipher {
    font-size: 1rem;
    padding: 0 1rem;
  }
  
  .void-key {
    width: 70px;
    height: 70px;
    font-size: 1.5rem;
  }
  
  /* Console */
  .developer-console {
    height: 50vh;
    max-height: 400px;
  }
  
  .console-trigger {
    display: none; /* Hide on mobile */
  }
  
  /* Footer */
  .shadow-footer {
    padding: 1rem;
  }
  
  /* Code Rain - Reduce for performance */
  .rain-column {
    display: none;
  }
  
  .rain-column:nth-child(3n) {
    display: block; /* Show every 3rd column */
  }
  
  /* Capabilities Page */
  .realms-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .realm-card {
    min-height: 250px;
  }
  
  .realm-surface {
    padding: 1.5rem;
  }
  
  .realm-title {
    font-size: 1.5rem;
  }
  
  /* Timeline Page */
  .timeline-track {
    padding-left: 2rem;
  }
  
  .node-marker {
    left: -2.5rem;
  }
  
  .timeline-node {
    margin-bottom: 2rem;
  }
  
  .node-content {
    padding: 1rem;
  }
  
  .node-title {
    font-size: 1.2rem;
  }
  
  .tech-stack {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .timeline-stats .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .scroll-indicator {
    right: 1rem;
    bottom: 3rem;
  }
  
  /* Laboratory Page */
  .experiments-grid {
    grid-template-columns: 1fr;
  }
  
  .experiment-module {
    margin-bottom: 1rem;
  }
  
  .experiment-canvas {
    min-height: 200px;
  }
  
  .generative-canvas {
    width: 100%;
    max-width: 300px;
    height: auto;
  }
  
  /* Portal Page */
  .lock-display {
    transform: scale(0.7);
    margin: 0 auto 2rem;
  }
  
  .puzzle-controls {
    gap: 1rem;
  }
  
  .ring-control {
    width: 45px;
    height: 45px;
  }
  
  .ethereal-form {
    padding: 1.5rem;
  }
  
  .form-field {
    margin-bottom: 1.5rem;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  /* Global */
  main {
    padding: 1rem;
  }
  
  /* Navigation - Hamburger style for mobile */
  .phantom-header.revealed {
    background: rgba(10, 10, 10, 0.95);
  }
  
  .nav-nodes {
    background: var(--color-shadow);
    border-radius: 4px;
    padding: 0.5rem;
  }
  
  /* Homepage */
  .brand-glyph {
    font-size: 2rem;
    gap: 0.05em;
  }
  
  .letter {
    display: inline-block;
  }
  
  .tagline-cipher {
    font-size: 0.9rem;
  }
  
  /* Page Headers */
  .page-title {
    font-size: 2rem;
    letter-spacing: 0.1em;
  }
  
  /* Capabilities */
  .realm-pattern pre {
    font-size: 0.6rem;
  }
  
  .capability-list {
    font-size: 0.9rem;
  }
  
  /* Timeline */
  .temporal-bridge {
    display: block;
    margin: 0.5rem 0;
  }
  
  .timeline-track {
    padding-left: 1.5rem;
  }
  
  .node-marker {
    left: -2rem;
    width: 10px;
    height: 10px;
  }
  
  .timeline-node:hover .node-marker,
  .timeline-node.major .node-marker {
    width: 12px;
    height: 12px;
    left: -2.1rem;
  }
  
  /* Laboratory */
  .experiment-controls {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .control-slider {
    width: 100%;
  }
  
  .playground-editor {
    font-size: 0.8rem;
  }
  
  /* Portal */
  .portal-gate {
    padding: 2rem 1rem;
  }
  
  .lock-display {
    transform: scale(0.6);
  }
  
  .puzzle-hint {
    font-size: 0.85rem;
  }
  
  .alternative-path {
    padding: 1rem;
  }
  
  .encoded-address {
    flex-direction: column;
    padding: 1rem;
  }
}

/* Touch-specific adjustments */
@media (hover: none) and (pointer: coarse) {
  /* Hide binary codes completely on touch devices */
  .cipher {
    display: none !important;
  }
  
  /* Show text directly */
  .nav-link::after {
    content: attr(data-text);
    position: static;
    opacity: 1;
    transform: none;
  }
  
  /* Make touch targets larger */
  .nav-link {
    padding: 1rem;
  }
  
  .void-key {
    width: 80px;
    height: 80px;
  }
  
  .ring-control {
    width: 60px;
    height: 60px;
  }
  
  /* Add active states for touch feedback */
  .void-key:active {
    transform: scale(0.95);
  }
  
  .nav-link:active {
    background: rgba(0, 255, 136, 0.1);
  }
  
  /* Simplify realm cards for touch */
  .realm-card .realm-revelation {
    position: static;
    opacity: 1;
    transform: none;
    margin-top: 1rem;
    border-top: 1px solid var(--color-glow);
    padding-top: 1rem;
  }
  
  .realm-card:hover .realm-revelation,
  .realm-card:focus .realm-revelation {
    opacity: 1;
    transform: none;
  }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-void {
    margin: 1rem 0;
  }
  
  .brand-glyph {
    font-size: 1.5rem;
  }
  
  .developer-console {
    height: 80vh;
  }
}

/* High resolution mobile displays */
@media (-webkit-min-device-pixel-ratio: 2) and (max-width: 768px),
       (min-resolution: 192dpi) and (max-width: 768px) {
  /* Optimize for retina displays */
  .quantum-field,
  .temporal-field,
  .lab-particles,
  .portal-void {
    filter: blur(50px); /* Less blur for performance */
  }
  
  .code-rain {
    opacity: 0.05; /* Reduce opacity for performance */
  }
}