/* ------------------------------
   TheDevLab Styles
   ------------------------------ */
:root {
  --bg: #05060a;
  --bg-alt: #0c0f17;
  --text: #eef2f7;
  --text-dim: #9aa4b1;
  --brand: linear-gradient(90deg, #4f46e5, #6366f1, #8b5cf6);
  --brand-accent: #6366f1;
  --accent: #14b8a6;
  --danger: #ef4444;
  --radius-s: 6px;
  --radius-m: 14px;
  --radius-l: 32px;
  --shadow-elev: 0 8px 24px -4px rgba(0, 0, 0, 0.6),
    0 2px 4px -1px rgba(0, 0, 0, 0.5);
  --font-stack: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans",
    "Helvetica Neue", Arial, sans-serif;
  --grad-radial: radial-gradient(
      circle at 25% 15%,
      #312e81 0%,
      rgba(5, 6, 10, 0) 60%
    ),
    radial-gradient(circle at 80% 60%, #064e3b 0%, rgba(5, 6, 10, 0) 65%);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.4' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

.light {
  --bg: #f8fafc;
  --bg-alt: #ffffff;
  --text: #0f172a;
  --text-dim: #4b5563;
  --brand-accent: #4f46e5;
  --grad-radial: radial-gradient(
      circle at 20% 15%,
      #dbeafe 0%,
      rgba(255, 255, 255, 0) 55%
    ),
    radial-gradient(circle at 80% 70%, #ede9fe 0%, rgba(255, 255, 255, 0) 60%);
  --noise: none;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--font-stack);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Scrollbar */
body::-webkit-scrollbar {
  width: 10px;
}
body::-webkit-scrollbar-track {
  background: #0b0d13;
}
body::-webkit-scrollbar-thumb {
  background: #1e2533;
  border-radius: 20px;
}
body::-webkit-scrollbar-thumb:hover {
  background: #283140;
}

canvas#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: var(--grad-radial), #05060a;
}
canvas#bg-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--noise);
  mix-blend-mode: overlay;
  pointer-events: none;
}

.nav-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(0.75rem, 1.2vw + 0.5rem, 1.35rem) clamp(1rem, 4vw, 4rem);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: rgba(10, 14, 22, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.light .nav-header {
  background: rgba(255, 255, 255, 0.7);
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.logo .dot {
  background: linear-gradient(90deg, #f59e0b, #ec4899, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.6rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: clamp(0.75rem, 2vw, 2rem);
  padding: 0;
  margin: 0;
}
nav a {
  text-decoration: none;
  font-weight: 500;
  color: var(--text-dim);
  position: relative;
}
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
nav a:hover,
nav a:focus {
  color: var(--text);
}
nav a:hover::after,
nav a:focus::after {
  width: 100%;
}

.cta-link {
  color: var(--text);
  font-weight: 600;
}

#themeToggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, #111827, #1f2937);
  cursor: pointer;
  position: relative;
}
#themeToggle::before {
  content: "☾";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  transition: 0.4s;
}
.light #themeToggle {
  background: linear-gradient(145deg, #e2e8f0, #f8fafc);
}
.light #themeToggle::before {
  content: "☀";
}

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 8rem clamp(1rem, 5vw, 6rem) 4rem;
  position: relative;
}
.hero-content {
  max-width: 820px;
  position: relative;
  z-index: 2;
}
.hero h1 {
  font-size: clamp(2.75rem, 7vw, 5rem);
  line-height: 1.05;
  margin: 0 0 1.15rem;
  font-weight: 800;
  letter-spacing: -2px;
  position: relative;
}
.hero .subtitle {
  font-size: clamp(1.05rem, 1.4vw + 0.85rem, 1.55rem);
  line-height: 1.5;
  margin: 0 0 2.2rem;
  font-weight: 500;
  color: var(--text-dim);
}
.highlight {
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.btn {
  --btn-bg: #1f2937;
  --btn-color: var(--text);
  --btn-border: rgba(255, 255, 255, 0.12);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--btn-border);
  padding: 0.9rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: var(--radius-m);
  text-decoration: none;
  color: var(--btn-color);
  background: var(--btn-bg);
  overflow: hidden;
  white-space: nowrap;
}
.btn.primary {
  --btn-bg: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
  --btn-border: transparent;
  box-shadow: 0 6px 22px -8px rgba(99, 102, 241, 0.55);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.05);
}
.btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 18px -6px rgba(0, 0, 0, 0.6);
}
.btn:active {
  transform: translateY(1px);
}
.btn.wide {
  width: 100%;
}

.social-proof {
  margin-top: 2rem;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

.hero-visual {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.floating-card {
  position: absolute;
  top: 50%;
  left: 50%;
  padding: 0.75rem 1.1rem;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  animation: float 9s ease-in-out infinite;
  transform-style: preserve-3d;
  color: var(--text-dim);
  font-weight: 500;
}
.floating-card:nth-child(1) {
  transform: translate(-320%, -80%) rotate(-8deg);
}
.floating-card:nth-child(2) {
  transform: translate(180%, -160%) rotate(12deg);
}
.floating-card:nth-child(3) {
  transform: translate(260%, 40%) rotate(-16deg);
}
.floating-card:nth-child(4) {
  transform: translate(-260%, 160%) rotate(6deg);
}

@keyframes float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 18px;
  }
}

.scroll-indicator {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 54px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  text-decoration: none;
}
.scroll-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text);
  border-radius: 50%;
  animation: wheel 2.2s cubic-bezier(0.65, 0.05, 0.36, 1) infinite;
}
@keyframes wheel {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: translateY(22px);
    opacity: 0;
  }
}

.marquee {
  width: 100%;
  overflow: hidden;
  padding: 0.75rem 0;
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.marquee-track {
  display: flex;
  gap: clamp(2rem, 5vw, 5rem);
  animation: marquee 40s linear infinite;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.marquee-track:hover {
  animation-play-state: paused;
}
.marquee-track span {
  white-space: nowrap;
}
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.section-title {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  margin: 0 0 1.2rem;
  line-height: 1.1;
  font-weight: 800;
}
.section-intro {
  margin: 0 0 2.5rem;
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 720px;
}
.panel {
  padding: clamp(4rem, 9vw, 8rem) clamp(1rem, 5vw, 6rem);
  position: relative;
}
.panel.alt {
  background: var(--bg-alt);
}

.services-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.service-card {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.6rem 1.4rem 1.5rem;
  border-radius: var(--radius-m);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 70% 15%,
    rgba(99, 102, 241, 0.35),
    transparent 60%
  );
  opacity: 0;
  transition: 0.6s;
}
.service-card:hover::before {
  opacity: 1;
}
.service-card h3 {
  margin: 0.2rem 0 0.8rem;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.service-card p {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-dim);
}
.service-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.service-card li {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-dim);
}

.process-flow {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.step {
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.015)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.1rem 1rem 1.05rem;
  border-radius: var(--radius-m);
  position: relative;
  isolation: isolate;
}
.step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(140deg, #6366f1, #8b5cf6, #ec4899);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.step h3 {
  margin: 0.1rem 0 0.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.step p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-dim);
}

.work-grid {
  display: grid;
  gap: 2.2rem;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}
.work-item {
  background: linear-gradient(
    140deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.015)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-l);
  padding: 1.6rem 1.2rem 1.4rem;
  position: relative;
  overflow: hidden;
}
.work-media {
  aspect-ratio: 3/2;
  border-radius: var(--radius-m);
  overflow: hidden;
  position: relative;
}
.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.1);
  transition: 0.6s;
}
.work-item:hover img {
  scale: 1.05;
}
.gradient-border {
  position: relative;
}
.gradient-border::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(120deg, #6366f1, #ec4899, #14b8a6);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.work-item h3 {
  margin: 1rem 0 0.6rem;
  font-size: 1rem;
  font-weight: 600;
}
.work-item p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.about-wrapper {
  display: grid;
  gap: 2.5rem;
  max-width: 1100px;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
}
.about-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-dim);
}
.about-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
  font-size: 0.85rem;
}
.about-list li {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-m);
  line-height: 1.4;
}

.contact {
  position: relative;
}
.contact-form {
  max-width: 880px;
}
.form-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.field {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.field.full {
  flex: 1 1 100%;
}
label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}
input,
textarea {
  font: inherit;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-s);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  resize: vertical;
  transition: 0.3s;
}
input:focus,
textarea:focus {
  outline: 2px solid #6366f180;
  outline-offset: 2px;
}
.error {
  font-size: 0.65rem;
  color: var(--danger);
  min-height: 14px;
  font-weight: 500;
}
.form-row.inline {
  align-items: center;
  gap: 2rem;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}
.checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #6366f1;
}
.form-status {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  min-height: 1em;
  color: var(--text-dim);
}
.direct-contact {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}
.contact-chip {
  --c: #6366f1;
  position: relative;
  text-decoration: none;
  padding: 0.7rem 1.05rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text);
  background: linear-gradient(
    140deg,
    rgba(255, 255, 255, 0.07),
    rgba(255, 255, 255, 0.03)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.contact-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #6366f1, #8b5cf6, #ec4899);
  mix-blend-mode: plus-lighter;
  opacity: 0;
  transition: 0.5s;
}
.contact-chip:hover::before {
  opacity: 0.15;
}

.site-footer {
  padding: 4rem clamp(1rem, 5vw, 6rem) 3rem;
  background: var(--bg-alt);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.footer-logo {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}
.site-footer h4 {
  margin: 0.2rem 0 0.8rem;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-dim);
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.site-footer a {
  text-decoration: none;
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
}
.site-footer a:hover {
  text-decoration: underline;
}
.legal {
  margin-top: 2.5rem;
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Glitch effect */
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: plus-lighter;
  animation: glitch 4s infinite linear;
}
.glitch::before {
  color: #6366f1;
  transform: translate(0);
}
.glitch::after {
  color: #ec4899;
  animation-duration: 3.5s;
}
@keyframes glitch {
  0% {
    clip-path: inset(0 0 0 0);
    transform: translate(0);
  }
  5% {
    clip-path: inset(10% 0 85% 0);
    transform: translate(-2px, -1px);
  }
  10% {
    clip-path: inset(85% 0 5% 0);
    transform: translate(2px, 1px);
  }
  15% {
    clip-path: inset(40% 0 43% 0);
    transform: translate(-3px, 2px);
  }
  20%,
  100% {
    clip-path: inset(0 0 0 0);
    transform: translate(0);
  }
}

/* Responsive */
@media (max-width: 960px) {
  .about-wrapper {
    grid-template-columns: 1fr;
  }
  .hero {
    padding-top: 7rem;
  }
}
@media (max-width: 720px) {
  nav ul {
    gap: 1rem;
  }
  .hero h1 {
    letter-spacing: -1px;
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .form-row {
    flex-direction: column;
  }
}
@media (max-width: 520px) {
  .nav-header {
    padding: 0.85rem 1rem;
  }
  .logo {
    font-size: 1.05rem;
  }
  .hero h1 {
    font-size: clamp(2.3rem, 11vw, 3.5rem);
  }
  .section-title {
    font-size: 2rem;
  }
  .services-grid,
  .work-grid {
    gap: 1.4rem;
  }
}

/* Light theming adjustments */
.light nav a {
  color: #475569;
}
.light nav a:hover {
  color: #1e293b;
}
.light .service-card,
.light .step,
.light .work-item,
.light .about-list li {
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.02));
  border-color: rgba(0, 0, 0, 0.08);
}
.light input,
.light textarea {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}
.light .contact-chip {
  background: linear-gradient(140deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.02));
  border-color: rgba(0, 0, 0, 0.08);
}
.light .marquee {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}
.light .scroll-indicator {
  border-color: rgba(0, 0, 0, 0.4);
}
.light .scroll-indicator span {
  background: #1e293b;
}
.light #themeToggle {
  border-color: rgba(0, 0, 0, 0.12);
}
