/* =================== RESET & GLOBAL STYLES =================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(120deg, #f0f4f8, #e6f7ff);
    color: #333;
    line-height: 1.6;
    font-size: 16px;
    scroll-padding-top: 180px;
}

/* =================== HEADER & NAVIGATION =================== */
header {
    background: #2b3e50;
    color: #fff;
    padding: 10px 15px; /* Adjusted padding */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 4px solid #ff9f1c;

    /* Flex layout for logo and title */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7cm; /* Space between logo and title */
}

header .logo-wrapper {
    width: 180px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* align top */
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.25);
    background: #fff;
    margin-top: -10px; /* Move logo up a bit */
}

/* ===== PAGE TITLE ABOVE NAV ===== */
.page-title {
    font-size: 2.7rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0;
    margin-top: 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    animation: headerColorPulse 3s infinite alternate;
    text-align: left;
    align-self: center; /* vertically center in header flex */
}

/* Move nav to right and move up */
nav {
    margin-left: auto;
}

.navbar a {
    text-decoration: none;
    padding: 10px 18px;
    background: #445869;
    color: white;
    border-radius: 8px;
    font-weight: 500;
}

.navbar a.active {
    background: orange;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: -15px; /* move nav up */
    margin-bottom: 0;
}

.navbar {
    background: #34495e;
    border-bottom: 4px solid orange;
}

.navbar ul {
    display: flex;
    justify-content: center;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 15px;
}


nav ul li a {
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
}

nav ul li a:hover,
nav ul li a.active {
    background: #ff9f1c;
    color: #fff;
    transform: scale(1.05);
}

/* =================== MAIN CONTENT =================== */
main {
    padding: 60px 20px 40px;
    margin-top: 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

main h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #2b3e50;
    animation: fadeIn 1s ease-out, headingGradient 6s infinite linear;
    position: relative;
    display: inline-block;
    padding-bottom: 5px;
    border-bottom: 4px solid;
    border-image-slice: 1;
    border-image-source: linear-gradient(90deg, #ff9f1c, #2b3e50, #ff9f1c);
    transition: all 0.5s ease, text-shadow 1s ease;
    text-shadow: 0 0 5px rgba(255, 159, 28, 0.4);
}

main h2:hover {
    transform: scale(1.05);
    text-shadow: 0 0 20px rgba(255, 159, 28, 0.8);
}

main p, .intro p {
    max-width: 750px;
    margin: 20px auto;
    color: #555;
    font-size: 1.1rem;
    line-height: 1.8;
    padding: 15px;
    border-left: 4px solid;
    border-image-slice: 1;
    border-image-source: linear-gradient(180deg, #ff9f1c, #2b3e50);
    background: rgba(255,255,255,0.55);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-image-source 2s linear;
}

main p:hover, .intro p:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.intro img {
    width: 100%;
    height: auto;
    max-width: 500px;
    border-radius: 10px;
    margin: 20px 0;
    transition: transform 0.3s ease;
}

.intro img:hover {
    transform: scale(1.05);
}

/* =================== SERVICE CARDS (IT & LAND) =================== */
.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
    padding: 0 10px;
}

.service-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    padding: 25px 15px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.service-card h3 {
    color: #2b3e50;
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.service-card p {
    color: #555;
    font-size: 1rem;
    line-height: 1.5;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

/* =================== PROFILES FLIP CARDS =================== */
.profiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 30px;
    padding: 0 10px;
}

.profile-card {
    perspective: 1000px;
    height: 380px;
}

.profile-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s ease;
    transform-style: preserve-3d;
    cursor: pointer;
}

.profile-card:hover .profile-card-inner,
.profile-card.flip .profile-card-inner {
    transform: rotateY(180deg);
}

.profile-card-front,
.profile-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.profile-card-front {
    background: #fff;
    color: #2b3e50;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.profile-card-back {
    background: #2b3e50;
    color: #fff;
    transform: rotateY(180deg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.profile-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 4px solid #ff9f1c;
    transition: transform 0.3s ease;
}

.profile-card h3 {
    margin-bottom: 5px;
    z-index: 2;
}

.profile-card-front h3 {
    color: #2b3e50;
}

.profile-card-back h3 {
    color: #ff9f1c;
}

.profile-card .biodata p {
    margin: 5px 0;
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
}

/* =================== ANIMATIONS =================== */
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes headerColorPulse {
    0% { color: #fff; }
    50% { color: #ff9f1c; }
    100% { color: #fff; }
}

@keyframes headingGradient {
    0% { border-image-source: linear-gradient(90deg, #ff9f1c, #2b3e50, #ff9f1c); }
    50% { border-image-source: linear-gradient(90deg, #2b3e50, #ff9f1c, #2b3e50); }
    100% { border-image-source: linear-gradient(90deg, #ff9f1c, #2b3e50, #ff9f1c); }
}

/* =================== MODALS =================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    position: relative;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
}

.modal img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 2rem;
    color: #333;
    cursor: pointer;
}

/* =================== SCROLL FADE-IN =================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

html {
    scroll-behavior: smooth;
}

/* =================== FOOTER =================== */
footer {
    text-align: center;
    padding: 20px 10px;
    margin-top: 40px;
    background: #2b3e50;
    color: #fff;
}

/* =================== RESPONSIVE =================== */
@media (max-width: 768px) {
    .profile-card-inner { height: 300px; }
    .profile-card { height: 340px; }

    header h1 { font-size: 2rem; }
    nav ul { flex-direction: column; gap: 10px; }
    main h2 { font-size: 1.7rem; }
    .intro img { max-width: 100%; }
    header .logo-wrapper { width: 120px; height: 90px; }
    header .logo-container { flex-direction: column; gap: 5px; }
    main { padding-top: 50px; margin-top: 0; }
}

/* =================== PAGE-SPECIFIC PAGE TITLE POSITION =================== */
.page-title {
    font-size: 48px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap; /* keeps it one line */
}


/* Profiles page - no downward shift */
body.profiles .page-title {
    margin-top: 0;
}

/* Home and other pages - move page-title down 25px */
body.home .page-title,
body.other .page-title {
    margin-top: -30px;
}
