:root
{
  --bg: #0a0c14;
  --bg-alt: #101425;
  --text: #e8eaf7;
  --muted: #a9add6;
  --card: #0e1222;
  --primary: #7a7cff; /* Blue-violet */
  --primary-contrast: #0a0c14;
  --primary-strong: #6a5cff; /* Slightly deeper for hovers/focus */
  --border: #1b2140;
  --shadow: 0 6px 24px rgba(6, 8, 20, 0.35);
  --hero-gradient-top: rgba(17, 21, 42, 0.7);
}

[data-theme="light"]
{
  --bg: #f7f8ff;
  --bg-alt: #eef0ff;
  --text: #0e1020;
  --muted: #4d5180;
  --card: #ffffff;
  --primary: #5b6cff; /* Light-mode blue-violet */
  --primary-contrast: #ffffff;
  --primary-strong: #4657f5;
  --border: #dfe3ff;
  --shadow: 0 6px 18px rgba(30, 40, 120, 0.12);
  /* Light-mode hero gradient override */
  --hero-gradient-top: rgba(200, 208, 255, 0.5);
}

*,
*::before,
*::after
{
  box-sizing: border-box;
}

html, body
{
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
               "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji",
               "Segoe UI Emoji", "Segoe UI Symbol";
  line-height: 1.6;
}

img
{
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

a
{
  color: var(--primary);
  text-decoration: none;
}
a:hover,
a:focus
{
  color: var(--primary-strong);
  text-decoration: underline;
}

/* Focus visibility */
:where(a, button, input, select, textarea):focus-visible
{
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 25%, transparent);
}

/* Skip link */
.skip-link
{
  position: absolute;
  left: -9999px;
  top: auto;
}
.skip-link:focus
{
  left: 1rem;
  top: 1rem;
  background: var(--primary);
  color: var(--primary-contrast);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}

.container
{
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header
{
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header .container
{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

/* Header blur on scroll */
.site-header.scrolled
{
  backdrop-filter: blur(12px);
  background: rgba(10, 12, 20, 0.65);
  transition: backdrop-filter 0.3s ease, background 0.3s ease;
}
[data-theme="light"] .site-header.scrolled
{
  background: rgba(247, 248, 255, 0.7);
}

.brand a
{
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--text);
}
.logo
{
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: var(--primary-contrast);
  border-radius: 8px;
  font-weight: 800;
}

.nav
{
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}
.nav a
{
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}
.nav a:hover
{
  background: var(--bg-alt);
  text-decoration: none;
}
/* Visual hint for the active section */
.nav a[aria-current="page"],
.nav a[aria-current="true"]
{
  background: var(--bg-alt);
  color: var(--text);
  text-decoration: none;
}

.theme-toggle
{
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
}

.hero
{
  padding: 3rem 0 2rem;
  background:
    linear-gradient(180deg, var(--hero-gradient-top), var(--bg-alt)),
    radial-gradient(1200px 600px at 10% -10%, rgba(122, 124, 255, 0.12), transparent 60%),
    radial-gradient(1000px 500px at 90% 0%, rgba(91, 108, 255, 0.08), transparent 60%),
    var(--bg);
}
.hero-inner
{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}
.hero-text h1
{
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.hero-cta
{
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Prevent collapse if the picture fails to load a source */
.hero-photo
{
  min-height: 200px;
}
.hero-photo picture,
.hero-photo img
{
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.btn
{
  display: inline-block;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow);
}
.btn:hover
{
  filter: brightness(1.05);
  text-decoration: none;
}
.btn.primary
{
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: transparent;
}
.btn.primary:hover
{
  background: var(--primary-strong);
}
.btn.secondary
{
  background: transparent;
}
.btn.sm
{
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
}
.btn.disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.section
{
  padding: 3rem 0;
}
.section.alt
{
  background: var(--bg-alt);
}
.section-header h2
{
  margin: 0 0 0.25rem;
}
.section-header p
{
  color: var(--muted);
  margin-top: 0;
}

.grid.cards
{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}

.card
{
  grid-column: span 6;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 140ms ease;
}
.card-media
{
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.card-media img
{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-body
{
  padding: 1rem;
}
.card h3
{
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}
.meta
{
  gap: 0.5rem 1rem;
  padding-left: 1rem;
  margin: 0.5rem 0 0.75rem;
  color: var(--muted);
}
.actions
{
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card:hover
{
  border-color: color-mix(in oklab, var(--border) 80%, var(--primary) 20%);
  transform: translateY(-6px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

/* Links list */
.list
{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.list a
{
  display: inline-block;
  padding: 0.6rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* Contact list */
.contact-list
{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.25rem;
}

.site-footer
{
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  color: var(--muted);
  background: var(--bg);
  font-size: 0.9rem;
}

/* Smooth color transitions on interactive elements */
a, button, .btn
{
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.reveal
{
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible
{
  opacity: 1;
  transform: translateY(0);
}

.hero-text, .hero-photo
{
  opacity: 0;
  transform: translateY(20px);
  animation: heroFade 0.8s ease forwards;
}
.hero-photo
{
  animation-delay: 0.25s;
}
@keyframes heroFade
{
  to
  {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px)
{
  .hero-inner
  {
    grid-template-columns: 1fr;
  }
  .card
  {
    grid-column: span 12;
  }
}

@media (prefers-reduced-motion: reduce)
{
  .reveal
  {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-text,
  .hero-photo
  {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .site-header.scrolled
  {
    transition: none !important;
  }
  .card
  {
    transition: none !important;
  }
}

/* --- Language toggle button --- */
.lang-toggle
{
  border: 1px solid var(--border, #d0d4e0);
  background: var(--surface, #6b7cff);
  color: var(--text, #111);
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-toggle:hover
{
  background: var(--surface-hover, #7f7ff2);
}

.lang-toggle:focus-visible
{
  outline: 2px solid var(--accent, #6b7cff);
  outline-offset: 2px;
}

/* Optional: align header buttons nicely */
.site-header .nav li
{
  display: inline-flex;
  align-items: center;
}

/* Ensure buttons look consistent in small size */
.btn.sm
{
  font-size: 0.875rem;
  padding: 0.4rem 0.6rem;
}

/* ----------------------------- */
/* HAMBURGER (mobile)            */
/* ----------------------------- */

.menu-toggle
{
  display: none; /* hidden on desktop by default */
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 720px)
{
  /* Allow brand + controls to wrap into two rows */
  .site-header .container
  {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  /* Show the hamburger on phones */
  .menu-toggle
  {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto; /* pushes the button to the right of brand */
  }

  /* Collapse nav by default on small screens */
  #primaryNav
  {
    width: 100%;
    order: 2;        /* nav below brand/menu button */
    display: none;   /* collapsed by default */
  }

  /* When toggled, reveal the nav */
  .nav-open #primaryNav
  {
    display: block;
  }

  /* Stack nav items vertically for clarity on small screens */
  .nav
  {
    display: grid;
    grid-auto-rows: minmax(40px, auto);
    gap: 0.25rem;
    padding: 0.25rem 0;
  }

  .nav a,
  .nav button
  {
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.75rem;
  }
}
