/* ==========================================================================
   NOCUT STUDIO — UNSLOPPED CRAFT SYSTEM
   Dual Theme: Dark Industrial Studio / White Architectural Paper
   Typography: Space Grotesk (Display) | Plus Jakarta Sans (Body) | JetBrains Mono (Specs)
   ========================================================================== */

:root {
  --bg-primary: #0A0C0A;
  --bg-surface: #121512;
  --bg-surface-elevated: #181C18;
  --text-primary: #F4F5F0;
  --text-secondary: #8E958A;
  --text-muted: #535A50;
  --border-subtle: #222621;
  --border-focus: #353B34;
  --accent-lime: #C6F500;
  --accent-lime-hover: #D4FF1A;
  --accent-text: #0A0C0A;
  --bento-glow: rgba(198, 245, 0, 0.08);
  --bento-border-glow: rgba(198, 245, 0, 0.5);
  --focus-glow: rgba(198, 245, 0, 0.22);
  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* White / Light Mode Theme */
html[data-theme="light"] {
  --bg-primary: #F8F9F6;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F0F2ED;
  --text-primary: #121512;
  --text-secondary: #586154;
  --text-muted: #848F80;
  --border-subtle: #DEE2DC;
  --border-focus: #B5BCB2;
  --accent-lime: #121512;
  --accent-lime-hover: #262B25;
  --accent-text: #FFFFFF;
  --bento-glow: rgba(18, 21, 18, 0.04);
  --bento-border-glow: rgba(18, 21, 18, 0.35);
  --focus-glow: rgba(18, 21, 18, 0.12);
}

/* Dual theme integration for utility classes */
html[data-theme="light"] .bg-bg-primary {
  background-color: var(--bg-primary) !important;
}
html[data-theme="light"] .bg-bg-secondary {
  background-color: #F0F2ED !important;
}
html[data-theme="light"] .bg-bg-surface {
  background-color: var(--bg-surface) !important;
}
html[data-theme="light"] .text-primary {
  color: var(--text-primary) !important;
}
html[data-theme="light"] .text-secondary {
  color: var(--text-secondary) !important;
}
html[data-theme="light"] .text-muted {
  color: var(--text-muted) !important;
}
html[data-theme="light"] .border-subtle {
  border-color: var(--border-subtle) !important;
}
html[data-theme="light"] .text-lime {
  color: #121512 !important;
}
html[data-theme="light"] .border-lime {
  border-color: #121512 !important;
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background-color: #FFFFFF !important;
  color: #121512 !important;
  border-color: var(--border-subtle) !important;
}
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
  border-color: #121512 !important;
}
html[data-theme="light"] .studio-nav {
  background-color: rgba(248, 249, 246, 0.95) !important;
  border-bottom-color: var(--border-subtle) !important;
}
html[data-theme="light"] .mobile-nav-drawer {
  background-color: #F8F9F6 !important;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

::selection {
  background: var(--accent-lime);
  color: var(--accent-text);
}

/* Subtle architectural hairline grid */
.bg-tech-grid {
  background-size: 48px 48px;
  background-image: 
    linear-gradient(to right, rgba(34, 38, 33, 0.45) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(34, 38, 33, 0.45) 1px, transparent 1px);
}

html[data-theme="light"] .bg-tech-grid {
  background-image: 
    linear-gradient(to right, rgba(210, 216, 208, 0.5) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(210, 216, 208, 0.5) 1px, transparent 1px);
}

.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }
.font-body { font-family: var(--font-body); }

/* Clean Mechanical Surface Cards */
.studio-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  transition: border-color 0.15s ease, background-color 0.2s ease;
}

.studio-card:hover {
  border-color: var(--border-focus);
}

/* High-Contrast Technical Badges */
.badge-tech {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 2px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.badge-lime {
  background-color: var(--accent-lime);
  border-color: var(--accent-lime);
  color: var(--accent-text);
  font-weight: 600;
}

html[data-theme="dark"] .badge-lime {
  background-color: rgba(198, 245, 0, 0.12);
  border-color: rgba(198, 245, 0, 0.4);
  color: var(--accent-lime);
}

/* Primary Button */
.btn-studio-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--accent-lime);
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 24px;
  min-height: 44px;
  border-radius: 2px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-studio-primary:hover {
  background-color: var(--accent-lime-hover);
}

.btn-studio-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: transparent;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 24px;
  min-height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-studio-ghost:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.btn-studio-sm {
  padding: 8px 16px;
  font-size: 12px;
  min-height: 36px;
}

/* Header & Theme Toggle Button */
.studio-nav {
  background-color: var(--bg-primary);
  opacity: 0.98;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 2px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* Image Framing */
.project-image-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background-color: #080A08;
  border-radius: 2px;
}

.project-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Blueprint Interactive Component */
.blueprint-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
}

.chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border-radius: 2px;
}

/* Modal */
.studio-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(10, 12, 10, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

html[data-theme="light"] .studio-modal-backdrop {
  background-color: rgba(240, 242, 237, 0.88);
}

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

.studio-modal-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Mobile Drawer */
.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  top: 61px;
  background-color: var(--bg-primary);
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.mobile-nav-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Responsive Touch Target Minimums */
@media (max-width: 768px) {
  input, select, textarea, button {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
  }
}

/* ==========================================================================
   REACT BITS — TRUE FOCUS (Text Animation Component)
   ========================================================================== */
.true-focus-wrapper {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 6px 4px;
  user-select: none;
}

.true-focus-word {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  transition: filter 0.35s cubic-bezier(0.25, 1, 0.5, 1), 
              opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              color 0.2s ease;
  cursor: pointer;
  z-index: 2;
  will-change: filter, opacity, transform;
}

.true-focus-word.is-focused {
  opacity: 1 !important;
  filter: blur(0px) !important;
  transform: scale(1.02);
  color: var(--text-primary);
}

.true-focus-word.is-blurred {
  opacity: 0.38;
  filter: blur(3.5px);
  transform: scale(0.98);
}

/* Reticle Focus Box */
.true-focus-box {
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--accent-lime);
  background: radial-gradient(circle at center, var(--focus-glow), transparent 80%);
  border-radius: 2px;
  transition: left 0.38s cubic-bezier(0.25, 1, 0.5, 1),
              top 0.38s cubic-bezier(0.25, 1, 0.5, 1),
              width 0.38s cubic-bezier(0.25, 1, 0.5, 1),
              height 0.38s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.2s ease;
  z-index: 1;
  box-shadow: 0 0 16px var(--focus-glow);
}

html[data-theme="light"] .true-focus-box {
  border-color: #121512;
  box-shadow: 0 0 12px rgba(18, 21, 18, 0.12);
}

.true-focus-corner {
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: var(--accent-lime);
  border-style: solid;
}

html[data-theme="light"] .true-focus-corner {
  border-color: #121512;
}

.true-focus-corner.tl { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.true-focus-corner.tr { top: -2px; right: -2px; border-width: 2px 2px 0 0; }
.true-focus-corner.bl { bottom: -2px; left: -2px; border-width: 0 0 2px 2px; }
.true-focus-corner.br { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }

/* ==========================================================================
   REACT BITS — MAGIC BENTO (Interactive Bento Grid with Cursor Spotlight)
   ========================================================================== */
.magic-bento-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 20px;
}

@media (min-width: 768px) {
  .magic-bento-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}

.magic-bento-card {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 28px;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), 
              border-color 0.2s ease, 
              box-shadow 0.25s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Spotlight surface glow following cursor */
.magic-bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), var(--bento-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.magic-bento-card:hover::before {
  opacity: 1;
}

/* Spotlight dynamic border illumination */
.magic-bento-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 5px;
  padding: 1px;
  background: radial-gradient(350px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), var(--bento-border-glow), transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}

.magic-bento-card:hover::after {
  opacity: 1;
}

.magic-bento-card:hover {
  border-color: var(--border-focus);
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] .magic-bento-card:hover {
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.08);
}

.magic-bento-content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ==========================================================================
   REACT BITS — LINE SIDEBAR COMPONENT
   ========================================================================== */
.line-sidebar-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 110px;
}

.line-sidebar-item {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px 0;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
  color: var(--text-secondary);
}

.line-sidebar-track {
  position: relative;
  width: 20px;
  height: 2px;
  background-color: var(--border-subtle);
  border-radius: 2px;
  transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1), 
              background-color 0.25s ease,
              box-shadow 0.25s ease;
  flex-shrink: 0;
}

.line-sidebar-item:hover .line-sidebar-track {
  width: 32px;
  background-color: var(--text-primary);
}

.line-sidebar-item.is-active {
  color: var(--text-primary);
}

.line-sidebar-item.is-active .line-sidebar-track {
  width: 48px;
  background-color: var(--accent-lime);
  box-shadow: 0 0 10px var(--focus-glow);
}

html[data-theme="light"] .line-sidebar-item.is-active .line-sidebar-track {
  background-color: #121512;
  box-shadow: 0 0 8px rgba(18, 21, 18, 0.2);
}

.line-sidebar-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  opacity: 0.6;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.line-sidebar-item.is-active .line-sidebar-num {
  opacity: 1;
  color: var(--accent-lime);
  font-weight: 700;
}

html[data-theme="light"] .line-sidebar-item.is-active .line-sidebar-num {
  color: #121512;
}

.line-sidebar-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color 0.2s ease, transform 0.2s ease;
}

.line-sidebar-item.is-active .line-sidebar-label {
  color: var(--text-primary);
  transform: translateX(4px);
}

/* ==========================================================================
   REACT BITS — SCROLL STACK COMPONENT
   ========================================================================== */
.scroll-stack-wrapper {
  position: relative;
  width: 100%;
}

.scroll-stack-card {
  position: sticky;
  top: 100px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 36px 32px;
  margin-bottom: 48px;
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1),
              filter 0.3s ease,
              opacity 0.3s ease,
              border-color 0.25s ease;
  transform-origin: center top;
  will-change: transform, filter, opacity;
}

html[data-theme="light"] .scroll-stack-card {
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.07);
}

.scroll-stack-card:hover {
  border-color: var(--border-focus);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}


