/* ==========================================================================
   1. RESET & BASE STYLES
   ========================================================================== */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, 
blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, 
img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, 
center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, 
tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, 
summary, time, mark, audio, video, button, input, select, textarea {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    vertical-align: baseline;
    background: transparent;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    height: 100%;
    font-family: "Forum", serif;
    font-size: 10px;
    line-height: 1.4;
    color: #222;
    overflow-x: auto;
    overflow-y: scroll;
    --scrollbar-width: 0px;
}

::-moz-selection { background: #b3d4fc; text-shadow: none; }
::selection { background: #b3d4fc; text-shadow: none; }

img { vertical-align: middle; }
textarea { resize: vertical; }

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
}

.clearer { clear: both; }

/* ==========================================================================
   2. NAVIGATION
   ========================================================================== */
#nav_wrapper {
    width: 100%;
    background-image: url(../img/menu_bg.png);
    background-repeat: repeat-x;
    background-position: center top;
    height: 48px;
    position: relative;
    z-index: 1020;
}

#nav_wrapper_center {
    width: 386px;
    margin: 0 auto;
}

nav {
    background-image: url(../img/menu_bg.png);
    background-repeat: repeat-x;
    height: 48px;
}

#nav_box { float: left; display: block; }

#nav_img_left, #nav_img_right {
    width: 20px;
    height: 35px;
    background-repeat: no-repeat;
    float: left;
}
#nav_img_left { background-image: url(../img/nav_img_left.png); }
#nav_img_right { background-image: url(../img/nav_img_right.png); }

ul.MenuBarHorizontal {
    min-height: 48px;
    font-size: 16px;
    list-style: none;
    display: flex;
}

ul.MenuBarHorizontal li { position: relative; }

ul.MenuBarHorizontal li a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: inherit;
    text-transform: uppercase;
}

nav ul li.mainmenu a:hover, 
nav ul li.mainmenu a:active, 
nav ul li.mainmenu.active a.topMenuMainItem {
    color: #fff !important;
    background-image: url(../img/menu_bg_h.png) !important;
    background-repeat: repeat-x;
}

nav ul li.mainmenu {
    color: #fff !important;
}

/* Submenu indicator triangles */
ul.MenuBarHorizontal li.has-submenu > a::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.75;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

ul.MenuBarHorizontal li.has-submenu:hover > a::after {
    transform: rotate(180deg);
    opacity: 1;
}

/* Submenus */
ul.MenuBarHorizontal li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    list-style: none;
    z-index: 1000;
    background-color: #064f6f;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

ul.MenuBarHorizontal li:hover > ul { display: block; }

ul.MenuBarHorizontal li ul li a {
    background-color: #064f6f !important;
    padding: 8px 15px;
    color: #fff !important;
    white-space: nowrap;
}

/* ==========================================================================
   3. LAYOUT & SECTIONS
   ========================================================================== */
#masterPage {
    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: max-content max-content min-content max-content;
}

#SITE_BG { position: fixed; width: 100%; height: 100%; }

#section1 {
    position: relative;
    width: 100%;
    height: 41vw;
    color: white;
    text-align: center;
    font-size: clamp(67px, 14vw, 133px);
    text-transform: uppercase;
    /*background: url("../img/home_bg.webp") no-repeat center -15vw fixed;
    background-size: 100vw auto;*/
    overflow: hidden;
    /*isolation: isolate;*/
}
#section1 h1 {
    font-size: clamp(67px, 14vw, 133px);
    text-transform: uppercase;
}

/* Pseudo-element parallax: replaces background-attachment:fixed.
   Fixed positioning + z-index:-1 gives the same frozen-background effect
   but works correctly on iOS Safari where background-attachment:fixed is broken. */
#section1::before {
    content: "";
    position: fixed;          /* stays put as user scrolls — the parallax effect */
    inset: 0;
    z-index: -1;
    background: url("../img/home_bg.webp") no-repeat center -10vw fixed;
    /*background-size: cover; */  /* replaces the old 100vw auto — fills any screen cleanly */
    background-size: 100vw auto;
    transform: translateZ(0); /* force GPU layer, prevents repaint jank */
    will-change: transform;
}

#section1 div { padding-top: 55px; }

.job_titles {
    font-size: clamp(18px, 2vw, 25px);
    display: block;
    text-shadow: 1px 1px 6px black;
}

#section2, #section4 {
    min-height: 253px;
    background-color: #242424;
    color: #b1b2b5;
    text-align: center;
    padding: 64px;
}
#section3 {

}
#section4 {
    background-image: url(../img/dots_bg.png);
    /*background-attachment: fixed;*/
    background-repeat: repeat;
    background-position: center top;
}
#section3,
#section5 {
        margin-left: 0;
        width: 100%;
        position: relative;
        left: 0;
}
#section6 {
    text-align: center;
    font-size: clamp(30px, 9vw, 50px);
    padding: 30px;
    background-color: #242424;
    color: white;
}

#section6 a { color: white; text-decoration: none; }
#section6 a:hover { text-decoration: underline; }

/* Flex Grid */
.flex-3-cols {
    display: flex;
    justify-content: space-between;
    gap: 67px;
}

.column {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.software_names .column {
    flex: 1;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 14px;
    padding: 0;
    padding-top: 20px;
}
.column a {
    text-decoration: none;
    color: #333;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
}

.portfolio_images .column, #section4 .column {
    height: clamp(220px, calc(220px + (430 * ((100vw - 1200px) / 1100))), 650px);
}

#SITE_FOOTER {
    background-color: #1e7fb6;
    height: 12px;
}

.dotbg {
    background-image: url(../../assets/img/IMG_6432.webp);
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed;
    width: 100%;
    height: 400px;
    background-size: cover;
}

.contactbg {
    position: sticky;
    width: 100%;
    top: 0px;
    display: block;
    padding: 0px;
    background-image: url("../../assets/img/contact_bg.webp");
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed;
    height: 42vw;
    background-size: cover;
}


/* ==========================================================================
   4. COMPONENTS (SLIDESHOW & FANCYBOX)
   ========================================================================== */
.slideshow { overflow: hidden; }

.slideshow a {
    position: relative;
    z-index: 2;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    width: 100%;
    text-decoration: none;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    background-size: cover;
    background-position: center;
    /*animation: slideshow-fade 10s linear infinite;
    animation-delay: calc(var(--offset) + (var(--i) * 10s));*/
    animation: none !important;
    will-change: opacity;
}

@keyframes slideshow-fade {
    0% { opacity: 0; }
    10%, 90% { opacity: 1; }
    100% { opacity: 0; }
}

/* Fancybox Grid */

.fancybox__content {
    background: var(--fancybox-content-bg, #222);
    width: 90% !important;
    max-width: 1200px !important;
}

/* Container for the 88 icons */
.photo-collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    gap: 10px;
    justify-content: center;
    padding: 20px;
}

.photo-icon {
    width: 70px;
    height: 70px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #444;
    transition: transform 0.2s, border-color 0.2s;
}

.photo-icon:hover {
    transform: scale(1.1);
    border-color: #1e7fb6;
    z-index: 10;
}

/* Ensure the Fancybox wrapper doesn't restrict width */
.fancy-grid-wrapper {
    width: 90vw;
    max-width: 1300px;
    display: contents;
}


.fancybox-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px;
    min-height: 300px; /* Forces the popup to have height even if images load slow */
    width: 100%;
}

.fancybox-grid-item {
    pointer-events: auto !important; /* Forces the image to accept clicks */
    cursor: pointer !important;
    aspect-ratio: 1; /* Keeps thumbnails square */
    object-fit: cover;
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.1s ease;
    background: #333;
}

.fancybox-grid-item:hover { opacity: 0.8; }

.fancybox-grid-item:active {
    transform: scale(0.95); /* Visual feedback when clicked */
}
.photo-collection-grid .fancybox-grid-item, .photo-icon-grid .fancybox-grid-item {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #444;
}

.photo-collection-grid .fancybox-grid-item:hover, .photo-icon-grid .fancybox-grid-item:hover {
    border-color: #1e7fb6;
    outline: 2px solid #1e7fb6;
}
.photo-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    gap: 8px;
    justify-content: center;
    padding: 20px;
}
.inner-gallery-popup .fancybox__content {
    width: 95% !important;
    max-width: 1200px !important;
    background: #1a1a1a;
}

#modal-title {
      text-transform: uppercase;
    color: white;
    text-align: center;
    margin-bottom: 20px;
}
#btn-back-to-wall{
        text-transform: uppercase;
    color: white;
}


/* ==========================================================================
   5. MEDIA QUERIES
   ========================================================================== */
@media (max-width: 740px) {
  #section1::before {
    /*background-size: 104vw auto;*/
    /*background-position-y: -20vw;*/
  }
  #section2, #section4 {
    padding: 27px;
  }
  #section3 {
    min-height: 400px;
  }
  #contact_separator_dot{
    display: none;
  }
  .portfolio_images .column, #section4 .column {
    height: 135px;
  }
}


@media (max-width: 530px) {
  #nav_wrapper{
    height: 10px;
  }
  #nav_img_left, #nav_box, #nav_img_right{
    display:none;
  }
  #section1 {
    height: 42vw;
  }
  .flex-3-cols {
    display: block;
  }
  .portfolio_images .column, #section4 .column {
    margin: 40px 10px;
  }
  .software_names{
    display:none;
  }
  #section3 {
    display:none;
  }
  #section1 div {
    padding-top: 35px;
  }
  #section2, #section4 {
    padding: 15px;
  }
}

@media (max-width: 425px) {
  #akname{
    display: inline-block;
    line-height: 52px;
  }
  #section1 {
    height: 54vw;
    /*background-size: 118vw auto;*/
  }
  #section1::before {
    background-size: 118vw auto;
  }
}




/*
.crossfade-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.crossfade-container .slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  will-change: opacity;
}

.crossfade-container .slide.active {
  opacity: 1;
}*/
.slide.active {
  opacity: 1;
  /*animation: kenburns 7s ease-in-out infinite;*/
}
/*@keyframes kenburns {
    0%   { transform: scale(1.00)   translate(0,0); }
    50%  { transform: scale(1.035)  translate(1%, 0.9%); }
    100% { transform: scale(1.00)   translate(0,0); }
}*/
.slide {
  transition: opacity 1.2s ease-in-out;
  will-change: opacity;
}





.reverse-direction {
  direction: rtl; /* Sets the text direction to right-to-left */
  unicode-bidi: bidi-override; /* Forces the direction change even for LTR text */
}





/*============ infinite photo wall===========*/
.infinite-masonry-wall {
    column-count: 4;
    column-gap: 10px;
    padding: 14px;
}

.infinite-masonry-wall img {
    display: block;          /* critical: prevents inline gap below images */
    width: 100%;
    height: auto;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 10px;     /* vertical gap between images in same column */
    break-inside: avoid;     /* prevents an image from splitting across columns */
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.infinite-masonry-wall img.loaded {
    opacity: 1;
    transform: none;
}

.loader {
    text-align: center;
    padding: 40px 0;
    color: #aaa;
    font-size: 1.3rem;
    column-span: all;        /* sentinel spans all columns */
}

/* Responsive columns */
@media (max-width: 1100px) { .infinite-masonry-wall { column-count: 3; } }
@media (max-width: 740px)  { .infinite-masonry-wall { column-count: 2; } }
@media (max-width: 480px)  { .infinite-masonry-wall { column-count: 1; } }

/* Fancybox modal tweaks */
.infinite-wall-modal .fancybox__content {
    max-width: 98vw !important;
    width: 98vw !important;
    height: 96vh !important;
    padding: 0 !important;
}



.gallery-nav {
    display: none;
}




/* ==========================================================================
   6. CONTACT FORM (section6)
   ========================================================================== */
#section6 {
    background-color: #242424;
    padding: 64px 32px;
    text-align: left;
}

#contact-form-wrapper {
    max-width: 760px;
    margin: 0 auto;
}

#contact-heading {
    font-family: "Forum", serif;
    font-size: clamp(28px, 5vw, 44px);
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 0.08em;
    margin-bottom: 36px;
    text-align: center;
    display: none;
}

#contact-form .form-row {
    display: flex;
    gap: 24px;
}

#contact-form .form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-bottom: 20px;
}

#contact-form label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #888;
    margin-bottom: 7px;
}

#contact-form input,
#contact-form textarea {
    background: transparent;
    border: 1px solid #444;
    border-radius: 0;
    color: #d8d9db;
    font-family: "Forum", serif;
    font-size: 15px;
    padding: 10px 14px;
    transition: border-color 0.2s ease, background 0.2s ease;
    outline: none;
    width: 100%;
}

#contact-form input::placeholder,
#contact-form textarea::placeholder {
    color: #555;
}

#contact-form input:focus,
#contact-form textarea:focus {
    border-color: #1e7fb6;
    background: rgba(30, 127, 182, 0.04);
}

#contact-form textarea {
    resize: vertical;
    min-height: 130px;
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 16px;
}

.contact-phone {
    font-size: clamp(18px, 3vw, 26px);
    color: #888;
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: color 0.2s;
}

.contact-phone:hover { color: #1e7fb6; }

#contact-submit {
    background: transparent;
    border: 1px solid #1e7fb6;
    color: #1e7fb6;
    font-family: "Forum", serif;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 12px 36px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

#contact-submit:hover {
    background: #1e7fb6;
    color: #fff;
}

#contact-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#contact-status {
    margin-top: 18px;
    font-size: 14px;
    text-align: center;
    min-height: 22px;
    letter-spacing: 0.05em;
}

#contact-status.success { color: #4caf82; }
#contact-status.error   { color: #e07070; }

@media (max-width: 530px) {
    #section6 { padding: 40px 20px; }
    #contact-form .form-row { flex-direction: column; gap: 0; }
    .form-footer { flex-direction: column; align-items: flex-start; }
}