/* ==========================================================================
   WebGuy Internet — Main Stylesheet
   Single-page Kwicks-style accordion landing page
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FONTS (self-hosted, no Google Fonts CDN)
   -------------------------------------------------------------------------- */

@font-face {
    font-family: 'Expletus Sans';
    src: url('/assets/fonts/ExpletusSans-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito Sans';
    src: url('/assets/fonts/NunitoSans-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* --------------------------------------------------------------------------
   2. CUSTOM PROPERTIES (design tokens)
   -------------------------------------------------------------------------- */

:root {
    /* Panel backgrounds */
    --color-hero-bg:       #0A0A0A;
    --color-it-bg:         #3D6B4A;
    --color-backup-bg:     #7A4258;
    --color-code-bg:       #4A4570;
    --color-contact-bg:    #E6E7E2;

    /* Panel accents */
    --color-hero-accent:   #888780;
    --color-it-accent:     #D8AC2F;
    --color-backup-accent: #FFFFFF;
    --color-code-accent:   #ED93B1;
    --color-contact-accent:#34904A;

    /* Text colors */
    --color-hero-headline: #FFFFFF;
    --color-hero-tagline:  #B4B2A9;
    --color-hero-body:     #E6E7E2;
    --color-contact-text:  #032841;

    /* Typography */
    --font-heading: 'Expletus Sans', 'Trebuchet MS', sans-serif;
    --font-body:    'Nunito Sans', 'Segoe UI', sans-serif;

    /* Animation */
    --transition-duration: 400ms;
    --transition-easing:   cubic-bezier(0.4, 0.0, 0.2, 1);
    --content-fade:        200ms;

    /* Panel sizing — fixed pixel bookends */
    --bookend-width:  60px;
    --bookend-height: 50px;  /* mobile vertical strips */
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    :root {
        --transition-duration: 50ms;
        --content-fade: 25ms;
    }
}

/* --------------------------------------------------------------------------
   3. RESET & BASE
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: #FFFFFF;
    background: #0A0A0A;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   4. SKIP LINK (accessibility)
   -------------------------------------------------------------------------- */

.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFFFFF;
    color: #0A0A0A;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 700;
    z-index: 9999;
    border-radius: 0 0 6px 6px;
    transition: top 150ms ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--color-it-accent);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   5. KWICKS CONTAINER — Desktop (horizontal)
   -------------------------------------------------------------------------- */

.kwicks {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* dynamic viewport height for mobile browsers */
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   6. PANEL BASE
   -------------------------------------------------------------------------- */

.kwicks-panel {
    position: relative;
    flex: 0 0 var(--bookend-width);
    overflow: hidden;
    cursor: pointer;
    transition: flex var(--transition-duration) var(--transition-easing);
    display: flex;
    align-items: stretch;
}

.kwicks-panel.is-expanded {
    flex: 1 1 0;
    cursor: default;
}

/* Panel backgrounds */
.panel-hero {
    background-color: var(--color-hero-bg);
    background-image: url('/assets/img/logos/FrogBackground.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Dark overlay on Hero for text readability over the background image */
.panel-hero .panel-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.25);
    z-index: -1;
    pointer-events: none;
}
.panel-it      { background-color: var(--color-it-bg); }
.panel-backup  { background-color: var(--color-backup-bg); }
.panel-code    { background-color: var(--color-code-bg); }
.panel-contact { background-color: var(--color-contact-bg); color: var(--color-contact-text); }

/* Contact panel has tall content — align from top so header doesn't get cut off */
.panel-contact .panel-content {
    justify-content: flex-start;
    padding-top: 2.5rem;
}

/* --------------------------------------------------------------------------
   7. BOOKEND (compressed state)
   -------------------------------------------------------------------------- */

.panel-bookend {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 2px 0;
    z-index: 2;
    opacity: 1;
    transition: opacity var(--content-fade) ease;
    pointer-events: none;
}

.is-expanded .panel-bookend {
    opacity: 0;
    pointer-events: none;
}

.bookend-logo,
.bookend-logo-icon {
    width: calc(var(--bookend-width) - 12px);
    height: calc(var(--bookend-width) - 12px);
    flex-shrink: 0;
    object-fit: contain;
    margin: 6px;
}

.bookend-logo-icon {
    font-size: calc(var(--bookend-width) - 20px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contact bookend icon needs dark color on light background */
.panel-contact .bookend-logo-icon {
    color: var(--color-contact-text);
}

.bookend-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    white-space: nowrap;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
}

.bookend-hint {
    font-size: 0.75rem;
    opacity: 0.5;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   8. PANEL CONTENT (expanded state)
   -------------------------------------------------------------------------- */

.panel-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    padding: 2rem 3rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--content-fade) ease;
    transition-delay: calc(var(--transition-duration) * 0.4);
    overflow-y: auto;
}

.is-expanded .panel-content {
    opacity: 1;
    pointer-events: auto;
}

/* Panel logos */
.panel-logo {
    margin: 0 auto 1.5rem;
}

.panel-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* Typography in panels */
h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    margin-bottom: 0.5rem;
    color: var(--color-hero-headline);
}

h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.tagline {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-variant: small-caps;
    letter-spacing: 3px;
    color: var(--color-hero-tagline);
    margin-bottom: 1.5rem;
}

.intro,
.blurb,
.heritage {
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.panel-hero .intro {
    color: var(--color-hero-body);
}

.blurb {
    margin-bottom: 2rem;
}

.heritage {
    margin-bottom: 1.5rem;
    color: var(--color-contact-text);
}

/* --------------------------------------------------------------------------
   9. CTA BUTTONS
   -------------------------------------------------------------------------- */

.cta-button {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.85rem 2.5rem;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 250ms ease, color 250ms ease, transform 200ms ease, box-shadow 250ms ease;
}

.cta-button:hover,
.cta-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.cta-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Panel-specific pill button styles */
.panel-it .cta-button {
    background: var(--color-it-accent);
    color: #1a1a1a;
}
.panel-it .cta-button:hover {
    background: #E4BC4A;
    color: #1a1a1a;
}

.panel-backup .cta-button {
    background: #FFFFFF;
    color: var(--color-backup-bg);
}
.panel-backup .cta-button:hover {
    background: #F0F0EE;
    color: var(--color-backup-bg);
}

.panel-code .cta-button {
    background: var(--color-code-accent);
    color: #1a1a1a;
}
.panel-code .cta-button:hover {
    background: #F2A8C2;
    color: #1a1a1a;
}

.panel-contact .cta-button {
    background: var(--color-contact-accent);
    color: #FFFFFF;
}
.panel-contact .cta-button:hover {
    background: #2D7D40;
    color: #FFFFFF;
}

/* Submit button states */
.cta-submit {
    width: 100%;
    max-width: 320px;
    position: relative;
}

.cta-submit .btn-spinner {
    display: none;
}

.cta-submit.is-loading .btn-text {
    visibility: hidden;
}

.cta-submit.is-loading .btn-spinner {
    display: inline;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* --------------------------------------------------------------------------
   10. CONTACT PANEL
   -------------------------------------------------------------------------- */

.contact-info {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.contact-info p,
.contact-info address {
    margin-bottom: 0.5rem;
    font-style: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.contact-info a {
    color: var(--color-contact-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.contact-info a:hover {
    opacity: 0.8;
}

/* --------------------------------------------------------------------------
   11. CONTACT FORM
   -------------------------------------------------------------------------- */

.contact-form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.35rem;
    color: var(--color-contact-text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-contact-text);
    background: #FFFFFF;
    border: 2px solid #C8C9C4;
    border-radius: 4px;
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-contact-accent);
    box-shadow: 0 0 0 3px rgba(52, 144, 74, 0.2);
}

.form-group input.is-invalid,
.form-group textarea.is-invalid {
    border-color: #D32F2F;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Honeypot — absolutely hidden from view */
.form-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Feedback messages */
.form-feedback {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: none;
}

.form-feedback.is-success {
    display: block;
    background: rgba(52, 144, 74, 0.12);
    color: #1B6B2E;
    border: 1px solid rgba(52, 144, 74, 0.3);
}

.form-feedback.is-error {
    display: block;
    background: rgba(211, 47, 47, 0.1);
    color: #B71C1C;
    border: 1px solid rgba(211, 47, 47, 0.3);
}

/* --------------------------------------------------------------------------
   12. FOCUS STYLES (accessibility)
   -------------------------------------------------------------------------- */

.kwicks-panel:focus-visible {
    outline: 3px solid var(--color-it-accent);
    outline-offset: -3px;
    z-index: 10;
}

.panel-contact .kwicks-panel:focus-visible,
.panel-contact:focus-visible {
    outline-color: var(--color-contact-accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--color-it-accent);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   13. MOBILE LAYOUT (< 768px) — Vertical stacking
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
    .kwicks {
        flex-direction: column;
    }

    /* Mobile: compressed panels use fixed height instead of width */
    .kwicks-panel {
        flex: 0 0 var(--bookend-height);
    }

    .kwicks-panel.is-expanded {
        flex: 1 1 0;
    }

    /* Mobile bookend logos — fit inside the shorter horizontal strips */
    .bookend-logo,
    .bookend-logo-icon {
        width: calc(var(--bookend-height) - 10px);
        height: calc(var(--bookend-height) - 10px);
    }

    /* Bookend: horizontal strip instead of vertical */
    .panel-bookend {
        flex-direction: row;
        align-items: center;
        padding: 0 0.5rem;
        height: 100%;
    }

    .bookend-title {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 0.8rem;
        padding: 0 0.75rem;
    }

    .bookend-hint {
        display: none; /* Hide chevron hints on mobile — tap interaction is obvious */
    }

    /* Adjust content padding for mobile */
    .panel-content {
        padding: 1.5rem 1.5rem;
    }

    .intro,
    .blurb,
    .heritage {
        font-size: 0.9rem;
    }

    .panel-logo {
        max-width: 200px;
        height: auto;
    }

    .contact-form {
        max-width: 100%;
    }
}

/* --------------------------------------------------------------------------
   14. LARGE DESKTOP REFINEMENTS
   -------------------------------------------------------------------------- */

@media (min-width: 1400px) {
    .panel-content {
        padding: 3rem 5rem;
    }

    .intro,
    .blurb,
    .heritage {
        max-width: 620px;
    }
}
