* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2rem;
    --space-5: 3rem;
}

body {
    font-family: monospace;
    background: #0c0c0c;
    color: #e6e6e6;
    min-height: 100vh;
}

body.home-page {
    min-height: 100vh;
    overflow-x: hidden;
    overscroll-behavior: none;
    --space-1: 0.5rem;
    --space-2: 0.9rem;
    --space-3: 1.3rem;
    --space-4: 2rem;
    --space-5: 3rem;
    --content-max-width: 100%;
}

.three-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.home-page .three-container {
    position: relative;
    inset: auto;
    width: clamp(240px, 55vmin, 420px);
    height: auto;
    aspect-ratio: 1 / 1;
    margin: var(--space-1) auto;
    z-index: 1;
    pointer-events: auto;
}

.home-page .hero-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: var(--space-2);
    width: 100%;
    margin: 0 auto;
}

.home-page .hero-button {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    border: 2px solid #ffffff;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    background: transparent;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.home-page .hero-button:hover,
.home-page .hero-button:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateY(-2px);
}

.three-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.home-page .three-container canvas {
    pointer-events: auto;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: var(--content-max-width, 640px);
    padding: 0;
}

.hero-card {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-3);
}

.hero-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) 0;
    width: 100%;
}

.section-heading {
    display: flex;
    justify-content: center;
    padding: var(--space-2) 0;
    width: 100%;
    text-align: center;
}

.section-heading h2 {
    margin: 0;
}

.hero-above-fold {
    justify-content: flex-start;
}

h1 {
    font-size: 3rem;
    font-weight: normal;
    margin: 0;
    width: 100%;
}

#hero-title,
#about-title,
#join-title {
    color: #ffffff;
}

#hero-title {
    font-size: 1.75rem;
}

body.home-page p {
    font-size: 1rem;
}

.intro {
    max-width: 100%;
    margin: 0;
    color: #b8b8b8;
    width: 100%;
}

.hero-card .divider + .intro {
    margin-top: var(--space-1);
}

.webring-intro {
    margin-top: var(--space-1);
}

.webrings {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: var(--space-2);
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    margin-bottom: var(--space-3);
    justify-items: center;
    position: relative;
}

.webrings::before,
.webrings::after {
    content: "";
    position: absolute;
    background: #e6e6e6;
    pointer-events: none;
    z-index: 0;
}

.webrings::before {
    width: 2px;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.webrings::after {
    height: 2px;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 520px) {
    .webrings {
        grid-template-columns: 1fr;
    }

    .webrings::before,
    .webrings::after {
        content: none;
    }
}

.section {
    width: 100%;
    max-width: var(--content-max-width, 640px);
    margin: 0 auto 0;
    text-align: center;
}

.section h2 {
    font-size: 1.6rem;
    margin-bottom: var(--space-2);
}

.section p {
    color: #b8b8b8;
    margin-bottom: var(--space-3);
    line-height: 1.6;
    text-align: left;
}

/* Ensure inline links in section copy are readable on dark background */
.section a,
.section a:visited {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.section a:hover,
.section a:focus-visible {
    color: #ffffff;
    background: transparent;
}

.section p:last-child {
    margin-bottom: 0;
}

.divider {
    width: 100%;
    max-width: var(--content-max-width, 640px);
    border: 0;
    border-top: 1px solid #ffffff;
    margin: 1rem auto;
    flex-shrink: 0;
}

.hero-card .divider {
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section .divider {
    margin: 1rem auto;
    max-width: none;
    width: 100%;
}

@media (min-width: 640px) {
    body.home-page {
        --content-max-width: calc(60vw - 1.75rem);
    }
}

@media (min-width: 1024px) {
    body.home-page {
        --content-max-width: calc(40vw - 1.25rem);
    }
}

.webring-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    width: 100%;
    min-height: 180px;
    padding: var(--space-3) var(--space-2);
    background: transparent;
    border: none;
    text-decoration: none;
    color: #ffffff;
    font-size: 1.05rem;
    text-align: center;
    transition: transform 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 1;
}

.webring-logo {
    width: clamp(110px, 30vw, 160px);
    height: clamp(110px, 30vw, 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 16px;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: transparent;
}

.webring-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.webring-logo canvas {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.webring-logo--model {
    overflow: hidden;
}

.webring-name {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: #ffffff;
}

.webring-card:hover,
.webring-card:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.webring-card:hover .webring-logo,
.webring-card:focus-visible .webring-logo {
    color: #f5f5f5;
    background: transparent;
}

.webring-card:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}

a:hover {
    background: #e6e6e6;
    color: #0c0c0c;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1a1a1a;
}
::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #444444 #1a1a1a;
}
