/* ==========================================================
   AENIR STUDIO — SYSTEM OVERRIDES
   Token consumption layer
   NO redesign, NO tuning
   ========================================================== */


/* ----------------------------------------------------------
   GLOBAL BASELINE (AUTHORITATIVE)
   ---------------------------------------------------------- */

html,
body {
  height: 100%;
  background: var(--color-bg-main);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: var(--color-text-primary);
  font-family: var(--font-family-primary);
  font-size: var(--font-size-base);
}

.site-main {
  flex: 1;
}


/* ----------------------------------------------------------
   GLOBAL BACKGROUND — TECHNICAL MICRO GRAIN + CYAN ACCENT
   Single activation point
   SAFE TO TUNE
---------------------------------------------------------- */

html {
  background-image:
    linear-gradient(
      0deg,
      var(--color-bg-grain-accent),
      transparent
    ),
    linear-gradient(
      0deg,
      var(--color-bg-grain-light),
      var(--color-bg-grain-dark)
    );
}


/* ----------------------------------------------------------
   MAIN CONTAINER — WORKBENCH SURFACE (IMPORTANT)
   This is what fixes the “boring stone” feeling
---------------------------------------------------------- */

.main-container {
  background-image: linear-gradient(
    to bottom,
    var(--color-workbench-top),
    var(--color-workbench-bottom)
  );

  background-color: var(--color-workbench-base);
  border: 1px solid var(--color-workbench-edge);
}

/* ----------------------------------------------------------
   MAIN CONTAINER — FULL HEIGHT CONTINUITY
   REQUIRED FOR EMPTY / SHORT PAGES
---------------------------------------------------------- */

.site-main {
  display: flex;
}

.site-main > .main-container {
  flex: 1;
}



/* ----------------------------------------------------------
   HEADER — TOKEN WIRING (LOCKED VISUALS)
   ---------------------------------------------------------- */

.site-header {
  height: var(--header-height-desktop);

  background-image: linear-gradient(
    to bottom,
    var(--color-surface-top),
    var(--color-surface-highlight) 45%,
    var(--color-surface-bottom)
  );

  background-color: var(--color-surface-bottom);

  border-bottom: 1px solid var(--color-header-border);
  box-shadow: inset 0 -1px 0 var(--color-surface-shadowline);
}


/* ----------------------------------------------------------
   FOOTER — STRUCTURAL BASE (PERFECT REVERSE)
   ---------------------------------------------------------- */

.site-footer {
  background-image: linear-gradient(
    to top,
    var(--color-surface-top),
    var(--color-surface-highlight) 45%,
    var(--color-surface-bottom)
  );

  background-color: var(--color-surface-top);
  border-top: 1px solid var(--color-footer-border);
  box-shadow: inset 0 1px 0 var(--color-surface-hairline);
}

.site-footer a {
  color: var(--color-footer-text);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}


/* ----------------------------------------------------------
   HEADER — INNER LAYOUT (FIX ONLY)
   ---------------------------------------------------------- */

.site-header .inner {
  min-width: 64px;
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  padding: 0 var(--space-xl);
}

.header-controls {
  justify-self:end;
  display: flex;
  align-items: center;
  gap: 14px;
}


/* ----------------------------------------------------------
   LEFT — LOGO (ALIGN ONLY)
   ---------------------------------------------------------- */

.site-header .logo {
  justify-self: start;
  display: flex;
  align-items: center;
  line-height: 0;
}

.logo-img {
  display: block;
  height: 68px;
  width: auto;
  max-width: var(--logo-header-max-width);
  object-fit: contain;
  user-select: none;
}


/* ----------------------------------------------------------
   CENTER — MAIN NAVIGATION (TRUE CENTER)
   ---------------------------------------------------------- */

.main-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.main-nav a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a:focus,
.main-nav a.active {
  color: var(--color-accent-primary);
  text-decoration: underline;
}





/* ----------------------------------------------------------
   LANGUAGE SELECTOR — TEXT FIRST, FLAG SECONDARY
   ---------------------------------------------------------- */

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  justify-self: center;
}

.lang-switcher a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--color-text-secondary);
  text-decoration: none;
  opacity: 0.55;
}

.lang-switcher a[aria-current="true"] {
  opacity: 1;
  font-weight: 500;
}

.lang-switcher a:hover {
  opacity: 1;
  text-decoration: underline;
}

.lang-flag {
  height: 12px;
  width: auto;
  display: block;
}

.lang-code {
  font-size: 0.75rem;
  line-height: 1;
}


/* ----------------------------------------------------------
   MAIN — HEADER OFFSET (UNCHANGED)
   ---------------------------------------------------------- */

main {
  padding-top: var(--header-height-desktop);
}


/* ----------------------------------------------------------
   MOBILE ADJUSTMENTS
   ---------------------------------------------------------- */

@media (max-width: 600px) {

  .site-header {
    height: var(--header-height-mobile);
  }

  main {
    padding-top: var(--header-height-mobile);
  }

  .site-header .inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* logo pushed left */
  .logo {
    justify-self: start;
  }

  /* burger perfectly centered */
  .burger {
    display: flex !important;
    justify-self: center;
    margin-right: 0;
  }

  /* flags pushed right */
  .lang-switcher {
    justify-self: end;
  }

  .main-nav {
    display: none;
  }

  .logo-img {
    height: var(--logo-header-height-mobile);
  }

}

/* =========================================
   SECTION LIST HEADER ALIGNMENT
========================================= */

.systems-header {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  
}

.systems-header h1 {
  margin-bottom: 1.5rem;
}

.systems-intro {
  max-width: 820px;
  line-height: 1.65;
}

/* =========================================
   THANK YOU PAGE
========================================= */

.thankyou-page {
  text-align: center;
  padding: 80px 20px;
}

.thankyou-icon {
  width: 80px;
  margin: 0 auto 30px auto;
}

.thankyou-icon svg {
  width: 80px;
  height: 80px;
}

.thankyou-icon circle {
  stroke: #2ecc71;
  stroke-width: 2;
}

.thankyou-icon path {
  stroke: #2ecc71;
  stroke-width: 3;
  fill: none;
}

/* =========================
   THANK YOU ICON ANIMATION
========================= */

.thankyou-icon circle {
  stroke: #3fbf6b;
  stroke-width: 2;
  fill: none;

  stroke-dasharray: 157;
  stroke-dashoffset: 157;

  animation: circle-draw 0.8s ease forwards;
}

.thankyou-icon path {
  stroke: #3fbf6b;
  stroke-width: 3;
  fill: none;

  stroke-dasharray: 36;
  stroke-dashoffset: 36;

  animation: check-draw 0.6s ease forwards;
  animation-delay: 0.6s;
}

@keyframes circle-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes check-draw {
  to { stroke-dashoffset: 0; }
}