/* Εισαγωγή High-Tech Γραμματοσειρών */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Rajdhani:wght@300;500;700&display=swap');

:root {
    --bg-main: #e8e9eb;    /* Ανοιχτό ασημί/γκρι μετάλλου */
    --bg-dark: #2d2e32;    /* Σκούρο ανθρακί */
    --orange: #ff6600;     /* Πορτοκαλί της φωτιάς/κοπής */
    --text-main: #1a1a1a;  /* Μαύρο για κείμενα */
    --silver-title: #e8e9eb; /* Το γκρι του τίτλου */
}

/* Γενικό Στυλ & Φόντο Blueprint */
body { 
    font-family: 'Rajdhani', sans-serif; 
    margin: 0; 
    background-color: var(--bg-main); 
    color: var(--text-main);
    /* Το πλέγμα ξεκινάει από το 0,0 */
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: top left; /* ΚΛΕΙΔΙ: Ξεκινάει από πάνω αριστερά */
    background-attachment: fixed; /* Το πλέγμα μένει σταθερό στο scroll */
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Header */
header { 
    background: var(--bg-dark);
    padding: 30px; 
    text-align: center; 
    border-bottom: 5px solid var(--orange);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

header img {
    max-width: 250px;
    height: auto;
}

/* Navigation - Industrial Tabs */
nav { 
    background: #f8f9fa;
    display: flex; 
    justify-content: center; 
    padding: 0;
    border-bottom: 1px solid #bcc0c4;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav a { 
    font-family: 'Orbitron', sans-serif;
    color: var(--bg-dark); 
    padding: 20px 30px;
    text-decoration: none; 
    font-size: 0.8rem; 
    letter-spacing: 2px;
    transition: 0.3s ease;
    border-right: 1px solid #bcc0c4;
}

nav a:hover { 
    background: var(--orange);
    color: white;
}

/* Hero Section & High-Tech Title */
.hero h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 8vw, 4rem); /* Προσαρμόζεται σε κινητά */
    text-transform: uppercase;
    color: var(--silver-title);
    margin-top: 40px;
    margin-bottom: 0;
    /* Εφέ βάθους και περιγράμματος */
    text-shadow: 
        2px 2px 0px var(--bg-dark), 
        4px 4px 0px rgba(0,0,0,0.2),
        0 0 10px rgba(255,102,0,0.3);
    letter-spacing: 5px;
}

.orange-bar { 
    width: 80px; 
    height: 4px; 
    background: var(--orange); 
    margin: 15px auto 40px; 
    box-shadow: 0 0 10px var(--orange);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px auto;
    max-width: 1000px;
    padding: 0 20px;
}

.feature-item {
    background: rgba(255, 255, 255, 0.5);
    border-top: 3px solid var(--orange);
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.feature-item h4 {
    font-family: 'Orbitron';
    font-size: 1.4rem;
    margin: 0 0 10px 0;
    color: var(--bg-dark);
}

.feature-item p {
    font-weight: 700;
    font-size: 0.9rem;
    color: #555;
    margin: 0;
}

/* CTA Container - Εδώ διορθώνεται η σειρά */
.cta-container {
    display: flex;
    flex-direction: column; /* Στοιχίζει κάθετα */
    align-items: center;    /* Κεντράρει οριζόντια */
    gap: 20px;              /* Απόσταση μεταξύ κουμπιού και κειμένου */
    margin: 60px 0;
}

/* Cyber Button */
.email-button {
    font-family: 'Orbitron', sans-serif;
    background: var(--bg-dark);
    color: white;
    padding: 22px 45px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    letter-spacing: 1px;
    /* "Κομμένο" σχήμα industrial */
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    transition: 0.4s ease;
    border: none;
}

.email-button:hover {
    background: var(--orange);
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(255, 102, 0, 0.4);
}

.file-types {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    color: #666;
    letter-spacing: 2px;
    margin: 0;
}

/* Footer & Socials */
footer {
    background: var(--bg-dark);
    color: #888;
    padding: 50px 20px;
    text-align: center;
}

.social-links {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    color: #e8e9eb;
    transition: 0.3s;
}

.social-links a:hover {
    color: var(--orange);
    transform: translateY(-3px);
}
/* Loading Screen Styles */
#loader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #0a0a0a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.loader-content { text-align: center; color: var(--orange); }

.fingerprint-icon svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px var(--orange));
    animation: pulse 1.5s infinite;
}

.progress-bar-container {
    width: 250px;
    height: 4px;
    background: rgba(255, 102, 0, 0.1);
    margin: 20px auto;
    border: 1px solid rgba(255, 102, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill {
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: var(--orange);
    box-shadow: 0 0 15px var(--orange);
    animation: load 2s forwards ease-in-out;
}

@keyframes load {
    0% { left: -100%; }
    100% { left: 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}
/* --- ΕΝΟΤΗΤΑ GALLERY (ΤΕΛΙΚΗ ΔΙΟΡΘΩΣΗ) --- */

.gallery-grid {
    display: grid;
    /* Ορίζουμε minmax 250px για να μην γίνονται τεράστιες οι φωτό */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 25px;
    margin: 40px auto;
    padding: 0 20px;
    max-width: 1200px;
}

.gallery-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    /* Industrial κόψιμο και στη gallery αν θες */
    clip-path: polygon(0 0, 100% 0, 100% 95%, 95% 100%, 0 100%);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    border-color: var(--orange);
}

/* ΕΔΩ ΡΥΘΜΙΖΕΤΑΙ ΤΟ ΜΕΓΕΘΟΣ ΤΗΣ ΦΩΤΟΓΡΑΦΙΑΣ */
.gallery-item img {
    width: 100%;
    height: 220px;     /* Σταθερό ύψος για να είναι όλες ίδιες */
    object-fit: cover; /* Κόβει τη φωτογραφία σωστά για να γεμίσει το πλαίσιο */
    display: block;
    filter: grayscale(20%); /* Ελαφρύ industrial εφέ */
    transition: 0.3s;
}

.gallery-item:hover img {
    filter: grayscale(0%);
}

/* Πλαίσιο κειμένου κάτω από τη φωτό */
.gallery-desc {
    padding: 15px;
    background: #fff;
    border-top: 2px solid var(--bg-main);
}

.gallery-desc span {
    font-family: 'Orbitron';
    font-size: 0.7rem;
    color: var(--orange);
    display: block;
    margin-bottom: 5px;
}

.gallery-desc p {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--bg-dark);
}
/* --- TABLE STYLING (CENTERED & INDUSTRIAL) --- */
table { 
    width: 100%; 
    max-width: 900px;    /* Περιορίζουμε το πλάτος για να δείχνει στιβαρός */
    margin: 40px auto;   /* Κεντράρει τον πίνακα οριζόντια στη σελίδα */
    border-collapse: collapse; 
    background: rgba(255, 255, 255, 0.4); /* Ημιδιαφάνεια για να ταιριάζει με το φόντο */
    backdrop-filter: blur(10px);
    border: 1px solid #bcc0c4;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    font-family: 'Rajdhani', sans-serif;
}

th, td { 
    padding: 18px; 
    text-align: center;  /* Κεντράρει το κείμενο μέσα στα κελιά */
    border-bottom: 1px solid #bcc0c4; 
}

th { 
    background: var(--bg-dark); /* Σκούρο ανθρακί από το root σου */
    color: var(--orange);      /* Πορτοκαλί accents */
    font-family: 'Orbitron';
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase; 
}

td {
    color: var(--text-main);
    font-weight: 500;
}

tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02); /* Διακριτική εναλλαγή χρωμάτων στις γραμμές */
}

tr:hover {
    background: rgba(255, 102, 0, 0.08); /* Πορτοκαλί highlight όταν περνάει το ποντίκι */
    transition: 0.3s;
}

/* Responsiveness για κινητά */
@media (max-width: 768px) {
    table {
        font-size: 0.85rem;
    }
    th, td {
        padding: 12px 8px;
    }
}
/* --- SOCIAL LINKS STYLE --- */
.social-links {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links svg {
    width: 24px;   /* Σταθερό μέγεθος για όλα */
    height: 24px;
    fill: #e8e9eb; /* Το γκρι-ασημί χρώμα σου */
    transition: 0.3s ease;
}

.social-links a:hover svg {
    fill: var(--orange); /* Γίνονται πορτοκαλί στο hover */
    transform: translateY(-3px);
}
/* --- LANGUAGE SWITCHER (TOP RIGHT CORNER) --- */
.lang-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 2000;
}

.lang-wrapper a {
    font-family: 'Orbitron', sans-serif;
    color: var(--bg-dark); /* Σκούρο χρώμα για να κάνει αντίθεση με το ανοιχτό γκρι φόντο */
    text-decoration: none;
    font-size: 0.75rem;
    padding: 5px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5); /* Glass εφέ */
    backdrop-filter: blur(5px);
    transition: 0.3s;
}

.lang-wrapper a.active {
    color: white;
    background: var(--orange);
    border-color: var(--orange);
}

.lang-wrapper a:hover:not(.active) {
    background: var(--bg-dark);
    color: white;
}

/* Διόρθωση για κινητά */
@media (max-width: 768px) {
    .lang-wrapper {
        position: relative;
        top: 10px;
        right: 0;
        justify-content: center;
        margin-bottom: 10px;
    }
}
/* Αυτό εξαφανίζει ΜΟΝΟ το μενού δίπλα από το "Αρχική, Υπηρεσίες κλπ" */
.nav-lang {
    display: none !important;
}
/* --- PRECISION ZOOM ENTRY --- */
body {
    /* Διάρκεια 1.2s για να είναι αργό και smooth */
    animation: precisionZoom 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    /* Κρύβουμε τις μπάρες για να μην εμφανιστούν κατά το zoom */
    overflow-x: hidden; 
}

@keyframes precisionZoom {
    0% {
        opacity: 0;
        transform: scale(1.04); /* Ξεκινάει ελάχιστα πιο μεγεθυμένο */
        filter: blur(3px);      /* Ξεκινάει θολό */
    }
    100% {
        opacity: 1;
        transform: scale(1);    /* Επανέρχεται στο κανονικό */
        filter: blur(0);        /* Καθαρίζει τελείως */
    }
}

/* ═══════════════════════════════════════════════════
   CAPABILITIES SECTION — Gear Image Watermark
═══════════════════════════════════════════════════ */
.capabilities-section {
    position: relative;
    isolation: isolate;      /* stacking context: gear z-index:-1 stays inside */
    overflow: hidden;
    padding: 0;
}

/* Wrapper absolutely centred behind the text block */
.wm-gear-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
    opacity: 0.18;
}

/* The image — same large size as the old SVG, slow rotation */
.wm-gear-img {
    width: min(680px, 94vw);
    height: auto;
    display: block;
    animation: gearRotate 60s linear infinite;
    transform-origin: center center;
}

@keyframes gearRotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .wm-gear-img {
        width: min(340px, 95vw);
    }
}

/* ═══════════════════════════════════════════════════
   LOGO — slow, gentle fade-in on page load
═══════════════════════════════════════════════════ */
.logo-container {
    animation: logoFadeIn 2s ease-out 0.1s both;
}

@keyframes logoFadeIn {
    0%   { opacity: 0; transform: translateY(-10px); }
    60%  { opacity: 0.7; }
    100% { opacity: 1;  transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════
   HERO TITLE — "PRECISION MACHINING" slides from left
   HERO SUBTITLE — "Capabilities & Heritage" from right
   Both meet at their natural position.
═══════════════════════════════════════════════════ */
.hero h1 {
    animation: slideFromLeft 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
    overflow: hidden;          /* prevent horizontal scrollbar during slide */
}

.hero > p {
    animation: slideFromRight 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
    overflow: hidden;
}

@keyframes slideFromLeft {
    from {
        opacity: 0;
        transform: translateX(-80px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideFromRight {
    from {
        opacity: 0;
        transform: translateX(80px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ═══════════════════════════════════════════════════
   FEATURE CARDS — scroll-triggered fade-in
═══════════════════════════════════════════════════ */
.fi-hidden,
.fi-visible {
    transition:
        opacity  0.65s ease var(--fi-delay, 0s),
        transform 0.65s ease var(--fi-delay, 0s);
}

.fi-hidden {
    opacity: 0;
    transform: translateY(28px);
}

.fi-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════
   ACTIVITIES SIDEBAR
   Fixed vertical tab on the left edge → slide-in panel
═══════════════════════════════════════════════════ */

/* ── Tab (always visible) ── */
.act-tab {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    cursor: pointer;
    user-select: none;
    background: var(--orange);
    border-radius: 0 6px 6px 0;
    box-shadow: 3px 0 14px rgba(0,0,0,0.45);
    outline: none;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.act-tab:hover,
.act-tab:focus {
    background: #d95c00;
    box-shadow: 4px 0 20px rgba(0,0,0,0.6);
}

.act-tab span {
    display: block;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 24px 11px;
    white-space: nowrap;
}

/* ── Overlay ── */
.act-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    z-index: 1000;
}
.act-overlay.act-open { display: block; }

/* ── Slide-in panel ── */
.act-panel {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 300px;
    max-width: 88vw;
    background: rgba(10,12,16,0.98);
    border-right: 2px solid var(--orange);
    box-shadow: 6px 0 32px rgba(0,0,0,0.65);
    transform: translateX(-100%);
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    padding: 68px 32px 40px;
    overflow-y: auto;
}
.act-panel.act-open { transform: translateX(0); }

/* ── Close button ── */
.act-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.30);
    color: #ffffff;
    font-size: 0.9rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
}
.act-close:hover { color: var(--orange); border-color: var(--orange); }

/* ── Panel title ── */
.act-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--orange);
    margin: 0 0 26px 0;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,140,0,0.30);
}

/* ── Activity list ── */
.act-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.act-item {
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.act-item:last-child { border-bottom: none; }

/* Each item is a full-width link */
.act-item a {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 17px 4px;
    width: 100%;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: color 0.22s ease, padding-left 0.22s ease;
}
.act-item a:hover {
    color: var(--orange);
    padding-left: 12px;
}

.act-icon {
    color: var(--orange);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Sidebar small-mobile specifics (see main responsive block below) ── */

/* ═══════════════════════════════════════════════════
   PAGE SECTION TITLE — slide-in effect (mirrors hero)
   Add class "page-hero-title" to any <h2 class="section-title">
   on services, gallery, contact pages.
═══════════════════════════════════════════════════ */
.page-hero-title {
    animation: slideFromLeft 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════
   PHOTO WATERMARK ROTATOR
   Used on services.html and contact.html.
   Images cross-fade randomly in the background.
═══════════════════════════════════════════════════ */
.container {
    position: relative;
}

/* Wrapper — sits behind all page content */
.wm-rotator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 500px;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

/* Each photo — stacked on top of each other, fades in/out */
.wm-rotator img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 2.4s ease;
    /* Desaturate slightly so it feels more like a watermark */
    filter: grayscale(25%);
}

/* The currently active slide */
.wm-rotator img.wm-active {
    opacity: 0.13;
}

/* ══════════════════════════════════════════════════════
   MOBILE & TABLET — Comprehensive Responsive Fixes
   Breakpoints: 1024px (tablet), 768px (mobile), 480px (small mobile)
══════════════════════════════════════════════════════ */

/* ── Fix: background-attachment: fixed breaks on iOS & Android ── */
@media (max-width: 1024px) {
    body { background-attachment: scroll; }
}
/* Touch devices (covers Android/iOS regardless of width) */
@media (hover: none) and (pointer: coarse) {
    body { background-attachment: scroll; }
    /* Android Chrome sometimes misrenders blur on fixed overlays */
    .act-overlay { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ── Tablet (769px – 1024px) ── */
@media (max-width: 1024px) {
    header { padding: 20px 15px; }
    header img { max-width: 200px; }

    nav a { padding: 18px 18px; font-size: 0.75rem; letter-spacing: 1px; }

    .lang-wrapper {
        top: 12px;
        right: 12px;
    }
}

/* ── Mobile (max-width: 768px) ── */
@media (max-width: 768px) {
    /* Header */
    header { padding: 15px 12px; }
    header img { max-width: 180px; }

    /* Navigation — 2×2 grid layout */
    nav {
        flex-wrap: wrap;
    }
    nav a {
        flex: 1 1 50%;
        padding: 14px 8px;
        font-size: 0.68rem;
        letter-spacing: 1px;
        text-align: center;
        border-right: none;
        border-bottom: 1px solid #bcc0c4;
        box-sizing: border-box;
        min-width: 0;
    }
    nav a:nth-child(odd)  { border-right: 1px solid #bcc0c4; }
    nav a:nth-last-child(3) { border-bottom: none; }
    nav a:last-child      { border-bottom: none; }
    nav a:nth-last-child(2) { border-bottom: none; }

    /* Language switcher */
    .lang-wrapper {
        position: relative;
        top: 0; right: 0;
        justify-content: center;
        padding: 8px 0 4px;
        background: rgba(232,233,235,0.9);
        border-bottom: 1px solid #bcc0c4;
    }
    header { position: relative; }

    /* Hero title/subtitle */
    .hero h1 { letter-spacing: 2px; }
    .hero > p { font-size: clamp(0.6rem, 3vw, 0.85rem); letter-spacing: 2px; }

    /* Section titles */
    .section-title { letter-spacing: 2px; }

    /* Container — add horizontal padding */
    .container { padding: 0 16px; box-sizing: border-box; }

    /* Features grid */
    .features-grid { padding: 0 12px; gap: 14px; }

    /* Email/CTA button — smaller on mobile */
    .email-button {
        padding: 18px 28px;
        font-size: 0.78rem;
        clip-path: polygon(6% 0, 100% 0, 100% 74%, 94% 100%, 0 100%, 0 26%);
    }

    /* Table container — horizontal scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        padding: 0 8px;
        box-sizing: border-box;
    }
    .table-container table { min-width: 520px; }
    th, td { font-size: 0.8rem; padding: 10px 8px; }

    /* Footer */
    footer { padding: 35px 16px; }
    footer p { font-size: 0.85rem; }

    /* Watermark rotator */
    .wm-rotator { min-height: 280px; }
    .wm-rotator img.wm-active { opacity: 0.09; }

    /* Activities sidebar — tab moves to BOTTOM so it never blocks content */
    .act-tab {
        top: auto;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 6px 6px 0 0;
        box-shadow: 0 -3px 14px rgba(0,0,0,0.45);
    }
    .act-tab span {
        writing-mode: horizontal-tb;   /* horizontal text */
        transform: none;
        font-size: 0.65rem;
        padding: 11px 26px;
        letter-spacing: 3px;
        white-space: nowrap;
    }
    .act-close {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        top: 12px;
        right: 12px;
    }
    .act-panel {
        height: 100dvh;
        height: 100vh;
        padding: 60px 22px 30px;
        width: 88vw;
    }
    /* Push footer & last sections above the bottom tab */
    body  { padding-bottom: 44px; }
    footer { margin-bottom: 0; }

    /* Lightbox */
    .act-modal { padding-top: 40px; }
    .act-modal-close {
        top: 10px;
        right: max(12px, env(safe-area-inset-right, 12px));
        font-size: 34px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .act-modal-prev,
    .act-modal-next { font-size: 22px; padding: 14px 12px; }
}

/* ── Small mobile (max-width: 480px) ── */
@media (max-width: 480px) {
    header img { max-width: 150px; }

    /* Nav — still 2 per row but even smaller */
    nav a { font-size: 0.62rem; padding: 12px 6px; letter-spacing: 0.5px; }

    /* Hero */
    .hero h1 { letter-spacing: 1px; }
    .hero > p { letter-spacing: 1px; }

    /* Features grid — single column */
    .features-grid { grid-template-columns: 1fr; padding: 0 10px; }

    /* Email button */
    .email-button { padding: 16px 20px; font-size: 0.72rem; }

    /* Sidebar */
    .act-panel { width: 93vw; max-width: none; }
    .act-tab span { font-size: 0.6rem; padding: 10px 18px; }

    /* Lightbox */
    .act-modal-img { width: 96%; }
    .act-modal-prev,
    .act-modal-next { font-size: 20px; padding: 10px 8px; }
}

/* ── Services table → card layout on mobile phones ── */
@media (max-width: 640px) {
    .table-container {
        overflow-x: visible !important;
        padding: 0 !important;
    }
    .table-container table {
        min-width: 0 !important;
        width: 100%;
        border-collapse: collapse;
    }
    .table-container thead {
        display: none;
    }
    .table-container tbody tr {
        display: block;
        background: rgba(255,255,255,0.65);
        border: 1px solid rgba(255,140,0,0.3);
        border-left: 4px solid var(--orange);
        border-radius: 4px;
        margin-bottom: 14px;
        padding: 6px 12px 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    .table-container td {
        display: block;
        text-align: left !important;
        padding: 7px 0 7px 0;
        border: none !important;
        border-bottom: 1px solid rgba(0,0,0,0.07) !important;
        font-size: 0.88rem;
        line-height: 1.5;
        background: transparent !important;
    }
    .table-container td:last-child {
        border-bottom: none !important;
        padding-bottom: 2px;
    }
    .table-container td::before {
        content: attr(data-label);
        display: block;
        font-family: 'Orbitron', sans-serif;
        font-size: 0.55rem;
        font-weight: 700;
        letter-spacing: 2px;
        color: var(--orange);
        text-transform: uppercase;
        margin-bottom: 3px;
    }
    .table-container tr:hover { background: rgba(255,255,255,0.65) !important; }
}

/* ── Safe-area insets for notched phones (iPhone X+) ── */
@supports (padding: env(safe-area-inset-bottom)) {
    footer {
        padding-bottom: calc(35px + env(safe-area-inset-bottom));
    }
    .act-panel {
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }
    /* On mobile the tab sits at the bottom: add home-bar clearance */
    @media (max-width: 768px) {
        .act-tab span {
            padding-bottom: calc(11px + env(safe-area-inset-bottom));
        }
        body {
            padding-bottom: calc(44px + env(safe-area-inset-bottom));
        }
    }
}

/* ── Accessibility: respect reduced-motion preference ── */
@media (prefers-reduced-motion: reduce) {
    body { animation: none; }
    .logo-container { animation: none; }
    .hero h1, .hero > p { animation: none; opacity: 1; transform: none; }
    .page-hero-title { animation: none; opacity: 1; transform: none; }
    .wm-gear-img { animation: none; }
    .fi-hidden { opacity: 1; transform: none; }
    @keyframes actZoom { from { transform: scale(1); opacity: 1; } }
}

/* ══════════════════════════════════════════════════════
   HISTORY & CHARACTERISTICS SECTION
   — same visual language as .features-grid / .feature-item
══════════════════════════════════════════════════════ */
.hist-section {
    background: transparent; /* inherits page background */
    padding: 20px 20px 60px;
}
.hist-inner {
    max-width: 1000px;
    margin: 0 auto;
}
/* Title — same style as section-title on services/gallery */
.hist-main-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: var(--bg-dark);
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 40px 0 6px;
}
/* Grid — matches .features-grid exactly */
.hist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}
/* Cards — identical to .feature-item */
.hist-block {
    background: rgba(255, 255, 255, 0.5);
    border-top: 3px solid var(--orange);
    padding: 25px;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
/* Sub-heading — Orbitron, orange, small caps (like feature-item h4 but smaller) */
.hist-block h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--orange);
    text-transform: uppercase;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,140,0,0.2);
}
.hist-block p {
    font-size: 0.92rem;
    line-height: 1.8;
    color: #555;
    font-weight: 500;
    margin: 0 0 10px;
}
.hist-block p:last-child { margin-bottom: 0; }
.hist-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.hist-block ul li {
    font-size: 0.91rem;
    font-weight: 500;
    line-height: 1.7;
    color: #555;
    padding: 7px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.hist-block ul li:last-child { border-bottom: none; }
.hist-block ul li .hist-icon {
    color: var(--orange);
    flex-shrink: 0;
    margin-top: 3px;
}
.hist-block strong { color: var(--bg-dark); }

@media (max-width: 768px) {
    .hist-section { padding: 10px 12px 44px; }
    .hist-main-title { letter-spacing: 2px; }
    .hist-grid { gap: 14px; }
}
@media (max-width: 480px) {
    .hist-grid { grid-template-columns: 1fr; }
}

/* ══ Activity Lightbox ══ */
.act-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    padding-top: 50px;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.95);
}
.act-modal-img {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    object-fit: contain;
    border: 2px solid var(--orange);
    box-shadow: 0 0 30px rgba(255,102,0,0.3);
    animation: actZoom 0.3s ease;
}
@keyframes actZoom {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.act-modal-close {
    position: absolute;
    top: 15px; right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 100000;
}
.act-modal-close:hover { color: var(--orange); }
.act-modal-prev,
.act-modal-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s;
    user-select: none;
    z-index: 100000;
}
.act-modal-next { right: 0; border-radius: 3px 0 0 3px; }
.act-modal-prev { left: 0;  border-radius: 0 3px 3px 0; }
.act-modal-prev:hover,
.act-modal-next:hover { background-color: rgba(255,102,0,0.8); }
.activity-card img { cursor: pointer; transition: opacity 0.3s; }
.activity-card img:hover { opacity: 0.75; }
@media only screen and (max-width: 700px) {
    .act-modal-img { width: 100%; }
    .act-modal-prev, .act-modal-next { font-size: 20px; padding: 10px; }
}

/* ══════════════════════════════════════════════════════
   MATERIAL CALCULATOR — integrated weight & cost tool
══════════════════════════════════════════════════════ */
.calc-page-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.05rem;
    font-weight: 500;
    max-width: 520px;
    margin: 0 auto 36px;
    line-height: 1.6;
    animation: slideFromRight 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both;
    overflow: hidden;
}
.calc-page-wrap {
    max-width: 720px;
    margin: 0 auto 60px;
    padding: 0 16px;
    position: relative;
    z-index: 1;
}
.calc-section {
    padding: 10px 20px 70px;
    position: relative;
}
.calc-inner {
    max-width: 720px;
    margin: 0 auto;
}
.calc-main-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.1rem, 3.5vw, 1.7rem);
    color: var(--bg-dark);
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 20px 0 8px;
}
.calc-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.05rem;
    font-weight: 500;
    max-width: 520px;
    margin: 0 auto 0;
    line-height: 1.6;
}
.calc-card {
    margin-top: 36px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    border: 1px solid #bcc0c4;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
    overflow: hidden;
}
.calc-card-header {
    background: var(--bg-dark);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 3px solid var(--orange);
}
.calc-card-header svg {
    width: 22px;
    height: 22px;
    fill: var(--orange);
    flex-shrink: 0;
}
.calc-card-header span {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 2px;
    color: #ccc;
    text-transform: uppercase;
}
.calc-card-body {
    padding: 28px 24px 24px;
}
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.calc-field {
    margin-bottom: 0;
}
.calc-field label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.68rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--bg-dark);
    margin-bottom: 8px;
    font-weight: 700;
}
.calc-field select,
.calc-field input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #bcc0c4;
    border-radius: 0;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.9);
    box-sizing: border-box;
    transition: border-color 0.25s, box-shadow 0.25s;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.calc-field select:focus,
.calc-field input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.15);
}
.calc-field-full {
    grid-column: 1 / -1;
    margin-top: 4px;
}
.calc-divider {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 22px 0;
}
.calc-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 4px;
}
.calc-result-box {
    padding: 20px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.calc-result-weight {
    background: var(--bg-dark);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.calc-result-cost {
    background: var(--orange);
    clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px);
}
.calc-result-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 6px;
}
.calc-result-val {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.2rem, 4vw, 1.55rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.calc-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.82rem;
    color: #888;
    line-height: 1.7;
}
.calc-footer strong {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: #aaa;
    margin-top: 4px;
    font-weight: 400;
}
@media (max-width: 768px) {
    #material-calculator .calc-grid,
    #material-calculator .calc-results {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    #material-calculator .calc-page-wrap {
        padding: 0 12px;
        margin-bottom: 48px;
    }
    #material-calculator .calc-card {
        margin-top: 24px;
    }
    #material-calculator .calc-card-body {
        padding: 20px 16px 18px;
    }
    #material-calculator .calc-card-header {
        padding: 14px 16px;
    }
    #material-calculator .calc-page-subtitle {
        font-size: 1rem;
        padding: 0 8px;
        margin-bottom: 28px;
        animation: none;
        opacity: 1;
        transform: none;
    }
    #material-calculator .wm-rotator {
        min-height: 340px;
    }
    #material-calculator.container {
        padding-left: 0;
        padding-right: 0;
        padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    }
}

/* Touch — iOS & Android phones/tablets */
@media (hover: none) and (pointer: coarse) {
    .calc-field select,
    .calc-field input {
        font-size: 16px;
        min-height: 48px;
        padding: 14px 16px;
        -webkit-appearance: none;
        appearance: none;
        clip-path: none;
        border-radius: 2px;
    }
    .calc-field select {
        background-color: rgba(255, 255, 255, 0.95);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%232d2e32' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 14px center;
        padding-right: 42px;
    }
    .calc-card {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(255, 255, 255, 0.94);
        clip-path: none;
        border-radius: 2px;
    }
    .calc-result-weight,
    .calc-result-cost {
        clip-path: none;
        min-height: 72px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .calc-result-val {
        font-size: 1.35rem;
    }
    .calc-field label {
        font-size: 0.72rem;
        margin-bottom: 10px;
    }
}

@media (max-width: 560px) {
    .calc-section { padding: 10px 12px 50px; }
    .calc-page-wrap { padding: 0 8px; margin-bottom: 44px; }
    .calc-grid,
    .calc-results { grid-template-columns: 1fr; }
    .calc-card-body { padding: 20px 16px 18px; }
    .calc-main-title { letter-spacing: 2px; }
    .calc-page-subtitle { animation: none; opacity: 1; transform: none; }
    #material-calculator .section-title.page-hero-title {
        font-size: clamp(0.95rem, 5vw, 1.3rem) !important;
        letter-spacing: 2px;
        padding: 0 10px;
    }
}
