/* transactology.com - Renaissance cartographic study of transactions */

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

:root {
    --ledger-dark: #2A2A3A;
    --ink-blue: #3A4A68;
    --steel-blue: #6B8BA4;
    --copper-accent: #B07848;
    --patina-green: #68947C;
    --vellum: #F4F0E8;
    --highlight-warm: #FAF4EC;
    --inset-cool: #E4DCD4;
}

body {
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    line-height: 1.8;
    color: var(--ledger-dark);
    background-color: var(--vellum);
    overflow-x: hidden;
}

/* === Neomorphic utilities === */
.neo-raised {
    box-shadow:
        -4px -4px 8px var(--highlight-warm),
        4px 4px 8px var(--inset-cool);
    border-radius: 12px;
}

.neo-inset {
    box-shadow:
        inset -4px -4px 8px var(--highlight-warm),
        inset 4px 4px 8px var(--inset-cool);
    border-radius: 12px;
}

.neo-raised-text {
    text-shadow:
        -2px -2px 4px var(--highlight-warm),
        2px 2px 4px var(--inset-cool);
}

/* === Navigation === */
.top-nav {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 56px;
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 0 32px;
    background-color: var(--vellum);
    z-index: 100;
}

.nav-link {
    font-family: 'Source Serif 4', serif;
    font-weight: 600;
    font-size: 0.875rem;
    font-variant: small-caps;
    color: var(--ink-blue);
    text-decoration: none;
    position: relative;
    background-image: linear-gradient(var(--copper-accent), var(--copper-accent));
    background-position: 0 100%;
    background-size: 0% 2px;
    background-repeat: no-repeat;
    transition: background-size 0.4s ease-out, color 0.3s ease;
    padding-bottom: 2px;
}

.nav-link:hover,
.nav-link.active {
    background-size: 100% 2px;
    color: var(--ledger-dark);
}

/* === Central Column === */
.central-column {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === Title Page === */
.title-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 56px;
}

.main-title {
    font-family: 'Zilla Slab', serif;
    font-weight: 600;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--ledger-dark);
    letter-spacing: 0.005em;
    text-align: center;
    padding: 16px 32px;
    opacity: 0;
    animation: fadeInUp 1s 0.3s ease forwards;
}

.main-subtitle {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    color: var(--ink-blue);
    text-align: center;
    margin-top: 16px;
    opacity: 0;
    animation: fadeInUp 0.8s 0.8s ease forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Flowing Curves === */
.flowing-curve {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: block;
    height: 60px;
}

.curve-hero {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
}

.curve-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease-out;
}

.flowing-curve.animate .curve-path {
    stroke-dashoffset: 0;
}

.curve-footer {
    height: 40px;
    margin-bottom: 24px;
}

/* === Marginal Icons === */
.margin-icon {
    position: absolute;
    width: 60px;
    height: 60px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.margin-icon.visible {
    opacity: 1;
}

.icon-left {
    left: calc(50% - 420px);
}

.icon-right {
    right: calc(50% - 420px);
}

.title-page .icon-left { top: 40%; }
.title-page .icon-right { top: 55%; }

/* === Content Sections === */
.content-section {
    padding: clamp(48px, 8vh, 96px) 24px;
    position: relative;
}

.content-section .flowing-curve {
    margin-bottom: 32px;
}

.content-section .margin-icon {
    top: 50%;
    transform: translateY(-50%);
}

.section-header {
    font-family: 'Zilla Slab', serif;
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--ledger-dark);
    letter-spacing: 0.005em;
    margin-bottom: 24px;
}

.section-body {
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    line-height: 1.8;
    color: var(--ledger-dark);
    margin-bottom: 20px;
    max-width: 65ch;
}

/* === Applications Grid === */
.applications-section {
    padding: clamp(48px, 8vh, 96px) 24px;
}

.applications-section .central-column {
    margin-bottom: 48px;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 880px;
    margin: 0 auto;
}

.app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background-color: var(--vellum);
    transition: box-shadow 0.4s ease, transform 0.3s ease;
    cursor: default;
}

.app-card:hover {
    box-shadow:
        -6px -6px 12px var(--highlight-warm),
        6px 6px 12px var(--inset-cool);
    transform: translateY(-2px);
}

.app-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

.app-label {
    font-family: 'Zilla Slab', serif;
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--steel-blue);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* === Footer === */
.colophon {
    max-width: 720px;
    margin: 40px auto 60px;
    padding: 40px 32px;
    background-color: var(--vellum);
}

.colophon-content {
    text-align: center;
}

.colophon-text {
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--steel-blue);
    margin-bottom: 12px;
}

.colophon-secondary {
    font-family: 'Zilla Slab', serif;
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--ink-blue);
    letter-spacing: 0.04em;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    .main-title, .main-subtitle {
        opacity: 1;
        animation: none;
    }
    .curve-path {
        stroke-dashoffset: 0;
        transition: none;
    }
    .margin-icon {
        opacity: 1;
        transition: none;
    }
    .nav-link {
        transition: none;
    }
}

/* === Responsive === */
@media (max-width: 900px) {
    .icon-left, .icon-right {
        display: none;
    }
    .app-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .top-nav {
        gap: 16px;
        padding: 0 16px;
        width: 100%;
        left: 0;
        transform: none;
        overflow-x: auto;
    }
    .app-grid {
        grid-template-columns: 1fr;
    }
}
