/* Fonts */

/* Google Sans - https://fonts.google.com/specimen/Google+Sans */
.google-sans {
  font-family: "Google Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: normal;
  font-style: normal;
  font-variation-settings:
    "GRAD" 0;
}

/* Box-sizing reset so padding/border never push elements past 100% width
   on narrow screens */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Styles */
html {
    background-color: #ffffff;
    color: #000000;
    font-family: "Google Sans", sans-serif;
    font-size: 12pt;
    cursor: auto;
}

header {
    min-width: 100dvw;
    position: top;
    top: 0;
    z-index: 999;
}
header > h1 {
    display: inline-block;
    margin-left: 1dvw;
}

html, body {
  /* Ensure the page takes up at least the full height of the screen */
  min-height: 100dvh; 
  max-width: 100dvw;
  margin: 0;
  
  /* Turn the body into a vertical layout stack */
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
    margin-left: 1dvw;
    margin-right: 1dvw;
    padding-left: 1dvw;
    padding-right: 1dvw;
}

footer {
    min-width: 100dvw;
    font-size: 10.7pt;
    text-align: center;
    padding: 20px;
    padding-right: 20px;
    align-items: center;
    position: fixed;
    bottom: 0;
}

.avtf-footer {
    position: static;
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}
.cs-footer {
    position: static;
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

button {
    cursor: pointer;
}

.avtf-button {
    background-color: #3a3c41;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 12pt;
    border-radius: 4px;
}
.avtf-button:hover {
    background-color: #b3b5bb;
    color: #000000;
    transition-duration: 0.3s;
    font-size: 13pt;
}

.cs-button {
    background-color: #3a3c41;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 12pt;
    border-radius: 4px;
}
.cs-button:hover {
    background-color: #b3b5bb;
    color: #000000;
    transition-duration: 0.3s;
    font-size: 13pt;
}

/*.contact-button {
    background-color: #3a3c41;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 12pt;
    border-radius: 4px;
}
.contact-button:hover {
    background-color: #b3b5bb;
    color: #000000;
    transition-duration: 0.3s;
    font-size: 13pt;
}*/
#contact-button {
    background-image: url(jackd.jpg);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    color: #ffffff;
}

.back-button {
    background-color: #3a3c41;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 12pt;
    border-radius: 4px;

    position: fixed;
    top: 1.8dvh;
    right: 0;
    margin-right: 1dvw;
}
.back-button:hover {
    background-color: #b3b5bb;
    color: #000000;
    transition-duration: 0.3s;
}

.home-button {
    background-color: #3a3c41;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 12pt;
    border-radius: 4px;

    position: fixed;
    top: 1.8dvh;
    right: 0;
    margin-right: 1dvw;
}
.home-button:hover {
    background-color: #b3b5bb;
    color: #000000;
    transition-duration: 0.3s;
}

.avtf-videos {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    min-width: 100%;
    justify-content: center;
    align-items: center;
    padding-top: 2dvh;
}

/* Fluid 16:9 wrapper for the AVTF video grid. This only changes how the
   embeds SCALE on narrow screens (fixed 560x315 iframes previously
   overflowed small viewports) — the surrounding AVTF layout, colors, and
   background video are unchanged. */
.embed-16x9 {
    position: relative;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.embed-16x9 iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.avtf-bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 100dvw;
    min-height: 100dvh;
    z-index: -1;
    overflow: hidden;
    filter: blur(8px);
    background-size: cover;
    background-color: #000000;
}
.avtf-bg-video > iframe {
    z-index: -1;
}
.avtf-bg-video > video {
    z-index: 2;
}

.avtf-top {
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

/* ===================================================================
   "Window" chrome component
   Shared by the Computer Science project cards and the Resume PDF
   viewer, so both pages read as looking at content through the same
   little app window.
   =================================================================== */

.window {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border: 1px solid #3a3c41;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.window-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background-color: #3a3c41;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 10pt;
}

.window-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.window-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 9pt;
    letter-spacing: 1px;
    opacity: 0.85;
    flex-shrink: 0;
}

.window-zoom {
    font-size: 9pt;
    opacity: 0.85;
    flex-shrink: 0;
}

.window-body {
    flex: 1;
    background-color: #ffffff;
}

.window-body iframe {
    display: block;
    border: 0;
}

/* ===================================================================
   Computer Science page
   =================================================================== */

.cs-projects {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    /* minmax(min(320px, 100%), 1fr) keeps a 320px preferred column width
       on larger screens but never forces overflow on phones narrower
       than 320px */
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 24px;
    align-items: start;
    justify-items: center;
    padding-top: 2dvh;
}

.cs-projects .window {
    /* width: 100%; */
    min-width: 480px;
}

/* Each .window-body sets --ar inline (e.g. style="--ar: 392/620") to
   match that embed's real aspect ratio, so it scales fluidly on any
   screen width instead of using a fixed pixel size. */
.cs-projects .window-body {
    position: relative;
    width: 100%;
    aspect-ratio: var(--ar, 4 / 3);
    overflow: hidden;
}

.cs-projects .window-body iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ===================================================================
   Home page
   =================================================================== */

.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-right: 1dvw;
    gap: 16px;
}

.home-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-right: 1dvw;
}

.resume-button {
    background-color: #3a3c41;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 12pt;
    border-radius: 4px;
    white-space: nowrap;
}
.resume-button:hover {
    background-color: #b3b5bb;
    color: #000000;
    transition-duration: 0.3s;
}

.profile-pic {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #3a3c41;
    flex-shrink: 0;
}

.home-nav-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 2dvh;
    margin-bottom: 2dvh;
}

.nav-card {
    flex: 1 1 240px;
    display: block;
    border: 1px solid #3a3c41;
    border-radius: 8px;
    padding: 24px;
    text-decoration: none;
    color: #000000;
    transition-duration: 0.3s;
}
.nav-card:hover {
    background-color: #3a3c41;
    color: #ffffff;
}
.nav-card h2 {
    margin: 0 0 8px 0;
    font-family: "Google Sans", sans-serif;
}
.nav-card p {
    margin: 0;
    font-size: 11pt;
}

/* ===================================================================
   Resume page
   =================================================================== */

.pdf-window {
    width: min(850px, 96dvw);
    height: 80dvh;
    margin: 2dvh auto;
}

.pdf-body {
    height: 75dvh;
}

.pdf-body iframe {
    width: 100%;
    height: 100%;
}

/* ===================================================================
   Mobile / small-screen adjustments
   These are additive breakpoints layered on top of the rules above —
   nothing here changes how any page looks on a normal desktop width.
   =================================================================== */

@media (max-width: 700px) {
    /* Fixed-position footers can grow past one line on narrow screens
       and permanently cover content sitting behind them. AVTF and CS
       already use position: static (unchanged); this only affects the
       plain footer used on Home, Contact, Credits, Resume, and 404. */
    footer:not(.avtf-footer):not(.cs-footer) {
        position: static;
        margin-top: 4dvh;
    }

    .pdf-body {
        height: 60dvh;
    }
}

@media (max-width: 600px) {
    /* Reserve space so the fixed Home/Back button never overlaps a
       wrapping page title */
    header > h1 {
        font-size: 20pt;
        max-width: calc(100% - 96px);
        overflow-wrap: break-word;
    }
    .home-button,
    .back-button {
        padding: 8px 14px;
        font-size: 10pt;
        top: 1.2dvh;
    }
}

@media (max-width: 560px) {
    .home-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .home-header-actions {
        margin-right: 0;
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .nav-card {
        flex-basis: 100%;
    }
    .cs-projects {
        gap: 16px;
    }
}