/* Self-hosted Manrope variable font (400-800), subsets from Google Fonts */
/* cyrillic-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/manrope-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   SM Engineering — sitewide styles.
   Pixel values transcribed from design_handoff_sm_engineering/
   mockups (1440px reference width).
   ============================================================ */

:root{
  --indigo:#372a6e; --indigo-dark:#241d52; --orange:#f79321; --orange-light:#ffb85e;
  --bg:#fbfbfd; --bg-alt:#f4f4f9; --ink:#221d44; --ink-2:#5f5b78; --ink-3:#8a87a0;
  --border:#e6e5ef; --indigo-tint:#eeedf7;
  --r-pill:999px; --r-card:18px; --r-card-lg:22px; --r-hero:28px; --r-band:36px; --r-field:10px;
  /* Max content width on wide screens (wide = hero + stats cards, which sit
     closer to the edge in the design). Tune here to widen/narrow the layout. */
  --content-w:1440px; --content-w-wide:1488px;
  --shadow-card:0 10px 26px rgba(34,29,68,.12);
  --shadow-card-hover:0 18px 38px rgba(34,29,68,.12);
  --font:'Manrope',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}
*,*::before,*::after{box-sizing:border-box}
/* Keeps anchor jumps (/projects#slug, scrollIntoView) clear of the sticky
   header: roughly its scrolled height (.is-stuck) plus a little breathing room. */
html{scroll-padding-top:76px}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font)}
/* Full-width page; sections cap their CONTENT via max() side paddings so
   backgrounds bleed edge-to-edge while content stays 1440px-centered. */
.page-frame{min-height:100vh;background:var(--bg)}
a{color:inherit;text-decoration:none}
h1,h2,h3,p{margin:0}
img{display:block}

/* Buttons (pill) */
.btn{display:inline-block;border-radius:var(--r-pill);font:600 14px var(--font);padding:12px 24px;transition:background .25s,color .25s,border-color .25s}
.btn-lg{font:700 14.5px var(--font);padding:16px 28px}
.btn-primary{background:var(--indigo);color:#fff}
.btn-primary:hover{background:var(--orange)}
.btn-accent{background:var(--orange);color:#fff}
.btn-accent:hover{background:#fff;color:var(--indigo)}
.btn-ghost{border:1.5px solid rgba(255,255,255,.6);color:#fff;backdrop-filter:blur(6px);padding:15px 28px}
.btn-ghost:hover{background:#fff;color:var(--indigo-dark);border-color:#fff}

/* Section scaffolding */
.section{padding:56px max(56px,calc((100% - var(--content-w))/2))}
.section-alt{background:var(--bg-alt)}
.section-head{display:flex;justify-content:space-between;align-items:baseline}
.section-head h2{margin:10px 0 0;font:700 34px var(--font);letter-spacing:-.02em}
.section-link{font:600 14px var(--font);color:var(--indigo)}
.sm-label{font:600 12px var(--font);letter-spacing:.28em;color:var(--orange);text-transform:uppercase}

/* Breadcrumb (every page but the homepage) */
.breadcrumb{display:flex;align-items:center;gap:8px;padding:18px max(56px,calc((100% - var(--content-w))/2)) 0;font:500 12.5px var(--font);color:var(--ink-3);animation:sm-rise .6s ease .05s both}
.breadcrumb a{transition:color .25s}
.breadcrumb a:hover{color:var(--indigo)}
.breadcrumb-current{color:var(--ink-2)}

/* Inner-page hero (services / projects / contacts) */
.page-hero{padding:40px max(56px,calc((100% - var(--content-w))/2)) 0}
.breadcrumb+.page-hero{padding-top:18px}
.page-hero .sm-label{animation:sm-rise .7s ease .1s both}
/* break-word only bites when a single word is wider than the column, i.e.
   never on desktop, but it stops long Bulgarian compounds from pushing the
   whole document sideways on a 320px phone. */
.page-hero h1{margin:14px 0 0;font:800 52px/1.08 var(--font);letter-spacing:-.028em;overflow-wrap:break-word;animation:sm-rise .8s ease .22s both}
.page-hero>p{margin:16px 0 0;max-width:600px;font:400 16.5px/1.6 var(--font);color:var(--ink-2);animation:sm-rise .8s ease .34s both}
.page-hero-narrow{max-width:560px}

/* Visually hidden, still read by assistive tech */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Keyframes (verbatim from mockups) */
@keyframes sm-kb{from{transform:scale(1.02)}to{transform:scale(1.13) translate(-1.6%,-1.2%)}}
@keyframes sm-fade{0%{opacity:0}5%{opacity:1}27%{opacity:1}33%{opacity:0}100%{opacity:0}}
@keyframes sm-rise{from{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}
@keyframes sm-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-11px)}}

/* Scroll-in animation: JS adds .js-animate (hidden state) only when it runs,
   so content stays visible without JS. */
[data-animate].js-animate{opacity:0;transform:translateY(30px);transition:opacity .8s ease,transform .8s ease}
[data-animate].in-view{opacity:1;transform:none}

/* EU funding acknowledgement: homepage hero has its own row (.eu-hero in
   landing.css); this sitewide footer row covers every page. White chips
   keep the logos readable on the dark footer background. */
.eu-footer{display:flex;align-items:center;justify-content:center;gap:20px;padding:20px max(56px,calc((100% - var(--content-w))/2));border-top:1px solid rgba(255,255,255,.12)}
.eu-footer-logos{display:flex;align-items:center;gap:20px}
.eu-footer-chip{background:#fff;border-radius:12px;padding:8px 14px;display:inline-block}
.eu-footer-chip img{height:34px;width:auto;display:block}
.eu-footer p{font:500 11.5px/1.5 var(--font);color:rgba(255,255,255,.65);max-width:340px;margin:0}
/* The project title links through to the /eu-funding page; underlined so it
   reads as a link against the surrounding fine print. */
.eu-footer p a{text-decoration:underline;text-underline-offset:3px;text-decoration-color:rgba(255,255,255,.3);transition:color .25s,text-decoration-color .25s}
.eu-footer p a:hover{color:#fff;text-decoration-color:rgba(255,255,255,.7)}

/* Header - sticks to the top of the viewport through the whole page.
   z-index sits below the mobile menu (50) and above the back-to-top (40).
   At the very top of the document it stays flush with the page background;
   the .is-stuck class (added by the script in header.php once scrolled)
   brings in the translucent panel and the shadow. The header height MUST
   stay constant between the two states: it is position:sticky (in flow),
   so any height change shifts the whole page and causes scroll jitter
   around the toggle threshold. Paint-only changes here. */
/* backdrop-filter lives on the BASE state (invisible while the background
   is opaque) so the blur layer exists permanently - toggling it together
   with .is-stuck created/destroyed a compositor layer at the threshold,
   which flashed. Only the background opacity and shadow animate. */
.site-header{position:sticky;top:0;z-index:45;display:flex;justify-content:space-between;align-items:center;padding:18px max(56px,calc((100% - var(--content-w))/2));background:var(--bg);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);transition:background .25s ease,box-shadow .25s ease}
.site-header.is-stuck{background:rgba(251,251,253,.85);box-shadow:0 6px 26px rgba(34,29,68,.1)}
.brand{display:flex;align-items:center;gap:12px}
.brand img{height:44px;width:auto}
.brand-text strong{display:block;font:700 16.5px var(--font)}
.brand-text small{display:block;font:400 11px var(--font);color:var(--ink-2)}
.main-nav{display:flex;align-items:center;gap:4px;background:#f1f1f7;border-radius:var(--r-pill);padding:5px;font:500 13.5px var(--font);color:#454060}
.main-nav a{padding:9px 18px;border-radius:var(--r-pill);transition:color .25s}
.main-nav a:hover{color:var(--ink)}
.main-nav a.is-active{background:#fff;font-weight:600;color:var(--ink);box-shadow:0 2px 8px rgba(34,29,68,.08)}
.header-cta{font:600 14px var(--font)}
/* On the contacts page the header CTA is the accent colour and inverts to indigo */
.header-cta.btn-accent:hover{background:var(--indigo);color:#fff}

/* Mobile menu (hidden on desktop; shown via responsive media queries) */
.nav-toggle{display:none;background:none;border:0;padding:12px;cursor:pointer}
.nav-toggle span{display:block;width:22px;height:2px;background:var(--ink);margin:5px 0;border-radius:2px}
/* Scrollable so the whole list stays reachable on short (landscape) screens;
   overscroll-behavior stops the page behind the overlay from chaining. */
.mobile-menu{display:none;position:fixed;inset:0;z-index:50;background:var(--bg);padding:20px 20px calc(24px + env(safe-area-inset-bottom,0px));overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.mobile-menu.is-open{display:block}
.mobile-menu-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.mobile-menu-brand{flex:1;min-width:0}
.mobile-menu-close{flex:none;background:none;border:0;font:400 30px/1 var(--font);color:var(--ink);cursor:pointer;width:46px;height:46px;display:grid;place-items:center;border-radius:50%;margin-right:-6px}
.mobile-menu-close:hover{background:var(--indigo-tint);color:var(--indigo)}
.mobile-menu nav{display:flex;flex-direction:column;gap:2px;margin-top:28px}
.mobile-menu nav a{font:600 20px var(--font);padding:14px 12px;border-radius:12px}
.mobile-menu nav a.is-active{background:var(--indigo-tint);color:var(--indigo)}
.mobile-menu-cta{background:var(--indigo);color:#fff;text-align:center;border-radius:var(--r-pill);margin-top:18px}
/* Real scroll lock: the inline script parks the body at -scrollY and restores it. */
body.menu-open{position:fixed;left:0;right:0;width:100%;overflow:hidden}
/* Short screens (landscape phones): shrink the list so it fits without scrolling. */
@media (max-height:520px){
  .mobile-menu nav{margin-top:18px}
  .mobile-menu nav a{font-size:17px;padding:10px 12px}
  .mobile-menu-cta{margin-top:12px}
}
/* Wide enough for two columns: the whole menu fits above the fold. */
@media (max-height:520px) and (min-width:480px){
  .mobile-menu nav{display:grid;grid-template-columns:1fr 1fr;gap:4px 16px;margin-top:16px}
  .mobile-menu-cta{grid-column:1 / -1;margin-top:8px}
}

/* CTA band + footer */
.footer-block{background:var(--indigo-dark);color:#fff}
.cta-band{display:flex;justify-content:space-between;align-items:center;gap:44px;padding:44px max(56px,calc((100% - var(--content-w))/2));border-bottom:1px solid rgba(255,255,255,.12)}
.cta-band h2{font:700 30px/1.2 var(--font);letter-spacing:-.02em}
.cta-band p{margin:10px 0 0;font:400 15px/1.6 var(--font);color:rgba(255,255,255,.65)}
.cta-band-btn{flex:none;font:700 15px var(--font);padding:16px 30px}
.footer-grid{display:grid;grid-template-columns:1.5fr 1fr 1fr 1.3fr;gap:44px;padding:44px max(56px,calc((100% - var(--content-w))/2))}
.footer-brand-row{display:flex;align-items:center;gap:12px}
.footer-brand-row .brand-text strong{font:700 16px var(--font)}
.footer-brand-row .brand-text small{color:rgba(255,255,255,.55)}
.footer-logo{background:#fff;border-radius:12px;padding:6px 10px;display:inline-block}
.footer-brand p{margin:16px 0 0;max-width:300px;font:400 13.5px/1.65 var(--font);color:rgba(255,255,255,.6)}
.footer-title{font:600 11.5px var(--font);letter-spacing:.2em;text-transform:uppercase;color:rgba(255,255,255,.45);margin-bottom:14px}
.footer-col{display:flex;flex-direction:column;gap:9px;font:400 14px/1.5 var(--font);color:rgba(255,255,255,.85);align-content:start}
.footer-col a:hover{color:var(--orange)}
/* Icon in its own column: a wrapped address lines up with the text above it
   instead of running back under the pin. */
.footer-contact{display:flex;gap:8px;align-items:flex-start}
.footer-contact i{flex:none;font-style:normal}
.footer-contact a{transition:color .25s}
.footer-contact a:hover{color:var(--orange)}
.footer-phones-sep{color:rgba(255,255,255,.45)}
.footer-contacts-link{color:var(--orange);font-weight:600;margin-top:2px}
.footer-contacts-link:hover{color:var(--orange-light)}
.footer-bottom{display:flex;justify-content:space-between;padding:18px max(56px,calc((100% - var(--content-w))/2));border-top:1px solid rgba(255,255,255,.12);font:400 12.5px var(--font);color:rgba(255,255,255,.5)}

/* Back-to-top button. Stays out of the flow until JS marks it visible, so it
   never shows at the top of the page or when JS is unavailable. */
/* White so it reads on both the light page background and the dark footer. */
.to-top{position:fixed;right:24px;bottom:24px;z-index:40;width:48px;height:48px;display:grid;place-items:center;border:1px solid var(--border);border-radius:50%;background:#fff;color:var(--indigo);cursor:pointer;box-shadow:0 10px 26px rgba(34,29,68,.2);opacity:0;visibility:hidden;transform:translateY(12px);transition:opacity .3s,transform .3s,visibility .3s,background .25s,color .25s,border-color .25s}
.to-top svg{width:20px;height:20px}
.to-top.is-visible{opacity:1;visibility:visible;transform:none}
.to-top:hover{background:var(--indigo);border-color:var(--indigo);color:#fff}
.to-top:focus-visible{outline:2px solid var(--orange);outline-offset:3px}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none !important;transition:none !important}
  [data-animate].js-animate{opacity:1;transform:none}
}

/* ---------- Responsive ---------- */
@media (max-width:1240px){
  .site-header{padding:18px 32px}
  .section{padding:40px 32px}
  .breadcrumb{padding:16px 32px 0}
  .page-hero{padding:32px 32px 0}
  .breadcrumb+.page-hero{padding-top:14px}
  .page-hero h1{font-size:44px}
  .cta-band,.footer-grid{padding-left:32px;padding-right:32px}
  .footer-bottom{padding:18px 32px}
}
@media (max-width:1080px){
  .nav-toggle{display:block}
  .footer-grid{grid-template-columns:1fr 1fr;gap:32px}
  /* From this width down the nav is a burger, i.e. we are on a touch device.
     The readability floor and the tap targets belong to the whole band, not
     just to phones - tablets were previously left with desktop typography. */
  .brand-text small{font-size:12px}
  .footer-title{font-size:12px;letter-spacing:.14em;color:rgba(255,255,255,.6)}
  .eu-footer p{font-size:12.5px;color:rgba(255,255,255,.78)}
  /* Padding lifts the fine-print link to a 45px hit area; the negative margin
     cancels it visually so the row keeps its original height. */
  .eu-footer p a{display:inline-block;padding:13px 0;margin:-8px 0}
  .breadcrumb a,.breadcrumb-current{display:inline-flex;align-items:center;min-height:44px}
  .breadcrumb{padding-top:8px}
  .breadcrumb+.page-hero{padding-top:6px}
  .section-link{display:inline-flex;align-items:center;min-height:44px;margin-top:-8px}
  .footer-col{gap:0}
  .footer-col a{display:block;padding:12px 0}
  /* Every child of the row carries the same vertical padding, so the icon
     column keeps sitting on the first line of its text while the links grow
     to a 45px hit area. No negative margins: two stacked phone links would
     overlap each other's box and blur the boundary between them. */
  .footer-contact{padding:0}
  .footer-contact>i,.footer-contact>span,.footer-contact>a{padding:12px 0}
  .footer-phones{padding:0}
  .footer-phones a{display:block;padding:12px 0}
  /* One number per row, each its own dial target */
  .footer-phones{display:flex;flex-direction:column}
  .footer-phones-sep{display:none}
  .btn{display:inline-flex;align-items:center;justify-content:center;min-height:46px}
  .btn-lg{min-height:52px}
  /* Re-assert the desktop-only header items: the .btn display rule above would
     otherwise win the cascade at equal specificity and put the CTA back. */
  .main-nav,.header-cta{display:none}
}
@media (max-width:760px){
  /* Header gutter matches the content gutter below it, so the logo and the
     page content share one 20px edge instead of stepping by 12px. */
  .site-header{padding:14px 20px}
  /* No-JS fallback; the header script overrides this with the measured height. */
  html{scroll-padding-top:64px}
  /* The logo lockup is a link home: keep it a 44px tap target even when the
     mark shrinks on the narrowest phones. */
  .brand{min-height:44px}
  .eu-footer{flex-wrap:wrap;padding:16px 20px}
  .eu-footer-chip img{height:28px}
  .eu-footer p{line-height:1.55;max-width:none}
  .to-top{right:16px;bottom:16px}
  .section{padding:44px 20px}
  .breadcrumb{padding:4px 20px 0;font-size:13px}
  .page-hero{padding:24px 20px 0}
  .breadcrumb+.page-hero{padding-top:0}
  .page-hero h1{font-size:36px}
  .page-hero>p{font-size:15px}
  .section-head{flex-direction:column;align-items:flex-start;gap:12px}
  .section-head h2{font-size:26px}
  /* One CTA block instead of two fragments: tighter gap, full-width button. */
  .cta-band{flex-direction:column;align-items:stretch;gap:22px;padding:36px 20px}
  .cta-band h2{font-size:24px}
  .cta-band-btn{width:100%}
  .footer-grid{padding:32px 20px}
  .footer-title{margin-bottom:12px}
  .footer-bottom{flex-direction:column;gap:8px;padding:18px 20px 26px}
}
@media (max-width:560px){
  .footer-grid{grid-template-columns:1fr}
  /* Deliberately centred EU block: the logo chips read as one group even
     when they wrap to two rows on the narrowest phones. */
  .eu-footer{flex-direction:column;gap:12px;text-align:center;padding:20px}
  .eu-footer-logos{flex-wrap:wrap;justify-content:center;gap:12px}
  .eu-footer p{text-align:center}
}
/* The two short link lists sit side by side while there is room for them. */
@media (min-width:430px) and (max-width:560px){
  .footer-grid{grid-template-columns:1fr 1fr;gap:28px 24px}
  .footer-brand,.footer-contacts{grid-column:1 / -1}
}
@media (max-width:430px){
  .brand{gap:10px}
  .brand img{height:38px}
  .brand-text strong{font-size:15.5px}
  /* One line for the tagline at 320px; the smaller mark above frees the room. */
  .site-header .brand-text small{white-space:nowrap}
  .page-hero h1{font-size:30px;line-height:1.12}
  .page-hero>p{margin-top:14px}
  .section{padding:38px 20px}
  .section-head h2{font-size:24px}
  .cta-band h2{font-size:22px}
  .footer-bottom{font-size:12px;line-height:1.5}
}
