@font-face {
    font-family: Ubuntu;
    src: url("../fonts/Ubuntu-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Ubuntu;
    src: url("../fonts/Ubuntu-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --background: #17191c;
    --foreground: #eeece7;
    --muted: #aaa8a3;
    --surface: #24272b;
    --border: #3b3d40;
    --accent: #f08174;
    --selected: #bf4940;
    --selected-hover: #aa3f37;
    --selected-text: #fff8f2;
    font-family: Ubuntu, sans-serif;
    line-height: 1.6;
}

:root[data-theme="light"] {
    color-scheme: light;
    --background: #f3f0e9;
    --foreground: #242526;
    --muted: #625e59;
    --surface: #e9e5dd;
    --border: #d4cfc5;
    --accent: #ac3029;
    --selected: #a7322b;
    --selected-hover: #912b25;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--background);
    color: var(--foreground);
}

[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }

button, a { -webkit-tap-highlight-color: transparent; }

button {
    font: inherit;
    cursor: pointer;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.site-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px 28px;
}

.site-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    min-height: 86px;
    border-bottom: 1px solid var(--border);
}

[data-theme-control] { display: inline-flex; }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: var(--surface);
    color: var(--foreground);
}

.theme-toggle:hover { background: var(--border); }
:root:not([data-theme="light"]) .theme-icon-moon { display: none; }
:root[data-theme="light"] .theme-icon-sun { display: none; }

.language-toggle {
    padding: 10px 14px;
    border: 0;
    border-radius: 4px;
    background: var(--surface);
    color: var(--foreground);
    font-size: 14px;
}

.language-toggle:hover, .action-secondary:hover { background: var(--border); }

.hero {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 64px;
    align-items: center;
    padding: 56px 0 48px;
}

.intro h1 {
    margin-bottom: 24px;
    font-size: clamp(40px, 5vw, 62px);
    line-height: 1.12;
}

.intro p {
    max-width: 390px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.75;
}

.intro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 28px;
}

.action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 15px;
}

.action-primary {
    background: var(--selected);
    color: var(--selected-text);
}

.action-primary:hover { background: var(--selected-hover); }

.action-secondary {
    background: var(--surface);
    color: var(--foreground);
    border: 0;
}

.wheel-frame {
    justify-self: center;
    width: min(calc(100% + 48px), 498px);
    min-width: 0;
    margin: -24px;
    padding: 24px;
    overflow: clip;
}

.wheel {
    position: relative;
    width: min(100%, 450px);
    margin: 0 auto;
    aspect-ratio: 1;
    border-radius: 50%;
    isolation: isolate;
}

.wheel-segment {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--surface);
    color: var(--foreground);
    transform: rotate(var(--angle)) translate(var(--segment-x, 0px), var(--segment-y, 0px)) scale(var(--segment-scale, 1));
    clip-path: polygon(50% 50%, 0 0, 50% 0);
    mask: url("../images/menu-segment.svg") center / 100% 100% no-repeat;
    transition: transform 220ms ease, background-color 160ms ease, color 160ms ease;
}

.segment-label {
    position: absolute;
    left: 35.5%;
    top: 14.6%;
    transform: translate(-50%, -50%) rotate(calc(-1 * var(--angle)));
    font-size: clamp(11px, 1.2vw, 14px);
    white-space: nowrap;
}

a.wheel-segment:focus-visible, a.wheel-segment:active {
    --segment-scale: 1.06;
    --segment-x: -3px;
    --segment-y: -7px;
    background: var(--selected);
    color: var(--selected-text);
    z-index: 1;
}

@media (hover: hover) {
    a.wheel-segment:hover {
        --segment-scale: 1.06;
        --segment-x: -3px;
        --segment-y: -7px;
        background: var(--selected);
        color: var(--selected-text);
        z-index: 1;
    }
}

.wheel-segment:focus-visible .segment-label {
    outline: 2px solid currentColor;
    outline-offset: 5px;
    border-radius: 2px;
}

.wheel-segment.is-empty { opacity: 0.45; }

.wheel-avatar {
    position: absolute;
    z-index: 2;
    inset: 32%;
    width: 36%;
    height: 36%;
    border: 3px solid var(--border);
    border-radius: 50%;
    object-fit: cover;
}

.content {
    border-top: 1px solid var(--border);
    scroll-margin-top: 24px;
}

.content-section {
    padding: 48px 0;
    scroll-margin-top: 24px;
}

.content-section:first-child { padding-top: 24px; }
.content-section + .content-section { border-top: 1px solid var(--border); }
.content-section:focus { outline: none; }
.content-section:focus-visible h2 { color: var(--accent); }

.content-section h2 {
    margin-bottom: 26px;
    font-size: 26px;
    line-height: 1.3;
}

.text-section, .collaboration {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 40px;
    align-items: baseline;
}

.text-section h2 { margin-bottom: 0; }
.text-section > .link-row { align-self: start; margin-top: -7px; }

.project {
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    gap: 40px;
    align-items: center;
}

.project-image {
    display: block;
    width: 100%;
    height: auto;
    background: transparent;
}

.project-copy h3 {
    margin-bottom: 12px;
    font-size: 26px;
    line-height: 1.25;
}

.project-copy p, .text-copy p {
    color: var(--muted);
    line-height: 1.75;
}

.project-copy p { margin-bottom: 18px; }

.collaboration {
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.collaboration h3 a {
    display: block;
    max-width: 220px;
}

.collaboration-logo { display: block; width: 100%; height: auto; }
.collaboration p { max-width: 700px; color: var(--muted); line-height: 1.75; }

.discord-copy { margin-top: 20px; }
.copy-status { min-height: 1.75em; margin-top: 12px; font-size: 14px; }

.text-copy { max-width: 700px; }

.link-row, .site-footer, .site-footer nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.link-row {
    gap: 12px;
    margin-left: -10px;
}

.link-row a, .site-footer a, .policy-page a {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 4px;
}

.link-row a:hover, .link-row a:focus-visible,
.site-footer a:hover, .site-footer a:focus-visible,
.policy-page a:hover, .policy-page a:focus-visible {
    background: var(--surface);
}

.site-footer {
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.site-footer nav { gap: 4px; }

.skip-link {
    position: absolute;
    z-index: 2;
    top: 12px;
    left: 12px;
    padding: 10px 16px;
    border-radius: 4px;
    background: var(--surface);
    transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.policy-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 64px 24px 40px;
}

.policy-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.policy-title {
    font-size: clamp(28px, 5vw, 38px);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.policy-meta, .policy-footer {
    color: var(--muted);
    font-size: 14px;
}

.policy-back {
    align-self: flex-start;
    margin-left: -10px;
}

.policy-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

.policy-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: -10px;
}

.policy-section {
    margin-top: 28px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.policy-section h3 { margin-bottom: 8px; }

.policy-section p + p, .policy-section ul { margin-top: 12px; }

.policy-section ul { padding-left: 24px; }

.policy-section li + li { margin-top: 6px; }

.policy-section a {
    display: inline;
    padding: 2px 0;
    overflow-wrap: anywhere;
}

.policy-footer {
    margin-top: 36px;
    text-align: center;
}

@media (max-width: 760px) {
    .site-shell { padding: 0 24px 24px; }
    .site-header { min-height: 76px; }

    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 36px 0;
    }

    .intro h1 { font-size: clamp(38px, 8vw, 52px); }
    .intro p { max-width: 520px; }
    .wheel-frame { max-width: 458px; }
    .wheel { max-width: 410px; }
    .segment-label { font-size: clamp(11px, 2.7vw, 13px); }

    .project {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .content-section { padding: 32px 0; }
    .text-section, .collaboration { grid-template-columns: 1fr; gap: 18px; }
    .site-footer, .site-footer nav { align-items: flex-start; }
    .policy-section { padding: 20px; }
}

@media (pointer: coarse) {
    .link-row a, .site-footer a { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .wheel-segment { transition: none; }
}
