@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Sleek Minimalist Slate Colors */
  --bg-main: #0c0b10;
  --bg-card: rgba(20, 19, 26, 0.75);
  --bg-card-hover: rgba(28, 27, 36, 0.9);
  --border-fine: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  --accent-blue: #38bdf8;
  --accent-purple: #c084fc;
  
  --font-header: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition-smooth: 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(192, 132, 252, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Glassmorphism utility */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-fine);
  border-radius: 20px;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-smooth);
}

.glass:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Base experience wrappers */
.experience-container {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== DESKTOP EXPERIENCE (APPLE MINIMALIST) ==================== */
#desktop-experience {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
}

.apple-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-fine);
  position: sticky;
  top: 0;
  background: rgba(12, 11, 16, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
}

.apple-header .logo {
  font-family: var(--font-header);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
}

.apple-nav {
  display: flex;
  gap: 2rem;
}

.apple-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.apple-nav a:hover {
  color: var(--text-primary);
}

.btn-apple-nav {
  background: var(--text-primary);
  color: var(--bg-main);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.btn-apple-nav:hover {
  opacity: 0.9;
}

.apple-main {
  display: flex;
  flex-direction: column;
  gap: 8rem;
  padding: 6rem 0;
}

/* Hero Section */
.apple-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 800px;
}

.hero-title {
  font-family: var(--font-header);
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 1.5rem;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.35rem;
  color: var(--text-secondary);
  line-height: 1.5;
  font-weight: 400;
  margin-bottom: 2.5rem;
  max-width: 680px;
}

.hero-cta {
  display: flex;
  gap: 1.2rem;
}

.btn-apple-primary {
  background: var(--text-primary);
  color: var(--bg-main);
  padding: 0.8rem 1.8rem;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid var(--text-primary);
}

.btn-apple-primary:hover {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.btn-apple-secondary {
  color: var(--text-primary);
  background: transparent;
  padding: 0.8rem 1.8rem;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.btn-apple-secondary:hover {
  color: var(--text-secondary);
}

/* Statement Section */
.apple-statement {
  border-top: 1px solid var(--border-fine);
  border-bottom: 1px solid var(--border-fine);
  padding: 5rem 0;
}

.statement-container {
  max-width: 800px;
}

.statement-title {
  font-family: var(--font-header);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.statement-body {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Expertise Section */
.apple-expertise {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.expertise-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-fine);
  border-radius: 20px;
  padding: 2.5rem;
  transition: all var(--transition-smooth);
}

.expertise-card:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-4px);
}

.expertise-icon {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.expertise-card h3 {
  font-family: var(--font-header);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.expertise-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Terminal Section */
.apple-pitch-terminal {
  display: flex;
  justify-content: center;
}

.terminal-card {
  width: 100%;
  max-width: 650px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-fine);
  background: rgba(15, 14, 20, 0.7);
}

.terminal-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-fine);
}

.terminal-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-header .red { background-color: #ef4444; }
.terminal-header .yellow { background-color: #f59e0b; }
.terminal-header .green { background-color: #10b981; }

.terminal-title {
  margin-left: 10px;
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.terminal-body {
  padding: 1.5rem;
  font-family: monospace;
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.terminal-line {
  margin-bottom: 0.4rem;
}

.terminal-line.output {
  color: #cbd5e1;
}

.terminal-prompt {
  color: #38bdf8;
  margin-right: 8px;
}

.terminal-cursor {
  animation: blink 1s infinite;
  color: var(--text-primary);
}

.json-key { color: #f472b6; }
.json-val { color: #34d399; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Footer Section */
.apple-footer {
  border-top: 1px solid var(--border-fine);
  padding: 5rem 0;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.apple-footer h2 {
  font-family: var(--font-header);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
}

.apple-footer p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2rem;
}

.footer-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-secondary);
}

.footer-separator {
  color: var(--text-muted);
}

.footer-copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==================== MOBILE AR EXPERIENCE ==================== */
#mobile-experience {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: black;
  z-index: 1000;
}

#camera-stream {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Scanner HUD layout */
.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
  padding: 2rem;
  background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.7) 100%);
  pointer-events: none;
}

.scanner-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.logo-mobile {
  font-family: var(--font-header);
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
}

.logo-thin {
  font-weight: 300;
  color: var(--text-secondary);
}

.scan-status {
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  color: #34d399;
  font-weight: 500;
  animation: pulse 1.5s infinite;
}

.scanner-frame {
  width: 250px;
  height: 250px;
  align-self: center;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid white;
}

.top-left { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.top-right { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.bottom-left { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.bottom-right { bottom: -2px; right: -2px; border-left: none; border-top: none; }

.laser-scanner {
  position: absolute;
  width: 100%;
  height: 2px;
  background: rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
  animation: scan 2s linear infinite;
}

.scanner-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  pointer-events: auto;
}

.scan-instructions {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  text-align: center;
  max-width: 280px;
}

.btn-action-mobile {
  background: white;
  color: black;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-action-mobile:active {
  transform: scale(0.95);
}

.btn-action-mobile.outline {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

/* AR Card Overlay styles */
.ar-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 3rem 2rem;
  background: rgba(0, 0, 0, 0.4);
  perspective: 1200px; /* Perspective added on parent container to enable true 3D rotations on absolute children */
}

.card-link {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
  cursor: pointer;
  pointer-events: auto;
}

.card-link:hover {
  color: var(--text-primary);
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.ar-card-wrapper {
  margin-top: auto;
  margin-bottom: auto;
  width: 300px;
  height: 180px;
  perspective: 1200px;
}

.business-card-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  cursor: pointer;
}

.business-card-3d.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-front {
  background: linear-gradient(135deg, #181720, #0d0c12);
}

.card-back {
  background: linear-gradient(135deg, #0d0c12, #181720);
  transform: rotateY(180deg);
}

.card-logo {
  font-family: var(--font-header);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  border: 1.5px solid var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-name {
  font-family: var(--font-header);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-role {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.card-contact {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.card-back-header {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 4px;
}

.card-back-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
  width: 100%;
}

.contact-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 4px;
}

.contact-val {
  color: var(--text-primary);
  font-family: monospace;
}

.card-footer {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-align: center;
}

.ar-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 250px;
}

/* Dynamic Keyframes */
@keyframes scan {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

@keyframes pulse {
  0% { opacity: 0.75; }
  50% { opacity: 1; }
  100% { opacity: 0.75; }
}

@keyframes floatCard {
  0% { transform: translateY(0px) rotateX(10deg) rotateY(15deg); }
  50% { transform: translateY(-10px) rotateX(8deg) rotateY(20deg); }
  100% { transform: translateY(0px) rotateX(10deg) rotateY(15deg); }
}

/* ==================== MODAL OVERLAYS ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 90%;
  max-width: 500px;
  padding: 2.5rem;
  transform: scale(0.95);
  transition: transform var(--transition-smooth);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-family: var(--font-header);
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

/* ==================== RESPONSIVE/ORIENTATION DETECT ==================== */
/* Device adaptation rule: Mobile/portrait displays camera scanner; Desktop/landscape displays bento grid */
@media (max-width: 768px) and (orientation: portrait) {
  #desktop-experience {
    display: none !important;
  }
  #mobile-experience {
    display: flex !important;
  }
}

@media (min-width: 769px) {
  #desktop-experience {
    display: flex !important;
  }
  #mobile-experience {
    display: none !important;
  }
}

/* Specific styling for grid layout on medium/small viewports */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  #card-profile {
    grid-column: span 2;
  }
  #card-repos {
    grid-column: span 2;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
  #card-profile, #card-repos, #card-experience, #card-3d-preview {
    grid-column: span 1;
  }
}
