:root {
    --ink-950: #07080d;
    --ink-900: #0b0d14;
    --ink-850: #11141c;
    --ink-800: #1a1e28;
    --ink-700: #232833;
    --text: #eef0f5;
    --text-2: #a3a9b8;
    --text-3: #7a8296;
    --line: rgba(238, 240, 245, 0.09);
    --line-strong: rgba(238, 240, 245, 0.16);
    --accent: #d6a15f;
    --accent-ink: #1b140c;
    --font: "IBM Plex Sans", system-ui, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --radius-control: 8px;
    --radius-panel: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--ink-950);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

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

ol {
    padding: 0;
    list-style: none;
}

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--ink-950);
    border-bottom: 1px solid var(--line);
}

.scroll-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(var(--scroll, 0));
    transform-origin: left;
    opacity: 0.85;
    pointer-events: none;
}

.nav-shell {
    max-width: 1200px;
    height: 64px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.brand-name {
    font-size: 17px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.brand-name span {
    color: var(--text-3);
    font-weight: 400;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    position: relative;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 140ms var(--ease);
}

.nav-links a[href^="#"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -7px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms var(--ease);
}

.nav-links a[href^="#"].is-active::after {
    transform: scaleX(1);
}

.nav-links a:hover {
    color: var(--text);
}

.nav-discord {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-discord i {
    font-size: 16px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease), transform 120ms var(--ease);
}

.button:active {
    transform: translateY(1px);
}

.button-primary {
    background: var(--text);
    color: var(--ink-950);
}

.button-primary:hover {
    background: #ffffff;
}

.button-secondary {
    background: var(--ink-850);
    border-color: var(--line);
    color: var(--text);
}

.button-secondary:hover {
    background: var(--ink-800);
    border-color: var(--line-strong);
}

.button-nav {
    min-height: 34px;
    padding: 0 16px;
    font-size: 13px;
    background: transparent;
    border-color: var(--line);
    color: var(--text);
}

.button-nav:hover {
    background: var(--ink-850);
    border-color: var(--line-strong);
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
}

.nav-toggle i {
    font-size: 16px;
}

.hero {
    position: relative;
    min-height: 680px;
    height: calc(100svh - 64px);
    max-height: 860px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: var(--ink-950);
}

.hero-media {
    position: absolute;
    inset: 0;
    background: var(--ink-900);
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 42%;
    animation: hero-image-in 1200ms var(--ease) both;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(7, 8, 13, 0.97) 0%, rgba(7, 8, 13, 0.88) 34%, rgba(7, 8, 13, 0.34) 62%, rgba(7, 8, 13, 0.05) 100%),
        linear-gradient(0deg, rgba(7, 8, 13, 0.62) 0%, rgba(7, 8, 13, 0) 42%);
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 96px 32px 144px;
}

.hero-copy {
    max-width: 560px;
}

.hero-copy > .kicker,
.hero-copy > h1,
.hero-copy > .hero-lede,
.hero-copy > .hero-actions,
.hero-copy > .hero-meta {
    animation: hero-rise 700ms var(--ease) both;
}

.hero-copy > h1 {
    animation-delay: 60ms;
}

.hero-copy > .hero-lede {
    animation-delay: 120ms;
}

.hero-copy > .hero-actions {
    animation-delay: 180ms;
}

.hero-copy > .hero-meta {
    animation-delay: 240ms;
}

.kicker {
    margin-bottom: 16px;
    color: var(--text-3);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

h1 {
    max-width: 18ch;
    font-size: clamp(40px, 3.8vw, 56px);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.025em;
}

.hero-lede {
    max-width: 34rem;
    margin-top: 20px;
    color: var(--text-2);
    font-size: 18px;
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 20px;
    color: var(--text-3);
    font-family: var(--mono);
    font-size: 12px;
}

.hero-meta a {
    color: var(--text-2);
    text-decoration: none;
    border-bottom: 1px solid var(--line-strong);
}

.hero-meta a:hover {
    color: var(--text);
}

.hero-frame {
    position: absolute;
    inset: 20px;
    z-index: 1;
    pointer-events: none;
}

.frame-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--accent);
    border-style: solid;
    opacity: 0.8;
}

.frame-corner-tl {
    top: 0;
    left: 0;
    border-width: 1px 0 0 1px;
}

.frame-corner-tr {
    top: 0;
    right: 0;
    border-width: 1px 1px 0 0;
}

.frame-corner-bl {
    bottom: 0;
    left: 0;
    border-width: 0 0 1px 1px;
}

.frame-corner-br {
    bottom: 0;
    right: 0;
    border-width: 0 1px 1px 0;
}

.section {
    padding: 96px 0;
    scroll-margin-top: 80px;
}

.showcase,
.log {
    border-top: 1px solid var(--line);
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 48px;
    margin-bottom: 48px;
}

.section-head .kicker {
    margin-bottom: 12px;
}

h2 {
    font-size: 32px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.015em;
}

.section-lede {
    max-width: 34rem;
    color: var(--text-2);
    font-size: 15px;
    line-height: 1.6;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 64px;
}

.feature-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 16px;
    padding: 24px 0;
    border-top: 1px solid var(--line);
}

.feature-row.is-featured {
    grid-column: 1 / -1;
    padding: 32px 0;
}

.feature-number {
    padding-top: 4px;
    color: var(--text-3);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.5;
}

.feature-row h3 {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
}

.feature-row.is-featured h3 {
    font-size: 22px;
    letter-spacing: -0.01em;
}

.feature-row p {
    max-width: 68ch;
    margin-top: 8px;
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.6;
}

.feature-row.is-featured p {
    max-width: 72ch;
    font-size: 15px;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
}

.compare-wide {
    grid-column: 1 / -1;
}

.compare-media {
    --split: 50%;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--ink-900);
}

.compare-media:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.compare-after,
.compare-before {
    position: absolute;
    inset: 0;
}

.compare-after,
.compare-before img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compare-before {
    clip-path: inset(0 calc(100% - var(--split)) 0 0);
}

.compare-media::before,
.compare-media::after {
    position: absolute;
    bottom: 12px;
    z-index: 2;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(7, 8, 13, 0.78);
    color: var(--text-2);
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.4;
    pointer-events: none;
}

.compare-media::before {
    content: "Original";
    left: 12px;
}

.compare-media::after {
    content: "ReForge";
    right: 12px;
}

.compare-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--split);
    z-index: 2;
    width: 1px;
    background: var(--accent);
    pointer-events: none;
}

.compare-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transform: translate(-50%, -50%);
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--ink-850);
    color: var(--text);
    transition: border-color 140ms var(--ease);
}

.compare-media:hover .compare-handle {
    border-color: var(--accent);
}

.compare-handle i {
    font-size: 16px;
}

.compare-range {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
    -webkit-appearance: none;
    appearance: none;
}

.compare figcaption {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: baseline;
    padding-top: 12px;
}

.compare-index {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 12px;
}

.compare-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
}

.compare-meta {
    color: var(--text-3);
    font-family: var(--mono);
    font-size: 12px;
}

.log-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 64px;
}

.log-column {
    min-width: 0;
    border-top: 1px solid var(--line-strong);
    padding-top: 20px;
}

.log-column-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.log-column h3 {
    font-size: 16px;
    font-weight: 500;
}

.log-column-head a {
    color: var(--text-3);
    font-size: 13px;
    text-decoration: none;
}

.log-column-head a:hover {
    color: var(--text);
}

.log-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.log-item-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.log-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.log-title:hover {
    color: var(--accent);
}

.log-date,
.log-meta {
    color: var(--text-3);
    font-family: var(--mono);
    font-size: 12px;
}

.log-meta {
    margin-top: 4px;
}

.log-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
}

.log-sha {
    flex-shrink: 0;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 12px;
    text-decoration: none;
}

.log-message {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-empty {
    padding: 12px 0;
    color: var(--text-3);
    font-size: 14px;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 48px 0;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px 48px;
    align-items: start;
}

.footer-brand p {
    max-width: 28rem;
    margin-top: 12px;
    color: var(--text-2);
    font-size: 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.footer-links a {
    color: var(--text-2);
    font-size: 13px;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-meta {
    grid-column: 1 / -1;
    max-width: 70ch;
    color: var(--text-3);
    font-size: 12px;
    line-height: 1.6;
}

.js .reveal {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 450ms var(--ease), transform 450ms var(--ease);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.js .reveal.scrub {
    --reveal: 0;
    opacity: var(--reveal);
    transform: translate3d(0, calc((1 - var(--reveal)) * 24px), 0);
    transition: none;
    will-change: opacity, transform;
}

.log-item {
    animation: log-in 320ms var(--ease) both;
}

.log-item:nth-child(2) {
    animation-delay: 40ms;
}

.log-item:nth-child(3) {
    animation-delay: 80ms;
}

.log-item:nth-child(4) {
    animation-delay: 120ms;
}

.js .nav-links.is-open {
    animation: menu-in 180ms var(--ease);
}

@keyframes hero-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hero-image-in {
    from {
        opacity: 0.65;
        transform: scale(1.03);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes log-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes menu-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 960px) {
    .section-head {
        display: block;
    }

    .section-lede {
        margin-top: 16px;
    }

    .feature-list,
    .showcase-grid,
    .log-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .feature-row.is-featured,
    .compare-wide {
        grid-column: auto;
    }

    .feature-row.is-featured {
        padding: 24px 0;
    }

    .hero {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        min-height: 0;
    }

    .hero::after {
        display: none;
    }

    .hero-inner {
        order: 1;
        padding: 56px 32px;
    }

    .hero-media {
        position: relative;
        inset: auto;
        order: 2;
        height: 360px;
    }

    .hero-media img {
        object-position: center 40%;
    }
}

@media (max-width: 760px) {
    .nav-shell {
        height: 60px;
        padding: 0 20px;
    }

    .js .nav-toggle {
        display: inline-flex;
    }

    .nav-shell {
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .nav-links {
        position: static;
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        gap: 8px 20px;
        padding-top: 8px;
    }

    .js .nav-shell {
        height: 60px;
        min-height: 0;
        flex-wrap: nowrap;
        padding-top: 0;
        padding-bottom: 0;
    }

    .js .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: auto;
        gap: 4px;
        padding: 16px 20px 24px;
        background: var(--ink-950);
        border-bottom: 1px solid var(--line);
    }

    .js .nav-links.is-open {
        display: flex;
    }

    .nav-links a {
        min-height: 40px;
        display: flex;
        align-items: center;
    }

    .nav-links .button-nav {
        margin-top: 8px;
        justify-content: center;
    }

    .hero {
        min-height: 0;
    }

    .hero-media {
        height: 300px;
    }

    .hero-media img {
        object-position: center 40%;
    }

    .hero-inner {
        padding: 56px 20px;
    }

    h1 {
        max-width: 20ch;
        font-size: 36px;
    }

    .hero-lede {
        font-size: 16px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-frame {
        inset: 12px;
    }

    .frame-corner {
        width: 14px;
        height: 14px;
    }

    .section {
        padding: 64px 0;
    }

    .section-inner,
    .footer-inner {
        padding: 0 20px;
    }

    h2 {
        font-size: 28px;
    }

    .feature-row {
        grid-template-columns: 32px minmax(0, 1fr);
        column-gap: 12px;
    }

    .feature-row.is-featured h3 {
        font-size: 20px;
    }

    .compare figcaption {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .compare-meta {
        grid-column: 2;
    }

    .footer-inner {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-copy > *,
    .hero-media img,
    .log-item {
        animation: none !important;
    }

    .js .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
