/* General */
:root {
    --color-bg: #f3eadf;
    --color-surface: #fbfaf6;
    --color-surface-strong: #ffffff;
    --color-text: #202528;
    --color-muted: #6d7271;
    --color-border: #e4e0d7;
    --color-primary: #2f5d78;
    --color-primary-dark: #183144;
    --color-ink: #14191c;
    --color-header: rgba(24, 49, 68, 0.92);
    --shadow-soft: 0 18px 45px rgba(20, 25, 28, 0.08);
    --shadow-card: 0 14px 35px rgba(20, 25, 28, 0.08);
    --radius-large: 28px;
    --radius-medium: 18px;
    --container-width: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    padding: 0;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(47, 95, 91, 0.08), transparent 34rem),
        var(--color-bg);
    color: var(--color-text);
    font-family: "Work Sans", Arial, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin: 0;
}

h1,
h2,
h3 {
    color: var(--color-ink);
    letter-spacing: -0.04em;
}

h1 {
    display: block;
    font-size: clamp(2.4rem, 7vw, 5.5rem);
    line-height: 0.95;
}

h2 {
    display: block;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 600;
    line-height: 1.08;
}

p {
    max-width: 72ch;
    padding: 0;
    color: var(--color-text);
    font-size: clamp(1rem, 1.4vw, 1.22rem);
    line-height: 1.75;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

a:hover {
    color: var(--color-primary);
}

ul {
    padding: 0;
    margin: 0;
    list-style-type: none;
}

button {
    border: none;
    background: none;
    font: inherit;
}

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

.main {
    min-height: calc(100vh - 72px);
    margin-top: 72px;
}

.container,
.articles-section,
.articles {
    width: min(calc(100% - 48px), var(--container-width));
    margin-right: auto;
    margin-left: auto;
}

[v-cloak] {
    display: none;
}

.bold {
    font-weight: 700;
}

:target {
    scroll-margin-top: 104px;
}

/* Header */
.navbar {
    position: fixed;
    z-index: 1030;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    height: 72px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    background: var(--color-header);
    color: white;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(24, 49, 68, 0.16);
    transition: all 0.4s;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 clamp(20px, 4vw, 48px);
}

.title {
    color: white;
    font-size: clamp(1.35rem, 1.8vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    text-decoration: none;
}

.title:hover {
    color: #d9c799;
}

.header-links {
    display: flex;
    gap: 8px;
    align-items: center;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.header-links a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: #fff;
}

.header-links a:hover {
    border-color: rgba(217, 199, 153, 0.7);
    background: rgba(255, 255, 255, 0.08);
    color: #d9c799;
}

/* Footer */
footer {
    position: relative;
    z-index: 111;
    padding: 56px 0 28px;
    background: var(--color-header);
    color: rgba(255, 255, 255, 0.68);
}

.footer {
    width: min(calc(100% - 48px), var(--container-width));
    margin-right: auto;
    margin-left: auto;
}

.footer p {
    max-width: none;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.98rem;
    line-height: 1.75;
}

.footer-title {
    margin-bottom: 16px;
    color: #fff;
    font-size: 1.35rem;
}

hr {
    height: 1px;
    margin: 28px 0 18px;
    border: 0;
    background: rgba(255, 255, 255, 0.16);
}

/* Home page */
.image-section {
    position: relative;
    display: grid;
    min-height: min(640px, calc(100vh - 80px));
    overflow: hidden;
    place-items: center;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    isolation: isolate;
}

.image-section::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(14, 24, 28, 0.74), rgba(23, 56, 59, 0.3)),
        radial-gradient(circle at 70% 28%, rgba(217, 199, 153, 0.22), transparent 18rem);
    content: "";
}

.home-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(calc(100% - 48px), 920px);
    color: white;
    text-align: center;
}

.home-title h1 {
    order: 1;
    font-family: "Space Grotesk", "Work Sans", Arial, sans-serif;
    font-size: clamp(2.9rem, 6.8vw, 6rem);
    font-weight: 600;
    letter-spacing: -0.065em;
    line-height: 0.88;
    color: white;
    text-wrap: balance;
    text-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.home-kicker {
    order: 2;
    display: inline-flex;
    margin-top: 40px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.articles-section {
    margin-top: 72px;
    margin-bottom: 80px;
}

.intro-card {
    display: grid;
    gap: 22px;
    padding: clamp(24px, 4vw, 48px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-large);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-soft);
}

.intro-card p {
    max-width: 80ch;
    color: var(--color-muted);
}

.section-title {
    margin: 58px 0 26px;
    text-align: left;
}

/* Articles */
.articles {
    margin-top: 48px;
    margin-bottom: 80px;
}

.articles h1,
.articles-section h2 {
    margin-bottom: 30px;
}

.article-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(220px, 38%) 1fr;
    gap: clamp(18px, 3vw, 34px);
    align-items: center;
    padding: clamp(16px, 2.6vw, 26px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-large);
    background: var(--color-surface-strong);
    box-shadow: var(--shadow-card);
    color: var(--color-text);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.article-card:hover {
    border-color: rgba(47, 95, 91, 0.3);
    box-shadow: 0 22px 55px rgba(20, 25, 28, 0.12);
    color: var(--color-text);
    transform: translateY(-4px);
}

.article-card + .article-card {
    margin-top: 24px;
}

.article-card img {
    width: 100%;
    height: 260px;
    border-radius: 22px;
    object-fit: cover;
}

.article-card__content {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 14px;
    min-width: 0;
}

.article-card__content h3 {
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    line-height: 1.12;
}

.article-card p {
    color: var(--color-muted);
}

.read-article {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-top: 20px;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--color-primary);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
}

.read-article:hover {
    background: var(--color-primary-dark);
    color: white;
}

/* Article */
.article-page {
    width: 100%;
}

.article-section {
    position: relative;
    min-height: 100vh;
    padding-left: 220px;
}

.article-heading {
    position: fixed;
    z-index: 90;
    top: 96px;
    left: 250px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    max-width: min(760px, calc(100vw - 300px));
    padding: 8px;
    border: 1px solid rgba(228, 224, 215, 0.72);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(20, 25, 28, 0.07);
}

.article-title {
    padding: 6px 10px;
    color: var(--color-primary-dark);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.chapter-title {
    padding: 6px 10px;
    border-left: 1px solid rgba(47, 95, 91, 0.18);
    color: var(--color-muted);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0;
}

.scrollHalf {
    position: relative;
    margin-top: 160px;
    margin-bottom: 100px;
}

.scrollHalf__grupo {
    transition: opacity 180ms ease-in-out;
}

.scrollHalf__grupo__imagen {
    overflow: hidden;
    height: 360px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-large);
    background-color: var(--color-surface);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: var(--shadow-card);
}

.scrollHalf__grupo__contenido {
    padding: 0 clamp(24px, 3vw, 46px);
}

.scrollHalf__grupo__contenido p {
    max-width: 760px;
    color: var(--color-text);
}

.scrollHalf__grupo__contenido p + p {
    margin-top: 1.2em;
}

.scrollHalf__grupo[data-scroll="out"] {
    opacity: 0;
}

.scrollHalf__grupo[data-scroll="in"] {
    opacity: calc(var(--visible-y) * 2.5);
}

.summary {
    position: fixed;
    z-index: 101;
    top: 71px;
    left: 0;
    width: 220px;
    height: calc(100vh - 71px);
    padding: 28px 18px;
    overflow-y: auto;
    border-right: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    box-shadow: 10px 0 30px rgba(20, 25, 28, 0.06);
    font-size: 0.92rem;
    font-weight: 700;
}

.summary li + li {
    margin-top: 8px;
}

.summary a {
    display: block;
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--color-muted);
    line-height: 1.35;
}

.summary a:hover {
    background: rgba(47, 95, 91, 0.08);
    color: var(--color-primary);
}

.summary a.is-active {
    background: rgba(47, 95, 91, 0.14);
    color: var(--color-primary-dark);
    box-shadow: inset 0 0 0 1px rgba(47, 95, 91, 0.14);
}

.summary a.is-active:hover {
    background: rgba(47, 95, 91, 0.2);
    color: var(--color-primary-dark);
}

.enter {
    left: 0;
    opacity: 1;
}

.open-summary {
    position: fixed;
    top: 72px;
    left: 10px;
}

.after-section {
    position: relative;
    z-index: 100;
    width: calc(100% + 220px);
    margin-left: -220px;
    padding: clamp(28px, 5vw, 64px) clamp(24px, 5vw, 72px) clamp(28px, 5vw, 64px) calc(220px + clamp(24px, 5vw, 72px));
    border-top: 1px solid rgba(228, 224, 215, 0.7);
    background: linear-gradient(180deg, rgba(247, 243, 237, 0.2), var(--color-bg));
}

.prev-next {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 36px;
}

.prev-next:empty {
    display: none;
}

.chapter-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 104px;
    padding: 20px 22px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.88);
    color: var(--color-primary-dark);
    box-shadow: var(--shadow-card);
}

.chapter-link--next {
    align-items: flex-end;
    text-align: right;
}

.chapter-link--next:only-child {
    grid-column: 2;
}

.chapter-link span {
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.chapter-link strong {
    color: var(--color-ink);
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    line-height: 1.2;
}

.chapter-link:hover {
    border-color: rgba(47, 95, 91, 0.28);
    background: var(--color-surface-strong);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.reference {
    font-size: 1rem;
}

.reference h2,
h2.reference {
    margin-bottom: 18px;
    font-size: clamp(1.4rem, 2vw, 2rem);
}

.reference p {
    max-width: 88ch;
    padding: 14px 0;
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

@media screen and (min-width: 900px) {
    .scrollHalf {
        --article-image-left: 260px;
        --article-image-width: min(32vw, 500px);
        --article-column-gap: clamp(18px, 2.5vw, 40px);
        --article-right-gap: clamp(24px, 4vw, 72px);
    }

    .scrollHalf__grupo {
        margin-bottom: clamp(48px, 7vh, 88px);
    }

    .scrollHalf__grupo__imagen {
        position: fixed;
        top: 164px;
        left: var(--article-image-left);
        width: var(--article-image-width);
        height: calc(100vh - 228px);
    }

    .scrollHalf__grupo__contenido {
        margin: 0 var(--article-right-gap) 0 calc(var(--article-image-width) + var(--article-column-gap));
        padding-top: 4px;
    }
}

@media screen and (max-width: 899px) {
    .main {
        margin-top: 72px;
    }

    .navbar {
        height: 72px;
    }

    .article-section {
        padding-left: 0;
    }

    .article-heading,
    .summary {
        position: static;
    }

    .article-heading {
        max-width: none;
        margin: 28px 24px 12px;
    }

    .summary {
        width: min(calc(100% - 48px), var(--container-width));
        height: auto;
        max-height: none;
        margin: 24px auto 0;
        padding: 16px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-medium);
    }

    .summary li {
        display: inline-block;
    }

    .scrollHalf {
        width: min(calc(100% - 48px), var(--container-width));
        margin: 32px auto 72px;
    }

    .scrollHalf__grupo {
        display: grid;
        gap: 24px;
        margin-bottom: 56px;
        opacity: 1 !important;
    }

    .scrollHalf__grupo__contenido {
        padding: 0;
    }

    .after-section {
        width: 100%;
        margin-left: 0;
        padding: clamp(24px, 4vw, 52px);
    }
}

@media screen and (max-width: 720px) {
    .container,
    .articles-section,
    .articles,
    .footer,
    .home-title {
        width: min(calc(100% - 32px), var(--container-width));
    }

    .nav-container {
        padding: 0 16px;
    }

    .image-section {
        min-height: 520px;
    }

    .articles-section {
        margin-top: 40px;
        margin-bottom: 56px;
    }

    .article-card {
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

    .article-card img {
        height: 220px;
    }

    .prev-next {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .chapter-link,
    .chapter-link--next:only-child {
        grid-column: auto;
        width: 100%;
    }
}

@media screen and (max-width: 520px) {
    .header-links a {
        min-height: 36px;
        padding: 0 12px;
    }

    .title {
        font-size: 1.35rem;
    }

    .intro-card {
        border-radius: 22px;
    }

    .scrollHalf__grupo__imagen {
        height: 260px;
        border-radius: 22px;
    }
}