/* Home: one left-aligned column inside the workspace. The wordmark, the search
   field and the navigation list share the same left edge and the same 4px grid,
   so the page reads as typography and alignment rather than effects.
   Type scale: 12 / 13 / 14 / 15 / 40. Radii: 6 (controls), 8 (fields, menus). */

#homePage {
    position: absolute;
    top: 40%;
    left: calc(50% + var(--sb-w, 0px) / 2);
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    z-index: 10;
    width: min(560px, calc(100vw - var(--sb-w, 0px) - 48px));
}

@property --noc-search-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@keyframes nocRise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes nocSearchOrbit {
    to { --noc-search-angle: 360deg; }
}

/* Homepage side ad units: pinned to the viewport edges, clear of the content
   column. Hidden below 1400px and while browsing a proxied page. */
.ad-side {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    min-height: 250px;
    z-index: 3;
    overflow: hidden;
    pointer-events: auto;
}
.ad-side-left { left: 16px; }
.ad-side-right { right: 16px; }

@media (max-width: 1400px) {
    .ad-side { display: none; }
}
body.browsing .ad-side,
body.noc-overlay-open .ad-side {
    display: none;
}

.title {
    margin: 0 0 28px;
    font-family: var(--font);
    font-size: 40px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.035em;
    color: #f2f1f5;
    white-space: nowrap;
    user-select: none;
    opacity: 0;
    animation: nocRise 0.6s var(--ease-out) 0.05s forwards;
}

.search-box {
    position: relative;
    z-index: 5; /* keeps the suggestions above the rows that follow */
    width: 100%;
    opacity: 0;
    animation: nocRise 0.6s var(--ease-out) 0.12s forwards;
}

.search-wrap {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 0;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.search-wrap::after {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 0;
    padding: 1px;
    background: conic-gradient(from var(--noc-search-angle), transparent 0deg 276deg, var(--accent-2) 310deg, var(--accent) 330deg, transparent 348deg 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0.75;
    pointer-events: none;
    animation: nocSearchOrbit 5.5s linear infinite;
}
.search-wrap > * { position: relative; z-index: 1; }
.search-wrap:hover { border-color: var(--line-3); }
.search-wrap:focus-within { border-color: rgba(255, 255, 255, 0.34); background: #0f0e14; }

.search-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    stroke-width: 1.6;
    color: var(--fg-3);
}

.search-field {
    flex: 1;
    align-self: stretch; /* the whole bar is a tap target, not just the text line */
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--fg);
    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
}
.search-field::placeholder { color: var(--fg-3); }

/* a real shortcut (Ctrl+L focuses this field), shown only while the field is idle */
.search-hint {
    flex-shrink: 0;
    padding: 2px 6px;
    border: 1px solid var(--line-2);
    border-radius: 0;
    color: var(--fg-3);
    font-family: inherit;
    font-size: 11px;
    line-height: 16px;
}
.search-wrap:focus-within .search-hint,
.search-field:not(:placeholder-shown) ~ .search-hint { display: none; }

/* quick links: one quiet row under the search. Application shortcuts live in the sidebar. */
.quick-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
    opacity: 0;
    animation: nocRise 0.6s var(--ease-out) 0.2s forwards;
}
.ql-label { margin-right: 8px; color: var(--fg-3); font-size: 13px; }
.ql-items { display: flex; flex-wrap: wrap; gap: 2px; }

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: var(--fg-2);
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.link-btn:hover { background: rgba(255, 255, 255, 0.055); color: var(--fg); }
.link-btn:active { background: rgba(255, 255, 255, 0.09); }
.link-btn:focus-visible { outline: 2px solid rgba(168, 152, 232, 0.6); outline-offset: -2px; }
.link-btn::after {
    content: "";
    width: 10px;
    height: 10px;
    background: currentColor;
    opacity: 0.45;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><path d='M2.5 7.5l5-5M3.5 2.5h4v4'/></svg>") center / contain no-repeat;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><path d='M2.5 7.5l5-5M3.5 2.5h4v4'/></svg>") center / contain no-repeat;
}

@media (max-width: 560px) {
    #homePage { top: 38%; width: calc(100vw - 32px); }
    .title { font-size: 34px; margin-bottom: 24px; }
    .search-wrap { height: 50px; }
    .search-field { font-size: 16px; }
    .search-hint { display: none; }
    .quick-links { flex-wrap: wrap; margin-top: 16px; }
    .link-btn { height: 40px; }
}

@media (max-height: 640px) {
    #homePage { top: 46%; }
}

/* footer: low-priority links, tucked into the corner of the workspace */
.home-foot {
    position: fixed;
    left: calc(var(--sb-w, 0px) + 24px);
    right: 24px;
    bottom: 14px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2px;
    z-index: 5;
    font-size: 12px;
    opacity: 0;
    animation: nocRise 0.6s var(--ease-out) 0.4s forwards;
}
body.browsing .home-foot,
body.noc-overlay-open .home-foot { display: none; }

.home-foot a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 0;
    color: var(--fg-3);
    text-decoration: none;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.home-foot a:hover { color: var(--fg); background: rgba(255, 255, 255, 0.05); }
.home-foot a:focus-visible { outline: 2px solid rgba(168, 152, 232, 0.6); outline-offset: -2px; }
.home-foot .discord-chip-icon { width: 13px; height: 13px; }
.ver { padding: 6px 0 6px 8px; color: var(--fg-3); opacity: 0.7; font-variant-numeric: tabular-nums; user-select: none; }

@media (max-width: 720px) {
    .home-foot { left: 16px; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .title, .search-box, .quick-links, .home-foot { animation: none; opacity: 1; }
    .search-wrap::after { animation: none; opacity: 0.2; }
}

html.perf-lite .search-wrap::after,
html.perf-min .search-wrap::after { animation: none; opacity: 0.2; }

.welcome-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 5, 9, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    animation: slideDown 0.4s var(--ease) forwards;
}

.welcome-banner.hidden {
    display: none;
}

.welcome-content {
    background: var(--panel);
    border: 1px solid var(--line-2);
    border-radius: 0;
    padding: 32px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.5s var(--ease) 0.1s forwards;
    opacity: 0;
}

.welcome-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--fg);
    margin: 0 0 8px 0;
}

.welcome-decoration {
    width: 200px;
    height: 40px;
    margin: 12px auto 20px;
    display: block;
    color: var(--accent-2);
    animation: slideUp 0.6s var(--ease) 0.15s forwards;
    opacity: 0;
}

.welcome-desc {
    font-size: 24px;
    font-weight: 500;
    color: var(--fg-2);
    margin: 0 0 20px 0;
    letter-spacing: 0.3px;
}

.welcome-desc .highlight {
    color: var(--accent);
    font-weight: 600;
}

.welcome-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 24px 0;
    text-align: left;
}

.info-section h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--fg-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px 0;
}

.info-section p {
    font-size: 13px;
    color: var(--fg-2);
    margin: 0;
}

.tech-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 12px;
    color: var(--fg-2);
}

.tech-list li {
    padding: 2px 0;
    line-height: 1.5;
}

.welcome-ok-btn {
    margin-top: 24px;
    padding: 10px 24px;
    background: var(--accent);
    color: #060509;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s var(--ease), transform 0.25s var(--ease);
    animation: slideUp 0.6s var(--ease) 0.3s forwards;
    opacity: 0;
}

.welcome-ok-btn:hover {
    background: var(--accent-2);
    transform: translateY(-2px);
}

.welcome-ok-btn:active {
    transform: translateY(0);
}

.ab-btn {
    position: absolute;
    top: 18px;
    left: 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px 7px 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0;
    color: var(--fg-2);
    font-size: 11px;
    font-family: 'JetBrains Mono', 'Space Mono', monospace;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    z-index: 5;
}
.ab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--fg);
}
.ab-btn svg { opacity: 0.9; }

.online-widget.outer {
    width: 220px;
    height: 140px;
    border-radius: 0;
    padding: 1px;
    background: radial-gradient(circle 200px at 0% 0%, rgba(255, 255, 255, 0.6), #0c0d0d);
    position: relative;
    margin: 28px auto 0;
}
.online-widget .dot {
    width: 5px;
    aspect-ratio: 1;
    position: absolute;
    background-color: #a898e8;
    box-shadow: 0 0 10px #a898e8;
    border-radius: 0;
    z-index: 2;
    right: 10%;
    top: 10%;
    animation: onlineMoveDot 6s linear infinite;
}
@keyframes onlineMoveDot {
    0%, 100% { top: 10%; right: 10%; }
    25% { top: 10%; right: calc(100% - 25px); }
    50% { top: calc(100% - 22px); right: calc(100% - 25px); }
    75% { top: calc(100% - 22px); right: 10%; }
}
.online-widget .card {
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: solid 1px #1c1d2d;
    background: radial-gradient(circle 240px at 0% 0%, #2a2b3f, #0c0d12);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-direction: column;
    color: var(--fg);
    overflow: hidden;
}
.online-widget .ray {
    width: 180px;
    height: 38px;
    border-radius: 0;
    position: absolute;
    background-color: #a898e8;
    opacity: 0.28;
    box-shadow: 0 0 50px #a898e8;
    filter: blur(10px);
    transform-origin: 10%;
    top: 0;
    left: 0;
    transform: rotate(40deg);
}
.online-widget .card .text {
    font-weight: 700;
    font-size: 2.6rem;
    line-height: 1;
    background: linear-gradient(45deg, #2a2336 4%, #fff, #2a2336);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
}
.online-widget .online-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-3);
    margin-top: 6px;
}
.online-widget .line {
    width: 100%;
    height: 1px;
    position: absolute;
    background-color: #2c2c3a;
}
.online-widget .topl {
    top: 10%;
    background: linear-gradient(90deg, #6b6580 30%, #1d1f2f 70%);
}
.online-widget .bottoml { bottom: 10%; }
.online-widget .leftl {
    left: 10%;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, #6b6580 30%, #22243a 70%);
}
.online-widget .rightl {
    right: 10%;
    width: 1px;
    height: 100%;
}

.search-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    display: none;
    flex-direction: column;
    padding: 4px;
    max-height: 320px;
    overflow-y: auto;
    background: #0d0c11;
    border: 1px solid var(--line-2);
    border-radius: 0;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.14s var(--ease), transform 0.14s var(--ease);
}
.search-suggest.open { display: flex; opacity: 1; transform: translateY(0); }

.suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--fg-2);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.suggest-item .si-icon { flex-shrink: 0; display: flex; color: var(--fg-3); }
.suggest-item .si-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-item:hover,
.suggest-item.active { background: rgba(255, 255, 255, 0.07); color: var(--fg); }

.noc-restore-chip {
    position: fixed;
    left: calc(50% + var(--sb-w, 0px) / 2);
    bottom: 56px;
    transform: translateX(-50%) translateY(8px);
    display: flex;
    align-items: center;
    padding: 3px;
    background: #121117;
    border: 1px solid var(--line-2);
    border-radius: 0;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.noc-restore-chip.visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.noc-restore-chip .nrc-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 10px;
    border-radius: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--fg-2);
    font-size: 13px;
    font-family: inherit;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.noc-restore-chip .nrc-main svg { color: var(--fg-3); flex-shrink: 0; }
.noc-restore-chip .nrc-main:hover { background: rgba(255, 255, 255, 0.07); color: var(--fg); }
.noc-restore-chip .nrc-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--fg-3);
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.noc-restore-chip .nrc-x:hover { background: rgba(255, 255, 255, 0.07); color: var(--fg); }
