@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #eefaf7;
    --surface: rgba(250, 255, 253, .94);
    --surface-solid: #fafffd;
    --ink: #063d35;
    --muted: #4c6f68;
    --line: rgba(6, 61, 53, .14);
    --accent: #25c9ae;
    --deep: #0a5047;
    --shadow: 0 22px 70px rgba(6, 61, 53, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 9% 8%, rgba(37, 201, 174, .22), transparent 28rem),
        radial-gradient(circle at 92% 35%, rgba(10, 80, 71, .13), transparent 34rem),
        linear-gradient(145deg, #f6fffc, var(--bg));
    font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.binary-rain { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }

.site-header {
    position: sticky;
    z-index: 20;
    top: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(1180px, calc(100% - 32px));
    min-height: 66px;
    margin: 12px auto 0;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(250, 255, 253, .88);
    box-shadow: 0 14px 42px rgba(6, 61, 53, .1);
    backdrop-filter: blur(18px);
}
.mini-brand { flex: 0 0 auto; text-decoration: none; }
.mini-brand span, .brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(145deg, var(--deep), #0f766e);
    box-shadow: 0 8px 24px rgba(6, 61, 53, .22);
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: -.04em;
}
.tabs { display: flex; gap: 5px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.header-tabs { flex: 1; }
.tab {
    min-height: 44px;
    padding: 10px 15px;
    border: 0;
    border-radius: 13px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
    transition: color .2s ease, background .2s ease, transform .2s ease;
}
.tab:hover { color: var(--ink); background: rgba(37, 201, 174, .1); }
.tab.is-active { color: #fff; background: var(--deep); box-shadow: 0 8px 20px rgba(6, 61, 53, .16); }
.header-actions { flex: 0 0 auto; }
.quiet-link { display: inline-grid; place-items: center; min-height: 44px; padding: 8px 12px; color: var(--muted); font-size: .73rem; font-weight: 800; text-decoration: none; }
.quiet-link:hover { color: var(--ink); }

.site-shell { width: min(1180px, calc(100% - 32px)); margin: 36px auto 76px; }
.hero { margin: 0 auto 34px; }
.hero-cover {
    display: block;
    width: 100%;
    aspect-ratio: 2.5 / 1;
    border: 1px solid rgba(6, 61, 53, .16);
    border-radius: 28px;
    object-fit: cover;
    object-position: center;
    box-shadow: var(--shadow);
}
.hero-subtitle {
    max-width: 760px;
    margin: 22px auto 0;
    padding: 14px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--muted);
    background: var(--surface);
    font-size: .98rem;
    line-height: 1.65;
    text-align: center;
}
.sections { position: relative; }
.link-section[hidden] { display: none; }
.link-section.is-active { animation: section-in .38s ease both; }
@keyframes section-in { from { opacity: 0; transform: translateY(8px); } }
.link-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.resource-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    min-height: 118px;
    padding: 20px 19px 18px 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 22px;
    color: #fff;
    background: var(--button-color);
    box-shadow: 0 13px 32px color-mix(in srgb, var(--button-color) 24%, transparent);
    text-decoration: none;
    isolation: isolate;
    transition: transform .22s ease, filter .22s ease, box-shadow .22s ease;
}
.resource-button::before {
    content: '01 10 01';
    position: absolute;
    z-index: -1;
    right: -8px;
    bottom: -9px;
    color: rgba(255, 255, 255, .07);
    font: 800 2.8rem/1 ui-monospace, monospace;
    letter-spacing: -.16em;
    transform: rotate(-7deg);
}
.resource-button:hover { transform: translateY(-4px); filter: brightness(1.06); box-shadow: 0 18px 38px color-mix(in srgb, var(--button-color) 31%, transparent); }
.resource-button:focus-visible, .tab:focus-visible, .quiet-link:focus-visible, button:focus-visible, .join-button:focus-visible, .quiet-button:focus-visible, .logout-link:focus-visible {
    outline: 4px solid rgba(37, 201, 174, .35);
    outline-offset: 3px;
}
.resource-copy { display: grid; gap: 7px; min-width: 0; }
.resource-copy strong { font-size: .93rem; line-height: 1.28; }
.resource-copy small { color: rgba(255,255,255,.76); font-size: .72rem; line-height: 1.45; }
.resource-copy .resource-author { color: rgba(255,255,255,.92); font-size: .65rem; font-weight: 800; letter-spacing: .01em; }
.resource-meta { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.access-badge { padding: 6px 8px; border: 1px solid rgba(255,255,255,.25); border-radius: 9px; color: rgba(255,255,255,.8); font-size: .54rem; font-weight: 700; white-space: nowrap; }
.arrow { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: rgba(255,255,255,.15); font-size: 1rem; }
.empty-state { padding: 60px 24px; border: 1px dashed var(--line); border-radius: 24px; background: var(--surface); text-align: center; }
.empty-state span { color: var(--accent); font-weight: 800; letter-spacing: .18em; }
.empty-state p { margin: 10px 0 0; color: var(--muted); }
footer { width: min(1180px, calc(100% - 32px)); margin: 0 auto 34px; color: var(--muted); font-size: .7rem; text-align: center; }
footer > a { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; padding: 8px; font-weight: 700; text-decoration: none; }
.color-legend { padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.color-legend > strong { display: block; margin-bottom: 12px; color: var(--ink); }
.color-legend-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; }
.color-legend-items > span { display: inline-flex; align-items: center; gap: 6px; }
.color-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--legend-color); }

.access-page { display: grid; place-items: center; padding: 28px; }
.access-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
    width: min(1120px, 100%);
    min-height: min(680px, calc(100vh - 56px));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}
.access-cover { min-height: 420px; background: #b9eee3; }
.access-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 56% center; }
.access-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 5vw, 64px); background: rgba(250,255,253,.98); }
.access-card .brand-mark { margin-bottom: 28px; }
.eyebrow { margin: 0 0 10px; color: #0f766e; font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.access-card h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.04; letter-spacing: -.055em; }
.access-intro { margin: 20px 0 26px; color: var(--muted); font-size: .92rem; line-height: 1.7; }
.access-card code { padding: 2px 6px; border-radius: 6px; color: var(--ink); background: rgba(37,201,174,.12); }
.setup-list { display: grid; gap: 10px; margin: 0; padding-left: 24px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.vk-login-button, .join-button, .secondary-button, .quiet-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 52px;
    padding: 12px 16px;
    border: 0;
    border-radius: 15px;
    cursor: pointer;
    font-size: .83rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform .2s ease, filter .2s ease;
}
.vk-login-button { justify-content: flex-start; color: #fff; background: #0077ff; box-shadow: 0 14px 30px rgba(0,119,255,.2); }
.vk-login-button b { margin-left: auto; font-size: 1.2rem; }
.vk-logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #0077ff; background: #fff; font-size: .65rem; }
.join-button { color: #fff; background: var(--deep); }
.secondary-button { width: 100%; color: var(--ink); background: rgba(37,201,174,.16); }
.quiet-button { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.vk-login-button:hover, .join-button:hover, .secondary-button:hover, .quiet-button:hover { transform: translateY(-2px); filter: brightness(1.03); }
.vk-login-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .65; }
.access-actions { display: grid; gap: 10px; }
.vk-login-error { min-height: 20px; margin: 14px 0 0; color: #9b2c2c; font-size: .72rem; line-height: 1.45; }
.privacy-note { margin: 22px 0 0; color: var(--muted); font-size: .65rem; line-height: 1.55; }
.logout-link { align-self: flex-start; margin-top: 20px; color: var(--muted); font-size: .72rem; font-weight: 700; }

@media (max-width: 1023px) {
    .link-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .access-shell { grid-template-columns: 1fr 390px; }
}
@media (max-width: 760px) {
    .access-page { padding: 14px; place-items: start center; }
    .access-shell { grid-template-columns: 1fr; min-height: 0; border-radius: 24px; }
    .access-cover { min-height: 0; aspect-ratio: 3 / 2; }
    .access-cover img { object-position: left center; }
    .access-card { padding: 30px 24px 34px; }
}
@media (max-width: 679px) {
    .site-header { width: calc(100% - 16px); top: 8px; margin-top: 8px; padding: 7px; gap: 7px; border-radius: 17px; }
    .mini-brand span { width: 44px; height: 44px; border-radius: 12px; }
    .header-actions { margin-left: auto; }
    .header-tabs { order: 3; flex-basis: 100%; }
    .tab { flex: 0 0 auto; }
    .site-shell { width: calc(100% - 20px); margin-top: 24px; }
    .hero { margin-bottom: 24px; }
    .hero-cover { aspect-ratio: 3 / 2; border-radius: 21px; object-position: left center; }
    .hero-subtitle { margin-top: 14px; font-size: .86rem; }
    .link-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .resource-button { min-height: 102px; padding: 17px; border-radius: 18px; }
    .resource-meta { align-self: stretch; flex-direction: column-reverse; justify-content: space-between; align-items: flex-end; }
    .access-badge { display: none; }
    .color-legend { padding: 16px; }
    .color-legend-items { justify-content: flex-start; }
}
@media (max-width: 360px) {
    .access-page { padding: 8px; }
    .access-shell { border-radius: 19px; }
    .access-card { padding: 26px 19px 30px; }
    .access-card h1 { font-size: 1.9rem; }
    .site-shell { width: calc(100% - 14px); }
    .resource-copy strong { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .binary-rain { display: none; }
}
