:root {
  --bg: #0c0d0f;
  --surface: #121317;
  --text: #ffffff;
  --muted: #b9bcc6;
  --accent: #c89b3c;
  --accent-2: #5b8def;
  --border: #24262c;
  --success: #2bb673;
  --danger: #e24a4a;
  --warning: #e0aa3e;
  --nav-hover: rgba(255, 255, 255, 0.1);
  --btn-bg: #c89b3c;
  --btn-text: #121317;
}
[data-theme="light"] {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #101316;
  --muted: #616a73;
  --accent: #c89b3c;
  --accent-2: #5b8def;
  --border: #dfe3e8;
  --success: #1f8a55;
  --danger: #cc3d3d;
  --warning: #b9852c;
  --nav-hover: rgba(0, 0, 0, 0.05);
  --btn-bg: #101316;
  --btn-text: #ffffff;
}
* {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  scroll-behavior: smooth;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 20px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.25);
}
.brand-text {
  font-size: 18px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav a {
  color: var(--text);
  text-decoration: none;
  margin-left: 16px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav a:hover {
  background: var(--nav-hover);
}
.mobile-menu-btn {
  display: none !important;
}
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: inline-flex !important;
  }
  .nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px;
    display: none;
    gap: 10px;
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    margin: 0;
    display: block;
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 8px;
  }
  .hero-title {
    font-size: 32px;
  }
  .hero-inner {
    gap: 16px;
  }
}
.hero {
  position: relative;
  padding: 80px 0 40px;
  background: radial-gradient(1200px 400px at 20% 0%, rgba(200,155,60,0.08), transparent), radial-gradient(800px 300px at 80% 0%, rgba(91,141,239,0.08), transparent);
}
.hero-inner {
  display: grid;
  gap: 24px;
  justify-items: start;
  position: relative;
  z-index: 1;
  will-change: transform;
  transition: transform 0.2s ease;
}
.hero-title {
  font-size: clamp(28px, 6vw, 48px);
  line-height: 1.1;
  margin: 0;
  letter-spacing: 0.2px;
}
.hero-subtitle {
  color: var(--muted);
  max-width: 750px;
  margin: 10px 0 0;
  font-size: 16px;
}
.hero-video {
  width: 48%;
  margin-top: 20px;
  justify-self: start;
}
@media (max-width: 900px), (any-pointer: coarse) {
  .hero-video { width: 100%; justify-self: stretch; }
}
.video-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}
.video-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.video-responsive video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.section {
  padding: 60px 0;
}
.section-title {
  font-size: 28px;
  margin: 0 0 16px;
  letter-spacing: 0.2px;
}
.section-text {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.cards-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 960px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: grid;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card h3 {
  margin: 0;
  font-size: 18px;
}
.card p {
  margin: 0;
  color: var(--muted);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}
.icon {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #1a1c21;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--border);
}
.icon svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}
.portfolio-grid .card {
  padding: 0;
  overflow: hidden;
}
.portfolio-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.portfolio-grid h3 {
  padding: 14px 14px 0;
}
.portfolio-grid p {
  padding: 0 14px 14px;
}
.modal {
  position: fixed;
  inset: 0;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal.show {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  opacity: 1;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
.modal-content {
  position: relative;
  z-index: 1;
  width: min(950px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: grid;
  gap: 12px;
  transform: translateY(6px);
  transition: transform 0.2s ease;
}
.modal-content img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(0,0,0,0.85);
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.modal-close:hover {
  background: rgba(0,0,0,0.92);
}

@media (max-width: 900px) {
  .modal.show {
    align-items: stretch;
  }
  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}
.contact-form {
  display: grid;
  gap: 14px;
}
.contact-form .btn {
  justify-self: start;
  min-width: 140px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}
.form-full {
  display: grid;
}
label span {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--muted);
}
input, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.modal.show .modal-content { transform: translateY(0); }
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(200,155,60,0.15);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease, background 0.2s ease, color 0.2s ease;
  user-select: none;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 15px; }
.btn-secondary { background: #1a1c21; color: var(--text); }
.btn-danger { background: var(--danger); border-color: transparent; }
.btn-success { background: var(--success); border-color: transparent; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.form-status {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}
.map-section .container {
  padding-bottom: 0;
}
.map-banner {
  width: 100%;
  height: 350px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.map-banner iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 60px 0 20px;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.footer-col h4 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  color: var(--text);
  font-weight: 600;
}
.footer-col p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links li {
  margin-bottom: 12px;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-links a:hover {
  color: var(--accent);
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
}
.contact-item svg {
  flex-shrink: 0;
  color: var(--accent);
}
.footer-bottom {
  padding-top: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
@media (max-width: 640px) {
  .site-footer { padding: 40px 0 20px; }
  .footer-inner { gap: 30px; text-align: left; }
  .footer-bottom { flex-direction: column; gap: 10px; }
}

/* Admin */
.admin-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #0f1013; border-right: 1px solid var(--border); padding: 16px; position: sticky; top: 0; align-self: start; height: 100vh; }
.sidebar h3 { margin: 0 0 12px; }
.sidebar a { display: block; color: var(--text); text-decoration: none; padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; transition: background 0.2s ease; }
.sidebar a:hover { background: #1a1c21; }
.admin-content { padding: 24px; display: grid; gap: 18px; }
.admin .card { margin-bottom: 14px; }
.preview { width: 140px; height: 140px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); display: grid; place-items: center; overflow: hidden; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .row { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--border); padding: 10px; text-align: left; }
th { background: #1a1c21; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #1a1c21; color: var(--text); border: 1px solid var(--border); padding: 12px 14px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,0.25); display: none; }
.toast.show { display: inline-block; }
.upload-progress { display: grid; gap: 6px; }
.upload-progress-track { height: 10px; border-radius: 999px; background: #1a1c21; border: 1px solid var(--border); overflow: hidden; }
.upload-progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.12s ease; }
.upload-progress-text { font-size: 13px; color: var(--muted); justify-self: end; }

/* Theme toggle */
.toggle {
  display: inline-flex;
  align-items: center;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 2px;
  cursor: pointer;
}
.toggle .knob {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--btn-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transform: translateX(0);
  transition: transform 0.2s ease, background 0.2s ease;
  display: grid;
  place-items: center;
  color: var(--btn-text);
}
.toggle .icon {
  width: 14px;
  height: 14px;
  position: absolute;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toggle .sun {
  opacity: 0;
  transform: rotate(-90deg);
}
.toggle .moon {
  opacity: 1;
  transform: rotate(0);
}
[data-theme="light"] .toggle .knob {
  transform: translateX(24px);
}
[data-theme="light"] .toggle .sun {
  opacity: 1;
  transform: rotate(0);
}
[data-theme="light"] .toggle .moon {
  opacity: 0;
  transform: rotate(90deg);
}

/* Architectural 3D attractor canvas */
#parametric-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: auto; /* Enable pointer events for drag */
  opacity: 0.85;
  cursor: grab;
}
#parametric-bg:active {
  cursor: grabbing;
}

/* 3D portfolio tilt */
.portfolio-grid { perspective: 800px; }
.portfolio-card {
  transform-style: preserve-3d;
  will-change: transform;
}
.portfolio-card img {
  transform: translateZ(24px);
  will-change: transform;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal.show {
  opacity: 1;
  transform: none;
}

[data-theme="light"] .sidebar { background: #f9fafb; }
[data-theme="light"] .sidebar a:hover { background: #eef2f7; }
[data-theme="light"] th { background: #eef2f7; }
[data-theme="light"] .btn-secondary { background: #e9eef3; color: var(--text); }
[data-theme="light"] .toast { background: #ffffff; color: var(--text); border: 1px solid var(--border); }

/* Switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg); /* Changed from var(--surface) for better contrast */
  border: 1px solid var(--border);
  transition: .4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 2px;
  bottom: 2px;
  background-color: var(--muted);
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--accent);
}
input:focus + .slider {
  box-shadow: 0 0 1px var(--accent);
}
input:checked + .slider:before {
  transform: translateX(24px);
  background-color: #fff;
}
