/* ══════ LOCAL FONTS ══════ */

/* Playfair Display — latin-ext (Czech diacritics) */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('/fonts/playfair-display-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Playfair Display — latin */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('/fonts/playfair-display-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans — latin-ext */
@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url('/fonts/ibm-plex-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Sans — latin */
@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url('/fonts/ibm-plex-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono — latin-ext (light) */
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-light-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Mono — latin (light) */
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-light-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono — latin-ext (regular) */
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-regular-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Mono — latin (regular) */
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-regular-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ══════ DESIGN TOKENS ══════ */

:root {
    --ember: #c96a3f;
    --ember-bright: #d9845a;
    --ember-deep: #a85530;
    --ember-text: #1c0a02;
    --coal: #0a0a0e;
    --surface: #111115;
    --text: #a0a0b0;
    --text-bright: #e8e8f0;
    --text-sub: #686878;
    --text-mute: #3e3e4c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }

body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--coal);
    color: var(--text);
    font-family: 'IBM Plex Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ══════ ATMOSPHERE ══════ */

.atmosphere {
    position: fixed; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 80% 45% at 50% 100%, rgba(160, 85, 40, 0.045), transparent 70%),
        radial-gradient(ellipse 60% 50% at 50% 55%, rgba(180, 100, 50, 0.02), transparent);
}

.grain {
    position: fixed; inset: 0; pointer-events: none; opacity: 0.018;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 512px;
}

#heatCanvas { position: fixed; inset: 0; pointer-events: none; }

/* ══════ CONTENT ══════ */

.content {
    position: relative; z-index: 1;
    text-align: center; padding: 2rem;
    opacity: 0;
    animation: fadeIn 2.8s ease 0.3s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 4.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    line-height: 1;
    margin-bottom: 1rem;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
}

.logo .tm {
    font-size: 0.28em;
    font-weight: 400;
    color: var(--text-sub);
    vertical-align: super;
    margin-left: 0.08em;
    letter-spacing: 0;
}

.logo span {
    color: var(--ember);
    text-shadow:
        0 0 80px rgba(201, 106, 63, 0.08),
        0 2px 30px rgba(0, 0, 0, 0.4);
}

.tagline {
    font-size: 0.62rem;
    font-weight: 400;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--text-sub);
    margin-bottom: 2.8rem;
}

/* ── Divider ── */

.divider {
    width: 100px;
    height: 2px;
    margin: 0 auto 2.8rem;
    position: relative;
    border-radius: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--ember-deep) 15%,
        var(--ember) 50%,
        var(--ember-deep) 85%,
        transparent);
    box-shadow:
        0 0 18px rgba(201, 106, 63, 0.1),
        0 0 4px rgba(201, 106, 63, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.divider::after {
    content: '';
    position: absolute;
    top: -1px; left: 0;
    width: 28%; height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-200%);
    animation: shimmer 16s ease-in-out 5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-200%); opacity: 0; }
    4% { opacity: 0.5; }
    35% { opacity: 1; }
    55% { opacity: 0.5; }
    75% { transform: translateX(500%); opacity: 0; }
    100% { transform: translateX(500%); opacity: 0; }
}

.divider::before {
    content: '';
    position: absolute;
    inset: -4px -10px;
    background: radial-gradient(ellipse at 50% 50%, rgba(201, 106, 63, 0.06), transparent 70%);
    animation: glowPulse 7s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

/* ── Enter button ── */

.enter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--text-sub);
    background: transparent;
    border: 1px solid rgba(201, 106, 63, 0.08);
    border-radius: 6px;
    padding: 0.8rem 2.2rem 0.8rem 1.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: color 0.5s, border-color 0.5s, box-shadow 0.5s, transform 0.5s;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.enter-btn::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%; right: 50%;
    height: 1px;
    background: var(--ember);
    box-shadow: 0 0 8px rgba(201, 106, 63, 0.3);
    transition: left 0.5s cubic-bezier(0.22, 1, 0.36, 1), right 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.enter-btn:hover {
    color: var(--text-bright);
    border-color: rgba(201, 106, 63, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.enter-btn:hover::after { left: 15%; right: 15%; }
.enter-btn:active { transform: translateY(0); transition: transform 0.1s; }

.enter-btn svg {
    width: 15px; height: 15px;
    stroke: currentColor; fill: none;
    stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

/* ══════ MODAL ══════ */

.overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(5, 5, 8, 0.88);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
}

.overlay.open { opacity: 1; visibility: visible; }

.panel {
    width: 440px; max-width: 94vw;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    overflow: hidden;
    transform: translateY(10px) scale(0.99); opacity: 0;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s;
    position: relative;
    box-shadow:
        0 50px 120px rgba(0, 0, 0, 0.8),
        0 16px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.overlay.open .panel { transform: translateY(0) scale(1); opacity: 1; }

.panel-accent {
    height: 2px;
    background: linear-gradient(90deg,
        transparent 8%,
        var(--ember-deep) 25%,
        var(--ember-bright) 50%,
        var(--ember-deep) 75%,
        transparent 92%);
    box-shadow: 0 0 14px rgba(201, 106, 63, 0.12);
}

.panel::after {
    content: '';
    position: absolute;
    top: 2px; left: 15%; right: 15%; height: 90px;
    background: radial-gradient(ellipse at 50% 0%, rgba(201, 106, 63, 0.025), transparent 70%);
    pointer-events: none;
}

.panel-head {
    padding: 2.2rem 2.2rem 0;
    display: flex; justify-content: space-between; align-items: flex-start;
    position: relative; z-index: 1;
}

.panel-brand {
    font-family: 'Playfair Display', serif;
    font-size: 0.62rem; font-weight: 600;
    color: var(--ember);
    letter-spacing: 0.14em;
    margin-bottom: 0.7rem;
}

.panel-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem; font-weight: 600;
    color: #fff; line-height: 1.25;
    margin-bottom: 0.45rem;
}

.panel-desc {
    font-size: 0.76rem; font-weight: 300;
    color: var(--text-sub); line-height: 1.5;
}

.close-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-mute);
    cursor: pointer; padding: 0.4rem;
    border-radius: 8px; display: flex;
    transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.close-btn:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.close-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── Form ── */

.panel-form { padding: 2rem 2.2rem 1.4rem; position: relative; z-index: 1; }
.form-group { margin-bottom: 1.3rem; }

.form-label {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.58rem; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text-sub); margin-bottom: 0.55rem;
}

.form-label svg {
    width: 12px; height: 12px;
    stroke: currentColor; fill: none;
    stroke-width: 1.5; opacity: 0.5;
}

.input-wrap { position: relative; }

.input-wrap::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%; right: 50%;
    height: 2px;
    background: linear-gradient(90deg, var(--ember-deep), var(--ember-bright), var(--ember-deep));
    box-shadow: 0 0 8px rgba(201, 106, 63, 0.2);
    transition: left 0.5s cubic-bezier(0.22, 1, 0.36, 1), right 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 0 0 6px 6px;
    z-index: 2;
}

.input-wrap:focus-within::after { left: 0; right: 0; }

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-size: 0.86rem; font-weight: 400;
    color: var(--text-bright); outline: none;
    transition: border-color 0.35s, box-shadow 0.35s, background 0.35s;
}

.form-input:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.form-input:focus {
    border-color: rgba(201, 106, 63, 0.25);
    box-shadow: 0 0 0 3px rgba(201, 106, 63, 0.04);
    background: rgba(255, 255, 255, 0.03);
}

.form-input::placeholder { color: var(--text-mute); font-weight: 300; }

/* ── Submit button ── */

.form-submit {
    width: 100%; margin-top: 0.6rem;
    padding: 0.9rem;
    background: linear-gradient(180deg,
        #da8a58 0%,
        var(--ember-bright) 20%,
        var(--ember) 55%,
        var(--ember-deep) 100%);
    border: none; border-radius: 8px;
    color: var(--ember-text);
    font-size: 0.86rem; font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer; position: relative; overflow: hidden;
    transition: box-shadow 0.4s, transform 0.4s;
    box-shadow:
        0 4px 16px rgba(201, 106, 63, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.form-submit::after {
    content: '';
    position: absolute;
    top: 0; left: -120%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.form-submit:hover {
    box-shadow:
        0 8px 32px rgba(201, 106, 63, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.form-submit:hover::after { left: 120%; }

.form-submit:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(201, 106, 63, 0.12),
        inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* ── Panel footer ── */

.panel-foot {
    padding: 1rem 2.2rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}

.panel-foot svg {
    width: 11px; height: 11px;
    stroke: var(--text-mute); fill: none;
    stroke-width: 1.5; opacity: 0.45;
}

.panel-foot span {
    font-size: 0.56rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300; color: var(--text-mute);
    letter-spacing: 0.05em;
}

.panel-foot .dot {
    width: 2px; height: 2px;
    border-radius: 50%; background: var(--text-mute);
}

/* ══════ SYSTEM STATUS ══════ */

.sys-status {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1;
    display: flex; align-items: center; gap: 0.45rem;
    opacity: 0;
    animation: fadeIn 2s ease 3s forwards;
}

.sys-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.3);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

.sys-label, .sys-version {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300; color: var(--text-mute); letter-spacing: 0.08em;
}

.sys-label { font-size: 0.52rem; }

.sys-version {
    position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 1;
    font-size: 0.5rem;
    opacity: 0;
    animation: fadeIn 2s ease 3.2s forwards;
}

/* ══════ RESPONSIVE ══════ */

@media (max-width: 480px) {
    .logo { font-size: 3rem; }
    .panel-head, .panel-form, .panel-foot { padding-left: 1.5rem; padding-right: 1.5rem; }
}
