@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Serif:wght@400;500;600&display=swap');

:root {
  /* Grounded Intelligence — letterpress palette from colorhunt.co/palette/1d4533f7eae0f9d2ba5e3122 */
  --forest: #1d4533;
  --forest-deep: #10281c;
  --forest-soft: #2a5741;
  --cream: #f7eae0;
  --peach: #f9d2ba;
  --cocoa: #5e3122;

  --bg-main: var(--forest-deep);
  --bg-card: rgba(42, 87, 65, 0.35);
  --bg-card-hover: rgba(42, 87, 65, 0.55);
  --border-fine: rgba(247, 234, 224, 0.1);
  --border-hover: rgba(247, 234, 224, 0.22);

  --text-primary: var(--cream);
  --text-secondary: rgba(247, 234, 224, 0.64);
  --text-muted: rgba(247, 234, 224, 0.38);

  --accent-blue: var(--peach);
  --accent-purple: var(--peach);

  --font-header: 'IBM Plex Serif', Georgia, serif;
  --font-body: 'IBM Plex Serif', Georgia, serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  --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(249, 210, 186, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(94, 49, 34, 0.18) 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: var(--forest-deep);
  z-index: 100;
}

.apple-header .logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
  /* flex + align-items:baseline, not plain inline layout: the pleats'
     overflow:hidden makes their CSS baseline their bottom edge instead of
     the text baseline, which visually shifted "ottens"/"ai" up and small
     against the "h" beside them. Flex baseline alignment sidesteps that. */
  display: inline-flex;
  align-items: baseline;
}

.logo-suffix {
  color: var(--peach);
}

.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, #f7eae0 0%, #d9c3b3 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(247, 234, 224, 0.03);
  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(247, 234, 224, 0.06);
  transform: translateY(-4px);
}

/* Alternate every other card with a warmer tint, so the section doesn't
   read as one uniform green block. */
.expertise-card:nth-child(even) {
  background: rgba(249, 210, 186, 0.09);
  border-color: rgba(249, 210, 186, 0.28);
}

.expertise-card:nth-child(even):hover {
  background: rgba(249, 210, 186, 0.14);
  border-color: rgba(249, 210, 186, 0.45);
}

.expertise-icon {
  color: var(--peach);
  margin-bottom: 1.5rem;
}

.expertise-icon svg {
  width: 1.9rem;
  height: 1.9rem;
  display: block;
}

.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;
}

/* Projects Section */
.apple-projects {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.projects-intro {
  max-width: 36rem;
}

.projects-title {
  font-family: var(--font-header);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

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

.projects-list {
  list-style: none;
  border-top: 1px solid var(--border-fine);
}

.project-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border: 0;
  border-bottom: 1px solid var(--border-fine);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.project-name-group {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.project-logo {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: contain;
  flex-shrink: 0;
}

.project-row:hover .project-name,
.project-row:focus-visible .project-name {
  color: var(--accent-blue);
}

.project-row:focus-visible {
  outline: none;
}

.project-name {
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.project-tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-align: right;
}

@media (max-width: 640px) {
  .project-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .project-tagline {
    text-align: left;
  }

  .apple-nav,
  .btn-apple-nav {
    display: none;
  }
}

/* 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(16, 40, 28, 0.75);
}

.terminal-header {
  background: rgba(247, 234, 224, 0.04);
  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: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.terminal-body {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

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

.terminal-line.output {
  color: var(--text-secondary);
}

.terminal-prompt {
  color: var(--peach);
  margin-right: 8px;
}

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

.json-key { color: var(--text-secondary); }
.json-val { color: var(--text-primary); }
.json-bool { color: var(--peach); }

@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;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-main);
  z-index: 1000;
}

#mobile-experience.no-camera-feed #camera-stream {
  visibility: hidden;
}

.mobile-locked-scroll {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.mobile-ar-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

#mobile-experience.is-locked,
#mobile-experience.is-browsing {
  position: relative;
  top: auto;
  left: auto;
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: visible;
  z-index: auto;
  background-color: var(--bg-main);
  background-image:
    radial-gradient(at 0% 0%, rgba(249, 210, 186, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(94, 49, 34, 0.18) 0px, transparent 50%);
}

#mobile-experience.is-locked .mobile-locked-scroll,
#mobile-experience.is-browsing .mobile-locked-scroll {
  position: static;
  inset: auto;
  height: auto;
  overflow: visible;
}

#mobile-experience.is-browsing .mobile-ar-stage {
  display: none;
}

#mobile-experience.is-locked .mobile-ar-stage {
  /* Plain document flow — no custom positioning, no JS-driven transform.
     It's a normal, full-screen-tall block at the top of the scrollable
     content, so scrolling past it is just... scrolling. The sticky header
     right after it (see #mobile-site-header) takes care of the rest. */
  position: relative;
  z-index: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100svh;
  height: 100dvh;
  min-height: 100svh;
  min-height: 100dvh;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 1.25rem 1rem 0.75rem;
  background: var(--bg-main);
  background-image:
    radial-gradient(at 0% 0%, rgba(249, 210, 186, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(94, 49, 34, 0.18) 0px, transparent 50%);
  border-bottom: 1px solid var(--border-fine);
  overflow: hidden;
}

#mobile-experience.is-locked #ar-card-mount {
  position: relative;
  z-index: auto;
  width: 100%;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-site-content {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

#mobile-site-header {
  /* Full-bleed: .mobile-site-content is already 100vw on mobile (max-width
     only kicks in above 1000px) but insets its children with its own
     padding — cancel that here and reapply it as the header's own padding,
     so the header's background actually reaches both screen edges. */
  margin-left: -1.25rem;
  margin-right: -1.25rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* The logo's two foldable segments — see header.js for the character
   split and header-logo-fold.js for what drives them on mobile. They
   render at natural width (the full "hottens // ai") everywhere by
   default; only the mobile header ever has its width shrunk by JS. */
.logo .pleat {
  display: inline-block;
  overflow: hidden;
  white-space: pre;
}

#mobile-experience.is-browsing .mobile-site-content {
  scroll-margin-top: 0.5rem;
}

html.mobile-scroll-locked,
body.mobile-scroll-locked {
  height: auto;
}

body.mobile-ar-scanning:not(.mobile-scroll-locked) {
  overflow: hidden;
}

.mobile-locked-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 0 0.25rem;
  pointer-events: auto;
}

.lock-status {
  animation: none;
}

#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, rgba(16, 40, 28, 0.35) 0%, rgba(6, 16, 11, 0.85) 100%);
  pointer-events: none;
}

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

.logo-mobile {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.scan-status {
  font-size: 0.85rem;
  background: rgba(6, 16, 11, 0.6);
  border: 1px solid var(--border-fine);
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  color: var(--text-primary);
  font-weight: 500;
  animation: pulse 1.5s infinite;
}

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

.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid var(--cream);
}

.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(249, 210, 186, 0.8);
  box-shadow: 0 0 10px rgba(249, 210, 186, 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(247, 234, 224, 0.8);
  font-size: 0.8rem;
  text-align: center;
  max-width: 280px;
}

.btn-action-mobile {
  background: var(--cream);
  color: var(--forest-deep);
  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(247, 234, 224, 0.1);
  color: var(--cream);
  border: 1px solid rgba(247, 234, 224, 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(6, 16, 11, 0.45);
  perspective: 1200px; /* Perspective added on parent container to enable true 3D rotations on absolute children */
}

.card-link {
  color: var(--peach);
  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(249, 210, 186, 0.5);
}

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

/* Lock transition (lockARCard in ar-scanner.js). The View Transitions API
   carries the card from its tracked pose to its resting spot in document
   flow while the camera view cross-fades into the page. One duration and
   one curve for every layer, so nothing lands early or late. */
::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
  animation-duration: 700ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Points at the QR while it's being tracked, live above the card as it
   floats — see renderArCardPosition() in ar-scanner.js for the math.
   Kept out of .ar-card-wrapper so it never inherits the card's own
   rotate/scale transform and stays flat and legible. */
.tap-hint {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 14px 8px;
  border-radius: 999px;
  background: rgba(16, 40, 28, 0.55);
  backdrop-filter: blur(3px);
  color: var(--cream);
  pointer-events: none;
  z-index: 6;
}

.tap-hint.hidden {
  display: none;
}

.tap-hint .tap-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-align: center;
  max-width: 11ch;
}

.tap-hint svg {
  width: 16px;
  height: 20px;
  color: var(--peach);
}

.ar-card-overlay.ar-card-overlay--locked {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  z-index: 0 !important;
  padding: 0.5rem 0 0.75rem !important;
  background: transparent !important;
  justify-content: center;
  pointer-events: auto;
  perspective: none;
}

#mobile-experience.is-locked .ar-card-wrapper {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  top: auto !important;
  margin: 0 auto;
  width: min(300px, calc(100vw - 2.5rem));
  height: auto;
  aspect-ratio: 5 / 3;
  transform: none !important;
}

#mobile-experience.is-locked .apple-main,
#mobile-experience.is-browsing .apple-main {
  gap: 4rem;
  padding: 3rem 0;
}

#mobile-experience.is-locked .hero-title,
#mobile-experience.is-browsing .hero-title {
  font-size: clamp(2rem, 9vw, 3.25rem);
  letter-spacing: -1px;
}

#mobile-experience.is-locked .hero-subtitle,
#mobile-experience.is-browsing .hero-subtitle {
  font-size: 1.05rem;
}

#mobile-experience.is-locked .hero-cta,
#mobile-experience.is-browsing .hero-cta {
  flex-direction: column;
  align-items: stretch;
}

#mobile-experience.is-locked .apple-statement,
#mobile-experience.is-browsing .apple-statement {
  padding: 3rem 0;
}

#mobile-experience.is-locked .expertise-grid,
#mobile-experience.is-browsing .expertise-grid {
  grid-template-columns: 1fr;
}

#mobile-experience.is-locked .apple-projects,
#mobile-experience.is-browsing .apple-projects {
  padding: 3rem 0;
}

.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);
}

.card-front {
  background: var(--cream);
  border: 1px solid rgba(94, 49, 34, 0.14);
  border-top: 3px solid var(--forest);
}

.card-back {
  background: linear-gradient(135deg, var(--forest), var(--forest-deep));
  border-color: rgba(247, 234, 224, 0.1);
  transform: rotateY(180deg);
}

.card-logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--forest);
  border: 1.5px solid var(--forest);
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  white-space: nowrap;
}

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

.card-name {
  font-family: var(--font-header);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cocoa);
}

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

.card-contact {
  font-size: 0.65rem;
  margin-top: 6px;
}

.card-front .card-link {
  color: var(--cocoa);
}

.card-front .card-link:hover {
  color: var(--forest);
  text-shadow: none;
}

.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(247, 234, 224, 0.1);
  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(247, 234, 224, 0.08);
  padding-bottom: 4px;
}

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

.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(6, 16, 11, 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 ==================== */
/* Experience switching is handled in JS (device.js). Desktop stays visible until mounted. */
@media (min-width: 769px) {
  #mobile-experience {
    display: none !important;
  }
}

.init-error-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3000;
  padding: 1rem 1.25rem;
  background: #450a0a;
  border-bottom: 1px solid #ef4444;
  color: #fecaca;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* 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;
  }
}
