@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Source Sans Pro', Tahoma, Verdana, Segoe, sans-serif;
}
body {
    min-height: 100vh;
    background: #10151a;
    color: #fff;
}
.taskbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 44px;
    background: linear-gradient(90deg, #004c6d 0%, #007a3d 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.7s;
}
.taskbar.hide {
    display: none !important;
}
.taskbar-logo {
    height: 24px;
    margin-right: 1.5rem;
}
.taskbar-title {
    font-size: 1.05rem;
    margin-right: 2.5rem;
    font-weight: bold;
    color: #fff;
}
.taskbar-nav {
    display: flex;
    gap: 2.5rem;
}
.taskbar-link {
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}
.taskbar-link.active, .taskbar-link:hover {
    background: rgba(0,122,61,0.18);
    color: #fff;
    font-weight: bold;
}
.progress-bar-container {
    position: fixed;
    top: 44px;
    left: 0;
    width: 100vw;
    height: 8px;
    background: transparent;
    z-index: 999;
}
.progress-bar {
    height: 100%;
    width: 0;
    /* Match the taskbar gradient */
    background: linear-gradient(90deg, #004c6d 0%, #007a3d 100%);
    border-radius: 4px;
    transition: width 0.2s;
    position: relative;
    overflow: hidden;
}
.progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 24px;
    background: radial-gradient(circle at right, #fff 0%, #0099cc00 80%);
    opacity: 0.08;
    pointer-events: none;
}
.main-content {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem 3rem 2rem;
    display: none;
}
.section {
    margin-bottom: 5rem;
    scroll-margin-top: 70px;
    padding-top: 3rem;
    padding-bottom: 3rem;
}
.cover-page {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #10151a 97%, #007a3d 0%, #004c6d 100%);
    color: #fff;
    text-align: center;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}
.aramco-logo {
    width: 170px;
    max-width: 60vw;
    margin-bottom: 2.5rem;
}
.cover-title {
    font-size: 3.2rem;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    color: #fff;
}
.cover-subtitle {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 2.5rem;
    color: #fff;
}
.cover-btn {
    background: linear-gradient(90deg, #007a3d, #0099cc, #007a3d);
    background-size: 200% 200%;
    color: #fff;
    padding: 1.2rem 3rem;
    border-radius: 10px;
    font-size: 1.25rem;
    font-weight: bold;
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,204,153,0.10);
    margin-top: 2.5rem;
    transition: border-color 0.2s;
    animation: water-gradient 3s linear infinite;
}

.sec-btn {
    background: #1b2733;
    color: #e8f4f0;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    box-shadow: inset 2px 2px 6px rgba(255,255,255,0.04), inset -2px -2px 6px rgba(0,0,0,0.35), 0 8px 18px rgba(0,0,0,0.22);
    margin-top: 2.5rem;
    transition: transform .15s ease, box-shadow .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
    animation: none;
}

.sec-btn:focus-visible {
    outline: 2px solid #00ccaa;
    outline-offset: 2px;
}

.sec-btn:active {
    transform: translateY(0);
    box-shadow: inset 1px 1px 4px rgba(0,0,0,0.45), inset -1px -1px 3px rgba(255,255,255,0.06);
}

@keyframes water-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.cover-btn:hover {
    border-color: #fff;
    color: #fff;
}

.sec-btn:hover {
    background: #223241;
    border-color: rgba(255,255,255,0.10);
    color: #ffffff;
    box-shadow: inset 1px 1px 4px rgba(255,255,255,0.05), inset -1px -1px 4px rgba(0,0,0,0.35), 0 10px 22px rgba(0,0,0,0.28);
    transform: translateY(-1px);
}

/* Gradient variant for secondary buttons (matches cover-btn gradient) */
.sec-btn.gradient {
    background: linear-gradient(90deg, #007a3d, #0099cc, #007a3d);
    background-size: 200% 200%;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
    animation: water-gradient 3s linear infinite;
}
.sec-btn.gradient:hover {
    background: linear-gradient(90deg, #007a3d, #0099cc, #007a3d);
    background-size: 200% 200%;
    border-color: #fff;
    color: #fff;
}
header {
    text-align: center;
    margin-bottom: 2rem;
    margin-top: 2rem;
}
header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.7rem;
}
header div {
    font-size: 1rem;
    color: #e3e6ea;
}
.section-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.section-title {
    font-size: 1.7rem;
    font-weight: bold;
    color: #fff;
    letter-spacing: 1px;
}
.section-icon {
    width: 2rem;
    height: 2rem;
    display: inline-block;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}
.card {
    background: #16222c;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0,204,153,0.07);
    padding: 2.5rem 2rem;
    color: #fff;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    position: relative;
    border: 1px solid #007a3d;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
}
.card-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.7rem;
    color: #fff;
}
.card-desc {
    font-size: 1.1rem;
    color: #fff;
}
.card-link {
    color: #fff !important;
    font-weight: bold !important;
    text-decoration: none !important;
    margin-top: 1rem;
    display: block;
}
/* Normalize action alignment inside cards */
.card .card-link,
.card .sec-btn {
    margin-top: auto;
    align-self: flex-start;
}
.info-section {
    background: #16222c;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,204,153,0.07);
    max-width: 900px;
    margin: 3rem auto 0;
    padding: 2.5rem 2rem;
    text-align: center;
    border: 1px solid #007a3d;
    font-size: 1.1rem;
    color: #fff;
}
.info-section h2 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: bold;
}
.info-section a {
    background: #007a3d;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    padding: 0.7rem 1.4rem;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,204,153,0.09);
    transition: background 0.2s;
    display: inline-block;
    margin-top: 1rem;
    font-size: 1.1rem;
}
.info-section a:hover {
    background: #004c6d;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    border-color: #fff;
}
.challenge-options {
    color: #fff;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    display: block;
}
.challenge-answer {
    margin-top: 1rem;
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
}
button {
    background: #16222c;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.7rem 1.3rem;
    cursor: pointer;
    font-size: 1.1rem;
    margin-top: 0.8rem;
    transition: background 0.2s;
    font-weight: bold;
}
button:hover {
    background: #0099cc;
    color: #fff;
}
#dynamic-tip {
    background: #16222c;
    color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin: 3rem auto 0;
    max-width: 900px;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0,204,153,0.07);
    font-weight: bold;
}
.footer {
    margin-top: 3rem;
    border-top: 2px solid #007a3d;
    padding: 1.2rem 0 0.7rem 0;
    text-align: center;
    font-size: 1.1rem;
    color: #fff;
    background: #10151a;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    font-weight: bold;
}
.footer .footer-links {
    margin-top: 0.5rem;
    font-size: 1.1rem;
}
.footer a {
    color: #fff !important;
    font-weight: bold !important;
    text-decoration: none !important;
}
.footer span[style*="font-weight:600"] {
    color: #fff !important;
}
@media (max-width: 900px) {
    .main-content {
        max-width: 100vw;
        padding: 0 0.5rem 2rem 0.5rem;
    }
    .info-section, #dynamic-tip {
        max-width: 98vw;
        margin: 2rem auto 0;
        padding: 1.5rem 0.5rem;
    }
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
@media (max-width: 600px) {
    .taskbar {
        height: 36px;
        padding: 0 0.5rem;
    }
    .taskbar-logo {
        height: 16px;
        margin-right: 0.7rem;
    }
    .taskbar-title {
        font-size: 0.85rem;
        margin-right: 1rem;
    }
    .taskbar-nav {
        gap: 1rem;
    }
    .progress-bar-container {
        top: 36px;
    }
    .cover-page {
        padding: 0 0.3rem;
    }
    .aramco-logo {
        width: 80px;
        max-width: 60vw;
    }
    .cover-title {
        font-size: 2rem;
    }
    .cover-subtitle {
        font-size: 1rem;
    }
    .cover-btn {
        font-size: 1rem;
        padding: 0.7rem 1.5rem;
    }

    .sec-btn {
        font-size: 0.95rem;
        padding: 0.6rem 1rem;
    }
    .main-content {
        padding: 0 0.3rem 1rem 0.3rem;
    }
    .section {
        padding-top: 1.2rem;
        padding-bottom: 1.2rem;
        margin-bottom: 2rem;
    }
    .section-header {
        margin-bottom: 1.2rem;
    }
    .card-grid {
        gap: 1rem;
        margin-top: 1rem;
    }
    .info-section, #dynamic-tip {
        margin: 1.2rem auto 0;
        padding: 1rem 0.3rem;
    }
    .footer {
        margin-top: 1.2rem;
    }
}
/* Open Research Gallery (no boxes, full-size paper flip) */
#research .research-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    justify-items: center;
}
#research .research-tile {
    position: relative;
    width: min(480px, 100%);
    aspect-ratio: 3 / 4; /* Portrait paper-like */
    border-radius: 18px;
    background: none;
    text-decoration: none;
    box-shadow: 0 14px 40px rgba(0,0,0,0.28);
    transition: transform .25s ease, box-shadow .25s ease;
    perspective: 1200px;
}
#research .research-tile:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 60px rgba(0,0,0,0.38);
}
#research .research-tile .flip {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform .6s ease;
    border-radius: 18px;
    overflow: hidden;
}
#research .research-tile:hover .flip,
#research .research-tile:focus-visible .flip {
    transform: rotateY(180deg);
}
#research .research-tile .front,
#research .research-tile .back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 18px;
}
#research .research-tile .front {
    background-image: var(--img);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transform: rotateY(0deg) translateZ(0);
    will-change: transform;
}
#research .research-tile .front .label {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 1rem 1.25rem;
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.25;
    background: linear-gradient( to top, rgba(0,0,0,.65), rgba(0,0,0,0) 70% );
    text-shadow: 0 2px 12px rgba(0,0,0,.7);
}
#research .research-tile .back {
    transform: rotateY(180deg) translateZ(0);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    color: #23262f;
    background-color: #ffffff !important; /* force pure white */
    background-image: none !important;
    mix-blend-mode: normal;
    isolation: isolate;
    filter: none !important;
    -webkit-filter: none !important;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.06), inset 0 -2px 10px rgba(0,0,0,0.04);
}
#research .research-tile .back::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #ffffff !important;
    z-index: 0;
}
#research .research-tile .back .readmore { position: relative; z-index: 1; }
#research .research-tile .back .readmore {
    font-size: 1.1rem;
    padding: .7rem 1.2rem;
    border: 1.5px solid rgba(0,0,0,0.3);
    border-radius: 10px;
    background: #fff;
    color: #23262f;
}
#research .reveal {
    opacity: 0;
    transform: translateY(22px) scale(.985);
    filter: blur(1px);
    transition: opacity .6s ease, transform .6s ease, filter .6s ease;
}
#research .reveal.in {
    opacity: 1;
    transform: none;
    filter: none;
}
@media (max-width: 820px) {
    #research .research-gallery {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    #research .research-tile {
        width: 100%;
        aspect-ratio: 3 / 4;
        transform: none;
    }
    #research .research-tile:hover { transform: none; }
}


/* === Research Flip 3D Enhancements (override) === */
#research .research-tile { 
    perspective: 1600px; 
    perspective-origin: 50% 50%;
}
#research .research-tile .flip {
    transform-origin: left center; /* turn like a page */
    transition: transform .7s cubic-bezier(.2,.65,.25,1);
}
/* Keep existing hover behavior, also support programmatic flip */
#research .research-tile.flipped .flip {
    transform: rotateY(180deg);
}
/* Subtle page thickness/shading while flipping */
#research .research-tile .front::before {
    content: "";
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,0) 45%);
    opacity: 0; transition: opacity .6s ease;
}
#research .research-tile:hover .front::before,
#research .research-tile.flipped .front::before { opacity: .25; }

/* Backside: enforce pure white and a spine/edge hint */
#research .research-tile .back {
    background-color: #ffffff !important;
    background-image: none !important;
    color: #23262f;
    box-shadow: inset 6px 0 12px rgba(0,0,0,0.06), inset -2px 0 8px rgba(0,0,0,0.04);
}
#research .research-tile .back::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 12px;
    background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(0,0,0,0));
    opacity: .55; pointer-events: none;
}

/* Dynamic drop shadow to suggest lift during flip */
#research .research-tile .flip::after {
    content: ""; position: absolute; inset: 4% 6% auto 6%; height: 12%;
    border-radius: 50%; filter: blur(12px);
    background: rgba(0,0,0,.35);
    transform: translateY(420%) scale(1); opacity: .4;
    transition: opacity .6s ease, transform .6s ease;
}
#research .research-tile:hover .flip::after,
#research .research-tile.flipped .flip::after {
    transform: translateY(470%) scale(1.08); opacity: .6;
}


/* === Disable Research Flip Animation (per request) === */
#research .research-tile .flip { 
    transform: none !important; 
    transition: none !important; 
}
#research .research-tile:hover .flip,
#research .research-tile:focus-visible .flip,
#research .research-tile.flipped .flip {
    transform: none !important;
}
#research .research-tile .front::before { display: none !important; }
#research .research-tile .flip::after { display: none !important; }


/* === Mobile-friendly core utilities (sitewide) === */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Media should never overflow the viewport */
img, video, canvas, svg { max-width: 100%; height: auto; }
iframe { max-width: 100%; }
/* Avoid horizontal scroll caused by wide children */
html, body { overflow-x: hidden; }
/* Wrap long strings and code gracefully on small screens */
.wrap-text, .text-wrap { overflow-wrap: anywhere; word-break: break-word; }
pre, code, kbd, samp { white-space: pre-wrap; word-break: break-word; }
/* Simple responsive table helper */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive > table { width: 100%; border-collapse: collapse; }
/* Respect safe areas on notched devices */
.container, .main-content { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
/* Better tap feedback */
a, button { -webkit-tap-highlight-color: rgba(255,255,255,0.15); }
@media (max-width: 480px) {
  .btn, .sec-btn, button, .cover-btn { min-height: 44px; padding: 0.7rem 1.1rem; }
}


/* Mobile nav overflow handling for small screens */
@media (max-width: 600px) {
  .taskbar-nav { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .taskbar-link { display: inline-block; }
}
@media (max-width: 480px) {
  .taskbar-title { display: none; }
}

/* Small-phone refinements: Top 3 section and navbar */
@media (max-width: 560px) {
  /* Top 3 Cybersecurity Projects section tweaks */
  #award-highlight { padding: 2rem 0.75rem !important; border-radius: 14px !important; }
  #award-highlight h1 { font-size: clamp(1.2rem, 6vw, 1.6rem) !important; margin-bottom: .5rem !important; }
  #award-highlight p { font-size: .95rem !important; margin-bottom: 1.1rem !important; padding: 0 .25rem !important; }
  #award-highlight > div { display: flex !important; flex-direction: column !important; gap: 1rem !important; padding: 0 .25rem 0.75rem !important; }
  #award-highlight .pyr-card { height: 280px !important; transform: none !important; }
  #award-highlight .pyr-shape { width: 92% !important; height: 62% !important; border-radius: 12px !important; }
  #award-highlight .pyr-rank { top: -8px !important; padding: .2rem .6rem !important; border-width: 1px !important; }
  #award-highlight .pyr-rank span { font-size: .9rem !important; }
  #award-highlight .pyr-btn { padding: .55rem .9rem !important; font-size: .95rem !important; border-radius: 8px !important; }
}
@media (max-width: 420px) {
  /* Extra-tight phones */
  #award-highlight .pyr-card { height: 260px !important; }
  #award-highlight .pyr-shape { height: 60% !important; }
}

@media (max-width: 480px) {
  /* Navbar: make horizontal scroll feel better and prevent last link cutoff */
  .taskbar-nav { padding-right: .5rem; scroll-snap-type: x mandatory; }
  .taskbar-link { font-size: .9rem; scroll-snap-align: start; }
}
@media (max-width: 360px) {
  .taskbar-nav { gap: .6rem; }
  .taskbar-link { font-size: .84rem; }
}


/* Phone fix: center and scale Top 3 section properly on small screens */
@media (max-width: 780px) {
  /* Make the section span full width so its child can center correctly */
  #award-highlight { align-items: stretch !important; }

  /* Center the inner container and constrain it to a comfortable max width */
  #award-highlight > div {
    margin-left: auto !important;
    margin-right: auto !important;
    width: min(100%, 640px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  /* Ensure each card uses full available width and is centered */
  #award-highlight .pyr-card {
    width: 100% !important;
    max-width: 640px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Make the image block fill the card width */
  #award-highlight .pyr-shape { width: 100% !important; }
}


/* Mobile navbar: wrap instead of scroll, fix alignment (phones only) */
@media (max-width: 600px) {
  /* Let the bar grow for 2 lines of links; align content to the top */
  .taskbar {
    height: auto;
    padding: 0.35rem 0.6rem 0.5rem;
    align-items: flex-start;
    flex-wrap: wrap; /* allow logo on first row, nav on next */
  }

  /* Hide long title on phones to free space */
  .taskbar-title { display: none; }

  /* Wrap links onto multiple lines, center them, and remove scrolling */
  .taskbar-nav {
    overflow: visible;
    white-space: normal;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .4rem .6rem; /* row gap / column gap */
    width: 100%;
    flex: 1 1 100%; /* force nav to occupy full row under logo */
    scroll-snap-type: none; /* override earlier mobile scroll-snap */
    padding-right: 0; /* undo earlier right padding used for scroll */
  }

  /* Make link text baseline consistent and compact */
  .taskbar-link {
    display: inline-flex;
    align-items: center;
    font-size: .92rem;
    line-height: 1.1;
    padding: .35rem .6rem;
  }

  /* If the progress bar is enabled elsewhere, don't force a fixed offset on phones */
  .progress-bar-container { top: 0; display: none; }

  /* Improve in-page anchor positioning under a taller fixed navbar */
  .section { scroll-margin-top: 96px; }
}

@media (max-width: 360px) {
  .taskbar-link { font-size: .86rem; padding: .3rem .55rem; }
  .taskbar-nav { gap: .3rem .5rem; }
}
