/* Open Sans Condensed, self-hosted.
   Replaces the old @import from fonts.googleapis.com, which forced a four-hop serial
   chain (HTML -> main.css -> Google CSS -> woff2) and pulled a 300italic the site never
   used. Cyrillic is declared but only downloaded if Cyrillic text actually appears. */
@font-face {
    font-family: 'Open Sans Condensed';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url(../fonts/open-sans-condensed-300-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                   U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                   U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Open Sans Condensed';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url(../fonts/open-sans-condensed-300-cyrillic.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Open Sans Condensed';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(../fonts/open-sans-condensed-700-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                   U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                   U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Open Sans Condensed';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(../fonts/open-sans-condensed-700-cyrillic.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* CSS Variables */
:root {
    color-scheme: light dark;

    --primary-color: #BADA55;
    --text-color: #333;
    --page-bg: #f5f5f5;

    --panel-bg: #1a1a1a;
    --panel-border: transparent;
    --panel-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --panel-shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.2);

    --tooltip-bg: #1a1a1a;
    --icon-ink-hover: #1a1a1a;
    --icon-glow: rgba(186, 218, 85, 0.4);

    --dur: 0.3s;
    --ease: ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e8e8e8;
        --page-bg: #121212;

        /* The panel has to stay distinguishable from the page, so it goes *lighter*
           than the background here rather than reusing the old near-black. */
        --panel-bg: #1e1e1e;
        --panel-border: rgba(255, 255, 255, 0.08);
        --panel-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        --panel-shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.65);

        --tooltip-bg: #2a2a2a;
        --icon-ink-hover: #121212;
        --icon-glow: rgba(186, 218, 85, 0.25);
    }
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans Condensed', 'Arial Narrow', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--page-bg);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100svh;    /* mobile browser chrome must not clip the layout */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The vertical rhythm below is viewport-relative so the whole page fits one screen
   without scrolling. vh rather than svh on purpose: mobile URL-bar resizing must not
   re-flow the padding mid-scroll. The block-end padding carries an extra 24px because
   the .social-icon tooltips hang ~35px below the icon row on hover, and that
   absolutely-positioned overflow still extends the page's scrollable area. */
.container {
    width: 100%;
    max-width: 800px;
    padding: clamp(16px, 4vh, 40px) 20px calc(clamp(16px, 4vh, 40px) + 24px);
}

.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(16px, 3.2vh, 40px);
}

/* Image Section */
.image-wrapper {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: clamp(16px, 4.5vh, 60px) clamp(20px, 5vw, 40px);
    box-shadow: var(--panel-shadow);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: var(--panel-shadow-hover);
}

/* The illustration is the tallest block on the page, so it scales with the viewport:
   native 640x400 on tall screens, proportionally smaller below. width: auto is
   load-bearing — with max-width alone, max-height would squash the image instead of
   scaling it. svh here (unlike the paddings) because it must fit the smallest viewport. */
.image-wrapper img {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: min(400px, 42svh);
    display: block;
}

/* Name + Professional Tagline */
.intro {
    text-align: center;
}

.intro h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.9rem, 6vw, 2.6rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: var(--text-color);
}

.tagline {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.85;
}

.sep {
    opacity: 0.45;
    margin: 0 0.15em;
}

/* Social Links Icon Bar */
.social-links {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
}

.social-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease),
                transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    text-decoration: none;
    position: relative;
    padding: 0;
}

/* One rule for hover and keyboard focus, so both get the same affordance. */
.social-icon:hover,
.social-icon:focus-visible {
    background-color: var(--primary-color);
    color: var(--icon-ink-hover);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 20px var(--icon-glow);
}

.social-icon:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 4px;
}

/* Inline SVG inherits currentColor, which is what removed the two long
   filter: brightness(0) saturate(100%) invert(...) chains the glider PNG needed. */
.social-icon svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
    display: block;
}

/* Magic Button Special Styling */
.magic-icon {
    background: transparent;
    cursor: pointer;
    font: inherit;
    animation: pulse 2s infinite;
}

.magic-icon:hover {
    animation: none;
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* background-color, not the background shorthand — the shorthand forced a full repaint. */
@keyframes rainbow {
    0%   { background-color: #f5f5f5; }
    16%  { background-color: #ffcccc; }
    33%  { background-color: #ffffcc; }
    50%  { background-color: #ccffcc; }
    66%  { background-color: #ccffff; }
    83%  { background-color: #ccccff; }
    100% { background-color: #f5f5f5; }
}

@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-5px, 5px);
    }
    40% {
        transform: translate(-5px, -5px);
    }
    60% {
        transform: translate(5px, 5px);
    }
    80% {
        transform: translate(5px, -5px);
    }
    100% {
        transform: translate(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Tooltip on hover / keyboard focus.
   Reads aria-label, not title: title is what gave the links their accessible name, but
   it also made the browser draw its own native tooltip on top of this one. */
.social-icon::after {
    content: attr(aria-label);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tooltip-bg);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease), bottom var(--dur) var(--ease);
}

.social-icon:hover::after,
.social-icon:focus-visible::after {
    opacity: 1;
    bottom: -40px;
}

/* Dark mode: the pastel rainbow would strobe white on a dark page, so the ramp is
   redefined with deep hues instead. */
@media (prefers-color-scheme: dark) {
    @keyframes rainbow {
        0%   { background-color: #121212; }
        16%  { background-color: #2a1414; }
        33%  { background-color: #2a2a14; }
        50%  { background-color: #142a14; }
        66%  { background-color: #142a2a; }
        83%  { background-color: #14142a; }
        100% { background-color: #121212; }
    }
}

/* Responsive Design */
/* These blocks only narrow things now — the vertical padding and gaps are already
   viewport-relative above, so overriding them here would undo the one-screen fit. */
@media screen and (max-width: 768px) {
    .container {
        padding-inline: 15px;
    }

    .image-wrapper {
        padding-inline: 30px;
        border-radius: 15px;
    }

    .social-links {
        gap: 25px;
    }

    .social-icon {
        width: 55px;
        height: 55px;
    }

    .social-icon svg {
        width: 24px;
        height: 24px;
    }

    .tagline {
        font-size: 1.1rem;
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding-inline: 10px;
    }

    .image-wrapper {
        padding-inline: 20px;
        border-radius: 12px;
    }

    .social-links {
        gap: 20px;
    }

    .social-icon {
        width: 50px;
        height: 50px;
    }

    .social-icon svg {
        width: 22px;
        height: 22px;
    }

    .social-icon::after {
        font-size: 12px;
        padding: 5px 10px;
    }

    .tagline {
        font-size: 1rem;
    }
}

/* Accessibility: honour the OS "reduce motion" setting.
   The button still works — its JS falls back to the one effect that neither moves
   nor flashes. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .magic-icon {
        animation: none !important;
    }

    .image-wrapper:hover,
    .social-icon:hover,
    .social-icon:focus-visible {
        transform: none;
    }
}
