/* Responsive adaptation of Aerial (HTML5 UP, CCA 3.0).
   Loaded after main.css; no Sass compilation required. */
:root {
    color-scheme: dark;
    --page-bg: #101419;
    --icon-size: clamp(3.25rem, 13vw, 4.375rem);
    --icon-gap: clamp(.6rem, 3vw, 1.15rem);
}

html, body { min-height: 100%; }
body {
    background: var(--page-bg);
    overflow: auto;
    min-width: 0;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* The original fixed-width, tiled panorama caused the mobile image strip.
   A static cover image fills all aspect ratios without seams. */
#wrapper {
    position: relative;
    isolation: isolate;
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    width: 100%;
}
#bg, #overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
#bg {
    z-index: -2;
    background: var(--page-bg) url('images/bg.jpg') center / cover no-repeat;
    transform: none;
}
#overlay {
    z-index: -1;
    background-attachment: scroll, scroll;
}

/* Keep content in normal flow so short screens and zoom can scroll. */
#main {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-rows: minmax(1.5rem, 1fr) auto minmax(4rem, 1fr);
    justify-items: center;
}
#main::before { display: none; }
#header {
    grid-row: 2;
    top: auto;
    width: 100%;
    max-width: 80rem;
    padding: 1.5rem clamp(1rem, 4vw, 3rem);
    transform: none;
    text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
#header h1 {
    font-size: clamp(2rem, 7vw, 5.4rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
    text-wrap: balance;
}
#header p.specialties {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .25em .45em;
    font-size: clamp(1rem, 2vw, 1.55rem);
    line-height: 1.6;
    margin: 1rem auto 0;
    opacity: 1;
    color: #e0e4e8;
}
.specialty-group {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .2em .45em;
    max-width: 100%;
}
.specialty-group > span:not(.separator) { white-space: nowrap; }
.separator { opacity: .85; }
#header nav { margin: 1.65rem 0 0; padding: 0; }
#header nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--icon-gap);
}
#header nav li {
    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--icon-size);
    height: var(--icon-size);
    line-height: normal;
    transform: none;
}
#header nav a {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 50%;
    font-size: 1rem;
    text-shadow: none;
    transition: background-color .2s ease, transform .2s ease;
}
#header nav a::before {
    width: auto;
    height: auto;
    line-height: 1;
    font-size: clamp(1.35rem, 5vw, 1.75rem);
    border: 0;
    background: transparent;
}
#header nav a:hover, #header nav a:active { font-size: 1rem; }
#header nav a:hover::before, #header nav a:active::before { background: transparent; }
@media (hover: hover) {
    #header nav a:hover { background: rgba(255,255,255,.17); transform: translateY(-2px); }
}
#header nav a:active { background: rgba(255,255,255,.25); transform: scale(.96); }
#header nav a:focus-visible { outline: 2px solid #fff; outline-offset: 5px; }
#footer {
    grid-row: 3;
    align-self: end;
    position: static;
    width: 100%;
    height: auto;
    padding: 1.5rem 1rem max(1rem, env(safe-area-inset-bottom));
    line-height: 1.4;
    font-size: .95rem;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,.4));
    text-shadow: 0 1px 5px rgba(0,0,0,.5);
}

/* The original multi-second intro also hid content if JavaScript failed.
   Render the page immediately, with no dependence on JavaScript. */
#wrapper, #bg, #overlay, #header, #header nav li {
    animation: none !important;
    opacity: 1;
}

@media (max-width: 800px) {
    #header p.specialties { flex-direction: column; gap: .2rem; }
    .group-separator { display: none; }
    #header h1 { font-size: clamp(2rem, 8.8vw, 4.35rem); }
}
@media (orientation: portrait) {
    /* Keep the server racks in frame rather than cropping the dark left side. */
    #bg { background-position: 78% center; }
    #header { background: radial-gradient(ellipse at center, rgba(0,0,0,.28), transparent 75%); }
}
@media (max-width: 360px) {
    #header { padding-inline: .75rem; }
    #header p.specialties { font-size: .94rem; }
}
@media (max-height: 480px) and (orientation: landscape) {
    #main { grid-template-rows: minmax(.5rem, 1fr) auto minmax(2.5rem, 1fr); }
    #header { padding-block: .75rem; }
    #header h1 { font-size: clamp(2rem, 7vw, 3.6rem); }
    #header nav { margin-top: 1rem; }
    #footer { padding-block: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
    #header nav a { transition: none; }
    #header nav a:hover, #header nav a:active { transform: none; }
}

@media (min-width: 1681px) {
    :root { --icon-size: 5.375rem; --icon-gap: 1.3rem; }
    #header nav a::before { font-size: 2rem; }
}
