/* ── Registered Animatable CSS Color Properties ── */
@property --bg-color-1 {
  syntax: '<color>';
  inherits: true;
  initial-value: rgba(99, 102, 241, 0.25);
}

@property --bg-color-2 {
  syntax: '<color>';
  inherits: true;
  initial-value: rgba(79, 70, 229, 0.18);
}

@property --accent-primary {
  syntax: '<color>';
  inherits: true;
  initial-value: #6366f1;
}

@property --accent-secondary {
  syntax: '<color>';
  inherits: true;
  initial-value: #818cf8;
}

/* ── Design System Tokens ── */
:root {
  --bg-dark: #0a0b0e;
  --bg-card: rgba(18, 20, 26, 0.85);
  --bg-card-hover: rgba(28, 32, 42, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(99, 102, 241, 0.5);

  --accent-primary: #6366f1;   /* Electric Indigo */
  --accent-secondary: #818cf8;
  --accent-amber: #f59e0b;     /* Warm Amber */
  --accent-emerald: #10b981;   /* Mint Emerald */

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --font-heading: 'Roboto', -apple-system, sans-serif;
  --font-body: 'Roboto', -apple-system, sans-serif;
  --font-code: 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 45px var(--border-glow);
}

/* ── Base Styles ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  scrollbar-color: rgba(255, 255, 255, 0.15) var(--bg-dark);
  scrollbar-width: thin;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── High-Vibrancy Dramatic Dual-Layer Background Crossfade ── */
.theme-overlay-layer {
  position: fixed;
  inset: -15%;
  width: 130vw;
  height: 130vh;
  z-index: -1;
  pointer-events: none;
  transition: opacity 1.8s cubic-bezier(0.4, 0, 0.2, 1);
  animation: ambientBreath 16s ease-in-out infinite alternate;
}

#theme-overlay-active {
  opacity: 1;
}

#theme-overlay-next {
  opacity: 0;
}

@keyframes ambientBreath {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.08) rotate(1deg); }
  100% { transform: scale(1.02) rotate(-1deg); }
}

/* ── Custom Dark Mode Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ── Accessible Focus Rings ── */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ── Custom Dark Form Inputs & Select Styling ── */
select, input, textarea {
  color-scheme: dark;
  font-family: var(--font-body);
}

::placeholder {
  color: var(--text-dim);
  opacity: 0.8;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.8;
  filter: invert(1);
  cursor: pointer;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.custom-checkbox input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
  border-radius: 4px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%239ca3af' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 40px !important;
  cursor: pointer;
}

select option {
  background-color: #12141a !important;
  color: #f3f4f6 !important;
  padding: 12px 16px !important;
  font-size: 15px;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-primary) 50%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: background 0.8s ease;
}

/* ── Layout Shell ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 80px 0;
}

/* ── Navigation ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 11, 14, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 16px 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* ── Minimalist Terminal Prompt Logo Mark ── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  transition: transform 0.2s ease;
}

.nav-logo:hover {
  transform: scale(1.02);
}

.nav-logo-terminal {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glow);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-code);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-primary);
  box-shadow: 0 0 14px var(--border-glow);
  transition: border-color 0.6s ease, color 0.6s ease, box-shadow 0.6s ease;
}

.terminal-bracket {
  color: var(--text-dim);
}

.terminal-prompt {
  color: var(--accent-primary);
  margin: 0 2px;
  transition: color 0.6s ease;
}

.nav-logo-text {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.logo-prompt {
  color: #ffffff;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.logo-panda {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  letter-spacing: -0.02em;
  transition: background 0.8s ease;
}

.logo-cursor {
  display: inline-block;
  width: 7px;
  height: 18px;
  background: var(--accent-primary);
  border-radius: 1px;
  margin-left: 4px;
  animation: logoCursorBlink 1.1s steps(2, start) infinite;
  transition: background 0.6s ease;
}

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

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-size: 20px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.nav-toggle:hover {
  border-color: var(--accent-primary);
  background: var(--bg-glass);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-main);
}

.btn-cta {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: var(--transition-smooth);
  cursor: pointer;
  display: inline-block;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--border-glow);
}

/* Tactile Micro-interactions */
.btn-cta:active,
.filter-btn:active,
.project-card:active,
.wizard-option-btn:active,
.modal-close:active {
  transform: scale(0.97) translateY(1px);
  transition: transform 0.1s ease;
}

/* ── Hero Section ── */
.hero {
  padding: 120px 0 80px;
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

.hero-title {
  font-size: 56px;
  line-height: 1.1;
  margin-bottom: 20px;
  font-weight: 900;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 40px;
  font-weight: 400;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 60px;
}

.stat-item h4 {
  font-size: 32px;
  color: var(--accent-primary);
  transition: color 0.6s ease;
  font-weight: 700;
}

.stat-item p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Portfolio Showcase Section & Image Aspect Ratio Fix ── */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 36px;
  margin-bottom: 12px;
  font-weight: 700;
}

.filter-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-btn.active, .filter-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-smooth);
  cursor: pointer;
  position: relative;
  max-width: 580px;
  margin: 0 auto;
  width: 100%;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

/* Widescreen 16:9 Aspect Ratio Container */
.project-img-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
  background: #000;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.5s ease;
}

.project-card:hover .project-img {
  transform: scale(1.04);
}

.project-content {
  padding: 24px;
}

.project-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tag {
  background: var(--bg-glass);
  color: var(--accent-primary);
  border: 1px solid var(--border-glass);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  transition: color 0.4s ease, border-color 0.4s ease;
}

.project-title {
  font-size: 20px;
  margin-bottom: 8px;
  font-weight: 700;
}

.project-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-glass);
  padding-top: 16px;
}

.link-btn {
  color: var(--accent-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.4s ease;
}

/* ── Interactive Quote Calculator Section ── */
.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 48px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  box-shadow: var(--shadow-glow);
}

.calc-options h3 {
  font-size: 24px;
  margin-bottom: 24px;
  font-weight: 700;
}

.option-group {
  margin-bottom: 24px;
}

.option-group label {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.custom-checkbox {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.custom-checkbox:hover, .custom-checkbox.selected {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.06);
}

.calc-summary {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.total-price {
  font-size: 48px;
  font-family: var(--font-heading);
  font-weight: 900;
  color: #fff;
  margin: 16px 0;
}

.summary-list {
  list-style: none;
  margin-bottom: 24px;
}

.summary-list li {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

/* ── FAQ Accordion Section ── */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 20px;
}

.faq-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition-smooth);
}

.faq-card:hover {
  border-color: var(--border-glow);
}

.faq-question {
  font-size: 18px;
  color: #fff;
  margin-bottom: 8px;
  font-weight: 700;
}

.faq-answer {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Modal Window & ARIA Styling ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-container {
  background: #12141a;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 90%;
  padding: 32px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: #fff;
}

/* ── Toast Container & Toast Component ── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(18, 20, 26, 0.95);
  border: 1px solid var(--border-glow);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease forwards;
}

.toast-success {
  border-color: var(--accent-emerald);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.toast-error {
  border-color: #ef4444;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(10px); }
}

/* ── Responsiveness ── */
@media (max-width: 900px) {
  .calc-card {
    grid-template-columns: 1fr;
  }
  .faq-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 40px;
  }
  .hero-stats {
    flex-direction: column;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 11, 14, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    padding: 20px 24px;
    gap: 16px;
  }
  .nav-links.mobile-open {
    display: flex;
  }
}
