:root {
  --navy-deepest: #050d1a;
  --navy-deep: #0a1628;
  --navy-mid: #0f2144;
  --navy-light: #1a3560;
  --navy-bright: #1e4080;
  --accent: #4d9fff;
  --accent-glow: #7ab8ff;
  --gold: #c8a96e;
  --text-primary: #e8eef8;
  --text-muted: #7a9bc4;
  --text-dim: #3d5a82;
  --border: rgba(77, 159, 255, 0.15);
}

[data-theme="light"] {
  --navy-deepest: #f0f4ff;
  --navy-deep: #e2e9f8;
  --navy-mid: #c8d6f0;
  --navy-light: #a8bde8;
  --navy-bright: #7a9bc4;
  --accent: #1a5fbf;
  --accent-glow: #2563eb;
  --text-primary: #0a1628;
  --text-muted: #3d5a82;
  --text-dim: #7a9bc4;
  --border: rgba(26, 95, 191, 0.15);
}

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

html,
body {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--navy-deepest);
  color: var(--text-primary);
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  line-height: 1.6;
}

/* ── NOISE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── LIGHT/DARK TOGGLE ── */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.toggle-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 56px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 4px;
  position: relative;
  transition: background 0.3s;
}

.toggle-thumb {
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  left: 4px;
  transition: transform 0.3s ease;
  z-index: 1;
}

.toggle-icon {
  font-size: 0.75rem;
  margin-left: auto;
  padding-right: 2px;
  z-index: 0;
}

[data-theme="light"] .toggle-track {
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .toggle-thumb {
  transform: translateX(28px);
}

/* ── LANG DROPDOWN ── */
.lang-dropdown {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  transition: all 0.2s;
}

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

.lang-btn .arrow-down {
  font-size: 0.55rem;
  transition: transform 0.2s;
}

.lang-dropdown.open .arrow-down {
  transform: rotate(180deg);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--navy-deep);
  border: 1px solid var(--border);
  border-radius: 4px;
  min-width: 130px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.lang-dropdown.open .lang-menu {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.lang-option:hover {
  background: var(--navy-mid);
  color: var(--text-primary);
}

.lang-option.active {
  color: var(--accent);
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem 4rem;
  background: linear-gradient(to bottom, rgba(5, 13, 26, 0.95), transparent);
  backdrop-filter: blur(2px);
  transition: background 0.3s;
}

.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  color: var(--accent-glow);
  letter-spacing: 0.02em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.nav-toggle {
  display: none;
  flex-shrink: 0;
}

.nav-controls-desktop {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.nav-controls-mobile {
  display: none;
}

/* ── HERO ── */
#hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 8rem 4rem 4rem;
  overflow: hidden;
  gap: 2rem;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 70% 50%, rgba(30,64,128,0.25) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(77,159,255,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.hero-canvas-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInRight 1s ease 0.3s both;
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

#hero-canvas {
  width: 100%;
  height: 100%;
}

.hero-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.hero-tag::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
}

h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

h1 em {
  font-style: italic;
  color: var(--accent-glow);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 3rem;
}

.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 3px;
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.25s;
}

.btn-primary {
  background: var(--accent);
  color: var(--navy-deepest);
  font-weight: 500;
}

.btn-primary:hover {
  background: var(--accent-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(77, 159, 255, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ── SCROLL INDICATOR ── */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: fadeInUp 1s ease 1s both;
  z-index: 1;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.2); }
}

/* ── SECTION COMMONS ── */
section {
  position: relative;
  z-index: 1;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 4rem;
}

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--accent);
}

h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* ── ABOUT ── */
#about {
  background: var(--navy-deep);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
  margin-top: 3rem;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  font-size: 0.98rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.skill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── PROJECTS (homepage) ── */
#projects {
  background: var(--navy-deepest);
  display: none;
}

.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  position: relative;
  background: var(--navy-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(77, 159, 255, 0.3);
  border-color: rgba(77, 159, 255, 0.3);
}

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

.project-preview-wrap {
  height: 200px;
  overflow: hidden;
  background: var(--navy-mid);
}

.project-preview {
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-1 { background: linear-gradient(135deg, #0a2040 0%, #1a3560 50%, #0f2144 100%); }
.thumb-2 { background: linear-gradient(135deg, #091830 0%, #0f2c50 50%, #0a1e38 100%); }
.thumb-3 { background: linear-gradient(135deg, #0c1e3a 0%, #1a2c50 50%, #0a1628 100%); }

.thumb-icon {
  font-size: 3rem;
  opacity: 0.25;
}

.project-body { padding: 1.5rem; }

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(77, 159, 255, 0.1);
  border: 1px solid rgba(77, 159, 255, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
}

.project-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.project-links { display: flex; gap: 1rem; }

.project-link {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s;
}

.project-link:hover { color: var(--accent-glow); }

.project-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
}

.project-card.featured .project-preview-wrap {
  height: auto;
  min-height: 260px;
}

/* ── CONTACT SECTION (index) ── */
#contact {
  background: var(--navy-deep);
  border-top: 1px solid var(--border);
}

.contact-inner {
  max-width: 650px;
  margin: 0 auto;
  text-align: center;
  padding: 6rem 2rem;
}

.contact-inner h2 { margin-bottom: 1rem; }

.contact-inner p {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 0.98rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  border-top: 1px solid var(--border);
}

/* ── ANIMATIONS ── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

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

.hero-content > * {
  animation: fadeInLeft 0.8s ease both;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.25s; }
.hero-content > *:nth-child(3) { animation-delay: 0.4s; }
.hero-content > *:nth-child(4) { animation-delay: 0.55s; }

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ══════════════════════════════════════
   CONTACT PAGE
══════════════════════════════════════ */

#contact-hero {
  position: relative;
  padding: 10rem 4rem 4rem;
  overflow: hidden;
  min-height: 38vh;
  display: flex;
  align-items: flex-end;
}

#contact-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 30% 60%, black 10%, transparent 80%);
  pointer-events: none;
}

.contact-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.contact-orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(30, 64, 128, 0.55) 0%, transparent 70%);
  top: -80px; left: -80px;
}

.contact-orb-2 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(77, 159, 255, 0.12) 0%, transparent 70%);
  bottom: -40px; right: 10%;
}

.contact-hero-content {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.contact-hero-content h1 { font-size: clamp(2.5rem, 5vw, 4rem); }

#contact-main { background: var(--navy-deepest); }

.contact-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 4rem 6rem;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 5rem;
  align-items: start;
}

.contact-info { position: sticky; top: 6rem; }

.contact-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.info-block { margin-bottom: 2rem; }

.info-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.info-value { font-size: 0.92rem; color: var(--text-primary); }
.info-value a { color: var(--text-primary); text-decoration: none; transition: color 0.2s; }
.info-value a:hover { color: var(--accent); }

.social-row {
  display: flex;
  gap: 0.8rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.social-btn {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 3px;
  text-decoration: none;
  transition: all 0.2s;
}

.social-btn:hover { color: var(--accent); border-color: rgba(77, 159, 255, 0.4); }

.contact-form-wrap {
  background: var(--navy-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.field { margin-bottom: 1.4rem; }

.field label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: rgba(10, 22, 40, 0.8);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.8rem 1rem;
  color: var(--text-primary);
  font-family: 'Lato', sans-serif;
  font-size: 0.92rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a9bc4' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.field select option { background: var(--navy-deep); color: var(--text-primary); }
.field textarea { resize: vertical; min-height: 140px; line-height: 1.6; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(77, 159, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.07);
}

.field input::placeholder,
.field textarea::placeholder { color: var(--text-dim); }

.field input:not(:placeholder-shown):valid { border-color: rgba(77, 159, 255, 0.3); }
.field input:not(:placeholder-shown):invalid { border-color: rgba(255, 100, 100, 0.3); }

.char-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-align: right;
  margin-top: 0.3rem;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  gap: 1rem;
}

.form-note { font-size: 0.78rem; color: var(--text-dim); }

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2.2rem;
  background: var(--accent);
  color: var(--navy-deepest);
  border: none;
  border-radius: 3px;
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}

.btn-submit:hover {
  background: var(--accent-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(77, 159, 255, 0.3);
}

.btn-submit:active { transform: translateY(0); }
.btn-submit .arrow { transition: transform 0.2s; }
.btn-submit:hover .arrow { transform: translateX(4px); }

.success-msg { display: none; text-align: center; padding: 3rem 2rem; }
.success-msg.visible { display: block; }
.success-icon { font-size: 2.5rem; margin-bottom: 1rem; }

.success-msg h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.success-msg p { color: var(--text-muted); font-size: 0.9rem; }

/* ══════════════════════════════════════
   PROJECTS PAGE
══════════════════════════════════════ */

#projects-hero {
  position: relative;
  padding: 10rem 4rem 4rem;
  overflow: hidden;
  min-height: 38vh;
  display: flex;
  align-items: flex-end;
}

#projects-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 30% 60%, black 10%, transparent 80%);
  pointer-events: none;
}

.projects-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.projects-orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(30, 64, 128, 0.55) 0%, transparent 70%);
  top: -80px; right: -80px;
}

.projects-orb-2 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(77, 159, 255, 0.12) 0%, transparent 70%);
  bottom: -40px; left: 10%;
}

.projects-hero-content {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.projects-hero-content h1 { font-size: clamp(2.5rem, 5vw, 4rem); }

#projects-main {
  background: var(--navy-deepest);
  padding: 4rem 4rem 6rem;
}

.projects-main-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.filter-btn {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

.filter-btn.active {
  background: var(--accent);
  color: var(--navy-deepest);
  border-color: var(--accent);
  font-weight: 500;
}

.all-projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  min-height: 300px;
}

.proj-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.3s, box-shadow 0.3s;
}

.proj-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
}

.proj-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease, filter 0.3s ease;
}

.proj-card:hover .proj-card-img {
  transform: scale(1.05);
  filter: blur(3px) brightness(0.5);
}

.proj-card-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.3;
}

.proj-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5,13,26,0.95) 0%, rgba(5,13,26,0.6) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.proj-card:hover .proj-card-overlay { opacity: 1; }

.proj-card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.proj-card-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.proj-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.proj-card-links { display: flex; gap: 0.8rem; }

.proj-card-link {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.4rem 1rem;
  border-radius: 3px;
  transition: all 0.2s;
}

.proj-card-link.primary {
  background: var(--accent);
  color: var(--navy-deepest);
  font-weight: 500;
}

.proj-card-link.primary:hover { background: var(--accent-glow); }

.proj-card-link.secondary {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
}

.proj-card-link.secondary:hover { border-color: var(--accent); color: var(--accent); }

.no-results {
  display: none;
  text-align: center;
  padding: 4rem 0;
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  grid-column: 1 / -1;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.page-btn {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.6rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

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

.page-btn.active {
  background: var(--accent);
  color: var(--navy-deepest);
  border-color: var(--accent);
  font-weight: 500;
}

.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-btn:disabled:hover { border-color: var(--border); color: var(--text-muted); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */

@media (max-width: 900px) {
  .all-projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  /* ── Nav ── */
  nav { padding: 1rem 1.5rem; }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 101;
    background: none;
    border: none;
    padding: 4px;
  }

  .nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-muted);
    transition: all 0.3s ease;
  }

  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-links {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0; right: 0;
    width: 260px;
    height: 100vh;
    background: rgba(5, 13, 26, 0.98);
    backdrop-filter: blur(12px);
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    border-left: 1px solid var(--border);
    z-index: 99;
  }

  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1rem; }

  .nav-controls-mobile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
  }

  .nav-controls-mobile .lang-dropdown { position: static; }

  .nav-controls-mobile .lang-menu {
  position: fixed;
  top: 7rem;
  left: 2rem;
  right: 2rem;
  bottom: auto;
  width: auto;
}

  .nav-controls-desktop { display: none; }

  /* ── Hero ── */
  #hero {
    grid-template-columns: 1fr;
    padding: 7rem 1.5rem 4rem;
    gap: 3rem;
  }

  .hero-canvas-wrap {
    height: 280px;
    order: -1;
  }

  /* ── General ── */
  .section-inner { padding: 4rem 1.5rem; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .project-card.featured { grid-template-columns: 1fr; }
  .project-card.featured .project-preview-wrap { height: 200px; }
  .projects-header { flex-direction: column; align-items: flex-start; gap: 1rem; }

  /* ── Contact page ── */
  #contact-hero { padding: 8rem 1.5rem 3rem; }
  .contact-layout { grid-template-columns: 1fr; gap: 3rem; padding: 3rem 1.5rem 5rem; }
  .contact-info { position: static; }
  .form-row { grid-template-columns: 1fr; }
  .form-footer { flex-direction: column; align-items: stretch; }
  .btn-submit { justify-content: center; }
  .contact-form-wrap { padding: 1.5rem; }

  /* ── Projects page ── */
  #projects-hero { padding: 8rem 1.5rem 3rem; }
  #projects-main { padding: 3rem 1.5rem 5rem; }
  .all-projects-grid { grid-template-columns: 1fr; }
  .proj-card-overlay { opacity: 1; }
  .proj-card:hover .proj-card-img { filter: blur(3px) brightness(0.5); }
}
