/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0c0a0d;
  --bg-elevated: #141016;
  --bg-card: #1a1520;
  --border: #2a2230;
  --border-hover: #3d3248;
  --text: #f2ece4;
  --text-secondary: #a89b8f;
  --text-muted: #6b5f56;
  --cream: #f2ece4;
  --cream-dim: #d4c9bc;
  --accent: #8b2942;
  --accent-light: #c94060;
  --accent-bright: #e8556e;
  --accent-glow: rgba(139, 41, 66, 0.2);
  --burgundy: #6b1d32;
  --burgundy-deep: #4a1423;
  --crimson: #a03050;
  --warm-dark: #1e1520;
  --radius: 10px;
  --radius-lg: 16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* === Skip Link === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 9999;
  padding: 12px 20px;
  background: var(--accent-bright);
  color: var(--cream);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* === Focus Visible === */
:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

/* === Particle Canvas === */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* === Layout === */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === Navigation === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(12, 10, 13, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1.1rem;
}

.logo-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.logo-text {
  color: var(--cream);
}

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

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--cream);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: 0.2s;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 16px 24px 24px;
  gap: 16px;
  border-top: 1px solid var(--border);
}

.mobile-nav a {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.mobile-nav.open {
  display: flex;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  border-color: var(--accent);
  color: var(--cream);
  box-shadow: 0 4px 24px rgba(139, 41, 66, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--crimson), var(--burgundy));
  border-color: var(--crimson);
  box-shadow: 0 4px 32px rgba(139, 41, 66, 0.5);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--cream);
  border-color: var(--accent);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

/* === Hero === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
  overflow: hidden;
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(242, 236, 228, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 236, 228, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
}

.glow-1 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  top: -200px;
  right: -100px;
  opacity: 0.15;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: var(--burgundy-deep);
  bottom: -150px;
  left: -100px;
  opacity: 0.2;
}

.glow-3 {
  width: 300px;
  height: 300px;
  background: var(--cream);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.03;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 0;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-bright);
  background: var(--accent-glow);
  border: 1px solid rgba(139, 41, 66, 0.3);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--cream);
}

.gradient-text {
  background: linear-gradient(135deg, var(--cream) 0%, var(--accent-bright) 50%, var(--crimson) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  max-width: 560px;
  margin: 0 auto 36px;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 64px;
}

/* === 3D Cubes === */
.hero-3d {
  position: relative;
  height: 120px;
  margin-bottom: 48px;
  perspective: 800px;
}

.cube-scene {
  position: absolute;
  width: 50px;
  height: 50px;
  perspective: 600px;
}

.cube-scene-1 {
  left: 20%;
  top: 10px;
  animation: float-1 6s ease-in-out infinite;
}

.cube-scene-2 {
  left: 50%;
  top: 30px;
  transform: translateX(-50%);
  animation: float-2 8s ease-in-out infinite;
}

.cube-scene-3 {
  right: 20%;
  top: 0;
  animation: float-3 7s ease-in-out infinite;
}

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: cube-spin 12s linear infinite;
  will-change: transform;
}

.cube-scene-2 .cube {
  animation-duration: 16s;
  animation-direction: reverse;
}

.cube-scene-3 .cube {
  animation-duration: 10s;
}

.cube-face {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(139, 41, 66, 0.3);
  background: rgba(139, 41, 66, 0.06);
  backdrop-filter: blur(4px);
}

.cube-scene-2 .cube-face {
  width: 50px;
  height: 50px;
  border-color: rgba(242, 236, 228, 0.1);
  background: rgba(242, 236, 228, 0.03);
}

.cube-scene-3 .cube-face {
  border-color: rgba(200, 64, 96, 0.25);
  background: rgba(200, 64, 96, 0.05);
}

.cube-front  { transform: rotateY(0deg) translateZ(25px); }
.cube-back   { transform: rotateY(180deg) translateZ(25px); }
.cube-right  { transform: rotateY(90deg) translateZ(25px); }
.cube-left   { transform: rotateY(-90deg) translateZ(25px); }
.cube-top    { transform: rotateX(90deg) translateZ(25px); }
.cube-bottom { transform: rotateX(-90deg) translateZ(25px); }

@keyframes cube-spin {
  0%   { transform: rotateX(0deg) rotateY(0deg); }
  100% { transform: rotateX(360deg) rotateY(360deg); }
}

@keyframes float-1 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes float-2 {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-20px); }
}

@keyframes float-3 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--cream);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* === Section Common === */
.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--cream);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* === Services === */
.services {
  position: relative;
  z-index: 1;
  padding: 120px 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.service-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color 0.3s, transform 0.3s;
  overflow: hidden;
  transform-style: preserve-3d;
  contain: layout style paint;
}

.card-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  transform: translate(-50%, -50%);
}

.service-card:hover .card-glow {
  opacity: 1;
}

.service-card:hover {
  border-color: rgba(139, 41, 66, 0.4);
  transform: translateY(-4px);
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--accent-glow);
  border: 1px solid rgba(139, 41, 66, 0.3);
  border-radius: 10px;
  color: var(--accent-bright);
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--cream);
}

.service-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.service-tags li {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(242, 236, 228, 0.04);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  transition: border-color 0.2s, color 0.2s;
}

.service-card:hover .service-tags li {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

/* === About === */
.about {
  position: relative;
  z-index: 1;
  padding: 120px 0;
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.about-content .section-tag {
  display: block;
  margin-bottom: 12px;
}

.about-content h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--cream);
}

.about-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.about-values {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
}

.value {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.value-indicator {
  width: 8px;
  height: 8px;
  background: var(--accent-bright);
  border-radius: 50%;
  margin-top: 8px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(232, 85, 110, 0.4);
}

.value strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cream);
}

.value span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* === Terminal === */
.about-visual {
  position: relative;
}

.terminal {
  background: rgba(12, 10, 13, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.terminal-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: rgba(242, 236, 228, 0.02);
  border-bottom: 1px solid var(--border);
}

.terminal-dots {
  display: flex;
  gap: 6px;
  margin-right: 16px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-hover);
}

.terminal-dots span:first-child { background: var(--accent-bright); }
.terminal-dots span:nth-child(2) { background: var(--cream-dim); }
.terminal-dots span:last-child { background: var(--text-muted); }

.terminal-title {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.terminal-body {
  padding: 20px;
}

.terminal-line {
  line-height: 1.8;
  white-space: pre;
}

.t-prompt {
  color: var(--accent-bright);
}

.t-cmd {
  color: var(--cream);
}

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

.t-accent {
  color: var(--accent-bright);
}

.t-gap {
  margin-top: 12px;
}

.t-cursor {
  color: var(--accent-bright);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* === Orbit Ring === */
.orbit-ring {
  position: absolute;
  width: 280px;
  height: 280px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotateX(65deg);
  transform-style: preserve-3d;
  border: 1px solid rgba(139, 41, 66, 0.15);
  border-radius: 50%;
  animation: orbit-rotate 20s linear infinite;
  pointer-events: none;
  will-change: transform;
}

.orbit-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--accent-bright);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(232, 85, 110, 0.6);
}

.orbit-dot-1 {
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
}

.orbit-dot-2 {
  bottom: 20%;
  left: -4px;
}

.orbit-dot-3 {
  bottom: 20%;
  right: -4px;
}

@keyframes orbit-rotate {
  0% { transform: translate(-50%, -50%) rotateX(65deg) rotateZ(0deg); }
  100% { transform: translate(-50%, -50%) rotateX(65deg) rotateZ(360deg); }
}

/* === Credibility === */
.credibility {
  position: relative;
  z-index: 1;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.credibility-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.cred-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.cred-badge svg {
  color: var(--accent-bright);
  flex-shrink: 0;
  opacity: 0.8;
}

.cred-badge:hover {
  color: var(--cream);
}

.cred-badge:hover svg {
  opacity: 1;
}

.cred-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .credibility-inner {
    gap: 8px;
  }

  .cred-divider {
    display: none;
  }

  .cred-badge {
    padding: 8px 16px;
    font-size: 0.75rem;
  }
}

/* === Stack === */
.stack {
  position: relative;
  z-index: 1;
  padding: 80px 0 120px;
}

.stack-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.stack-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--mono);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 8px;
  transition: all 0.2s;
}

.stack-item svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.stack-item:hover {
  border-color: var(--accent);
  color: var(--cream);
  box-shadow: 0 0 16px rgba(139, 41, 66, 0.2);
}

.stack-item:hover svg {
  opacity: 1;
}

/* === Work === */
.work {
  position: relative;
  z-index: 1;
  padding: 80px 0 120px;
  border-top: 1px solid var(--border);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 420px));
  gap: 20px;
  justify-content: center;
}

.work-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: var(--bg-card);
}

.work-card:hover {
  border-color: rgba(139, 41, 66, 0.4);
  box-shadow: 0 0 32px rgba(139, 41, 66, 0.12);
}

.work-card-bg {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  transition: opacity 0.3s;
}

.work-card:hover .work-card-bg {
  opacity: 0.55;
}

.work-card-bg-grid {
  background-image:
    linear-gradient(rgba(139, 41, 66, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 41, 66, 0.5) 1px, transparent 1px);
  background-size: 32px 32px;
}

.work-card-bg-circles {
  background-image:
    radial-gradient(circle at 30% 30%, rgba(232, 85, 110, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(107, 29, 50, 0.5) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(139, 41, 66, 0.3) 0%, transparent 60%);
}

.work-card-bg-diagonal {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 16px,
    rgba(139, 41, 66, 0.35) 16px,
    rgba(139, 41, 66, 0.35) 17px
  );
}

.work-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 10, 13, 0.5);
  backdrop-filter: blur(2px);
}

.work-coming-soon {
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 100px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* === Work Card — Live Product === */
.work-card-live {
  aspect-ratio: auto;
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.work-card-live .work-card-bg {
  opacity: 0.2;
}

.work-card-live:hover .work-card-bg {
  opacity: 0.35;
}

.work-card-content {
  position: relative;
  z-index: 1;
  padding: 32px;
}

.work-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.work-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--accent-glow);
  border: 1px solid rgba(139, 41, 66, 0.3);
  border-radius: 10px;
  color: var(--accent-bright);
}

.work-live-badge {
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--mono);
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-card-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 10px;
}

.work-card-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Reuses .service-tags base styles; only margin differs */
.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin-bottom: 20px;
}

.work-tags li {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(242, 236, 228, 0.04);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  transition: border-color 0.2s, color 0.2s;
}

.work-card-live:hover .work-tags li {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

.work-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-bright);
  transition: color 0.2s;
}

.work-card-live:hover .work-card-link {
  color: var(--cream);
}

/* === Contact === */
.contact {
  position: relative;
  z-index: 1;
  padding: 120px 0;
  border-top: 1px solid var(--border);
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact-content .section-tag {
  display: block;
  margin-bottom: 12px;
}

.contact-content h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--cream);
}

.contact-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-bright);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.contact-link:hover {
  color: var(--cream);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--cream);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 41, 66, 0.15);
}

.form-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* === Footer === */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-left p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--cream);
}

/* === Animations === */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Hero reveal === */
.hero-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero-reveal.hero-visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Terminal typing animation === */
.terminal-typed .terminal-line {
  opacity: 0;
}

.terminal-typed .terminal-line.typed-visible {
  opacity: 1;
}

/* Characters in typed lines start hidden until JS reveals them */
.terminal-typed .t-cmd.typing::after {
  content: '';
}

/* === Responsive === */

/* Tablet: 1024px — services grid transitions from 2-col */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .about-grid {
    gap: 40px;
  }

  .contact-inner {
    gap: 40px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
  }

}

/* Mobile: 768px */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
    /* Ensure 44x44px minimum touch target */
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px;
  }

  /* Mobile nav links — minimum touch target */
  .mobile-nav a {
    font-size: 0.95rem;
    color: var(--text-secondary);
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Hero — better spacing and readable font sizes */
  .hero-content {
    padding: 48px 0 40px;
  }

  .hero h1 {
    font-size: clamp(2rem, 8vw, 3rem);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
  }

  .hero-sub {
    font-size: 0.95rem;
    margin-bottom: 28px;
    padding: 0 8px;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 5px 14px;
    margin-bottom: 20px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
  }

  /* Buttons — minimum 44px touch target height */
  .btn {
    min-height: 44px;
    padding: 10px 20px;
  }

  .btn-sm {
    min-height: 44px;
    padding: 10px 16px;
  }

  /* Hero stats — 2x2 grid on small screens */
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
    justify-items: center;
    max-width: 320px;
    margin: 0 auto;
  }

  .stat-divider {
    display: none;
  }

  .hero-3d {
    display: none;
  }

  /* Services — single column */
  .services {
    padding: 80px 0;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* About */
  .about {
    padding: 80px 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-visual {
    order: -1;
  }

  /* Terminal — scale properly on mobile */
  .terminal {
    font-size: 0.75rem;
    overflow-x: auto;
  }

  .terminal-body {
    padding: 16px;
  }

  .terminal-line {
    white-space: pre-wrap;
    word-break: break-word;
  }

  .orbit-ring {
    display: none;
  }

  /* Contact — better spacing */
  .contact {
    padding: 80px 0;
  }

  .contact-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-content p {
    margin-bottom: 24px;
  }

  /* Footer — stack properly */
  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .footer-left {
    flex-direction: column;
    gap: 8px;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  /* Footer links — minimum touch target */
  .footer-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Section header */
  .section-header {
    margin-bottom: 40px;
  }

  /* Stack section */
  .stack {
    padding: 60px 0 80px;
  }

  /* Work section */
  .work {
    padding: 60px 0 80px;
  }

  .work-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: none;
  }
}

/* Small phones: 375px */
@media (max-width: 375px) {
  .container {
    padding: 0 16px;
  }

  .nav-inner {
    padding: 0 16px;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .hero-sub {
    font-size: 0.88rem;
    padding: 0 4px;
  }

  .hero-badge {
    font-size: 0.7rem;
    padding: 4px 12px;
  }

  /* Hero stats remain 2x2 but tighter */
  .hero-stats {
    gap: 16px 20px;
    max-width: 280px;
  }

  .stat-value {
    font-size: 0.9rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .service-card {
    padding: 20px;
  }

  .section-header h2 {
    font-size: 1.6rem;
  }

  .contact-form {
    gap: 16px;
  }

  .form-group input,
  .form-group textarea {
    padding: 12px 12px;
  }

  /* Ensure no horizontal scroll at 320px minimum */
  .hero-3d {
    display: none;
  }

  .terminal {
    font-size: 0.7rem;
  }

  .stack-item {
    font-size: 0.75rem;
    padding: 8px 14px;
  }
}

/* Minimum 320px — guard against horizontal overflow */
@media (max-width: 320px) {
  .container {
    padding: 0 12px;
  }

  .nav-inner {
    padding: 0 12px;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .btn {
    font-size: 0.8rem;
    padding: 10px 14px;
  }
}

/* Smooth transitions between breakpoints */
.services-grid,
.about-grid,
.contact-inner,
.hero-stats,
.footer-inner {
  transition: gap 0.3s ease;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .terminal-typed .terminal-line {
    opacity: 1;
  }

  .cube,
  .cube-scene-1,
  .cube-scene-2,
  .cube-scene-3 {
    animation: none;
  }

  .orbit-ring {
    animation: none;
  }

  .t-cursor {
    animation: none;
  }

  .service-card {
    transition: none;
  }

  .service-card:hover {
    transform: none;
  }
}
