:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #0f172a;
  --bg-light: #111827;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --card-bg: #020617;
  --border: #1f2937;
  --accent: #22c55e;
  --danger: #f97373;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.35);
}

/* =======================
   LIGHT THEME OVERRIDES
   ======================= */

body[data-theme="light"] {
  background: #f3f4f6;
  color: #111827;
}

/* Navbar + header */
body[data-theme="light"] .navbar {
  background: rgba(249, 250, 251, 0.96);
  border-bottom-color: #e5e7eb;
}

/* Light text / muted text */
body[data-theme="light"] .brand-text-sub,
body[data-theme="light"] .section-subtitle,
body[data-theme="light"] .hero-subtitle,
body[data-theme="light"] .hero-meta,
body[data-theme="light"] .section-eyebrow,
body[data-theme="light"] .section-link,
body[data-theme="light"] .card-text,
body[data-theme="light"] .card-list,
body[data-theme="light"] .portfolio-card,
body[data-theme="light"] .about-card,
body[data-theme="light"] .contact-card,
body[data-theme="light"] .footer,
body[data-theme="light"] .field-label,
body[data-theme="light"] .stack-list,
body[data-theme="light"] .hero-footer-note {
  color: #4b5563;
}

body[data-theme="light"] .hero-meta {
  color: #374151;
}

body[data-theme="light"] .hero-meta strong {
  color: #111827;
}

/* Normal cards in light mode */
body[data-theme="light"] .card,
body[data-theme="light"] .portfolio-card,
body[data-theme="light"] .about-card,
body[data-theme="light"] .contact-card {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

/* Hero right card (JTeki project snapshot) in light mode */
body[data-theme="light"] .hero-right {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .hero-right-header {
  color: #6b7280;
}

body[data-theme="light"] .mini-pill {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #4b5563;
}

body[data-theme="light"] .stat-card {
  background: #f9fafb;
  border-color: #e5e7eb;
}

body[data-theme="light"] .stat-label {
  color: #6b7280;
}

body[data-theme="light"] .stat-value {
  color: #111827;
}

body[data-theme="light"] .stat-tag {
  color: #2563eb;
}

/* About card specific light fixes */
body[data-theme="light"] .about-card {
  color: #4b5563;
}

body[data-theme="light"] .about-highlight {
  color: #111827;
}

body[data-theme="light"] .about-list li::before {
  color: #3b82f6;
}

/* Footer border */
body[data-theme="light"] .footer {
  border-top-color: #e5e7eb;
}

/* Form controls */
body[data-theme="light"] input,
body[data-theme="light"] textarea,
body[data-theme="light"] select {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}

/* Mobile nav in light mode */
body[data-theme="light"] .mobile-nav {
  background: rgba(249, 250, 251, 0.98);
  border-bottom-color: #e5e7eb;
}

body[data-theme="light"] .mobile-nav a {
  color: #374151;
}

/* Theme toggle button */
.theme-toggle {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.8);
  color: #f9fafb;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
}

body[data-theme="light"] .theme-toggle {
  background: #ffffff;
  color: #111827;
}

/* =======================
   BASE STYLES (DARK)
   ======================= */

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #1f2937 0, #020617 50%, #000 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* =======================
   NAVBAR
   ======================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.95),
    rgba(15, 23, 42, 0.85),
    transparent
  );
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
  margin-bottom: 1.5rem;
}

.navbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Brand */

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: radial-gradient(circle at top left, #38bdf8, #2563eb 45%, #020617 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: none;
}

.brand-text-main {
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 1.05rem;
  text-transform: uppercase;
}

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

/* Center nav links (desktop) */

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  color: var(--text-muted);
  position: relative;
  padding-bottom: 0.2rem;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #38bdf8, #2563eb);
  transition: width 0.2s ease-out;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Right-side controls */

.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* Language select */

.lang-select {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
}

.lang-select:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
}

/* Hamburger button (inside nav-cta) */

.nav-toggle {
  display: none; /* hidden by default, visible only on mobile */
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding: 0.3rem 0.7rem;
  font-size: 1rem;
  cursor: pointer;
}

/* Mobile nav panel */

.mobile-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 64px; /* approx navbar height */
  padding: 0.75rem 1.25rem 1rem;
  background: rgba(15, 23, 42, 0.98);
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.mobile-nav a {
  display: block;
  padding: 0.4rem 0;
  color: var(--text-muted);
}

.mobile-divider {
  margin: 0.5rem 0 0.75rem;
  border-top: 1px solid rgba(55, 65, 81, 0.7);
}

.mobile-lang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
}

/* Light theme mobile nav */
body[data-theme="light"] .mobile-nav {
  background: rgba(249, 250, 251, 0.98);
  border-bottom-color: #e5e7eb;
}

body[data-theme="light"] .mobile-nav a {
  color: #374151;
}

/* =======================
   BUTTONS
   ======================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.13s ease-out, box-shadow 0.13s ease-out,
    background 0.13s ease-out, border-color 0.13s ease-out;
  background: none;
  color: var(--text);
}

.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  box-shadow: none;
  border-color: rgba(148, 163, 184, 0.15);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
}

.btn-outline {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.7);
}

.btn-outline:hover {
  transform: translateY(-1px);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.7);
}

.btn small {
  opacity: 0.7;
  font-size: 0.7rem;
}

/* Badge under hero buttons */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.7rem 0.2rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: radial-gradient(circle at top left, #0f172a, #020617);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.18);
}

/* =======================
   HERO
   ======================= */

.hero {
  margin-top: 1.3rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.eyebrow-pill {
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.09);
  border: 1px solid rgba(37, 99, 235, 0.65);
  color: #bfdbfe;
  font-size: 0.72rem;
}

h1 {
  font-size: clamp(2.2rem, 3.1vw, 3rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
}

h1 span.highlight {
  background: linear-gradient(120deg, #38bdf8, #60a5fa, #a855f7);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  max-width: 32rem;
  font-size: 0.98rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
  align-items: center;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.9rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.hero-meta strong {
  color: var(--text);
  font-weight: 600;
}

/* Hero right snapshot card */

.hero-right {
  padding: 1.1rem;
  border-radius: 1.3rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: radial-gradient(circle at top, #1f2937, #020617 55%);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.hero-right-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mini-pill {
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.stat-card {
  border-radius: 1rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: radial-gradient(circle at top left, #111827, #020617);
  padding: 0.7rem 0.8rem;
  font-size: 0.8rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}

.stat-value {
  font-weight: 600;
  font-size: 1rem;
}

.stat-tag {
  font-size: 0.7rem;
  color: #a5b4fc;
}

.stack-list {
  margin-top: 0.55rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stack-list span {
  color: #bfdbfe;
}

.hero-footer-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* =======================
   SECTIONS
   ======================= */

.section {
  margin-top: 3rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 600;
}

.section-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 26rem;
}

.section-link {
  font-size: 0.8rem;
  color: #93c5fd;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0.9;
}

.section-link:hover {
  opacity: 1;
}

/* SERVICES */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: radial-gradient(circle at top left, #020617, #020617);
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 55%);
  opacity: 0;
  transition: opacity 0.18s ease-out;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: radial-gradient(circle at top, #38bdf8, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.card-title {
  font-weight: 600;
  font-size: 0.98rem;
}

.card-tag {
  font-size: 0.68rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--text-muted);
}

.card-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-list {
  margin-top: 0.4rem;
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: grid;
  gap: 0.22rem;
}

.card-list li::before {
  content: "•";
  color: #60a5fa;
  margin-right: 0.35rem;
}

/* PORTFOLIO */

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.portfolio-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: radial-gradient(circle at top right, #111827, #020617);
  padding: 0.85rem 0.9rem;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.portfolio-pill {
  font-size: 0.7rem;
  color: #a5b4fc;
}

.portfolio-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.portfolio-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.meta-pill {
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
}

/* ABOUT + CONTACT */

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.6rem;
}

.about-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: radial-gradient(circle at top, #111827, #020617);
  padding: 1rem;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.9);
  font-size: 0.9rem;
  color: var(--text-muted);
  display: grid;
  gap: 0.8rem;
}

/* About tags row */

.about-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.about-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border-width: 1px;
  border-style: solid;
  font-size: 0.78rem;
  line-height: 1;
  width: auto;
  height: auto;
}

/* Dark mode look for tags */
body[data-theme="dark"] .about-tag,
body:not([data-theme="light"]) .about-tag {
  border-color: rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
  background: transparent;
}

/* Light mode tags */
body[data-theme="light"] .about-tag {
  border-color: #d1d5db;
  color: #374151;
  background: #f9fafb;
}

.about-highlight {
  color: #e5e7eb;
  font-size: 0.95rem;
}

.about-list {
  list-style: none;
  display: grid;
  gap: 0.25rem;
  font-size: 0.84rem;
}

.about-list li::before {
  content: "▹";
  color: #38bdf8;
  margin-right: 0.35rem;
}

/* Contact card */

.contact-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: radial-gradient(circle at top left, #020617, #020617);
  padding: 1rem;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.9);
  display: grid;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.contact-form {
  display: grid;
  gap: 0.7rem;
}

.field {
  display: grid;
  gap: 0.2rem;
}

.field-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

input,
textarea,
select {
  border-radius: 0.55rem;
  border: 1px solid rgba(55, 65, 81, 0.95);
  background: rgba(15, 23, 42, 0.85);
  padding: 0.55rem 0.7rem;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  resize: vertical;
  min-height: 2.4rem;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
}

.contact-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: grid;
  gap: 0.3rem;
}

.contact-meta a {
  color: #93c5fd;
}

/* =======================
   FOOTER
   ======================= */

.footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(31, 41, 55, 0.95);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
}

/* =======================
   RESPONSIVE
   ======================= */

/* Mobile header + layout up to 900px */
@media (max-width: 900px) {
  /* Hide desktop nav links */
  .nav-links {
    display: none !important;
  }

  /* Keep only theme + hamburger in top bar (Option D) */
  .nav-cta .btn-primary,
  .nav-cta .lang-select {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .navbar-inner {
    justify-content: space-between;
  }

  /* Layout: hero stacks, 2-column cards */
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-right {
    order: -1;
  }

  .cards-grid,
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .cards-grid,
  .portfolio-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  h1 {
    font-size: 1.9rem;
  }

  .section {
    margin-top: 2.3rem;
  }
}

/* =======================
   FADE-IN UTILITY
   ======================= */

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

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

/* =======================
   MOBILE MENU CTA ALIGNMENT
   ======================= */
@media (max-width: 900px) {
  .mobile-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
    margin: 1rem 0 0.5rem;
    border-radius: 999px;
    font-size: 1rem;
    text-align: center;
  }

  .mobile-cta .cta-text {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem; /* spacing between text and arrow */
  }
}

.form-message {
  margin-top: 0.6rem;
  font-size: 0.8rem;
}

.form-message--success {
  color: #22c55e; /* green */
}

.form-message--error {
  color: #f97373; /* red */
}