/* ==========================================================================
   WOOD-PANEL GABLE DOORWAY STYLES
   Designed strictly for templates/doorway/frame.html
   ========================================================================== */

.doorway-marketing-wrapper {
    min-height: 100vh;
    min-height: 100dvh;   /* accounts for mobile browser chrome */
    width: 100%;          /* 100vw overflows horizontally when a scrollbar exists */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    
    /* Fixed background image parallax behavior */
    background-image: url('/static/crest.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Dark translucent mask over background image to elevate frame contrast */
.doorway-marketing-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(10, 14, 23, 0.65);
    z-index: 1;
}

/* --- The Wood-Panel Gable Frame Container --- */
.gable-wooden-frame {
    position: relative;
    z-index: 2;
    width: 100%;
    /* Scales with the viewport instead of pinning a phone-width card onto a
       desktop screen. Capped so the reading measure stays sane. */
    max-width: clamp(20rem, 92vw, 34rem);
    background-color: #2b1810; /* Dark rich mahogany base wood */
    border: 12px solid #1a0f0a;  /* Heavy routed wooden trim border */
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 
                inset 0 0 20px rgba(0, 0, 0, 0.9);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-block: 4vh;
}

/* Peak of the Gable (Tudor architectural style peaked roof motif) */
.gable-peak {
    position: absolute;
    top: -42px;
    left: calc(50% - 40px);
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 30px solid #1a0f0a; /* Peaked trim color matches wood frame */
    z-index: 5;
}

/* --- In-Frame Nav Controls --- */
.doorway-inframe-nav {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    background-color: #1a0f0a; /* Recessed panel */
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid #3d251a;
}

.nav-link-btn {
    min-height: 40px; /* Highly accessible touch point inside navigation row */
    border: none;
    background-color: transparent;
    color: #8c7366; /* Muted tan-wood color */
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link-btn.active {
    background-color: #2b1810;
    color: var(--color-primary); /* Active crown gold */
}

.nav-link-btn:hover {
    color: var(--color-text-primary);
}

/* --- The Scrollable Content Pane (Frosted Glass Paper look) --- */
.gable-scroll-pane {
    width: 100%;
    /* Grows with its content rather than clipping it at a fixed 460px, and
       only starts scrolling once it would outgrow the viewport. */
    min-height: 18rem;
    max-height: min(68vh, 44rem);
    overflow-y: auto;
    background-color: rgba(10, 14, 23, 0.85); /* Dark obsidian backing */
    backdrop-filter: blur(12px); /* High fidelity modern glass blur */
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    border: 1px solid #3d251a;
    
    /* Styled retro wooden scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #1a0f0a transparent;
}

.gable-scroll-pane::-webkit-scrollbar {
    width: 6px;
}

.gable-scroll-pane::-webkit-scrollbar-track {
    background: transparent;
}

.gable-scroll-pane::-webkit-scrollbar-thumb {
    background-color: #1a0f0a;
    border-radius: var(--radius-round);
}

/* --- Decoupled Content Transitions --- */
.partial-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.fade-in {
    animation: simple-fade 250ms ease-out;
}

@keyframes simple-fade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sub-page informational layout mappings inside the scroll pane */
.doorway-info-content {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text-primary);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.doorway-info-content h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-primary);
    border-bottom: 1px dashed #3d251a;
    padding-bottom: var(--space-xs);
    text-transform: uppercase;
}

.doorway-info-content ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.doorway-info-content li::before {
    content: "⚡ ";
    color: var(--color-primary);
}


/* --- Branded Custom Audio Control Deck --- */
.audio-control-deck {
    background-color: #1a0f0a; /* Recessed dark wood panel insert */
    border-radius: var(--radius-md);
    padding: var(--space-xs);
    border: 1px solid #3d251a;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-audio-toggle {
    min-height: var(--touch-target-min); /* 48px Target */
    width: 100%;
    border: none;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    cursor: pointer;
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 1px;
    transition: color var(--transition-fast);
}

.btn-audio-toggle:hover,
.btn-audio-toggle:focus {
    color: var(--color-primary);
    outline: none;
}

/* Active State Styles */
.btn-audio-toggle[aria-pressed="true"] {
    color: var(--color-primary);
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.audio-state-icon {
    font-size: 1.1rem;
    transition: transform var(--transition-bounce);
}

.btn-audio-toggle:hover .audio-state-icon {
    transform: scale(1.1);
}

/* --- Retro Equalizer Bars Animation --- */
.visual-equalizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
    width: 16px;
    margin-left: var(--space-xs);
}

.eq-bar {
    width: 2px;
    background-color: var(--color-primary);
    border-radius: var(--radius-round);
    animation: bounce-eq 1s ease-in-out infinite alternate;
}

/* Set dynamic offsets for each bar to create a chaotic sound-wave aesthetic */
.eq-bar:nth-child(1) { height: 30%; animation-delay: -0.2s; }
.eq-bar:nth-child(2) { height: 100%; animation-delay: -0.6s; }
.eq-bar:nth-child(3) { height: 60%; animation-delay: -0.4s; }
.eq-bar:nth-child(4) { height: 80%; animation-delay: -0.1s; }

@keyframes bounce-eq {
    from { height: 10%; }
    to { height: 100%; }
}

/* --- Auth & Onboarding Panes --- */
.auth-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-tab {
    flex: 1;
    min-height: var(--touch-target-min);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-text-secondary);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    padding: var(--space-sm);
}

.auth-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.auth-tabs-inner {
    margin-top: var(--space-md);
}

.auth-lede {
    color: var(--color-text-secondary);
    text-align: center;
    margin-bottom: var(--space-sm);
}

.auth-error,
.auth-notice {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
    line-height: 1.4;
}

.auth-error {
    background-color: rgba(220, 38, 38, 0.14);
    border: 1px solid var(--color-danger-crimson);
    color: var(--color-text-primary);
}

.auth-notice {
    background-color: rgba(16, 185, 129, 0.14);
    border: 1px solid var(--color-success-mint);
    color: var(--color-text-primary);
}

.doorway-form select {
    width: 100%;
    min-height: var(--touch-target-min);
    padding: 0 var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background-color: var(--color-bg-surface);
    color: var(--color-text-primary);
    font-size: 1rem;
}

.btn-primary-doorway[disabled] {
    opacity: 0.6;
    cursor: progress;
}

/* --- Informational partials (about / rules / terms) --- */
.doorway-prose {
    color: var(--color-text-secondary);
    line-height: 1.65;
}

.doorway-prose h2 {
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

.doorway-prose h3 {
    color: var(--color-text-primary);
    margin: var(--space-lg) 0 var(--space-sm);
    font-size: 1rem;
}

.doorway-prose ul,
.doorway-prose ol {
    padding-left: var(--space-lg);
    margin-bottom: var(--space-md);
}

.doorway-prose li {
    margin-bottom: var(--space-sm);
}

.doorway-prose strong {
    color: var(--color-text-primary);
}

.prose-footnote {
    margin-top: var(--space-lg);
    font-size: 0.85rem;
    color: var(--color-text-disabled);
}


/* --- Social sign-in --- */
.social-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin: var(--space-lg) 0;
}

.btn-social {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    min-height: var(--touch-target-min);
    padding: 0 var(--space-sm);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.22);
    background-color: var(--color-bg-elevated);
    color: var(--color-text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;

    /* The Google option is an <a>, the not-yet-built ones are <button>s. Both
       have to sit in the stack looking identical. */
    text-decoration: none;
    justify-content: flex-start;
    box-sizing: border-box;
    font-family: inherit;
    text-align: left;
}

.btn-social:hover:not([disabled]) {
    background-color: var(--color-bg-surface);
    border-color: var(--color-primary);
}

.btn-social[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.social-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    flex: 0 0 24px;
    font-weight: 800;
}

.social-label {
    flex: 1 1 auto;
    text-align: left;
    /* The doorway card is narrow; keep the label on one line and shrink it
       rather than letting "Continue with Facebook" stack three deep. */
    white-space: nowrap;
    min-width: 0;
    font-size: clamp(0.82rem, 3.4vw, 0.95rem);
}

/* Below ~400px the card is too narrow for the full phrase; the icon and the
   panel heading already establish what the button does. */
@media (max-width: 400px) {
    .social-prefix { display: none; }
}

.social-label em {
    font-style: normal;
    font-size: 0.72em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-disabled);
}

.auth-legal {
    font-size: 0.8rem;
    color: var(--color-text-disabled);
    text-align: center;
    line-height: 1.5;
}

.auth-legal a { color: var(--color-text-secondary); }
