/* op9.rs - Artist's Field Notebook */
/* Colors: Aged Parchment #F5EDE0, Cork #D4B896, Dark Umber #3B2F2F, 
   Warm Coffee #5C4A3A, Faded Ink #8B7355, Terra Rosa #C67A5C, 
   Verdigris #5B8A72, Iron Gall Blue #4A5568, Cream #FFF8F0 */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.6vw, 19px);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: #5C4A3A;
    background-color: #D4B896;
    overflow-x: hidden;
}

/* ===================== INTRO OVERLAY ===================== */

#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #F5EDE0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    flex-direction: column;
    transition: opacity 0.5s ease-out;
}

#intro-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

#intro-circle {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#intro-circle.visible {
    opacity: 1;
}

#intro-circle-path {
    stroke-dasharray: 620;
    stroke-dashoffset: 620;
    transition: stroke-dashoffset 0.8s ease-in-out;
}

#intro-circle-path.draw {
    stroke-dashoffset: 0;
}

#intro-title {
    position: absolute;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(36px, 6vw, 80px);
    color: #3B2F2F;
    letter-spacing: 0.02em;
    line-height: 1.12;
    opacity: 0;
    transition: opacity 0.4s ease-in;
}

#intro-title.visible {
    opacity: 1;
}

/* ===================== MAIN CONTENT ===================== */

#main-content {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

#main-content.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.cork-surface {
    min-height: 100vh;
    padding: clamp(24px, 4vw, 64px);
    background-color: #D4B896;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(139, 115, 85, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 115, 85, 0.06) 0%, transparent 50%);
}

/* ===================== PORTFOLIO GRID ===================== */

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

@media (min-width: 600px) and (max-width: 1023px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 599px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ===================== CARDS ===================== */

.card {
    position: relative;
    background-color: #F5EDE0;
    padding: 0;
    z-index: 2;
    transition: transform 0.25s ease, z-index 0s, box-shadow 0.25s ease;
    perspective: 800px;
    margin: -2px;
    cursor: default;
}

.card:hover {
    z-index: 10;
    box-shadow: 4px 6px 20px rgba(59, 47, 47, 0.15);
}

.card-hero {
    grid-column: 1 / -1;
    text-align: center;
}

.card-wide {
    grid-column: span 2;
}

@media (max-width: 599px) {
    .card-wide {
        grid-column: span 1;
    }
    .card {
        transform: rotate(0deg) !important;
    }
}

.card-colophon {
    grid-column: 1 / -1;
}

/* Card border SVG overlay */
.card-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.card-border path {
    transition: stroke-width 0.2s ease;
}

.card:hover .card-border path {
    stroke-width: 0.8;
}

/* Crosshatch overlay */
.crosshatch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Pushpin */
.pushpin {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    transition: transform 0.2s ease;
}

.card:hover .pushpin {
    transform: translateX(-50%) rotate(15deg);
}

/* Card content */
.card-content {
    position: relative;
    z-index: 2;
    padding: 28px 24px 20px;
}

.card-hero .card-content {
    padding: 40px 32px 32px;
}

/* Illustrations */
.card-illustration {
    margin-bottom: 16px;
}

.card-illustration svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Hero title SVG */
.hero-title-svg {
    display: block;
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 0 auto 20px;
}

/* Typography */
.card-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(28px, 5vw, 72px);
    color: #3B2F2F;
    letter-spacing: 0.02em;
    line-height: 1.12;
    margin-bottom: 12px;
}

.card-hero .card-title {
    font-size: clamp(32px, 5vw, 72px);
}

.card-title-colophon {
    font-style: italic;
}

.card-body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.6vw, 19px);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: #5C4A3A;
    margin-bottom: 12px;
}

.hero-intro {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.5;
    color: #8B7355;
    max-width: 600px;
    margin: 0 auto;
    transform: rotate(-0.5deg);
}

.card-annotation {
    display: block;
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(14px, 1.4vw, 18px);
    color: #8B7355;
    margin-top: 8px;
}

/* Botanical decorations */
.botanical {
    position: absolute;
    pointer-events: none;
    z-index: 4;
}

.botanical-hero {
    bottom: 20px;
    right: 30px;
    animation: sway 4.2s ease-in-out infinite alternate;
}

.botanical-corner {
    bottom: 10px;
    right: 10px;
    animation: sway 3.5s ease-in-out infinite alternate;
}

.botanical-bottom {
    bottom: 8px;
    left: 15px;
    animation: sway 5.1s ease-in-out infinite alternate;
}

.botanical-right {
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    animation: sway 4.8s ease-in-out infinite alternate;
}

.botanical-left {
    bottom: 15px;
    left: 10px;
    animation: sway 3.8s ease-in-out infinite alternate;
}

@keyframes sway {
    0% {
        transform: rotate(-2deg);
    }
    100% {
        transform: rotate(3deg);
    }
}

.botanical-right {
    animation-name: swayVertical;
}

@keyframes swayVertical {
    0% {
        transform: translateY(-50%) rotate(-2deg);
    }
    100% {
        transform: translateY(-50%) rotate(3deg);
    }
}

/* Colophon decoration */
.colophon-decoration {
    margin-top: 16px;
    opacity: 0.7;
}

/* ===================== COMPASS NAVIGATION ===================== */

.compass-nav {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
}

.compass-rose {
    width: 48px;
    height: 48px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    animation: pulse 3s ease-in-out infinite;
    transition: transform 0.2s ease;
}

.compass-rose:hover {
    transform: scale(1.1);
}

.compass-rose svg {
    display: block;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.compass-rose:hover {
    animation: none;
    transform: scale(1.1);
}

.compass-menu {
    position: absolute;
    bottom: 60px;
    right: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.compass-menu.open {
    pointer-events: auto;
    opacity: 1;
}

.compass-label {
    display: block;
    font-family: 'Caveat', cursive;
    font-weight: 500;
    font-size: 16px;
    color: #3B2F2F;
    text-decoration: none;
    white-space: nowrap;
    padding: 4px 12px;
    background: rgba(245, 237, 224, 0.92);
    border: 1px solid rgba(59, 47, 47, 0.15);
    margin-bottom: 4px;
    transform: translateX(60px) rotate(var(--angle, 0deg));
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    transition-delay: var(--delay, 0ms);
}

.compass-menu.open .compass-label {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
}

.compass-label:hover {
    color: #C67A5C;
    background: #FFF8F0;
}

/* ===================== HOVER EFFECTS ===================== */

.card:hover .card-content {
    background-color: transparent;
}

.card:hover {
    background-color: #FFF8F0;
}

/* ===================== SELECTION ===================== */

::selection {
    background-color: rgba(198, 122, 92, 0.25);
    color: #3B2F2F;
}

/* ===================== SCROLLBAR ===================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #D4B896;
}

::-webkit-scrollbar-thumb {
    background: #8B7355;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5C4A3A;
}
