/* =========================================================
   Xtech Systems — Product portfolio
   ========================================================= */

:root {
  --c-dark: #0a2540;            /* deep navy */
  --c-text: #2b3a4a;
  --c-muted: #5f6f80;
  --c-light: #eef3f7;
  --c-white: #ffffff;
  --c-accent: #22a6d8;          /* cyan from the background artwork */
  --c-accent-text: #15739c;     /* darker cyan for small text on light backgrounds (WCAG AA) */
  --c-nav-bg: rgba(0, 0, 0, .8);
  --c-line: rgba(0, 0, 0, .08);

  --f-display: "Jost", "Helvetica Neue", Arial, sans-serif; /* single font family site-wide */
  --f-body: "Jost", "Helvetica Neue", Arial, sans-serif;

  --header-h: 88px;
  --gutter: clamp(20px, 4vw, 64px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--c-text);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
.icon { width: 1em; height: 1em; flex-shrink: 0; }
.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  z-index: 2000;
  padding: .6rem 1.2rem;
  background: var(--c-white); color: var(--c-dark);
}
.skip-link:focus { top: 1rem; }
#main:focus { outline: none; }
a { color: inherit; text-decoration: none; transition: color .3s var(--ease), opacity .3s var(--ease); }
figure { margin: 0; }
section[id], footer[id] { scroll-margin-top: 0; }

.eyebrow {
  display: inline-block;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--c-accent-text);
  margin-bottom: 1.25rem;
}
.eyebrow-light { color: rgba(255, 255, 255, .7); }

.section-title {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-dark);
  margin-bottom: 2rem;
  line-height: 1.25;
  overflow-wrap: break-word;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1030;
  background-color: var(--c-nav-bg);      /* dark from the start, over the intro too */
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  transition: height .5s var(--ease);
}
.site-nav {
  height: var(--header-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: height .5s var(--ease);
}
.logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
/* Logo: assets/Xtech_logo.svg */
.logo-img { width: auto; height: 52px; transition: height .5s var(--ease); }
.site-header.is-scrolled .logo-img { height: 44px; }
.mobile-menu .logo-img { height: 44px; }
.not-found .logo-img { height: 72px; }
@media (max-width: 575.98px) {
  .logo-img, .site-header.is-scrolled .logo-img { height: 40px; }
}
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  gap: clamp(1.5rem, 3vw, 3.25rem);
}
.nav-links a {
  position: relative;
  font-size: .8rem;
  font-weight: 400;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--c-white);
  padding: .5rem 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--ease);
}
.nav-links a:hover::after,
.nav-links a.is-active::after { transform: scaleX(1); transform-origin: left; }

/* Language switch */
.nav-right { display: flex; align-items: center; gap: clamp(1.5rem, 3vw, 3.25rem); }
.lang-flag {
  display: inline-flex;
  width: 26px;
  height: 17px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35);
  flex-shrink: 0;
}
.lang-flag img { width: 100%; height: 100%; object-fit: cover; }
.lang-current {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: none;
  border: 0;
  padding: .35rem 0;
  color: var(--c-white);
  opacity: .9;
  transition: opacity .3s var(--ease);
}
.lang-current:hover, .lang-current[aria-expanded="true"] { opacity: 1; }
.lang-caret { font-size: .8rem; transition: transform .3s var(--ease); }
.lang-current[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }
.lang-menu {
  --bs-dropdown-min-width: 0;
  --bs-dropdown-padding-y: .4rem;
  --bs-dropdown-bg: rgba(10, 37, 64, .94);
  --bs-dropdown-border-color: rgba(255, 255, 255, .12);
  --bs-dropdown-border-radius: 2px;
  margin-top: .6rem !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.lang-option {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem 1rem;
  font-size: .75rem;
  letter-spacing: .2em;
  color: rgba(255, 255, 255, .85);
}
.lang-option:hover { color: var(--c-white); background: rgba(255, 255, 255, .08); }
@media (max-width: 991.98px) { .nav-right { gap: 1.25rem; } }

.site-header.is-scrolled .site-nav { height: 70px; }

/* Hamburger */
.nav-toggle {
  width: 40px; height: 40px;
  background: none; border: 0; padding: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-end;
  gap: 7px;
}
.nav-toggle span {
  display: block; width: 28px; height: 3px; border-radius: 2px; background: var(--c-white);
  transition: background-color .3s;
}

/* Offcanvas */
.mobile-menu {
  --bs-offcanvas-width: 80%;
  background: var(--c-dark);
  color: var(--c-white);
}
.offcanvas-backdrop.show { opacity: .35; }
.mobile-menu .offcanvas-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--gutter) 2.5rem;
}
.mobile-menu .mobile-links {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.mobile-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .9rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, .15);
}
.mobile-contact .contact-link { font-size: .95rem; letter-spacing: .04em; }
.mobile-contact .contact-icon { width: 38px; height: 38px; padding: 9px; }
.mobile-menu .offcanvas-header { height: var(--header-h); padding: 0 var(--gutter); justify-content: space-between; }
.menu-close {
  background: none; border: 0; color: var(--c-white);
  font-size: 1.75rem; line-height: 1; padding: 0;
}
.mobile-links { list-style: none; padding: 0; margin: 0; text-align: center; }
.mobile-links li + li { margin-top: 1.75rem; }
.mobile-links a {
  font-family: var(--f-display);
  font-size: clamp(1.3rem, 6vw, 1.6rem);
  font-weight: 300;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.mobile-links a:hover { color: var(--c-accent); }

/* ---------- Intro ---------- */
/* Full-screen layer under the header: the headline zooms in from the centre,
   then white vertical blinds close over it and uncover the portfolio. */
.intro-active, .intro-active body { overflow: hidden; }
.intro {
  position: fixed;
  inset: 0;
  z-index: 1020;              /* below the header, so the logo, menu and flags stay visible */
  overflow: hidden;
  background: var(--c-dark);
  display: grid;
  grid-template-columns: minmax(0, 1fr);  /* a long word must not widen the column */
  place-items: center;
}
.intro.is-done, .intro-skip.is-done { display: none; }
/* after the blinds: the white layer fades into the content background */
.intro.is-fading { opacity: 0; transition: opacity .6s var(--ease); }
.intro-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  animation: introBg 6s var(--ease) both;
}
@keyframes introBg { from { transform: scale(1.08); } to { transform: scale(1); } }
.intro-title {
  position: relative;
  max-width: 100%;
  margin: 0;
  padding: 0 var(--gutter);
  text-align: center;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 6vw, 5.6rem);
  line-height: 1.1;
  letter-spacing: .06em;
  color: var(--c-white);
  text-shadow: 0 1px 3px rgba(0, 86, 118, .45), 0 6px 28px rgba(0, 92, 128, .55);  /* deep teal-blue from the artwork */
  overflow-wrap: break-word;
  animation: introZoom 2.4s cubic-bezier(.16, .84, .3, 1) .2s both;
}
@keyframes introZoom {
  0%   { opacity: 0; transform: scale(.08); filter: blur(10px); }
  45%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* Vertical blinds: 10 white slats turn closed one after another */
.intro-blinds {
  position: absolute; inset: 0;
  display: flex;
  pointer-events: none;
}
.intro-blinds span {
  flex: 1 1 0;
  margin-right: -1px;         /* no hairline gaps between the slats */
  background: var(--c-white);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .75s cubic-bezier(.65, 0, .35, 1);
}
.intro-blinds span:nth-child(2)  { transition-delay: .06s; }
.intro-blinds span:nth-child(3)  { transition-delay: .12s; }
.intro-blinds span:nth-child(4)  { transition-delay: .18s; }
.intro-blinds span:nth-child(5)  { transition-delay: .24s; }
.intro-blinds span:nth-child(6)  { transition-delay: .30s; }
.intro-blinds span:nth-child(7)  { transition-delay: .36s; }
.intro-blinds span:nth-child(8)  { transition-delay: .42s; }
.intro-blinds span:nth-child(9)  { transition-delay: .48s; }
.intro-blinds span:nth-child(10) { transition-delay: .54s; }
.intro.is-closing .intro-blinds span { transform: scaleX(1); }

.intro-skip {
  position: fixed;
  right: var(--gutter);
  bottom: clamp(24px, 5vh, 48px);
  z-index: 1021;
  padding: .7rem 1.4rem;
  background: none;
  border: 1px solid rgba(10, 37, 64, .55);
  color: var(--c-dark);           /* sits on the white lower part of the intro artwork */
  font: 400 .7rem/1 var(--f-body);
  letter-spacing: .26em;
  text-transform: uppercase;
  transition: background-color .3s var(--ease), color .3s var(--ease), opacity .4s var(--ease);
}
.intro-skip:hover { background: var(--c-dark); color: var(--c-white); }
.intro.is-closing ~ .intro-skip { opacity: 0; pointer-events: none; }

/* ---------- Product portfolio: 2 rows x 5 blocks ---------- */
.section-portfolio {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + clamp(32px, 5vw, 72px)) 0 clamp(56px, 7vw, 110px);
  background: var(--c-white);
  --portfolio-gray: .6;       /* grayscale of the background picture only; main.js reads it for the waves */
}
.section-portfolio::before {
  content: "";
  position: absolute; inset: 0;
  background: url("../assets/content.webp") center top / cover no-repeat;
  filter: grayscale(var(--portfolio-gray));
  pointer-events: none;
}
.portfolio-inner { position: relative; padding: 0 var(--gutter); }
/* animated copy of the background (see initWaves in main.js); the static image stays underneath as fallback */
.portfolio-waves {
  position: absolute; left: 0; top: 0;
  width: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .8s var(--ease);
}
.portfolio-waves.is-on { opacity: 1; }
.portfolio-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(32px, 3.6vw, 56px) clamp(16px, 2vw, 32px);
}
.portfolio-card { display: block; color: var(--c-dark); }
.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 20px;
  background: var(--c-light);
}
.card-media img, .card-placeholder {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
/* shown until the real photo is added to assets/portfolio/ */
.card-placeholder {
  background:
    radial-gradient(circle at 70% 30%, rgba(34, 166, 216, .22), transparent 60%),
    linear-gradient(135deg, #e3ecf3, #cfdde8);
}
.portfolio-card:hover .card-media img,
.portfolio-card:hover .card-placeholder { transform: scale(1.06); }
/* Glare: a slanted band of light sweeps across the photo on hover / keyboard focus.
   The transition exists only in the hover state, so it does not sweep back on leave. */
.card-media::after {
  content: "";
  position: absolute; inset: 0;
  z-index: 1;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .5) 50%, transparent 65%);
  transform: translateX(-101%);
  pointer-events: none;
}
@media (hover: hover) {
  .portfolio-card:hover .card-media::after { transform: translateX(101%); transition: transform .9s var(--ease); }
}
.portfolio-card:focus-visible .card-media::after { transform: translateX(101%); transition: transform .9s var(--ease); }
.card-title {
  margin: 1rem 0 0;
  font-family: var(--f-body);
  font-size: clamp(.9rem, 1.0625vw, 1.125rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-align: center;
  color: var(--c-dark);
  overflow-wrap: break-word;  transition: color .3s var(--ease);
}
.card-title::after {
  content: "";
  display: block;
  width: 28px; height: 1px;
  margin: .7rem auto 0;
  background: var(--c-accent);
  transform: scaleX(.4);
  transition: transform .5s var(--ease);
}
.portfolio-card:hover .card-title { color: var(--c-accent-text); }
.portfolio-card:hover .card-title::after { transform: scaleX(1); }

/* Blocks appear one after another once the blinds have closed */
.portfolio-item {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease), transform 1s var(--ease);
}
.portfolio-item:nth-child(2)  { transition-delay: .07s; }
.portfolio-item:nth-child(3)  { transition-delay: .14s; }
.portfolio-item:nth-child(4)  { transition-delay: .21s; }
.portfolio-item:nth-child(5)  { transition-delay: .28s; }
.portfolio-item:nth-child(6)  { transition-delay: .35s; }
.portfolio-item:nth-child(7)  { transition-delay: .42s; }
.portfolio-item:nth-child(8)  { transition-delay: .49s; }
.portfolio-item:nth-child(9)  { transition-delay: .56s; }
.portfolio-item:nth-child(10) { transition-delay: .63s; }
.section-portfolio.is-in .portfolio-item { opacity: 1; transform: none; }
/* intro skipped (language switch, #contact link) */
.no-intro .intro, .no-intro .intro-skip { display: none; }

/* ---------- Contact / Footer ---------- */
.section-contact {
  position: relative;
  z-index: 1;
  padding: clamp(110px, 14vw, 200px) 0 2.5rem;
  color: var(--c-white);
  overflow: hidden;
  background: var(--c-dark);
}
/* Fixed footer revealed by the content scrolling away above it.
   Enabled by JS only when the footer fits in the viewport. */
.section-contact.is-reveal {
  position: sticky;
  bottom: 0;
  z-index: 0;
}
.has-footer-reveal main { position: relative; z-index: 1; }
.has-footer-reveal .section-portfolio { box-shadow: 0 40px 70px rgba(0, 0, 0, .25); }
.contact-bg { position: absolute; inset: 0; }
.contact-bg img { width: 100%; height: 100%; object-fit: cover; }
/* Navy overlay keeps the white text readable over the artwork */
.contact-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6, 30, 56, .8) 0%, rgba(6, 26, 48, .99) 100%);
}
.contact-inner { position: relative; z-index: 1; }
.section-contact .section-title { color: var(--c-white); margin-bottom: 1.25rem; }
.contact-intro { color: rgba(255, 255, 255, .8); max-width: 520px; margin: 0 auto 3.5rem; }

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2.5rem 0;
  text-align: left;
}
.contact-person {
  list-style: none;
  margin: 0;
  padding: 0 clamp(3rem, 8vw, 7rem) 0 0;
  border-right: 1px solid rgba(255, 255, 255, .2);
}
.contact-person li {
  display: flex;
  align-items: center;
  gap: .9rem;
  color: rgba(255, 255, 255, .85);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  letter-spacing: .04em;
}
.contact-person li + li { margin-top: 1.1rem; }
.contact-person-text { display: flex; flex-direction: column; line-height: 1.35; }
.contact-person .contact-name { color: var(--c-white); font-size: clamp(1rem, 1.5vw, 1.2rem); font-weight: 400; letter-spacing: .06em; }
.contact-role { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .65); }
.contact-icon.contact-icon-font { display: inline-grid; place-items: center; padding: 0; font-size: 1.15rem; }
.contact-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.1rem;
  padding-left: clamp(3rem, 8vw, 7rem);
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  letter-spacing: .06em;
}
.contact-icon {
  width: 44px; height: 44px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 50%;
  flex-shrink: 0;
  transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s;
}
.contact-link:hover { color: var(--c-white); }
.contact-link:hover .contact-icon { background: var(--c-white); color: var(--c-dark); border-color: var(--c-white); }

.copyright {
  margin: clamp(90px, 12vw, 160px) 0 0;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .65);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.1s var(--ease), transform 1.3s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (scripting: none) {
  .reveal, .portfolio-item { opacity: 1; transform: none; }
  .intro, .intro-skip { display: none; }
}

/* ---------- 404 page ---------- */
.not-found {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2.5rem;
  padding: 3rem var(--gutter);
  text-align: center;
  background: var(--c-dark);
  color: var(--c-white);
}
.not-found h1 { font-weight: 300; font-size: clamp(3rem, 12vw, 6rem); margin: 0; color: var(--c-white); }
.not-found ul { list-style: none; margin: 0; padding: 0; }
.not-found li + li { margin-top: .5rem; }
.not-found a { text-decoration: underline; text-underline-offset: .25em; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
  .card-title { letter-spacing: .12em; }
}
@media (max-width: 991.98px) {
  :root { --header-h: 76px; }
  .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-title { font-size: .975rem; }
}
@media (max-width: 575.98px) {
  .contact-grid { flex-direction: column; }
  .contact-person { padding: 0 0 2rem; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .2); }
  .contact-links { padding-left: 0; }
  .section-title { font-size: 1.5rem; letter-spacing: .12em; }
  .card-title { font-size: .85rem; letter-spacing: .08em; }
  /* Phones: the widest line fills 90% of the screen.
     --intro-line = width of that line in em, measured per language (re-measure after changing the text) */
  .intro-title { padding: 0 5vw; font-size: calc(89.5vw / var(--intro-line, 6)); letter-spacing: .03em; }
  html:lang(sk) .intro-title { --intro-line: 6.57; }
  html:lang(hu) .intro-title { --intro-line: 9.79; }
  html:lang(de) .intro-title { --intro-line: 7.39; }
  html:lang(cs) .intro-title { --intro-line: 5.85; }
  html:lang(uk) .intro-title { --intro-line: 6.95; }
}
html:lang(hu) .section-title { font-size: clamp(1.45rem, 2.6vw, 2.2rem); letter-spacing: .08em; }
