:root {
    color-scheme: light dark;
    --canvas: #f7f6ef;
    --ink: #202e29;
    --accent: #34654f;
    --text: var(--tg-theme-text-color, var(--ink));
    --line: color-mix(in srgb, var(--text) 20%, transparent);
}

@media (prefers-color-scheme: dark) {
    :root {
        --canvas: #18201d;
        --ink: #eeefe7;
        --accent: #b9d5a4;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--tg-theme-bg-color, var(--canvas));
    color: var(--text);
    font-family: "Inter", system-ui, sans-serif;
}

main {
    max-width: 49rem;
    margin: 0 auto;
    padding: max(clamp(1rem, 6vh, 4rem), env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px))
             max(1rem, env(safe-area-inset-right))
             max(2rem, env(safe-area-inset-bottom))
             max(1rem, env(safe-area-inset-left));
}

.cover {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(1.75rem, 6vw, 3.5rem);
    border-radius: 1.25rem;
    background: #233e35;
    color: #fff6dd;
}

.cover::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 75%;
    height: 160%;
    right: -14%;
    top: -35%;
    transform: rotate(-31deg);
    border-radius: 50%;
    background: radial-gradient(ellipse at 62% 55%, #182f28 9%, transparent 9.5%),
                repeating-radial-gradient(ellipse at 62% 55%, #98af78 0 1%, #476a50 1.4% 3.5%, #294838 4% 7%);
}

h1 {
    margin: 0;
    font-family: "Instrument Serif", Georgia, serif;
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: -0.065em;
}

.cover h1 { font-size: clamp(4.25rem, 13vw, 7.6rem); }
.cover em { display: block; padding-left: 0.32em; }

.sections {
    display: grid;
    margin-top: clamp(1.25rem, 4vw, 2.25rem);
    border-top: 1px solid var(--line);
}

.entry, .back-link {
    color: inherit;
    text-decoration: none;
}

.entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 4.75rem;
    padding: 0.9rem 0.5rem;
    border-bottom: 1px solid var(--line);
    font-size: clamp(1.15rem, 3vw, 1.5rem);
    font-weight: 550;
}

.mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    background: #dae6c5;
    color: #31483a;
}

.mark::before {
    content: "";
    width: 1.1rem;
    height: 0.72rem;
    border: 2px solid;
    border-radius: 50%;
    transform: rotate(-38deg);
}

.entry:nth-child(2) .mark { background: #eed9bd; }
.entry:nth-child(2) .mark::before {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 0;
    transform: rotate(45deg);
}

.entry:nth-child(3) .mark { background: #d1dcd9; }
.entry:nth-child(3) .mark::before {
    width: 0.9rem;
    height: 0.9rem;
    transform: none;
    background: linear-gradient(90deg, transparent 44%, currentColor 44% 56%, transparent 56%);
}

.arrow {
    margin-left: auto;
    font-size: 1.5rem;
    font-weight: 400;
}

.entry:hover, .back-link:hover { color: var(--tg-theme-link-color, var(--accent)); }
a:focus-visible { outline: 3px solid var(--tg-theme-link-color, var(--accent)); outline-offset: 2px; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    color: var(--tg-theme-link-color, var(--accent));
}

.section-title {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    font-size: clamp(3rem, 9vw, 5rem);
}
