// ============================================================
// SHARED — i18n + data + UI primitives + Header/Footer/Hero
// Loaded before home.jsx and servicii.jsx
// ============================================================

const { useState, useEffect, useRef } = React;

// Date de contact — citite din content.js dacă există, altfel fallback
const CONTACT = window.EPT_CONTACT || {
  address:    "Str. Exemplu nr. 12, București",
  phone:      "+40 700 000 000",
  phone_link: "tel:+40700000000",
  email:      "contact@energyprofiteam.ro",
  facebook:   "#",
  linkedin:   "#",
  hours_ro:   "Luni–Vineri 8:30–17:30",
  hours_en:   "Mon–Fri 8:30–17:30"
};

// ============================================================
// === i18n (RO/EN) ============================================
// ============================================================
const i18n = {
  ro: {
    nav_services: "Servicii",
    nav_services_all: "Vezi toate serviciile",
    nav_packages: "Oferte",
    nav_portfolio: "Portofoliu",
    nav_certifications: "Certificări",
    nav_about: "Despre",
    nav_contact: "Contact",
    nav_blog: "Blog",
    home: "Acasă",
    hero_label: "ENERGY PROFI TEAM SRL · ROMÂNIA",
    hero_title_1: "Soluții complete",
    hero_title_2: "în energie",
    hero_tagline: "Proiectare · Execuție · Mentenanță",
    hero_subtitle: "Instalații electrice, sisteme de curenți slabi și energie verde pentru clădiri rezidențiale și comerciale.",
    hero_cta_primary: "Solicită ofertă",
    hero_cta_secondary: "Vezi serviciile",
    hero_strip_more: "Vezi mai mult",
    cat_electric: "Instalații electrice",
    cat_low: "Curenți slabi",
    cat_pv: "Fotovoltaice",
    cat_bess: "BESS · Stocare",
    services_num: "",
    services_title: "Servicii oferite",
    services_meta: "Acoperim întregul ciclu — de la proiectare la mentenanță.",
    services_more: "Află mai multe",
    services_see_all: "Vezi toate serviciile",
    services_hero_label: "SERVICII · CICLU COMPLET",
    services_hero_title: "Servicii",
    services_hero_subtitle: "De la prima schiță la punerea în funcțiune și mentenanță — acoperim întregul ciclu pentru rezidențial, comercial și industrial.",
    services_breadcrumb_back: "Înapoi la pagina principală",
    services_cta_title: "Ai un proiect în minte?",
    services_cta_meta: "Trimite-ne un mesaj sau sună-ne. Răspundem în maxim 24h în zilele lucrătoare.",
    services_cta_btn: "Solicită ofertă",
    packages_num: "02 · PACHETE REZIDENȚIAL",
    packages_label: "OFERTE LIMITATE · REZIDENȚIAL",
    packages_title: "Pachete sisteme de securitate",
    packages_meta: "CCTV + efracție + control acces — instalate la cheie, cu manoperă inclusă.",
    packages_cta: "Comandă acum",
    packages_currency: "RON",
    packages_vat: "TVA inclus · Manoperă inclusă",
    offers_hero_label: "OFERTE · SECURITATE REZIDENȚIAL",
    offers_hero_title: "Oferte",
    offers_hero_subtitle: "Pachete complete de securitate rezidențială, instalate la cheie, cu materiale profesionale și manoperă inclusă.",
    offers_brand: "Brand / Producător",
    offers_includes: "Ce include",
    offers_specs: "Date tehnice",
    cert_num: "",
    cert_title: "Autorizații și certificări",
    cert_meta: "Suntem acreditați pentru toate tipurile de instalații electrice și de curenți slabi pentru clădiri civile.",
    cert_download: "Descarcă PDF",
    portfolio_num: "",
    portfolio_title: "Proiecte realizate",
    portfolio_meta: "O selecție din lucrările echipei — rezidențial, comercial, industrial.",
    portfolio_filter_all: "Toate",
    portfolio_filter_res: "Rezidențial",
    portfolio_filter_com: "Comercial",
    portfolio_filter_ind: "Industrial",
    portfolio_filter_pv: "Fotovoltaic",
    portfolio_view: "Vezi detalii",
    stats_clients: "CLIENȚI",
    stats_projects: "PROIECTE",
    stats_systems: "SISTEME INSTALATE",
    stats_cable: "METRI DE CABLU",
    about_num: "DESPRE",
    about_title: (window.EPT_ABOUT && window.EPT_ABOUT.title_ro) || "O echipă care livrează la cheie.",
    about_p1: (window.EPT_ABOUT && window.EPT_ABOUT.p1_ro) || "Energy Profi Team proiectează, execută și menține instalații electrice de joasă tensiune, sisteme de curenți slabi și soluții de energie verde. Fiecare proiect e gândit pentru oameni care vor liniște și siguranță în spațiul lor.",
    about_p2: (window.EPT_ABOUT && window.EPT_ABOUT.p2_ro) || "Lucrăm cu beneficiari rezidențiali, dezvoltatori și companii din toată țara. Materialele sunt din game profesionale, iar manopera e garantată.",
    about_v1_t: "Echipă certificată",
    about_v1_d: "Electricieni autorizați ANRE și tehnicieni atestați IGSU.",
    about_v2_t: "Garanție extinsă",
    about_v2_d: "Până la 24 luni pe manoperă, conform contract.",
    about_v3_t: "Suport post-instalare",
    about_v3_d: "Mentenanță programată și intervenții în maxim 24h.",
    contact_num: "CONTACT",
    contact_title: "Hai să discutăm proiectul tău",
    contact_meta: "Răspundem în maxim 24h în zilele lucrătoare.",
    contact_address: "Adresă",
    contact_address_v: CONTACT.address,
    contact_phone: "Telefon",
    contact_email: "Email",
    contact_hours: "Program",
    contact_hours_v: CONTACT.hours_ro,
    contact_form_name: "Nume",
    contact_form_email: "Email",
    contact_form_phone: "Telefon",
    contact_form_subject: "Subiect",
    contact_form_subject_choose: "Alege un subiect",
    contact_form_subject_opts: ["Instalații electrice", "Curenți slabi", "Fotovoltaice / BESS", "Pachet rezidențial", "Altele"],
    contact_form_message: "Mesaj",
    contact_form_gdpr: "Sunt de acord cu prelucrarea datelor personale conform GDPR.",
    contact_form_submit: "Trimite mesaj",
    contact_form_required: "Câmp obligatoriu",
    contact_form_email_invalid: "Email invalid",
    contact_form_success: "Mesajul a fost trimis. Te contactăm în maxim 24h.",
    footer_tagline: "PROIECTARE · EXECUȚIE · MENTENANȚĂ",
    footer_nav: "Navigare",
    footer_contact: "Contact",
    footer_program: "Program",
    footer_social: "Social",
    footer_rights: "Toate drepturile rezervate.",
    footer_priv: "Politică de confidențialitate",
    footer_terms: "Termeni și condiții",
    footer_cookies: "Cookies"
  },
  en: {
    nav_services: "Services",
    nav_services_all: "See all services",
    nav_packages: "Offers",
    nav_portfolio: "Portfolio",
    nav_certifications: "Certifications",
    nav_about: "About",
    nav_contact: "Contact",
    nav_blog: "Blog",
    home: "Home",
    hero_label: "ENERGY PROFI TEAM LTD · ROMANIA",
    hero_title_1: "Complete energy",
    hero_title_2: "solutions",
    hero_tagline: "Design · Build · Maintain",
    hero_subtitle: "Electrical installations, low-voltage systems and green energy for residential and commercial buildings.",
    hero_cta_primary: "Request a quote",
    hero_cta_secondary: "See services",
    hero_strip_more: "Learn more",
    cat_electric: "Electrical",
    cat_low: "Low-voltage",
    cat_pv: "Photovoltaic",
    cat_bess: "BESS · Storage",
    services_num: "",
    services_title: "What we do",
    services_meta: "We cover the full cycle — from design to maintenance.",
    services_more: "Learn more",
    services_see_all: "See all services",
    services_hero_label: "SERVICES · FULL CYCLE",
    services_hero_title: "Services",
    services_hero_subtitle: "From first sketch to commissioning and maintenance — we cover the full cycle for residential, commercial and industrial.",
    services_breadcrumb_back: "Back to home",
    services_cta_title: "Got a project in mind?",
    services_cta_meta: "Drop us a message or call. We reply within 24h on business days.",
    services_cta_btn: "Request a quote",
    packages_num: "02 · RESIDENTIAL PACKAGES",
    packages_label: "LIMITED OFFER · RESIDENTIAL",
    packages_title: "Residential security packages",
    packages_meta: "CCTV + intrusion + access control — turnkey installation with labor included.",
    packages_cta: "Order now",
    packages_currency: "RON",
    packages_vat: "VAT included · Labor included",
    offers_hero_label: "OFFERS · RESIDENTIAL SECURITY",
    offers_hero_title: "Offers",
    offers_hero_subtitle: "Complete residential security packages, turnkey installation with professional materials and labor included.",
    offers_brand: "Brand / Manufacturer",
    offers_includes: "What's included",
    offers_specs: "Technical specs",
    cert_num: "",
    cert_title: "Permits & certifications",
    cert_meta: "We are accredited for all types of electrical and low-voltage installations in civil buildings.",
    cert_download: "Download PDF",
    portfolio_num: "",
    portfolio_title: "Recent projects",
    portfolio_meta: "A selection of work — residential, commercial, industrial.",
    portfolio_filter_all: "All",
    portfolio_filter_res: "Residential",
    portfolio_filter_com: "Commercial",
    portfolio_filter_ind: "Industrial",
    portfolio_filter_pv: "Photovoltaic",
    portfolio_view: "View details",
    stats_clients: "CLIENTS",
    stats_projects: "PROJECTS",
    stats_systems: "SYSTEMS INSTALLED",
    stats_cable: "METERS OF CABLE",
    about_num: "ABOUT",
    about_title: (window.EPT_ABOUT && window.EPT_ABOUT.title_en) || "A team that delivers turnkey.",
    about_p1: (window.EPT_ABOUT && window.EPT_ABOUT.p1_en) || "Energy Profi Team designs, builds and maintains low-voltage electrical installations, low-current systems and green energy solutions. Every project is built for people who want quiet, safety and reliability in their space.",
    about_p2: (window.EPT_ABOUT && window.EPT_ABOUT.p2_en) || "We work with residential clients, developers and companies across the country. Materials are professional grade and labor is guaranteed.",
    about_v1_t: "Certified team",
    about_v1_d: "ANRE-authorized electricians and IGSU-certified technicians.",
    about_v2_t: "Extended warranty",
    about_v2_d: "Up to 24 months on labor, per contract.",
    about_v3_t: "Post-install support",
    about_v3_d: "Scheduled maintenance and on-site response within 24 hours.",
    contact_num: "CONTACT",
    contact_title: "Let's talk about your project",
    contact_meta: "We reply within 24h on business days.",
    contact_address: "Address",
    contact_address_v: CONTACT.address,
    contact_phone: "Phone",
    contact_email: "Email",
    contact_hours: "Hours",
    contact_hours_v: CONTACT.hours_en,
    contact_form_name: "Name",
    contact_form_email: "Email",
    contact_form_phone: "Phone",
    contact_form_subject: "Subject",
    contact_form_subject_choose: "Choose a subject",
    contact_form_subject_opts: ["Electrical", "Low-voltage", "Photovoltaic / BESS", "Residential package", "Other"],
    contact_form_message: "Message",
    contact_form_gdpr: "I agree to the processing of personal data per GDPR.",
    contact_form_submit: "Send message",
    contact_form_required: "Required field",
    contact_form_email_invalid: "Invalid email",
    contact_form_success: "Your message was sent. We will contact you within 24h.",
    footer_tagline: "DESIGN · BUILD · MAINTAIN",
    footer_nav: "Navigation",
    footer_contact: "Contact",
    footer_program: "Hours",
    footer_social: "Social",
    footer_rights: "All rights reserved.",
    footer_priv: "Privacy policy",
    footer_terms: "Terms & conditions",
    footer_cookies: "Cookies"
  }
};

// ============================================================
// === SERVICES (10) — cu imagini și descrieri lungi ===========
// ============================================================
const SERVICES = window.EPT_SERVICES || [
{ id: 'electric', label_ro: 'Instalații electrice', label_en: 'Electrical installations',
  desc_ro: 'Tablouri electrice, distribuție JT, iluminat și prize.',
  desc_en: 'Switchboards, LV distribution, lighting and outlets.',
  long_ro: 'Tablouri de distribuție conform SR EN 61439, circuite de iluminat și prize, automatizări și protecții diferențiale (RCD/RCBO). Proiectăm și executăm întreaga instalație pentru blocuri, vile, birouri și hale industriale, cu PV final și certificat de conformitate la punerea sub tensiune. Câștigi siguranță, conformitate ANRE și o instalație care nu te lasă pe întuneric.',
  long_en: 'Distribution boards per SR EN 61439, lighting and outlet circuits, automation and RCD/RCBO protections. We design and build complete installations for apartments, villas, offices and industrial halls, with final test report and certificate of conformity at energization. You get safety, ANRE compliance and an installation that doesn\'t leave you in the dark.',
  image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=1200&q=70&auto=format&fit=crop',
  path: '<path d="M13 3 L5 14 H11 L10 21 L19 9 H13 Z"/>' },
{ id: 'solar', label_ro: 'Panouri fotovoltaice', label_en: 'Photovoltaic systems',
  desc_ro: 'On-grid, off-grid și hibrid pentru rezidențial și comercial.',
  desc_en: 'On-grid, off-grid and hybrid for residential and commercial.',
  long_ro: 'Sisteme on-grid, hibrid și off-grid de la 3 kWp până la 100+ kWp, cu invertoare premium și panouri Tier-1 garantate 25 de ani. Ne ocupăm de avizare, montaj, comisionare și înregistrarea ca prosumator. Reduci factura cu până la 90%, vinzi surplusul în rețea și ai backup automat la pene de curent dacă alegi versiunea hibridă cu baterie.',
  long_en: 'On-grid, hybrid and off-grid systems from 3 kWp up to 100+ kWp, with premium inverters and Tier-1 panels backed by 25-year warranties. We handle permits, installation, commissioning and prosumer registration. You cut bills up to 90%, sell surplus to the grid and get automatic backup during outages with the hybrid + battery option.',
  image: 'https://images.unsplash.com/photo-1509391366360-2e959784a276?w=1200&q=70&auto=format&fit=crop',
  path: '<path d="M5 18 L8 7 H20 L17 18 Z"/><path d="M9 7 L7 18 M14 7 L13 18 M5 12 H19"/><path d="M11 18 V21 M11 21 H8 M11 21 H14"/>' },
{ id: 'ev', label_ro: 'Stații de încărcare EV', label_en: 'EV charging stations',
  desc_ro: 'AC și DC, single sau multi-conector, gestiune energie.',
  desc_en: 'AC and DC, single or multi-connector, energy management.',
  long_ro: 'Stații AC mono/trifazate (7-22 kW) și DC fast charging (până la 60 kW), cu management dinamic al sarcinii pentru a nu depăși branșamentul. Conectivitate OCPP 1.6/2.0, RFID și aplicație mobilă pentru taxare, raportare și acces controlat. Soluții pentru locuință, parcări de bloc, flote și clienți comerciali — cu integrare opțională în sistemul fotovoltaic.',
  long_en: 'AC single/three-phase stations (7-22 kW) and DC fast charging (up to 60 kW), with dynamic load management to avoid overloading the connection. OCPP 1.6/2.0, RFID and mobile app for billing, reporting and controlled access. Home, apartment-parking, fleet and commercial solutions — with optional integration into your PV system.',
  image: 'https://images.unsplash.com/photo-1647500666543-6e4b66a31e1e?w=1200&q=70&auto=format&fit=crop',
  path: '<rect x="4" y="4" width="10" height="16" rx="1.5"/><path d="M9 9 L7 13 H10 L8 17"/><path d="M14 8 H17 V14 A2 2 0 0 1 19 12 A2 2 0 0 1 21 14 V18"/>' },
{ id: 'camera', label_ro: 'Supraveghere video CCTV', label_en: 'CCTV video surveillance',
  desc_ro: 'Camere IP 4K, NVR, înregistrare locală sau cloud.',
  desc_en: '4K IP cameras, NVR, local or cloud recording.',
  long_ro: 'Camere IP 4K, NVR cu HDD redundante și înregistrare locală sau cloud, cu analiză video inteligentă: detecție persoană/vehicul, line-cross și alarme la mișcare suspectă. Vizualizare live și replay de oriunde din aplicația mobilă, cu notificări push. Configurare conform GDPR — zone de mascare automată și retenție controlată.',
  long_en: '4K IP cameras, NVRs with redundant HDDs and local or cloud recording, with smart video analytics: person/vehicle detection, line-crossing and suspicious-motion alerts. Live view and playback from anywhere via mobile app, with push notifications. GDPR-compliant setup — automatic privacy masking and controlled retention.',
  image: 'https://images.unsplash.com/photo-1557597774-9d273605dfa9?w=1200&q=70&auto=format&fit=crop',
  path: '<rect x="3" y="9" width="13" height="7" rx="1.5"/><path d="M16 11 L21 9 V16 L16 14"/><circle cx="9.5" cy="12.5" r="1.5"/>' },
{ id: 'fire', label_ro: 'Detecție incendiu', label_en: 'Fire detection',
  desc_ro: 'Centrale, detectoare, sirene — proiect și ISU.',
  desc_en: 'Panels, detectors, sirens — design and ISU compliance.',
  long_ro: 'Centrale convenționale și adresabile, detectoare optice/termice, butoane manuale, sirene optic-acustice și module de zonă, în conformitate cu P118/3 și SR EN 54. Verificăm planul cu ISU și obținem avizul/autorizația pentru clădirea ta. Mentenanță semestrială documentată conform legii — protecția vieții nu admite improvizații.',
  long_en: 'Conventional and addressable panels, optical/thermal detectors, manual call points, sounder/strobes and zone modules, per P118/3 and SR EN 54. We file with ISU and obtain the fire-safety authorization for your building. Bi-annual maintenance documented per law — life-safety doesn\'t tolerate shortcuts.',
  image: 'https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?w=1200&q=70&auto=format&fit=crop',
  path: '<path d="M12 3 C13 7 17 8 17 13 A5 5 0 1 1 7 13 C7 10 9 9 9 7 C10 9 11 9 12 3 Z"/>' },
{ id: 'lock', label_ro: 'Control acces & efracție', label_en: 'Access control & intrusion',
  desc_ro: 'Cititoare card, tastatură, biometrie, centrale alarmă.',
  desc_en: 'Card readers, keypads, biometrics, intrusion panels.',
  long_ro: 'Centrale efracție Paradox / DSC / Inim, senzori PIR și magnetici, sirene exterioare și interioare, comunicator GSM/IP cu aplicație mobilă. Control acces cu cititoare RFID, tastaturi sau biometric, jurnal complet de evenimente și automatizări pe orare. Integrare cu CCTV și smart-home pentru notificări instant și scenarii de alarmă.',
  long_en: 'Paradox / DSC / Inim intrusion panels, PIR and magnetic sensors, indoor and outdoor sirens, GSM/IP communicator with mobile app. Access control with RFID readers, keypads or biometrics, full event log and schedule-based automation. Integration with CCTV and smart-home for instant notifications and alarm scenarios.',
  image: 'https://images.unsplash.com/photo-1622563019-b7bba5d9e7e0?w=1200&q=70&auto=format&fit=crop',
  path: '<rect x="5" y="11" width="14" height="9" rx="1.5"/><path d="M8 11 V8 A4 4 0 0 1 16 8 V11"/><circle cx="12" cy="15.5" r="1.2" fill="#0E2A47" stroke="none"/>' },
{ id: 'intercom', label_ro: 'Interfonie & video-interfonie', label_en: 'Intercom & video intercom',
  desc_ro: 'Sisteme audio și video pentru blocuri și vile.',
  desc_en: 'Audio and video systems for apartment blocks and villas.',
  long_ro: 'Sisteme audio și video pentru blocuri sau vile, monitoare 7"/10" tactile, deschidere poartă/portiță și intercomunicare între posturi. Variante cablate sau IP, cu apel pe smartphone când nu ești acasă și înregistrarea apelurilor pierdute. Compatibile cu Comelit, Hikvision, Dahua și Bticino — alegem soluția potrivită clădirii.',
  long_en: 'Audio and video systems for apartment blocks or villas, 7"/10" touch monitors, gate release and unit-to-unit intercom. Wired or IP variants, with smartphone forwarding when you\'re away and missed-call recording. Comelit, Hikvision, Dahua and Bticino compatible — we pick what fits the building.',
  image: 'https://images.unsplash.com/photo-1573165706511-3ffde6f3deec?w=1200&q=70&auto=format&fit=crop',
  path: '<rect x="6" y="3" width="12" height="18" rx="2"/><rect x="9" y="6" width="6" height="4" rx="1"/><circle cx="10" cy="14" r=".8" fill="#0E2A47" stroke="none"/><circle cx="14" cy="14" r=".8" fill="#0E2A47" stroke="none"/><circle cx="10" cy="17" r=".8" fill="#0E2A47" stroke="none"/><circle cx="14" cy="17" r=".8" fill="#0E2A47" stroke="none"/>' },
{ id: 'wifi', label_ro: 'Rețele structurate & Wi-Fi', label_en: 'Structured cabling & Wi-Fi',
  desc_ro: 'Cablare cat. 6/6A, AP-uri, dulapuri rack, switch-uri.',
  desc_en: 'Cat. 6/6A cabling, access points, racks, switches.',
  long_ro: 'Cablare structurată Cat. 6 / 6A, dulapuri rack, switch-uri PoE, AP-uri Wi-Fi 6 cu controller și fibră optică pentru distanțe lungi sau coloane. Acoperire fără zone moarte, prin proiect cu site survey și hărți de semnal. Rețele segmentate (VLAN) pentru oaspeți, IoT și camere — securitate și performanță în același timp.',
  long_en: 'Cat. 6 / 6A structured cabling, server racks, PoE switches, Wi-Fi 6 access points with controller and fiber for long runs or risers. No-deadspot coverage, planned with a site survey and signal heatmaps. Segmented networks (VLANs) for guests, IoT and cameras — security and performance at the same time.',
  image: 'https://images.unsplash.com/photo-1551703599-6b3e8379aa8d?w=1200&q=70&auto=format&fit=crop',
  path: '<path d="M3.5 9 A14 14 0 0 1 20.5 9"/><path d="M6.5 12.5 A9.5 9.5 0 0 1 17.5 12.5"/><path d="M9.5 16 A5 5 0 0 1 14.5 16"/><circle cx="12" cy="19.3" r="1.1" fill="#0E2A47" stroke="none"/>' },
{ id: 'sound', label_ro: 'Sonorizare ambientală', label_en: 'Public address & sonorization',
  desc_ro: 'Sisteme zonate pentru spații comerciale și horeca.',
  desc_en: 'Zoned systems for retail and HoReCa spaces.',
  long_ro: 'Sisteme zonate cu mixer digital, amplificatoare și difuzoare 100V/8Ω pentru retail, restaurante, săli de evenimente sau birouri. Control de pe tabletă și surse multiple — streaming, microfon, auxiliar — cu nivele independente per zonă. Anunțuri prioritare, message-on-hold și integrare cu sistemul de incendiu pentru evacuare vocală.',
  long_en: 'Zoned systems with digital mixer, amplifiers and 100V/8Ω speakers for retail, restaurants, event venues and offices. Tablet control with multiple sources — streaming, microphone, aux — and independent zone levels. Priority announcements, message-on-hold and fire-system integration for voice evacuation.',
  image: 'https://images.unsplash.com/photo-1545454675-3531b543be5d?w=1200&q=70&auto=format&fit=crop',
  path: '<path d="M3 10 V14 H6 L11 18 V6 L6 10 Z"/><path d="M14 9 A4 4 0 0 1 14 15"/><path d="M17 6 A8 8 0 0 1 17 18"/>' },
{ id: 'tools', label_ro: 'Service & mentenanță', label_en: 'Service & maintenance',
  desc_ro: 'Contracte de mentenanță și intervenții programate.',
  desc_en: 'Maintenance contracts and scheduled interventions.',
  long_ro: 'Contracte de mentenanță preventivă lunare sau trimestriale, intervenții de urgență cu timp de răspuns garantat și raportare detaliată după fiecare vizită. Echipă mobilă cu piese de schimb pentru sistemele instalate — minimizăm timpul de oprire. Audit periodic, actualizări firmware pentru CCTV/controlere și recomandări de upgrade când are sens.',
  long_en: 'Monthly or quarterly preventive maintenance contracts, emergency interventions with guaranteed response time and detailed reporting after every visit. Mobile team with spare parts for installed systems — we minimize downtime. Periodic audit, firmware updates for CCTV/controllers and upgrade recommendations when it makes sense.',
  image: 'https://images.unsplash.com/photo-1581094794329-c8112a89af12?w=1200&q=70&auto=format&fit=crop',
  path: '<path d="M14 4 a4 4 0 1 0 4 6 L21 13 L18 16 L15 13 A4 4 0 0 0 9 7"/><path d="M11 9 L4 16 L7 19 L14 12"/>' }];


// IDs pentru "featured" pe pagina principală (4 carduri în loc de toate 10)
const FEATURED_SERVICE_IDS = ['electric', 'solar', 'camera', 'fire'];

// ============================================================
// === Certificări =============================================
// ============================================================
const CERTIFICATIONS = window.EPT_CERTIFICATIONS || [
{ id: 'anre-c1b', tag: 'ANRE C1B',
  title_ro: 'Proiectare instalații electrice', title_en: 'Electrical design',
  desc_ro: 'Atestat ANRE pentru proiectare instalații electrice de joasă tensiune.',
  desc_en: 'ANRE certification for low-voltage electrical design.', pdf_url: '#' },
{ id: 'anre-b', tag: 'ANRE B',
  title_ro: 'Execuție instalații electrice', title_en: 'Electrical execution',
  desc_ro: 'Atestat ANRE pentru execuția lucrărilor de instalații electrice.',
  desc_en: 'ANRE certification for electrical installation works.', pdf_url: '#' },
{ id: 'igsu-pp', tag: 'IGSU',
  title_ro: 'Proiectare sisteme PSI', title_en: 'Fire protection design',
  desc_ro: 'Aviz IGSU pentru proiectarea sistemelor de detecție și semnalizare incendiu.',
  desc_en: 'IGSU approval for fire detection and alarm system design.', pdf_url: '#' },
{ id: 'igsu-ex', tag: 'IGSU',
  title_ro: 'Execuție sisteme PSI', title_en: 'Fire protection execution',
  desc_ro: 'Aviz IGSU pentru execuția sistemelor de detecție și semnalizare incendiu.',
  desc_en: 'IGSU approval for fire detection and alarm system execution.', pdf_url: '#' }];


// ============================================================
// === Portofoliu ==============================================
// ============================================================
const PROJECTS = window.EPT_PROJECTS || [
{ id: 'p1', category: 'res', loc_ro: 'BUCUREȘTI', loc_en: 'BUCHAREST',
  title_ro: 'Vilă P+1 · instalație electrică completă', title_en: 'P+1 villa · complete electrical install',
  desc_ro: 'Tablou principal, automatizări iluminat, prize și CCTV integrat.',
  desc_en: 'Main switchboard, lighting automation, outlets and integrated CCTV.',
  summary_ro: 'Proiect rezidențial pentru o vilă P+1 cu suprafață utilă de ~280 mp. Am realizat instalația electrică completă (tablou principal + 3 subtablouri pe nivel), automatizări de iluminat cu scenarii smart, prize comandate și sistem CCTV integrat cu 6 camere pentru perimetru și acces.',
  summary_en: 'Residential project for a P+1 villa (~280 sqm). We delivered complete electrical works (main panel + 3 sub-panels per level), smart lighting scenarios, switched outlets and an integrated 6-camera CCTV for perimeter and access.',
  image: 'https://placehold.co/1200x750/0E2A47/F5C518?text=Vil%C4%83+P%2B1',
  images: [
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Vil%C4%83+P%2B1+%C2%B7+Tablou',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Vil%C4%83+P%2B1+%C2%B7+Iluminat',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Vil%C4%83+P%2B1+%C2%B7+CCTV',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Vil%C4%83+P%2B1+%C2%B7+Exterior']
},
{ id: 'p2', category: 'com', loc_ro: 'CLUJ-NAPOCA', loc_en: 'CLUJ-NAPOCA',
  title_ro: 'Birouri 1.200 mp · curenți slabi', title_en: '1,200 sqm office · low-voltage',
  desc_ro: 'Cablare cat. 6A, CCTV, control acces și sistem detecție incendiu.',
  desc_en: 'Cat. 6A cabling, CCTV, access control and fire detection.',
  summary_ro: 'Spațiu de birouri 1.200 mp pe 2 etaje. Cablare structurată cat. 6A pentru ~120 utilizatori, 14 camere CCTV cu NVR redundant, control acces cu 6 uși și sistem detecție incendiu adresabil P118/3 cu predare la ISU.',
  summary_en: '1,200 sqm office on 2 floors. Cat. 6A structured cabling for ~120 users, 14 CCTV cameras with redundant NVR, 6-door access control and addressable fire detection (P118/3) with ISU handover.',
  image: 'https://placehold.co/1200x750/0E2A47/F5C518?text=Birouri+1200mp',
  images: [
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Birouri+%C2%B7+Rack',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Birouri+%C2%B7+CCTV',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Birouri+%C2%B7+Acces',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Birouri+%C2%B7+Open+Space']
},
{ id: 'p3', category: 'pv', loc_ro: 'PRAHOVA', loc_en: 'PRAHOVA',
  title_ro: 'Fotovoltaic 10 kWp · rezidențial', title_en: '10 kWp PV · residential',
  desc_ro: 'Sistem on-grid, invertor hibrid și monitorizare prin aplicație.',
  desc_en: 'On-grid system, hybrid inverter and app monitoring.',
  summary_ro: 'Sistem fotovoltaic 10 kWp pentru locuință unifamilială: 22 panouri monocristaline pe acoperiș înclinat, invertor hibrid 10 kW, sistem de fixare aluminiu, protecții AC/DC și monitorizare prin aplicație mobilă.',
  summary_en: '10 kWp PV system for a single-family home: 22 monocrystalline panels on pitched roof, 10 kW hybrid inverter, aluminium mounting, AC/DC protections and mobile-app monitoring.',
  image: 'https://placehold.co/1200x750/0E2A47/F5C518?text=PV+10+kWp',
  images: [
  'https://placehold.co/1200x750/0E2A47/F5C518?text=PV+%C2%B7+Acoperi%C8%99',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=PV+%C2%B7+Invertor',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=PV+%C2%B7+Tablou+DC',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=PV+%C2%B7+App']
},
{ id: 'p4', category: 'ind', loc_ro: 'TIMIȘOARA', loc_en: 'TIMIȘOARA',
  title_ro: 'Hală producție · tablou general', title_en: 'Production hall · main switchboard',
  desc_ro: 'Distribuție JT, iluminat industrial și sistem PSI.',
  desc_en: 'LV distribution, industrial lighting and fire system.',
  summary_ro: 'Hală producție 2.400 mp: tablou general 630A, distribuție JT către 5 subtablouri pentru utilaje, iluminat industrial LED cu telecomandă DALI și sistem detecție incendiu adresabil.',
  summary_en: '2,400 sqm production hall: 630A main switchboard, LV distribution to 5 sub-panels for equipment, LED industrial lighting with DALI control and addressable fire detection.',
  image: 'https://placehold.co/1200x750/0E2A47/F5C518?text=Hal%C4%83+Industrial%C4%83',
  images: [
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Hal%C4%83+%C2%B7+Tablou',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Hal%C4%83+%C2%B7+Iluminat',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Hal%C4%83+%C2%B7+Distribu%C8%9Bie',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Hal%C4%83+%C2%B7+PSI']
},
{ id: 'p5', category: 'res', loc_ro: 'ILFOV', loc_en: 'ILFOV',
  title_ro: 'Ansamblu 12 vile · pachet securitate', title_en: '12-villa development · security package',
  desc_ro: 'CCTV perimetral, control acces poartă și videointerfonie.',
  desc_en: 'Perimeter CCTV, gate access control and video intercom.',
  summary_ro: 'Ansamblu rezidențial de 12 vile: supraveghere video perimetrală cu 18 camere, control acces la poartă cu cititor de cartelă și telecomandă, videointerfonie cu monitor 7" în fiecare vilă, totul conectat la o aplicație mobilă comună.',
  summary_en: 'Residential complex of 12 villas: perimeter CCTV with 18 cameras, gate access with card reader and remote, 7" video intercom in every villa, all linked to a shared mobile app.',
  image: 'https://placehold.co/1200x750/0E2A47/F5C518?text=Ansamblu+12+vile',
  images: [
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Ansamblu+%C2%B7+Poart%C4%83',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Ansamblu+%C2%B7+CCTV',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Ansamblu+%C2%B7+Interfon',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Ansamblu+%C2%B7+App']
},
{ id: 'p6', category: 'com', loc_ro: 'BRAȘOV', loc_en: 'BRAȘOV',
  title_ro: 'Restaurant · sonorizare ambientală', title_en: 'Restaurant · public address',
  desc_ro: 'Sistem zonat 4 zone cu mixer digital și back-up amplificare.',
  desc_en: '4-zone system with digital mixer and amp backup.',
  summary_ro: 'Restaurant cu 4 zone acustice independente (sală principală, terasă, bar, separeu): difuzoare de tavan, mixer digital, controlere de zonă pe perete și amplificare cu back-up automat.',
  summary_en: 'Restaurant with 4 independent acoustic zones (main hall, terrace, bar, private room): ceiling speakers, digital mixer, wall zone controllers and amplification with automatic backup.',
  image: 'https://placehold.co/1200x750/0E2A47/F5C518?text=Restaurant+Sound',
  images: [
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Restaurant+%C2%B7+Sal%C4%83',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Restaurant+%C2%B7+Teras%C4%83',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Restaurant+%C2%B7+Bar',
  'https://placehold.co/1200x750/0E2A47/F5C518?text=Restaurant+%C2%B7+Rack']
}];


// ============================================================
// === Pachete promoționale ===================================
// ============================================================
const PACKAGES = [
{ id: 'start', tag: 'OFERTA START',
  title_ro: '4 camere CCTV + sistem efracție', title_en: '4 CCTV cameras + intrusion',
  brand: 'Hikvision / DSC',
  desc_ro: 'Pachet de bază pentru locuințe cu o singură intrare și perimetru redus — supraveghere video și alarmă antiefracție conectată la aplicație mobilă.',
  desc_en: 'Entry-level package for homes with a single entrance and small perimeter — video surveillance and intrusion alarm connected to a mobile app.',
  items_ro: ['4 camere full HD exterioare', 'NVR cu HDD 1TB', 'Centrală alarmă + 2 senzori PIR', 'Sirenă exterioară', 'Manoperă inclusă'],
  items_en: ['4 outdoor full HD cameras', 'NVR with 1TB HDD', 'Alarm panel + 2 PIR sensors', 'Outdoor siren', 'Labor included'],
  specs_ro: ['Rezoluție camere: 2MP / 1080p', 'Stocare: HDD 1TB (~7 zile)', 'Acces remote: aplicație iOS / Android', 'Garanție: 24 luni'],
  specs_en: ['Camera resolution: 2MP / 1080p', 'Storage: 1TB HDD (~7 days)', 'Remote access: iOS / Android app', 'Warranty: 24 months'],
  price: 4000, highlight: false },
{ id: 'comfort', tag: 'OFERTA CONFORT',
  title_ro: '6 camere 4MP + control acces', title_en: '6 4MP cameras + access control',
  brand: 'Hikvision / Paradox',
  desc_ro: 'Pentru case medii cu curte, garaj și mai multe intrări — supraveghere extinsă, alarmă cu mai multe zone și control acces la o ușă principală.',
  desc_en: 'For mid-sized homes with yard, garage and multiple entries — extended surveillance, multi-zone alarm and access control at a main door.',
  items_ro: ['6 camere CCTV 4MP', 'NVR cu HDD 2TB', 'Centrală alarmă + 4 senzori PIR', 'Control acces cu 1 cititor', 'Manoperă inclusă'],
  items_en: ['6 4MP CCTV cameras', 'NVR with 2TB HDD', 'Alarm panel + 4 PIR sensors', 'Access control with 1 reader', 'Labor included'],
  specs_ro: ['Rezoluție camere: 4MP / 2K', 'Stocare: HDD 2TB (~14 zile)', 'Cititor card RFID + tastatură', 'Garanție: 24 luni'],
  specs_en: ['Camera resolution: 4MP / 2K', 'Storage: 2TB HDD (~14 days)', 'RFID card reader + keypad', 'Warranty: 24 months'],
  price: 7500, highlight: true },
{ id: 'premium', tag: 'OFERTA PREMIUM',
  title_ro: 'Smart Home · 8 camere & integrare', title_en: 'Smart Home · 8 cameras & integration',
  brand: 'Hikvision / Ajax / Comelit',
  desc_ro: 'Pachet complet pentru vile și locuințe smart — supraveghere extinsă, alarmă wireless cu app mobilă, videointerfon și integrare cu scenarii smart home.',
  desc_en: 'Complete package for villas and smart homes — extended surveillance, wireless alarm with mobile app, video intercom and smart-home scenario integration.',
  items_ro: ['8 camere CCTV 4MP', 'NVR cu HDD 4TB', 'Efracție GSM/Wi-Fi cu app', 'Videointerfon cu monitor 7"', 'Integrare smart-phone'],
  items_en: ['8 4MP CCTV cameras', 'NVR with 4TB HDD', 'GSM/Wi-Fi intrusion with app', '7-inch video intercom', 'Smartphone integration'],
  specs_ro: ['Rezoluție camere: 4MP / 2K', 'Stocare: HDD 4TB (~30 zile)', 'Notificări push în timp real', 'Garanție: 36 luni'],
  specs_en: ['Camera resolution: 4MP / 2K', 'Storage: 4TB HDD (~30 days)', 'Real-time push notifications', 'Warranty: 36 months'],
  price: 12000, highlight: false }];


const STATS = window.EPT_STATS || [
{ key: 'stats_clients', value: '0+' },
{ key: 'stats_projects', value: '0+' },
{ key: 'stats_systems', value: '0+' },
{ key: 'stats_cable', value: '0+' }];

// ============================================================
// === EDITEAZĂ AICI: articole blog ============================
// body = array de blocuri { type: 'h2'|'p', text: '...' }
// ============================================================
const ARTICLES = window.EPT_ARTICLES || [
  {
    id: 'cctv-cum-alegi',
    category: 'cctv',
    cat_ro: 'CCTV',
    cat_en: 'CCTV',
    date: '2026-04-12',
    read_min: 6,
    image: 'https://images.unsplash.com/photo-1557597774-9d273605dfa9?w=1400&q=70&auto=format&fit=crop',
    title_ro: 'Cum alegi un sistem CCTV potrivit pentru locuință sau afacere',
    title_en: 'How to choose a CCTV system that fits your home or business',
    excerpt_ro: 'Rezoluție, lentile, lumină slabă, NVR, stocare și conformitate GDPR — un ghid concret pentru a alege un sistem CCTV care chiar îți rezolvă problema, nu doar bifează căsuța „supraveghere".',
    excerpt_en: 'Resolution, lenses, low light, NVR, storage and GDPR — a concrete guide to picking a CCTV system that actually solves your problem instead of just ticking a box.',
    body_ro: [
      { type: 'h2', text: 'De la ce începi: definește scopul, nu echipamentul' },
      { type: 'p', text: 'Înainte să compari camere și NVR-uri, întreabă-te concret ce vrei să vezi și, mai ales, ce ai nevoie să poți recunoaște în înregistrare. O imagine în care „se vede ceva" e diferită de una care identifică un chip sau un număr de mașină. Standardul DORI (Detect / Observe / Recognize / Identify) îți spune câți pixeli pe metru ai nevoie pentru fiecare scenariu. Pentru identificare facială sigură ai nevoie de cel puțin 250 px/m pe zona de interes, nu doar pe centru.' },
      { type: 'h2', text: 'Rezoluție și lentile — pixelii nu sunt tot' },
      { type: 'p', text: 'O cameră de 4MP cu lentilă potrivită bate o cameră de 8MP cu lentilă greșită. Pentru curte mică alegi lentile cu deschidere largă (2.8 mm); pentru perimetrul unei hale, lentile varifocale (2.7–12 mm) care îți permit să cadrezi exact zona critică. La identificare la distanță, varifocală 8–32 mm pe un suport rigid e mai utilă decât 8MP la 2.8 mm.' },
      { type: 'h2', text: 'Lumină slabă: nu „IR" la grămadă' },
      { type: 'p', text: 'Specificațiile „0.001 lux" și „IR 30 m" sunt indicative, nu garanție. În realitate contează tipul senzorului (Starlight / ColorVu), apertura lentilei (f/1.4 vs f/1.6) și cum sunt poziționate camerele față de surse parazite. Pentru imagine color noaptea ai nevoie de iluminat ambiental sau cameră cu reflector LED încorporat.' },
      { type: 'h2', text: 'NVR, stocare și backup' },
      { type: 'p', text: 'Un sistem de 8 camere 4MP la 15 fps generează ~6–8 Mbps per cameră, deci ~60 Mbps total. Un HDD 4TB îți ține înregistrarea ~14–21 zile. Pentru continuitate folosim HDD-uri „Surveillance grade" (WD Purple, Seagate SkyHawk) și păstrăm o copie pe cloud sau pe un al doilea NVR.' },
      { type: 'h2', text: 'GDPR — partea pe care toată lumea o uită' },
      { type: 'p', text: 'CCTV-ul prelucrează date personale. Ai nevoie de zone de mascare automată, informare prin afișaj la intrare („ZONĂ MONITORIZATĂ VIDEO"), retenție justificată și acces controlat la înregistrări. Tot ce nu e configurat din start devine reclamație la ANSPDCP mai târziu.' },
      { type: 'h2', text: 'Concluzie practică' },
      { type: 'p', text: 'Un sistem CCTV bun nu e cel mai scump, ci cel proiectat pentru spațiul tău. Cere întotdeauna o schiță cu zonele de acoperire și o simulare DORI înainte de cumpărare.' },
    ],
    body_en: [
      { type: 'h2', text: 'Start with the goal, not the gear' },
      { type: 'p', text: 'Before you compare cameras and NVRs, ask concretely what you want to see and what you need to actually recognize in the recording. DORI (Detect / Observe / Recognize / Identify) tells you how many pixels per meter you need. For reliable face ID you need at least 250 px/m on the area of interest.' },
      { type: 'h2', text: 'Resolution and lenses — pixels aren\'t everything' },
      { type: 'p', text: 'A 4MP camera with the right lens beats an 8MP camera with the wrong one. Small yards take wide lenses (2.8 mm); warehouse perimeters take varifocals (2.7–12 mm). For distant identification, an 8–32 mm varifocal on a rigid mount is more useful than 8MP at 2.8 mm.' },
      { type: 'h2', text: 'Low light: don\'t just buy "IR" by the kilo' },
      { type: 'p', text: 'Spec sheets are indicative, not a guarantee. What matters is the sensor type (Starlight / ColorVu), lens aperture and camera positioning. For color night vision you need ambient lighting or a camera with built-in LED.' },
      { type: 'h2', text: 'NVR, storage and backup' },
      { type: 'p', text: 'An 8-camera 4MP system at 15 fps generates ~60 Mbps total. A 4TB HDD gives 14–21 days of recording. Use surveillance-grade drives and keep a backup on cloud or a second NVR.' },
      { type: 'h2', text: 'GDPR — the part everyone forgets' },
      { type: 'p', text: 'CCTV processes personal data. You need privacy masks, entrance signage, justified retention and controlled access. Anything not configured up front becomes a complaint later on.' },
      { type: 'h2', text: 'Practical conclusion' },
      { type: 'p', text: 'A good CCTV system isn\'t the most expensive — it\'s the one designed for your space. Always ask for a coverage drawing and DORI simulation before buying.' },
    ],
  },
  {
    id: 'detectie-incendiu-ghid',
    category: 'fire',
    cat_ro: 'DETECȚIE INCENDIU',
    cat_en: 'FIRE DETECTION',
    date: '2026-03-22',
    read_min: 7,
    image: 'https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?w=1400&q=70&auto=format&fit=crop',
    title_ro: 'Detecție incendiu: ce înseamnă, de fapt, un sistem care funcționează',
    title_en: 'Fire detection: what a working system really means',
    excerpt_ro: 'Convențional vs. adresabil, P118/3, SR EN 54, avize ISU și mentenanță obligatorie — diferențele care decid dacă sistemul te alertează la timp sau e doar o cutie pe perete.',
    excerpt_en: 'Conventional vs. addressable, P118/3, EN 54, fire approvals and mandatory maintenance — the differences between a system that warns you in time and one that\'s just a box on the wall.',
    body_ro: [
      { type: 'h2', text: 'De ce contează tipul centralei' },
      { type: 'p', text: 'Sistemele convenționale grupează detectoarele pe zone — știi că „undeva pe etajul 2" e o alarmă, dar nu unde anume. Adresabile identifică fiecare detector în parte. Pentru clădiri publice, hale și birouri, P118/3 cere de regulă sistem adresabil cu raportare la dispecerat.' },
      { type: 'h2', text: 'Detectoare: optic, termic, multisenzor' },
      { type: 'p', text: 'Optice (fum) reacționează rapid la fum; termice sunt pentru bucătării și parcări; multisenzor combină ambele plus CO. Așezarea e critică: distanță maximă 7,5 m pentru optice și 5,3 m pentru termice, ajustată pentru tavane înalte și ventilație.' },
      { type: 'h2', text: 'Sirene, butoane manuale, evacuare' },
      { type: 'p', text: 'Sirenele asigură cel puțin 65 dB(A) în orice punct de evacuare. Butoanele manuale se montează la fiecare ieșire, la ~1,4 m înălțime. Sistemul de evacuare vocală (EN 54-16) e cerut pentru clădiri cu peste 500 persoane.' },
      { type: 'h2', text: 'Documente, avize, predare' },
      { type: 'p', text: 'Sistemul legal cuprinde: proiect verificat, execuție de către firmă autorizată IGSU, certificate EN 54, scenariu de securitate la incendiu și obținerea avizului ISU. Fără documente nu poți obține autorizație de funcționare.' },
      { type: 'h2', text: 'Mentenanța nu e opțională' },
      { type: 'p', text: 'Legea cere verificare semestrială documentată. Asigurătorii cer dovada mentenanței. Un sistem instalat și uitat poate să nu detecteze nimic la momentul critic.' },
    ],
    body_en: [
      { type: 'h2', text: 'Why the panel type matters' },
      { type: 'p', text: 'Conventional systems group detectors into zones — you know there\'s an alarm "somewhere on floor 2," but not where. Addressable systems identify each detector individually. Public buildings, warehouses and offices typically require addressable per P118/3.' },
      { type: 'h2', text: 'Detectors: optical, thermal, multi-sensor' },
      { type: 'p', text: 'Optical (smoke) reacts quickly to smoke; thermal suits kitchens and garages; multi-sensor combines both plus CO. Placement is critical: max 7.5 m for optical, 5.3 m for thermal.' },
      { type: 'h2', text: 'Sirens, manual call points, evacuation' },
      { type: 'p', text: 'Sounders hit at least 65 dB(A) at any escape route. Manual call points at every exit, at ~1.4 m height. Voice evacuation (EN 54-16) is required for buildings with over 500 people.' },
      { type: 'h2', text: 'Paperwork, approvals, handover' },
      { type: 'p', text: 'A compliant system includes: verified design, execution by IGSU-authorized company, EN 54 certificates, fire safety scenario and the ISU permit. Without these you can\'t get the operating permit.' },
      { type: 'h2', text: 'Maintenance isn\'t optional' },
      { type: 'p', text: 'Law requires documented bi-annual inspection. Insurers ask for proof. A "fit-and-forget" system may not detect anything when it matters.' },
    ],
  },
  {
    id: 'fotovoltaice-2026',
    category: 'pv',
    cat_ro: 'FOTOVOLTAICE',
    cat_en: 'PHOTOVOLTAIC',
    date: '2026-02-28',
    read_min: 8,
    image: 'https://images.unsplash.com/photo-1509391366360-2e959784a276?w=1400&q=70&auto=format&fit=crop',
    title_ro: 'Fotovoltaice în 2026: ce trebuie să știi înainte să investești',
    title_en: 'Photovoltaics in 2026: what to know before investing',
    excerpt_ro: 'On-grid vs. hibrid, dimensionare corectă, statutul de prosumator, programe de finanțare și greșelile tipice — totul în limbaj simplu, pentru cei care fac investiția pentru prima dată.',
    excerpt_en: 'On-grid vs. hybrid, sizing, prosumer status, funding schemes and typical mistakes — in plain language for first-time investors.',
    body_ro: [
      { type: 'h2', text: 'On-grid, off-grid sau hibrid?' },
      { type: 'p', text: 'On-grid e cel mai răspândit: panourile produc, surplusul intră în rețea, primești energia înapoi la nevoie. Limita: la pană de curent sistemul se oprește. Hibridul adaugă o baterie pentru noapte sau avarii. Off-grid e doar pentru locații izolate.' },
      { type: 'h2', text: 'Cum dimensionezi corect' },
      { type: 'p', text: 'Plecăm de la consumul real (facturi pe ultimele 12 luni). Un consum de 4.000–6.000 kWh/an se acoperă cu 5–8 kWp. Supradimensionarea „de siguranță" e o greșeală costisitoare; subdimensionarea înseamnă că tot iei din rețea seara.' },
      { type: 'h2', text: 'Echipamente: panouri și invertor' },
      { type: 'p', text: 'Panouri Tier-1 (LONGi, JA Solar, Trina, REC, Q-Cells) cu garanție 25 ani la 80% performanță. Invertoare hibride Huawei, Fronius, SolarEdge, Goodwe. Atenție la „panouri ieftine no-name" — pierd 20% în 5 ani.' },
      { type: 'h2', text: 'Statutul de prosumator' },
      { type: 'p', text: 'După montaj, operatorul de rețea îți schimbă contorul și te înregistrează ca prosumator (30–60 zile). Compensarea e cantitativă pentru sisteme până la 200 kWp — kWh livrat = kWh primit înapoi.' },
      { type: 'h2', text: 'Finanțare: Casa Verde, ElectricUp' },
      { type: 'p', text: 'Casa Verde Fotovoltaice oferă voucher pentru persoane fizice. ElectricUp e pentru IMM-uri (până la 100.000 EUR, 80% finanțare). Procesul cere instalator autorizat ANRE — noi ne ocupăm de tot dosarul.' },
      { type: 'h2', text: 'Greșeli tipice' },
      { type: 'p', text: 'Montaj cu umbrire de la coș/copac vecin, cabluri DC subdimensionate, lipsa protecțiilor antiincendiu, panouri amestecate. Toate se evită cu un proiect tehnic serios.' },
    ],
    body_en: [
      { type: 'h2', text: 'On-grid, off-grid or hybrid?' },
      { type: 'p', text: 'On-grid is the most common: panels generate, surplus goes to grid, you take it back when needed. In a blackout the system shuts down. Hybrid adds battery storage. Off-grid is only for isolated locations.' },
      { type: 'h2', text: 'How to size it correctly' },
      { type: 'p', text: 'Start from real consumption. A 4,000–6,000 kWh/year house needs 5–8 kWp. "Safety oversizing" is a costly mistake; undersizing means you still pull from the grid in the evening.' },
      { type: 'h2', text: 'Equipment: panels and inverter' },
      { type: 'p', text: 'Tier-1 panels (LONGi, JA Solar, Trina, REC, Q-Cells) with 25-year warranty. Hybrid inverters from Huawei, Fronius, SolarEdge, Goodwe. Beware no-name panels — 20% degradation in 5 years.' },
      { type: 'h2', text: 'Prosumer status' },
      { type: 'p', text: 'After installation, the grid operator swaps the meter and registers you as a prosumer (30–60 days). Quantity-based netting for systems up to 200 kWp.' },
      { type: 'h2', text: 'Funding: Casa Verde, ElectricUp' },
      { type: 'p', text: 'Casa Verde Photovoltaic offers vouchers to individuals. ElectricUp is for SMEs (up to EUR 100,000, 80% funded). We handle the whole file.' },
      { type: 'h2', text: 'Typical mistakes' },
      { type: 'p', text: 'Shading from chimney or neighbor\'s tree, undersized DC cabling, missing fire protections, mixed panels — all avoidable with a serious technical design.' },
    ],
  },
  {
    id: 'mentenanta-preventiva',
    category: 'maintenance',
    cat_ro: 'MENTENANȚĂ',
    cat_en: 'MAINTENANCE',
    date: '2026-01-15',
    read_min: 5,
    image: 'https://images.unsplash.com/photo-1581094794329-c8112a89af12?w=1400&q=70&auto=format&fit=crop',
    title_ro: 'De ce mentenanța preventivă costă mai puțin decât prima avarie',
    title_en: 'Why preventive maintenance costs less than the first failure',
    excerpt_ro: 'Termografie la tablou, test al RCD-urilor, curățare detectoare PSI și verificare CCTV — gesturi mici, programate, care evită opriri costisitoare și prelungesc viața echipamentelor.',
    excerpt_en: 'Switchboard thermography, RCD testing, fire-detector cleaning and CCTV checks — small scheduled actions that prevent costly downtime.',
    body_ro: [
      { type: 'h2', text: 'Ce înseamnă, concret, „mentenanță"' },
      { type: 'p', text: 'Nu e „vine un electrician să arunce un ochi". E un set de verificări procedurale, documentate, cu instrumente: termografiere tablouri, test RCD/RCBO la curent diferențial real, curățare detectoare PSI cu aspirator anti-static, verificare focalizare camere CCTV, control firmware NVR/centrale.' },
      { type: 'h2', text: 'Termografia — cea mai bună investiție' },
      { type: 'p', text: 'O conexiune slăbită într-un tablou se vede cu 10–20°C mai cald înainte să cedeze. Termografierea anuală costă cât 1–2 ore de manoperă și prinde defecte care altfel devin scurtcircuit cu incendiu.' },
      { type: 'h2', text: 'RCD-uri și protecții — testează, nu presupune' },
      { type: 'p', text: 'Diferențialele se „lipesc" în timp. În mentenanța preventivă verificăm timpul real de declanșare cu un tester (max. 300 ms la I∆n). Un RCD blocat e ca o curea de siguranță tăiată.' },
      { type: 'h2', text: 'Detectoare PSI — praful e dușmanul' },
      { type: 'p', text: 'În 6–12 luni, un detector optic prinde praf cât să genereze alarme false. Curățarea cu aspirator dedicat și testare cu spray de fum la fiecare 6 luni e cerută legal. Înregistrăm fiecare detector în registru.' },
      { type: 'h2', text: 'Contract sau intervenții punctuale?' },
      { type: 'p', text: 'Pentru clienții cu sisteme complexe, un contract de mentenanță cu vizite programate iese mai ieftin decât intervenții la cerere. Reducem timpul de răspuns la 24h și păstrăm piese de schimb.' },
    ],
    body_en: [
      { type: 'h2', text: 'What "maintenance" actually means' },
      { type: 'p', text: 'Not just "an electrician swings by." It\'s a procedural set of checks with proper tools: switchboard thermography, RCD/RCBO testing, anti-static vacuum cleaning of fire detectors, CCTV focus verification, firmware checks.' },
      { type: 'h2', text: 'Thermography — the best investment' },
      { type: 'p', text: 'A loose connection runs 10–20°C hotter before it fails. Annual thermography costs as much as 1–2 hours of labor and catches faults that otherwise become short-circuit fires.' },
      { type: 'h2', text: 'RCDs and protections — test, don\'t assume' },
      { type: 'p', text: 'RCDs can stick over time. We test actual trip time with a tester (max 300 ms at I∆n). A stuck RCD is a cut seat belt.' },
      { type: 'h2', text: 'Fire detectors — dust is the enemy' },
      { type: 'p', text: 'In 6–12 months, an optical detector collects enough dust to generate false alarms. Vacuuming and smoke-spray testing every 6 months is legally required.' },
      { type: 'h2', text: 'Contract or on-demand?' },
      { type: 'p', text: 'For complex systems, a maintenance contract with scheduled visits costs less than on-demand calls. We cut response time to 24h and keep spare parts.' },
    ],
  },
];



// ============================================================
// === UI primitives ==========================================
// ============================================================
function Logo({ size = 'M', dark = false }) {
  const px = size === 'L' ? 200 : size === 'M' ? 40 : 28;
  const bgFill = dark ? '#F4F1EA' : '#0E2A47';
  return (
    <svg width={px} height={px} viewBox="0 0 100 100" aria-hidden="true" style={{ display: 'block' }}>
      <rect x="2" y="2" width="96" height="96" rx="20" fill={bgFill} />
      <rect x="22" y="22" width="56" height="11" rx="2" fill="#F5C518" />
      <rect x="22" y="67" width="56" height="11" rx="2" fill="#F5C518" />
      <rect x="22" y="22" width="11" height="56" rx="2" fill="#F5C518" />
      <path d="M22 45 H58 L48 50 H72 L52 60 H22 Z" fill="#F5C518" />
    </svg>);

}

function ServiceIcon({ path, size = 44, color = '#0E2A47' }) {
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none"
    stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"
    dangerouslySetInnerHTML={{ __html: path }} />);

}

function Mono({ children, className = '', style }) {
  return <span className={`font-mono uppercase tracking-[0.22em] text-[12px] ${className}`} style={style}>{children}</span>;
}

function SectionHeader({ num, title, meta }) {
  return (
    <div className="flex items-baseline justify-between gap-8 flex-wrap mb-8 md:mb-10">
      <div className="max-w-2xl">
        <div className="font-mono uppercase tracking-[0.22em] text-[12px] opacity-55">{num}</div>
        <h2 className="font-sora font-semibold text-[36px] md:text-[44px] leading-[1.05] tracking-[-0.02em] mt-3" style={{ textAlign: "left" }}>{title}</h2>
      </div>
      {meta && <p className="text-[14px] text-muted max-w-sm md:text-right">{meta}</p>}
    </div>);

}

// ============================================================
// === Inline icons ===========================================
// ============================================================
const I = (props) => <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" {...props} />;
const PhoneIcon = () => <I><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z" /></I>;
const MailIcon = () => <I><rect x="3" y="5" width="18" height="14" rx="2" /><path d="M3 7l9 6 9-6" /></I>;
const MapIcon = () => <I><path d="M21 10c0 7-9 13-9 13S3 17 3 10a9 9 0 0 1 18 0z" /><circle cx="12" cy="10" r="3" /></I>;
const ClockIcon = () => <I><circle cx="12" cy="12" r="9" /><path d="M12 7v5l3 2" /></I>;
const ArrowRightIcon = () => <I width="18" height="18"><path d="M5 12h14" /><path d="M13 5l7 7-7 7" /></I>;
const ArrowLeftIcon = () => <I width="18" height="18"><path d="M19 12H5" /><path d="M11 5l-7 7 7 7" /></I>;
const MenuIcon = () => <I width="26" height="26"><path d="M3 6h18M3 12h18M3 18h18" /></I>;
const CloseIcon = () => <I width="26" height="26"><path d="M6 6l12 12M6 18 18 6" /></I>;
const DownloadIcon = () => <I width="14" height="14"><path d="M12 3v12" /><path d="M7 10l5 5 5-5" /><path d="M5 21h14" /></I>;
const CheckIcon = () => <svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="#0E2A47" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round"><path d="M5 12l5 5L20 7" /></svg>;
const FacebookIcon = () => <I width="16" height="16"><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z" /></I>;
const LinkedInIcon = () => <I width="16" height="16"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-4 0v7h-4v-7a6 6 0 0 1 6-6z" /><rect x="2" y="9" width="4" height="12" /><circle cx="4" cy="4" r="2" /></I>;
const ChevronDownIcon = () => <I width="14" height="14"><path d="M6 9l6 6 6-6" data-comment-anchor="657160b055-path-495-57" /></I>;

// ============================================================
// === HEADER (cu dropdown Servicii) ==========================
// servicesHref: 'self' = scroll to #services (home);
//               URL pentru link extern către pagina de servicii
// ============================================================
function Header({ lang, setLang, mobileOpen, setMobileOpen, servicesBase = 'servicii.html' }) {
  const t = i18n[lang];
  const [openDropdown, setOpenDropdown] = useState(false);
  const closeTimer = useRef(null);
  const dropRef = useRef(null);

  const onEnter = () => {if (closeTimer.current) clearTimeout(closeTimer.current);setOpenDropdown(true);};
  const onLeave = () => {closeTimer.current = setTimeout(() => setOpenDropdown(false), 180);};

  useEffect(() => {
    const onKey = (e) => {if (e.key === 'Escape') setOpenDropdown(false);};
    window.addEventListener('keydown', onKey);
    return () => window.removeEventListener('keydown', onKey);
  }, []);

  const links = [
  ['packages', t.nav_packages, 'oferte.html'],
  ['portfolio', t.nav_portfolio, 'portofoliu.html'],
  ['about', t.nav_about, 'index.html#about'],
  ['contact', t.nav_contact, 'index.html#contact'],
  ['blog', t.nav_blog, 'blog.html']];

  return (
    <>
    <header className="sticky top-0 z-40 bg-paper/85 backdrop-blur border-b border-line">
      <div className="max-w-7xl mx-auto px-6 md:px-10 h-[72px] md:h-[80px] flex items-center justify-between gap-6">
        <a href="index.html" className="flex items-center gap-3 shrink-0">
          <Logo size="M" />
          <span className="hidden sm:inline-block font-sora text-[15px] tracking-tight">
            <span className="font-semibold">Energy</span><span style={{ color: '#F5C518' }}>.</span>{" "}
            <span className="font-light">Profi Team</span>
          </span>
        </a>
        <nav className="hidden lg:flex items-center gap-7 text-[14px]">
          {/* Services dropdown */}
          <div className="relative" onMouseEnter={onEnter} onMouseLeave={onLeave} ref={dropRef}>
            <a href={servicesBase}
              onClick={(e) => {/* allow normal nav */}}
              className="flex items-center gap-1 text-navy/70 hover:text-navy transition-opacity py-2">
              {t.nav_services}
              <span className={`transition-transform ${openDropdown ? 'rotate-180' : ''}`}><ChevronDownIcon /></span>
            </a>
            {openDropdown && (
              <div className="absolute left-0 top-full w-52 bg-paper border border-line rounded-xl shadow-[0_8px_28px_rgba(14,42,71,0.13)] py-2 z-50"
                   onMouseEnter={onEnter} onMouseLeave={onLeave}>
                {SERVICES.map((s) => (
                  <a key={s.id} href={`${servicesBase}#${s.id}`}
                     onClick={() => setOpenDropdown(false)}
                     className="flex items-center gap-3 py-2 px-3 hover:bg-navy/5 transition-colors">
                    <ServiceIcon path={s.path} size={15} color="currentColor" />
                    <span className="font-sora font-medium text-[13px] text-navy">
                      {lang === 'ro' ? s.label_ro : s.label_en}
                    </span>
                  </a>
                ))}
              </div>
            )}
          </div>
          {links.map(([id, label, href]) =>
            <a key={id} href={href} className="text-navy/70 hover:text-navy transition-opacity">{label}</a>
            )}
        </nav>
        <div className="flex items-center gap-4 md:gap-6 shrink-0">
          <a href={CONTACT.phone_link} className="hidden md:flex items-center gap-2 text-[13px] text-navy/80 hover:text-navy">
            <PhoneIcon />
            <span className="font-mono tracking-wider">{CONTACT.phone}</span>
          </a>
          <div className="flex items-center text-[12px] font-mono">
            <button onClick={() => setLang('ro')}
              className={`px-2 py-1 transition-colors ${lang === 'ro' ? 'text-navy font-semibold border-b-2 border-yel' : 'text-navy/50 border-b-2 border-transparent hover:text-navy'}`}>RO</button>
            <span className="text-navy/30">|</span>
            <button onClick={() => setLang('en')}
              className={`px-2 py-1 transition-colors ${lang === 'en' ? 'text-navy font-semibold border-b-2 border-yel' : 'text-navy/50 border-b-2 border-transparent hover:text-navy'}`}>EN</button>
          </div>
          <button className="lg:hidden p-2 -mr-2" aria-label="Menu" onClick={() => setMobileOpen(true)}>
            <MenuIcon />
          </button>
        </div>
      </div>

    </header>

    {/* Mobile menu — OUTSIDE <header> so backdrop-blur doesn't trap the fixed overlay on iOS/Android */}
    {mobileOpen &&
      <div className="fixed inset-0 z-[200] bg-navy text-paper flex flex-col overflow-y-auto" style={{ WebkitOverflowScrolling: 'touch' }}>
        <div className="flex justify-between items-center px-6 h-[72px] border-b border-paper/15 shrink-0">
          <Logo size="M" dark />
          <button onClick={() => setMobileOpen(false)} aria-label="Close" className="p-2 -mr-2"><CloseIcon /></button>
        </div>
        <div className="px-6 py-8 flex flex-col flex-1">
          <a href={servicesBase} onClick={() => setMobileOpen(false)}
          className="font-sora font-semibold text-3xl tracking-tight mb-3">{t.nav_services}</a>
          <div className="flex flex-col gap-0.5 mb-8 pl-1">
            {SERVICES.map((s) =>
            <a key={s.id} href={`${servicesBase}#${s.id}`} onClick={() => setMobileOpen(false)}
            className="flex items-center gap-3 py-2.5 text-paper/85 active:text-yel">
                <ServiceIcon path={s.path} size={18} color="#F5C518" />
                <span className="text-[15px] font-medium">{lang === 'ro' ? s.label_ro : s.label_en}</span>
              </a>
            )}
          </div>
          <nav className="flex flex-col gap-6 border-t border-paper/15 pt-8">
            {links.map(([id, label, href]) =>
            <a key={id} href={href} onClick={() => setMobileOpen(false)}
            className="font-sora font-semibold text-3xl tracking-tight active:text-yel">{label}</a>
            )}
          </nav>
          <div className="mt-auto pt-8 border-t border-paper/15 text-paper/70">
            <a href={CONTACT.phone_link} className="block font-mono tracking-wider mb-2">{CONTACT.phone}</a>
            <a href={`mailto:${CONTACT.email}`} className="block font-mono tracking-wider text-sm">{CONTACT.email}</a>
          </div>
        </div>
      </div>
      }
    </>);


}

// ============================================================
// === FOOTER =================================================
// ============================================================
function Footer({ lang }) {
  const t = i18n[lang];
  const links = [
  ['services', t.nav_services, 'servicii.html'],
  ['packages', t.nav_packages, 'oferte.html'],
  ['portfolio', t.nav_portfolio, 'portofoliu.html'],
  ['about', t.nav_about, 'index.html#about'],
  ['certifications', t.nav_certifications, 'index.html#certifications'],
  ['contact', t.nav_contact, 'index.html#contact'],
  ['blog', t.nav_blog, 'blog.html']];

  return (
    <footer className="bg-navy text-paper">
      <div className="max-w-7xl mx-auto px-6 md:px-10 py-16">
        <div className="grid grid-cols-1 md:grid-cols-4 gap-10 md:gap-8">
          <div className="md:col-span-1">
            <Logo size="M" dark />
            <div className="mt-5 font-sora">
              <div className="text-[18px] font-semibold tracking-tight">Energy<span style={{ color: '#F5C518' }}>.</span></div>
              <div className="text-[18px] font-light tracking-tight">Profi Team</div>
            </div>
            <div className="mt-5 flex items-center gap-3">
              <div className="w-6 h-px bg-yel" />
              <Mono className="text-paper/65">{t.footer_tagline}</Mono>
            </div>
          </div>
          <div>
            <Mono className="text-paper/55">{t.footer_nav}</Mono>
            <ul className="mt-5 space-y-2.5 text-[14px]">
              {links.map(([id, l, href]) =>
              <li key={id}><a href={href} className="text-paper/80 hover:text-yel transition-colors">{l}</a></li>
              )}
            </ul>
          </div>
          <div>
            <Mono className="text-paper/55">{t.footer_contact}</Mono>
            <ul className="mt-5 space-y-2.5 text-[14px] text-paper/80">
              <li>{CONTACT.address}</li>
              <li><a href={CONTACT.phone_link} className="hover:text-yel">{CONTACT.phone}</a></li>
              <li><a href={`mailto:${CONTACT.email}`} className="hover:text-yel">{CONTACT.email}</a></li>
            </ul>
          </div>
          <div>
            <Mono className="text-paper/55">{t.footer_program}</Mono>
            <div className="mt-5 text-[14px] text-paper/80 leading-relaxed">{t.contact_hours_v}</div>
            <Mono className="block mt-6 text-paper/55">{t.footer_social}</Mono>
            <div className="mt-3 flex gap-2">
              <a href={CONTACT.facebook} aria-label="Facebook" className="w-9 h-9 rounded-full border border-paper/15 flex items-center justify-center hover:bg-yel hover:text-navy hover:border-yel transition-colors"><FacebookIcon /></a>
              <a href={CONTACT.linkedin} aria-label="LinkedIn" className="w-9 h-9 rounded-full border border-paper/15 flex items-center justify-center hover:bg-yel hover:text-navy hover:border-yel transition-colors"><LinkedInIcon /></a>
            </div>
          </div>
        </div>
        <div className="mt-14 pt-7 border-t border-paper/12 flex flex-col md:flex-row gap-4 justify-between items-start md:items-center text-[12px] text-paper/55 font-mono uppercase tracking-[0.18em]">
          <div>© 2026 Energy Profi Team SRL · {t.footer_rights}</div>
          <div className="flex flex-wrap gap-x-6 gap-y-2">
            <a href="#" className="hover:text-yel">{t.footer_priv}</a>
            <a href="#" className="hover:text-yel">{t.footer_terms}</a>
            <a href="#" className="hover:text-yel">{t.footer_cookies}</a>
          </div>
        </div>
      </div>
    </footer>);

}

// ============================================================
// === Hero (drone slideshow) =================================
// ============================================================
function DroneScene({ kind }) {
  if (kind === 'bucharest') return (
    <svg viewBox="0 0 1600 900" preserveAspectRatio="xMidYMid slice" className="w-full h-full block">
      <defs><linearGradient id="sky1" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stopColor="#0E2A47" /><stop offset="1" stopColor="#1a3d5e" /></linearGradient></defs>
      <rect width="1600" height="900" fill="url(#sky1)" />
      <g fill="#0a1622" opacity="0.7">{Array.from({ length: 18 }).map((_, i) => {const w = 40 + i * 53 % 70;const h = 80 + i * 97 % 180;return <rect key={i} x={i * 90} y={500 - h} width={w} height={h + 400} />;})}</g>
      <g fill="#070f1a"><rect x="80" y="420" width="120" height="480" /><rect x="230" y="320" width="160" height="580" /><rect x="420" y="480" width="100" height="420" /><rect x="550" y="260" width="180" height="640" /><rect x="760" y="380" width="140" height="520" /><rect x="930" y="200" width="200" height="700" /><rect x="1160" y="360" width="130" height="540" /><rect x="1320" y="440" width="160" height="460" /></g>
      <g fill="#F5C518" opacity="0.55">{Array.from({ length: 120 }).map((_, i) => {const x = 80 + i * 43 % 1400;const y = 240 + i * 71 % 620;return <rect key={i} x={x} y={y} width="5" height="7" />;})}</g>
    </svg>);

  if (kind === 'pv-house') return (
    <svg viewBox="0 0 1600 900" preserveAspectRatio="xMidYMid slice" className="w-full h-full block">
      <rect width="1600" height="900" fill="#3a4a32" />
      <path d="M0,580 L1600,540 L1600,900 L0,900 Z" fill="#4a5a40" />
      <g><polygon points="480,300 1140,300 1280,560 340,580" fill="#1a1410" /></g>
      <g fill="#0E2A47" stroke="#1a3d5e" strokeWidth="2">{Array.from({ length: 6 }).map((_, r) => Array.from({ length: 8 }).map((_, c) => {const x = 520 + c * 68;const y = 320 + r * 38;return <rect key={r + '-' + c} x={x} y={y} width="60" height="30" />;}))}</g>
    </svg>);

  if (kind === 'pv-park') return (
    <svg viewBox="0 0 1600 900" preserveAspectRatio="xMidYMid slice" className="w-full h-full block">
      <rect width="1600" height="900" fill="#5a6048" />
      <g>{Array.from({ length: 14 }).map((_, r) => {const y = 180 + r * 48;const w = 900 + r * 40;const x = (1600 - w) / 2;return <g key={r}><rect x={x} y={y} width={w} height={26} fill="#0E2A47" /><rect x={x} y={y} width={w} height={3} fill="#F5C518" opacity="0.25" /></g>;})}</g>
    </svg>);

  if (kind === 'industrial') return (
    <svg viewBox="0 0 1600 900" preserveAspectRatio="xMidYMid slice" className="w-full h-full block">
      <defs><linearGradient id="sky2" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stopColor="#1a2638" /><stop offset="1" stopColor="#3a4658" /></linearGradient></defs>
      <rect width="1600" height="900" fill="url(#sky2)" />
      <rect x="0" y="560" width="1600" height="340" fill="#2a3142" />
      <g><rect x="340" y="360" width="920" height="260" fill="#0a1622" /><rect x="340" y="360" width="920" height="8" fill="#F5C518" opacity="0.5" /></g>
      {[180, 800, 1420].map((x, i) => <g key={i}><line x1={x} y1="700" x2={x} y2="260" stroke="#0a1622" strokeWidth="6" /><rect x={x - 4} y="258" width="60" height="8" fill="#0a1622" /><rect x={x + 45} y="248" width="22" height="22" rx="3" fill="#0a1622" /></g>)}
    </svg>);

  return null;
}

const HERO_SLIDES = [
{ kind: 'bucharest', img: 'https://images.unsplash.com/photo-1496588152823-86ff7695e68f?w=1800&q=70&auto=format&fit=crop' },
{ kind: 'pv-house', img: 'https://images.unsplash.com/photo-1611365892117-00ac5ef43c90?w=1800&q=70&auto=format&fit=crop' },
{ kind: 'pv-park', img: 'https://images.unsplash.com/photo-1509391366360-2e959784a276?w=1800&q=70&auto=format&fit=crop' },
{ kind: 'industrial', img: 'https://images.unsplash.com/photo-1494412651409-8963ce7935a7?w=1800&q=70&auto=format&fit=crop' }];


function Hero({ lang }) {
  const t = i18n[lang];
  const cats = [['electric', t.cat_electric], ['camera', t.cat_low], ['solar', t.cat_pv], ['tools', t.cat_bess]];
  const findIcon = (id) => SERVICES.find((s) => s.id === id);
  const [slide, setSlide] = useState(0);
  useEffect(() => {
    const id = setInterval(() => setSlide((s) => (s + 1) % HERO_SLIDES.length), 5500);
    return () => clearInterval(id);
  }, []);
  return (
    <section id="top" className="relative border-b border-line overflow-hidden">
      <div className="absolute inset-0">
        {HERO_SLIDES.map((s, i) =>
        <div key={s.kind} className="absolute inset-0 transition-opacity duration-[1200ms] ease-out" style={{ opacity: i === slide ? 1 : 0 }}>
            <div className="absolute inset-0"><DroneScene kind={s.kind} /></div>
            <img src={s.img} alt="" loading={i === 0 ? 'eager' : 'lazy'}
          className="absolute inset-0 w-full h-full object-cover"
          onError={(e) => {e.currentTarget.style.display = 'none';}} />
          </div>
        )}
        <div className="absolute inset-0" style={{
          background: 'linear-gradient(90deg, rgba(244,241,234,0.96) 0%, rgba(244,241,234,0.92) 38%, rgba(244,241,234,0.55) 62%, rgba(244,241,234,0.15) 100%)'
        }} />
        <div className="absolute inset-0 dot-pattern opacity-60 pointer-events-none" />
      </div>
      <div className="relative max-w-7xl mx-auto px-6 md:px-10 pt-12 md:pt-16 pb-8 md:pb-12">
        <Mono className="opacity-55">{t.hero_label}</Mono>
        <h1 className="font-sora font-semibold leading-[0.95] tracking-[-0.03em] mt-6 text-[clamp(48px,9vw,120px)]">
          {t.hero_title_1}<span style={{ color: '#F5C518' }}>.</span><br />
          <span className="font-light tracking-[-0.025em]">{t.hero_title_2}</span>
        </h1>
        <div className="flex items-center gap-3 mt-6">
          <div className="w-10 h-px bg-navy" />
          <Mono className="opacity-70">{t.hero_tagline}</Mono>
        </div>
        <p className="mt-8 max-w-xl text-[17px] md:text-[19px] leading-relaxed text-ink/80">{t.hero_subtitle}</p>
        <div className="mt-10 flex flex-wrap items-center gap-4 md:gap-6">
          <a href="#contact" className="inline-flex items-center gap-2 bg-yel text-navy font-sora font-semibold px-7 py-4 rounded-full hover:bg-yel/90 transition-colors focus-yel shadow-[0_8px_30px_rgba(14,42,71,0.12)]">
            <span>{t.hero_cta_primary}</span><ArrowRightIcon />
          </a>
          <a href="servicii.html" className="inline-flex items-center gap-2 text-navy font-sora font-semibold underline decoration-yel decoration-[3px] underline-offset-[6px] hover:decoration-navy transition-colors">
            {t.hero_cta_secondary}
          </a>
        </div>
        <div className="mt-8 md:mt-12 flex items-center gap-2">
          {HERO_SLIDES.map((_, i) =>
          <button key={i} onClick={() => setSlide(i)} aria-label={`Slide ${i + 1}`}
          className={`h-1.5 rounded-full transition-all ${i === slide ? 'w-10 bg-navy' : 'w-5 bg-navy/25 hover:bg-navy/50'}`} />
          )}
        </div>
      </div>
    </section>);

}

// ============================================================
// === Export to window =======================================
// ============================================================
Object.assign(window, {
  i18n, SERVICES, FEATURED_SERVICE_IDS, CERTIFICATIONS, PROJECTS, PACKAGES, STATS, HERO_SLIDES, ARTICLES,
  CONTACT,
  Logo, ServiceIcon, Mono, SectionHeader,
  PhoneIcon, MailIcon, MapIcon, ClockIcon, ArrowRightIcon, ArrowLeftIcon, MenuIcon, CloseIcon,
  DownloadIcon, CheckIcon, FacebookIcon, LinkedInIcon, ChevronDownIcon,
  Header, Footer, DroneScene, Hero,
  useState, useEffect, useRef
});