/* =============================================
   PPADDL.com - Styles
   Flat Design | Masonry Layout | Triadic Palette
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
    /* Triadic Colors */
    --vermillion: #E84855;
    --azure: #3185FC;
    --chartreuse: #8AC926;

    /* Neutrals */
    --blanc: #FAFAFA;
    --cream: #F5F0EB;
    --graphite: #3A3A3C;
    --slate: #6B7280;
    --lilac: #C4A7D7;

    /* RGB versions for rgba usage */
    --vermillion-rgb: 232, 72, 85;
    --azure-rgb: 49, 133, 252;
    --chartreuse-rgb: 138, 201, 38;
    --lilac-rgb: 196, 167, 215;

    /* Grid */
    --columns: 8;
    --gutter: 24px;
    --outer-margin: 48px;
    --row-unit: 160px;

    /* Typography */
    --font-display: 'Libre Baskerville', 'Georgia', serif;
    --font-body: 'Libre Baskerville', 'Georgia', serif;
    --font-caption: 'DM Sans', 'Helvetica Neue', sans-serif;

    /* Nav height */
    --nav-height: 52px;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--graphite);
    background-color: var(--blanc);
    /* Dot-grid background pattern */
    background-image: radial-gradient(circle, var(--lilac) 0.8px, transparent 0.8px);
    background-size: 8px 8px;
    background-position: 0 0;
    overflow-x: hidden;
    position: relative;
}

/* Apply 15% opacity to dot grid using pseudo-element */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, var(--lilac) 0.8px, transparent 0.8px);
    background-size: 8px 8px;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

/* Remove the dot grid from body itself, use pseudo only */
body {
    background-image: none;
    background-color: var(--blanc);
}

/* --- Connecting Lines SVG Layer --- */
#connecting-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* --- Grid Column Lines (Blueprint Scaffold) --- */
#grid-columns {
    position: fixed;
    top: 0;
    left: var(--outer-margin);
    right: var(--outer-margin);
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(var(--columns), 1fr);
    gap: var(--gutter);
    pointer-events: none;
    z-index: 1;
}

#grid-columns .grid-line {
    border-right: 1px solid rgba(var(--lilac-rgb), 0.3);
}

#grid-columns .grid-line:first-child {
    border-left: 1px solid rgba(var(--lilac-rgb), 0.3);
}

/* --- Navigation --- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: var(--blanc);
    border-bottom: 2px solid var(--vermillion);
    z-index: 100;
    display: flex;
    align-items: center;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 var(--outer-margin);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--vermillion);
    letter-spacing: 0.05em;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 32px;
}

.nav-links li a {
    font-family: var(--font-caption);
    font-size: 12px;
    font-variant: small-caps;
    text-transform: lowercase;
    letter-spacing: 0.08em;
    color: var(--slate);
    text-decoration: none;
    transition: color 200ms ease;
}

.nav-links li a:hover {
    color: var(--azure);
}

/* --- Main Masonry Container --- */
#masonry-container {
    position: relative;
    z-index: 2;
    padding-top: calc(var(--nav-height) + 40px);
    padding-left: var(--outer-margin);
    padding-right: var(--outer-margin);
    padding-bottom: 80px;
}

/* --- Masonry Section --- */
.masonry-section {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--gutter);
    margin-bottom: 64px;
    max-width: 100%;
}

.masonry-section-sparse {
    gap: 48px;
}

/* --- Masonry Block Base --- */
.masonry-block {
    border: 2px solid var(--slate);
    border-radius: 4px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background-color: var(--blanc);
    /* Pre-animation state */
    opacity: 0;
    transform: scale(0.95);
}

.masonry-block.animated {
    animation: pulse-enter 300ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --- Pulse-Attention Animation --- */
@keyframes pulse-enter {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    60% {
        transform: scale(1.01);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Block Hover --- */
.masonry-block:hover {
    border-width: 4px;
    padding: 22px; /* compensate for border growth */
}

.masonry-block.border-vermillion:hover {
    border-color: var(--vermillion);
}

.masonry-block.border-azure:hover {
    border-color: var(--azure);
}

.masonry-block.border-chartreuse:hover {
    border-color: var(--chartreuse);
}

.masonry-block.border-lilac:hover {
    border-color: var(--lilac);
}

/* --- Border Color Classes --- */
.border-vermillion {
    border-color: var(--vermillion);
}

.border-azure {
    border-color: var(--azure);
}

.border-chartreuse {
    border-color: var(--chartreuse);
}

.border-lilac {
    border-color: var(--lilac);
}

/* --- Background Classes --- */
.bg-blanc {
    background-color: var(--blanc);
}

.bg-cream {
    background-color: var(--cream);
}

/* --- Column Span Classes --- */
.col-span-1 {
    grid-column: span 1;
}

.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

.col-span-4 {
    grid-column: span 4;
}

/* --- Row Span Classes --- */
.row-span-1 {
    min-height: var(--row-unit);
}

.row-span-2 {
    min-height: calc(var(--row-unit) * 2 + var(--gutter));
}

.row-span-3 {
    min-height: calc(var(--row-unit) * 3 + var(--gutter) * 2);
}

/* --- Block Label (Number) --- */
.block-label {
    position: absolute;
    top: 8px;
    left: 10px;
    font-family: var(--font-caption);
    font-size: 10px;
    color: var(--slate);
    opacity: 0.6;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-display);
    letter-spacing: 0.01em;
    line-height: 1.15;
}

h2 {
    font-size: 36px;
    color: var(--vermillion);
    margin-bottom: 20px;
}

.hero-title {
    font-size: 72px;
    color: var(--vermillion);
    line-height: 1.1;
    margin-bottom: 16px;
    margin-top: 40px;
}

.hero-tagline {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 28px;
    color: var(--graphite);
    line-height: 1.4;
}

.body-text {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    letter-spacing: 0.005em;
    color: var(--graphite);
    max-width: 38em;
    margin-bottom: 12px;
}

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

.caption-text {
    font-family: var(--font-caption);
    font-size: 13px;
    line-height: 1.5;
    color: var(--slate);
}

/* --- Hero Block --- */
.hero-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 40px;
}

/* --- Text Blocks --- */
.text-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 32px;
}

/* --- Pull Quotes --- */
.quote-block {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pull-quote {
    position: relative;
    padding: 20px 48px;
    text-align: center;
}

.quote-mark {
    font-family: var(--font-display);
    font-size: 120px;
    color: var(--azure);
    line-height: 1;
    position: absolute;
    opacity: 0.3;
}

.quote-mark-open {
    top: -30px;
    left: -10px;
}

.quote-mark-close {
    bottom: -60px;
    right: -10px;
}

blockquote {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 28px;
    line-height: 1.4;
    color: var(--graphite);
}

/* --- Decorative Blocks --- */
.decorative-block {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.shape {
    max-width: 100%;
    max-height: 100%;
    transition: transform 200ms ease;
}

.shape:hover {
    transform: rotate(15deg);
}

.shape-circle-lg {
    width: 100%;
    max-width: 280px;
}

.shape-triangle {
    width: 80%;
    max-width: 120px;
}

.shape-rect-bar {
    width: 20px;
    height: 80%;
    max-height: 160px;
}

.shape-dots,
.shape-dots-scattered {
    width: 80%;
    max-width: 100px;
}

.shape-semicircle {
    width: 80%;
    max-width: 160px;
}

.shape-quarter-arc {
    width: 80%;
    max-width: 120px;
}

.shape-composition,
.shape-system,
.shape-network {
    width: 90%;
    max-width: 260px;
}

.shape-bars {
    width: 90%;
    max-width: 200px;
}

.shape-triangles-row {
    width: 90%;
    max-width: 240px;
}

.shape-circle-small {
    width: 70%;
    max-width: 100px;
}

.shape-triangle-small {
    width: 60%;
    max-width: 80px;
}

/* --- Fin Block --- */
.fin-block {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.shape-circle-fin {
    width: 80%;
    max-width: 360px;
    position: absolute;
}

.fin-text {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 48px;
    color: var(--blanc);
    position: relative;
    z-index: 1;
}

/* --- Section Divider --- */
.section-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 48px 0;
    position: relative;
}

.divider-line {
    width: 100%;
    height: 2px;
    background-color: var(--azure);
}

.divider-triangle {
    width: 30px;
    height: 20px;
    margin-top: -1px;
}

/* --- Footer --- */
#main-footer {
    position: relative;
    z-index: 2;
    padding: 0 var(--outer-margin);
    padding-bottom: 48px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gutter);
}

.footer-cell {
    border: 2px solid var(--slate);
    border-radius: 4px;
    padding: 24px;
    background-color: var(--blanc);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.footer-cell.border-lilac {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-heading {
    font-family: var(--font-caption);
    font-size: 12px;
    font-variant: small-caps;
    text-transform: lowercase;
    letter-spacing: 0.08em;
    color: var(--slate);
    margin-bottom: 8px;
}

.footer-text {
    font-family: var(--font-caption);
    font-size: 13px;
    color: var(--graphite);
    line-height: 1.5;
}

.footer-glyph {
    width: 60px;
    height: 60px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    :root {
        --outer-margin: 32px;
        --row-unit: 140px;
    }

    .masonry-section {
        grid-template-columns: repeat(4, 1fr);
    }

    .col-span-3 {
        grid-column: span 3;
    }

    .col-span-4 {
        grid-column: span 4;
    }

    .hero-title {
        font-size: 56px;
    }

    h2 {
        font-size: 30px;
    }

    blockquote {
        font-size: 22px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --outer-margin: 20px;
        --gutter: 16px;
        --row-unit: 120px;
    }

    .masonry-section {
        grid-template-columns: repeat(3, 1fr);
    }

    .col-span-2,
    .col-span-3,
    .col-span-4 {
        grid-column: span 3;
    }

    .hero-title {
        font-size: 42px;
    }

    h2 {
        font-size: 26px;
    }

    blockquote {
        font-size: 20px;
    }

    .hero-tagline {
        font-size: 22px;
    }

    .quote-mark {
        font-size: 80px;
    }

    .nav-links {
        gap: 16px;
    }

    .nav-links li a {
        font-size: 10px;
    }

    #grid-columns {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    :root {
        --outer-margin: 16px;
        --gutter: 12px;
    }

    .masonry-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .col-span-1,
    .col-span-2,
    .col-span-3,
    .col-span-4 {
        grid-column: span 2;
    }

    .hero-title {
        font-size: 36px;
    }

    .nav-links {
        display: none;
    }

    .fin-text {
        font-size: 36px;
    }
}
