/* ==========================================================================
   transactology.dev — Luxurious Cottagecore Digital Estate
   ========================================================================== */

/* Custom Properties */
:root {
    --deep-burgundy: #4A0E1B;
    --warm-cream: #F5EDE0;
    --claret-rose: #8B1A2B;
    --antique-brass: #C9A96E;
    --oxblood-black: #2C0A12;
    --parchment-tan: #E8D5B8;
    --honeyed-copper: #D4A574;

    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Cormorant Garamond', Garamond, 'Times New Roman', serif;
    --font-ui: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;

    --ease-gentle: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-draw: cubic-bezier(0.65, 0, 0.35, 1);
    --column-width: 680px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--deep-burgundy);
    background-color: var(--warm-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: rgba(44, 10, 18, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(201, 169, 110, 0.15);
}

.header-inner {
    max-width: var(--column-width);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.monogram {
    width: 36px;
    height: 36px;
    color: var(--antique-brass);
    flex-shrink: 0;
}

.monogram-svg {
    width: 100%;
    height: 100%;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-variant: small-caps;
    color: var(--warm-cream);
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--antique-brass);
    transition: width 400ms var(--ease-gentle);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--antique-brass);
    transition: color 400ms var(--ease-gentle);
}

/* ==========================================================================
   Title Card — Full Viewport Opening
   ========================================================================== */

.title-card {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--oxblood-black);
    overflow: hidden;
}

.title-card-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.title-svg {
    width: min(90vw, 800px);
    height: auto;
    margin-bottom: 1.5rem;
}

.title-text-stroke {
    fill: none;
    stroke: var(--antique-brass);
    stroke-width: 1;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawTitle 2.5s var(--ease-draw) forwards;
}

.title-text-fill {
    fill: var(--warm-cream);
    opacity: 0;
    animation: fadeInTitle 1s var(--ease-gentle) 2s forwards;
}

@keyframes drawTitle {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes fadeInTitle {
    to {
        opacity: 1;
    }
}

.title-subtitle {
    font-family: var(--font-ui);
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-variant: small-caps;
    color: var(--antique-brass);
    opacity: 0;
    animation: fadeInSubtitle 800ms var(--ease-gentle) 2.5s forwards;
    margin-bottom: 0.75rem;
}

.title-tagline {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--parchment-tan);
    opacity: 0;
    animation: fadeInSubtitle 800ms var(--ease-gentle) 2.8s forwards;
    margin-bottom: 3rem;
}

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

.scroll-chevron {
    opacity: 0;
    animation: fadeInSubtitle 800ms var(--ease-gentle) 3.2s forwards, pulseChevron 2.5s ease-in-out 4s infinite;
}

@keyframes pulseChevron {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(8px);
        opacity: 1;
    }
}

.bg-pattern {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.06;
    z-index: 1;
}

/* ==========================================================================
   SVG Dividers
   ========================================================================== */

.svg-divider {
    padding: 1.5rem 0;
    display: flex;
    justify-content: center;
    background-color: var(--warm-cream);
    overflow: hidden;
}

.svg-divider svg {
    width: min(90vw, 600px);
    height: auto;
}

.divider-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s var(--ease-draw);
}

.svg-divider.is-visible .divider-path {
    stroke-dashoffset: 0;
}

.divider-dot {
    opacity: 0;
    transition: opacity 600ms var(--ease-gentle) 1.5s;
}

.svg-divider.is-visible .divider-dot {
    opacity: 1;
}

.divider-line-left,
.divider-line-right {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.5s var(--ease-draw) 0.5s;
}

.svg-divider.is-visible .divider-line-left,
.svg-divider.is-visible .divider-line-right {
    stroke-dashoffset: 0;
}

/* Alternate divider backgrounds for sections between burgundy sections */
.folio-section[data-theme="burgundy"] + .svg-divider {
    background-color: var(--oxblood-black);
}

.folio-section[data-theme="burgundy"] + .svg-divider + .folio-section[data-theme="cream"] + .svg-divider {
    background-color: var(--warm-cream);
}

/* ==========================================================================
   Folio Sections
   ========================================================================== */

.folio-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(4rem, 8vh, 8rem) 2rem;
    position: relative;
}

.folio-section[data-theme="cream"] {
    background-color: var(--warm-cream);
    color: var(--deep-burgundy);
}

.folio-section[data-theme="burgundy"] {
    background-color: var(--oxblood-black);
    color: var(--warm-cream);
}

.folio-inner {
    max-width: var(--column-width);
    width: 100%;
    position: relative;
    padding: 3rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms var(--ease-gentle), transform 800ms var(--ease-gentle);
}

.folio-section.is-visible .folio-inner {
    opacity: 1;
    transform: translateY(0);
}

/* Corner Brackets */
.corner-bracket {
    position: absolute;
    width: 30px;
    height: 30px;
    opacity: 0;
}

.corner-bracket path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 600ms var(--ease-draw);
}

.corner-tl {
    top: 0;
    left: -20px;
}

.corner-tr {
    top: 0;
    right: -20px;
}

.corner-bl {
    bottom: 0;
    left: -20px;
}

.corner-br {
    bottom: 0;
    right: -20px;
}

.folio-section.is-visible .corner-bracket {
    opacity: 1;
    transition: opacity 200ms var(--ease-gentle);
}

.folio-section.is-visible .corner-tl path {
    stroke-dashoffset: 0;
    transition-delay: 200ms;
}

.folio-section.is-visible .corner-tr path {
    stroke-dashoffset: 0;
    transition-delay: 400ms;
}

.folio-section.is-visible .corner-bl path {
    stroke-dashoffset: 0;
    transition-delay: 600ms;
}

.folio-section.is-visible .corner-br path {
    stroke-dashoffset: 0;
    transition-delay: 800ms;
}

/* Chapter Numeral */
.chapter-numeral {
    text-align: center;
    margin-bottom: 1.5rem;
}

.chapter-numeral svg {
    width: 50px;
    height: 50px;
}

/* Folio Headings */
.folio-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.02em;
    text-align: center;
    margin-bottom: 2.5rem;
}

.folio-section[data-theme="cream"] .folio-heading {
    color: var(--deep-burgundy);
}

.folio-section[data-theme="burgundy"] .folio-heading {
    color: var(--warm-cream);
}

/* Folio Body */
.folio-body p {
    margin-bottom: 1.5rem;
}

.folio-body p:last-child {
    margin-bottom: 0;
}

/* Drop Caps */
.drop-cap {
    float: left;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 4rem;
    line-height: 0.8;
    padding-right: 0.15em;
    padding-top: 0.05em;
    color: var(--antique-brass);
}

/* Pull Quotes */
.pull-quote {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.35rem;
    line-height: 1.6;
    text-align: center;
    padding: 2rem 2.5rem;
    margin: 2.5rem -1rem;
    position: relative;
    border-left: none;
}

.pull-quote::before,
.pull-quote::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background-color: var(--antique-brass);
    margin: 0 auto;
}

.pull-quote::before {
    margin-bottom: 1.5rem;
}

.pull-quote::after {
    margin-top: 1.5rem;
}

.folio-section[data-theme="cream"] .pull-quote {
    color: var(--claret-rose);
}

.folio-section[data-theme="burgundy"] .pull-quote {
    color: var(--antique-brass);
}

/* ==========================================================================
   Principles Section
   ========================================================================== */

.principle-item {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
    border-left: 1px solid rgba(201, 169, 110, 0.3);
}

.principle-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
    color: var(--antique-brass);
}

.principle-item p {
    font-size: 1.05rem;
}

/* ==========================================================================
   Methodology Section
   ========================================================================== */

.method-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.02em;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.folio-section[data-theme="cream"] .method-heading {
    color: var(--claret-rose);
}

.folio-section[data-theme="burgundy"] .method-heading {
    color: var(--antique-brass);
}

/* ==========================================================================
   Folio Entries
   ========================================================================== */

.folio-entry {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(201, 169, 110, 0.2);
}

.folio-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.entry-date {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-variant: small-caps;
    color: var(--antique-brass);
    display: block;
    margin-bottom: 0.5rem;
}

.entry-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
}

.folio-section[data-theme="burgundy"] .entry-title {
    color: var(--parchment-tan);
}

/* ==========================================================================
   Colophon Section
   ========================================================================== */

.folio-section--colophon {
    min-height: auto;
    padding: clamp(3rem, 6vh, 6rem) 2rem;
}

.folio-section--colophon .folio-body {
    text-align: center;
    font-style: italic;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background-color: var(--oxblood-black);
    color: var(--warm-cream);
    padding: 3rem 2rem;
    text-align: center;
}

.footer-inner {
    max-width: var(--column-width);
    margin: 0 auto;
}

.footer-ornament {
    margin-bottom: 1.5rem;
}

.footer-ornament svg {
    width: 150px;
    height: auto;
}

.footer-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    color: var(--warm-cream);
    margin-bottom: 0.5rem;
}

.footer-meta {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--parchment-tan);
    margin-bottom: 0.5rem;
}

.footer-year {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--antique-brass);
}

/* ==========================================================================
   Links
   ========================================================================== */

a {
    color: var(--claret-rose);
    text-decoration: none;
    position: relative;
}

a:hover {
    color: var(--antique-brass);
    transition: color 400ms var(--ease-gentle);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .header-nav {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.6rem;
        letter-spacing: 0.1em;
    }

    .folio-section {
        padding: clamp(3rem, 6vh, 6rem) 1.5rem;
    }

    .folio-inner {
        padding: 2rem 0;
    }

    .corner-bracket {
        display: none;
    }

    .pull-quote {
        padding: 1.5rem 1rem;
        margin: 2rem 0;
        font-size: 1.15rem;
    }

    .title-svg {
        width: 95vw;
    }

    .principle-item {
        padding-left: 1rem;
    }
}

@media (max-width: 480px) {
    .header-nav {
        gap: 0.6rem;
    }

    .nav-link {
        font-size: 0.55rem;
    }

    .drop-cap {
        font-size: 3rem;
    }

    .folio-heading {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
    }
}

/* ==========================================================================
   Utility: Smooth Scroll Offset for Fixed Header
   ========================================================================== */

[id] {
    scroll-margin-top: 70px;
}

/* Background geometric pattern for alternating sections */
.folio-section[data-theme="burgundy"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 52'%3E%3Cpolygon points='30,2 55,15 55,37 30,50 5,37 5,15' fill='none' stroke='%23C9A96E' stroke-width='0.3'/%3E%3C/svg%3E");
    background-size: 60px 52px;
    opacity: 0.04;
    pointer-events: none;
}
