html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

.history-page {
    min-height: 100vh;
    margin: 0;
    background-color: #fffdfb;
    background-image: url("../img/batik-pattern.svg"), radial-gradient(ellipse at 18% 12%, rgba(205, 163, 132, 0.28), transparent 44%);
    background-repeat: repeat, no-repeat;
    background-size: 140px 140px, auto;
    background-attachment: fixed, fixed;
    color: #28221e;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.history-page #navbar {
    border-bottom-color: transparent;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.history-page #navbar.shadow-md {
    border-bottom-color: rgba(139, 90, 43, 0.08);
    background: rgba(255, 253, 251, 0.82);
    box-shadow: 0 4px 18px rgba(62, 40, 28, 0.06);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.history-main {
    overflow: hidden;
}

.history-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 4vw, 3.5rem) 1.5rem 4.5rem;
    background: transparent;
}

.history-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(100%, 1160px);
    min-height: 390px;
    grid-template-columns: 0.92fr 1.08fr;
    align-items: center;
    gap: clamp(2.5rem, 7vw, 6rem);
    margin: 0 auto;
}

.history-hero-copy {
    max-width: 500px;
}

.history-eyebrow,
.history-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1rem;
    color: #8b5a2b;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.13em;
    line-height: 1.4;
}

.history-eyebrow span {
    width: 1.55rem;
    height: 1px;
    background: #a66d3a;
}

.history-hero h1 {
    margin: 0;
    color: #201a17;
    font-size: clamp(3.2rem, 6.5vw, 5.7rem);
    font-weight: 760;
    letter-spacing: -0.065em;
    line-height: 0.99;
}

.history-hero h1 em {
    color: #80341f;
    font-style: normal;
}

.history-hero-description {
    max-width: 430px;
    margin: 1.35rem 0 1.8rem;
    color: #6b625c;
    font-size: clamp(1rem, 1.6vw, 1.12rem);
    line-height: 1.75;
}

.history-primary-link {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1.15rem;
    border: 1px solid #783a25;
    border-radius: 999px;
    background: #783a25;
    color: #fffaf6;
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(120, 58, 37, 0.17);
    transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.history-primary-link:hover {
    transform: translateY(-2px);
    background: #642d1c;
    box-shadow: 0 12px 24px rgba(120, 58, 37, 0.22);
}

.history-hero-image-wrap {
    position: relative;
    min-width: 0;
    margin: 0;
    padding: 0 0.9rem 1rem 0;
}

.history-hero-image-wrap::before {
    position: absolute;
    z-index: -1;
    top: 1rem;
    right: 0;
    bottom: 0;
    left: 1rem;
    border: 1px solid rgba(139, 90, 43, 0.22);
    border-radius: 1.7rem;
    content: '';
}

.history-hero-image {
    display: block;
    width: 100%;
    height: clamp(280px, 35vw, 430px);
    border: 5px solid rgba(255, 255, 255, 0.76);
    border-radius: 1.55rem;
    background: #eee4dc;
    box-shadow: 0 22px 55px rgba(65, 43, 29, 0.16);
    object-fit: cover;
}

.history-hero-image-wrap figcaption {
    position: absolute;
    right: 1.8rem;
    bottom: 2rem;
    max-width: calc(100% - 3.5rem);
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    background: rgba(35, 27, 23, 0.78);
    color: white;
    font-size: 0.78rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.history-hero-image-wrap figcaption i {
    margin-right: 0.4rem;
    color: #e6b98f;
}

.history-hero-decoration {
    position: absolute;
    right: -5rem;
    bottom: -11rem;
    width: 23rem;
    height: 23rem;
    border: 1px solid rgba(128, 52, 31, 0.08);
    border-radius: 50%;
    box-shadow: 0 0 0 2rem rgba(128, 52, 31, 0.025), 0 0 0 4rem rgba(128, 52, 31, 0.02);
}

.history-contents {
    position: relative;
    z-index: 2;
    display: flex;
    width: min(calc(100% - 3rem), 1080px);
    min-height: 66px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: -1.35rem auto 0;
    padding: 0.55rem;
    border: 1px solid #eee4dc;
    border-radius: 999px;
    background: rgba(255, 253, 251, 0.94);
    box-shadow: 0 12px 35px rgba(55, 38, 28, 0.09);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.history-contents-label {
    padding: 0 0.8rem;
    color: #8b5a2b;
    font-size: 0.75rem;
    font-weight: 700;
}

.history-contents a {
    padding: 0.65rem 0.85rem;
    border-radius: 999px;
    color: #665b53;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 150ms ease, color 150ms ease;
}

.history-contents a:hover,
.history-contents a:focus-visible {
    outline: none;
    background: #f5e9df;
    color: #713a24;
}

.history-content {
    padding: 4.5rem 1.5rem 5rem;
    background: #fffdfb;
}

.history-content-inner {
    display: grid;
    width: min(100%, 1040px);
    gap: 1.5rem;
    margin: 0 auto;
}

.history-card {
    padding: clamp(1.4rem, 4vw, 3rem);
    border: 1px solid #eee5de;
    border-radius: 1.45rem;
    background: #fff;
    box-shadow: 0 12px 36px rgba(58, 39, 28, 0.055);
    scroll-margin-top: 6rem;
}

.history-introduction {
    border-left: 3px solid #a66739;
    background: linear-gradient(115deg, #fffaf6 0%, #fff 70%);
}

.history-introduction h2,
.history-story-heading h2,
.history-section-heading h2,
.history-references h2 {
    margin: 0;
    color: #29221e;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    font-weight: 720;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.history-introduction h2 {
    margin-bottom: 1.1rem;
}

.history-prose {
    color: #5f5751;
    font-size: 0.98rem;
    line-height: 1.9;
}

.history-introduction .history-prose {
    max-width: 850px;
}

.history-reference-inline {
    margin-top: 1rem;
    color: #776b62;
    font-size: 0.8rem;
    line-height: 1.7;
}

.history-reference-inline strong {
    color: #8b5a2b;
}

.history-reference-inline a {
    color: #7b3f27;
    text-decoration: underline;
    text-decoration-color: #d9b89e;
    text-underline-offset: 2px;
}

.history-story-heading {
    margin-bottom: 1.5rem;
}

.history-story-heading .history-section-kicker,
.history-section-heading .history-section-kicker {
    margin-bottom: 0.65rem;
}

.history-story-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: start;
    gap: clamp(1.5rem, 4vw, 3rem);
}

.history-story-figure {
    min-width: 0;
    margin: 0;
}

.history-story-image {
    display: block;
    width: 100%;
    max-height: 430px;
    aspect-ratio: 4 / 3;
    border-radius: 1.1rem;
    background: #f1e8e0;
    box-shadow: 0 12px 28px rgba(43, 31, 23, 0.12);
    object-fit: cover;
}

.history-story-figure figcaption {
    margin-top: 0.65rem;
    color: #8a7e75;
    font-size: 0.72rem;
    line-height: 1.5;
}

.history-section-heading {
    max-width: 620px;
    margin: 0 auto 2rem;
    text-align: center;
}

.history-section-heading p {
    margin: 0.75rem 0 0;
    color: #776b62;
    font-size: 0.92rem;
    line-height: 1.6;
}

.history-timeline-list {
    position: relative;
    display: grid;
    max-width: 790px;
    gap: 1.7rem;
    margin: 0 auto;
    padding-left: 1.4rem;
}

.history-timeline-list::before {
    position: absolute;
    top: 0.45rem;
    bottom: 0.5rem;
    left: 0.36rem;
    width: 1px;
    background: linear-gradient(#b8794d, #ead9cb 80%, transparent);
    content: '';
}

.history-timeline-item {
    position: relative;
    padding: 0 0 0.15rem 0.65rem;
}

.history-timeline-dot {
    position: absolute;
    top: 0.27rem;
    left: -1.36rem;
    width: 0.72rem;
    height: 0.72rem;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #8b5a2b;
    box-shadow: 0 0 0 1px #cba98f;
}

.history-timeline-item h3 {
    margin: 0 0 0.55rem;
    color: #5a351f;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.45;
}

.history-timeline-item .history-prose {
    margin: 0;
    font-size: 0.92rem;
}

.history-motif-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.history-motif-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #eee5de;
    border-radius: 1rem;
    background: #fffdfa;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.history-motif-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(58, 39, 28, 0.1);
}

.history-motif-image-wrap {
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #f1e8e0;
}

.history-motif-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}

.history-motif-card:hover .history-motif-image {
    transform: scale(1.04);
}

.history-motif-copy {
    padding: 1rem;
}

.history-motif-copy h3 {
    margin: 0;
    color: #603c27;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

.history-motif-copy p {
    margin: 0.5rem 0 0;
    color: #6f655e;
    font-size: 0.84rem;
    line-height: 1.65;
}

.history-motif-copy span {
    display: block;
    margin-top: 0.8rem;
    color: #94877d;
    font-size: 0.68rem;
    line-height: 1.5;
}

.history-closing {
    overflow: hidden;
    padding: clamp(2rem, 5vw, 3.6rem);
    border-radius: 1.5rem;
    background:
        radial-gradient(circle at 100% 0%, rgba(222, 175, 135, 0.2), transparent 36%),
        linear-gradient(125deg, #71351f, #421d18);
    color: #fffaf6;
    text-align: center;
}

.history-closing .history-section-kicker {
    color: #e9c8ad;
}

.history-closing h2 {
    margin: 0 auto 0.85rem;
    color: #fffaf6;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    font-weight: 720;
    letter-spacing: -0.03em;
}

.history-closing p {
    max-width: 780px;
    margin: 0 auto;
    color: rgba(255, 250, 246, 0.83);
    font-size: 0.96rem;
    line-height: 1.85;
}

.history-references {
    overflow: hidden;
    border: 1px solid #eee5de;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
}

.history-references summary {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    color: #4a3528;
    cursor: pointer;
    list-style: none;
}

.history-references summary::-webkit-details-marker {
    display: none;
}

.history-references summary strong,
.history-references summary small {
    display: block;
}

.history-references summary strong {
    font-size: 0.96rem;
    font-weight: 700;
}

.history-references summary small {
    margin-top: 0.2rem;
    color: #82766e;
    font-size: 0.78rem;
}

.history-references summary > i {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    place-items: center;
    border-radius: 50%;
    background: #f5e9df;
    color: #8b5a2b;
    font-size: 0.75rem;
    transition: transform 160ms ease;
}

.history-references[open] summary {
    border-bottom: 1px solid #eee5de;
}

.history-references[open] summary > i {
    transform: rotate(180deg);
}

.history-references ul {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 1rem 1.2rem 1.2rem;
    list-style: none;
}

.history-references li {
    overflow-wrap: anywhere;
    padding: 0.9rem 1rem;
    border: 1px solid #eee5de;
    border-radius: 0.8rem;
    background: #fff;
    color: #665c55;
    font-size: 0.8rem;
    line-height: 1.6;
}

.history-references li a {
    color: #7b3f27;
    text-decoration: underline;
    text-decoration-color: #d9b89e;
    text-underline-offset: 2px;
}

@media (max-width: 960px) {
    .history-hero-inner {
        grid-template-columns: 1fr 1fr;
        gap: 2.25rem;
    }

    .history-motif-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .history-hero {
        padding: 3rem 1.15rem 3.75rem;
    }

    .history-hero-inner {
        min-height: 0;
        grid-template-columns: 1fr;
        gap: 1.9rem;
    }

    .history-hero h1 {
        font-size: clamp(3rem, 14vw, 4.25rem);
    }

    .history-hero-description {
        margin: 1rem 0 1.35rem;
        font-size: 0.97rem;
    }

    .history-hero-image-wrap {
        padding-right: 0.6rem;
        padding-bottom: 0.7rem;
    }

    .history-hero-image {
        height: min(66vw, 320px);
        min-height: 215px;
        border-width: 4px;
        border-radius: 1.2rem;
    }

    .history-hero-image-wrap::before {
        top: 0.7rem;
        left: 0.7rem;
        border-radius: 1.2rem;
    }

    .history-hero-image-wrap figcaption {
        right: 1.25rem;
        bottom: 1.5rem;
        font-size: 0.68rem;
    }

    .history-contents {
        width: calc(100% - 1.5rem);
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.2rem;
        overflow-x: auto;
        margin-top: -1.1rem;
        padding: 0.45rem;
        border-radius: 1rem;
        scrollbar-width: none;
    }

    .history-contents::-webkit-scrollbar {
        display: none;
    }

    .history-contents-label {
        flex: 0 0 auto;
        padding: 0 0.55rem;
        font-size: 0.68rem;
    }

    .history-contents a {
        flex: 0 0 auto;
        padding: 0.58rem 0.65rem;
        font-size: 0.72rem;
    }

    .history-content {
        padding: 2.5rem 1rem 3rem;
    }

    .history-content-inner {
        gap: 1rem;
    }

    .history-card {
        padding: 1.25rem;
        border-radius: 1.05rem;
    }

    .history-prose {
        font-size: 0.91rem;
        line-height: 1.8;
    }

    .history-story-layout {
        grid-template-columns: 1fr;
        gap: 1.15rem;
    }

    .history-story-image {
        max-height: 310px;
    }

    .history-section-heading {
        margin-bottom: 1.5rem;
        text-align: left;
    }

    .history-timeline-list {
        gap: 1.35rem;
        padding-left: 1rem;
    }

    .history-timeline-list::before {
        left: 0.28rem;
    }

    .history-timeline-dot {
        left: -1.08rem;
    }

    .history-timeline-item {
        padding-left: 0.55rem;
    }

    .history-timeline-item h3 {
        font-size: 0.98rem;
    }

    .history-timeline-item .history-prose {
        font-size: 0.88rem;
    }

    .history-motif-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .history-motif-card {
        display: grid;
        grid-template-columns: minmax(105px, 0.8fr) minmax(0, 1.2fr);
        align-items: stretch;
    }

    .history-motif-image-wrap {
        min-height: 100%;
        aspect-ratio: auto;
    }

    .history-motif-copy {
        padding: 0.85rem;
    }

    .history-motif-copy h3 {
        font-size: 0.92rem;
    }

    .history-motif-copy p {
        font-size: 0.78rem;
    }

    .history-closing {
        padding: 1.65rem 1.25rem;
        border-radius: 1.1rem;
    }

    .history-closing p {
        font-size: 0.88rem;
    }

    .history-references {
        border-radius: 0.85rem;
    }

    .history-references summary {
        min-height: 64px;
        padding: 0.85rem 0.95rem;
    }

    .history-references ul {
        padding: 0.8rem 0.85rem 0.9rem;
    }
}

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

    .history-primary-link,
    .history-motif-card,
    .history-motif-image {
        transition: none;
    }
}
