/* persona.quest -- a muji aesthetic, sunset-warm card grid for the unfolding self */

:root {
    --golden:        #F8D0A0;
    --amber:         #E8A070;
    --sienna:        #6A3828;
    --parchment:     #FBF4E8;
    --rose:          #D88878;
    --green:         #688858;
    --shadow-warm:   #C0A080;

    --serif-display: 'Playfair Display', 'Lora', Georgia, serif;
    --serif-body:    'Lora', Georgia, serif;

    --gutter:        20px;
    --card-pad:      48px;
    --section-pad:   clamp(80px, 10vh, 140px);
    --radius:        2px;
    --hairline:      0.5px solid var(--shadow-warm);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--serif-body);
    color: var(--sienna);
    background: var(--parchment);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    line-height: 1.85;
    font-size: clamp(15px, 1vw, 17px);
    overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

.quest {
    display: block;
    width: 100%;
    background:
        linear-gradient(180deg, var(--golden) 0%, #FBE4C0 18%, var(--parchment) 38%, var(--parchment) 70%, #F4E2C8 100%);
}

/* ---------- HERO (golden hour 100vh) ---------- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 640px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.hero-gradient {
    position: absolute;
    inset: -10%;
    z-index: 0;
    background:
        radial-gradient(120% 90% at 50% 110%, rgba(216,136,120,0.55) 0%, rgba(216,136,120,0) 60%),
        linear-gradient(168deg, var(--golden) 0%, var(--amber) 60%, #C97858 100%);
    background-size: 220% 220%, 220% 220%;
    background-position: 50% 50%, 50% 50%;
    animation: sunset-shift 15s ease-in-out infinite alternate;
}

@keyframes sunset-shift {
    0%   { background-position: 30% 40%, 30% 40%; }
    50%  { background-position: 70% 60%, 70% 60%; }
    100% { background-position: 30% 40%, 30% 40%; }
}

.hero-circuit,
.hero-portraits {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    filter: contrast(1.05) saturate(0.9) sepia(0.15);
}

.hero-circuit-lines .cline {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    opacity: 0.7;
    animation: draw-line 2400ms cubic-bezier(0.22, 0.61, 0.36, 1) 1200ms forwards;
}

.hero-circuit-lines .cline:nth-child(2)  { animation-delay: 1300ms; }
.hero-circuit-lines .cline:nth-child(3)  { animation-delay: 1400ms; }
.hero-circuit-lines .cline:nth-child(4)  { animation-delay: 1500ms; }
.hero-circuit-lines .cline:nth-child(5)  { animation-delay: 1600ms; }
.hero-circuit-lines .cline:nth-child(6)  { animation-delay: 1700ms; }
.hero-circuit-lines .cline:nth-child(7)  { animation-delay: 1800ms; }
.hero-circuit-lines .cline:nth-child(8)  { animation-delay: 1900ms; }
.hero-circuit-lines .cline:nth-child(9)  { animation-delay: 2000ms; }
.hero-circuit-lines .cline:nth-child(10) { animation-delay: 2100ms; }

@keyframes draw-line {
    to { stroke-dashoffset: 0; }
}

.hero-circuit-nodes circle {
    opacity: 0;
    animation: node-in 600ms ease-out 2400ms forwards;
}

@keyframes node-in {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 0.85; transform: scale(1); }
}

.hero-portraits {
    z-index: 2;
    opacity: 0;
    animation: portrait-fade 1400ms ease-out 1800ms forwards;
}

@keyframes portrait-fade {
    to { opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 0 clamp(24px, 6vw, 80px);
    max-width: 880px;
    opacity: 0;
    transform: translateY(8px);
    animation: hero-rise 1000ms cubic-bezier(0.22, 0.61, 0.36, 1) 200ms forwards;
}

@keyframes hero-rise {
    to { opacity: 1; transform: translateY(0); }
}

.hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--sienna);
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    opacity: 0.78;
    margin-bottom: 28px;
}

.meta-line {
    display: inline-block;
    width: 48px;
    height: 1px;
    background: var(--sienna);
    opacity: 0.55;
}

.hero-title {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: clamp(28px, 3.5vw, 52px);
    letter-spacing: 0.01em;
    line-height: 1.1;
    margin: 0 0 22px 0;
    color: var(--sienna);
    text-shadow: 0 1px 0 rgba(251,244,232,0.35);
}

.hero-subtitle {
    font-family: var(--serif-body);
    font-weight: 400;
    font-size: clamp(15px, 1.1vw, 18px);
    line-height: 1.85;
    color: var(--sienna);
    opacity: 0.9;
    max-width: 580px;
    margin: 0 auto 36px auto;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.tag {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--sienna);
    background: rgba(251,244,232,0.5);
    border: var(--hairline);
    padding: 6px 14px;
    border-radius: var(--radius);
    backdrop-filter: blur(2px);
}

.hero-scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    color: var(--sienna);
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: scroll-pulse 2400ms ease-in-out 3000ms infinite;
}

@keyframes scroll-pulse {
    0%   { opacity: 0;    transform: translate(-50%, 0); }
    20%  { opacity: 0.7;  transform: translate(-50%, 0); }
    50%  { opacity: 0.95; transform: translate(-50%, 4px); }
    80%  { opacity: 0.7;  transform: translate(-50%, 0); }
    100% { opacity: 0;    transform: translate(-50%, 0); }
}

/* ---------- SECTIONS ---------- */
.traits,
.connections,
.journal {
    width: 100%;
    padding: var(--section-pad) clamp(24px, 6vw, 80px);
    max-width: 1280px;
    margin: 0 auto;
}

.section-head {
    max-width: 720px;
    margin: 0 auto var(--section-pad) auto;
    text-align: center;
}

.section-eyebrow {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: lowercase;
    color: var(--rose);
    margin: 0 0 14px 0;
}

.section-title {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: clamp(26px, 3vw, 42px);
    letter-spacing: 0.01em;
    line-height: 1.2;
    color: var(--sienna);
    margin: 0 0 22px 0;
}

.section-lede {
    font-family: var(--serif-body);
    font-size: clamp(15px, 1.05vw, 17px);
    line-height: 1.85;
    color: var(--sienna);
    opacity: 0.82;
    margin: 0;
}

/* ---------- CARD GRID ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gutter);
    perspective: 1200px;
}

.card {
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    --gloss-x: 50%;
    --gloss-y: 50%;
    position: relative;
    background: var(--parchment);
    border: var(--hairline);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(106,56,40,0.08);
    transform-style: preserve-3d;
    transform: perspective(1200px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(0);
    transition:
        transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1),
        box-shadow 320ms ease,
        border-color 320ms ease,
        opacity 600ms ease;
    opacity: 0;
    transform: translateY(12px);
    will-change: transform, box-shadow;
}

.card.is-visible {
    opacity: 1;
    transform: perspective(1200px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(0);
}

.card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(180px circle at var(--gloss-x) var(--gloss-y), rgba(251,244,232,0.35), rgba(251,244,232,0) 60%);
    opacity: 0;
    transition: opacity 320ms ease;
}

.card:hover {
    transform: perspective(1200px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(-3px);
    box-shadow: 0 10px 28px rgba(106,56,40,0.16);
    border-color: var(--rose);
}

.card:hover::after {
    opacity: 1;
}

.card:hover .card-photo svg {
    transform: scale(1.02);
}

.card-photo {
    width: 100%;
    aspect-ratio: 1.618 / 1;
    overflow: hidden;
    background: var(--shadow-warm);
    filter: contrast(1.05) saturate(0.9) sepia(0.15);
}

.card-photo svg {
    width: 100%;
    height: 100%;
    transition: transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.card-body {
    padding: var(--card-pad);
}

.card-eyebrow {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    color: var(--rose);
    margin: 0 0 10px 0;
}

.card-title {
    font-family: var(--serif-display);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.01em;
    line-height: 1.3;
    color: var(--sienna);
    margin: 0 0 14px 0;
}

.card-text {
    font-family: var(--serif-body);
    font-size: 15px;
    line-height: 1.85;
    color: var(--sienna);
    opacity: 0.88;
    margin: 0 0 22px 0;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--serif-body);
    font-style: italic;
    font-weight: 400;
    font-size: 12px;
    color: var(--sienna);
    opacity: 0.62;
}

.card-dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--shadow-warm);
}

/* ---------- CONNECTIONS ---------- */
.connections {
    background: linear-gradient(180deg, var(--parchment) 0%, #F6E8D4 100%);
    max-width: none;
    padding-left: clamp(24px, 6vw, 80px);
    padding-right: clamp(24px, 6vw, 80px);
}

.connection-svg {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: auto;
    display: block;
    filter: contrast(1.05) saturate(0.9) sepia(0.15);
}

.conn-line {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    opacity: 0.55;
    transition: opacity 320ms ease, stroke 320ms ease, stroke-width 320ms ease;
}

.conn-line.is-drawn {
    animation: conn-draw 1600ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes conn-draw {
    to { stroke-dashoffset: 0; }
}

.conn-line.is-active {
    stroke: var(--rose);
    stroke-width: 1.4;
    opacity: 0.95;
}

.conn-node circle {
    transition: fill 320ms ease, r 320ms ease;
    cursor: pointer;
}

.conn-node:hover circle {
    fill: var(--rose);
}

.conn-node text {
    font-family: var(--serif-display);
    font-weight: 600;
    font-size: 14px;
    fill: var(--sienna);
    text-anchor: middle;
    opacity: 0.85;
    pointer-events: none;
}

.conn-caption {
    text-align: center;
    margin: 36px auto 0 auto;
    max-width: 520px;
    font-family: var(--serif-body);
    font-size: 13px;
    color: var(--sienna);
    opacity: 0.7;
}

/* ---------- JOURNAL ---------- */
.journal {
    background: linear-gradient(180deg, #F6E8D4 0%, #EFD8B8 100%);
    max-width: none;
    padding-left: clamp(24px, 6vw, 80px);
    padding-right: clamp(24px, 6vw, 80px);
}

.journal .section-head {
    margin-bottom: calc(var(--section-pad) * 0.6);
}

.journal-entry {
    max-width: 640px;
    margin: 0 auto 56px auto;
    padding: 0 8px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.journal-entry.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.journal-entry + .journal-entry {
    border-top: var(--hairline);
    padding-top: 56px;
}

.journal-date {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    color: var(--rose);
    margin: 0 0 14px 0;
}

.journal-text {
    font-family: var(--serif-body);
    font-size: clamp(15px, 1.05vw, 17px);
    line-height: 1.95;
    color: var(--sienna);
    margin: 0;
}

.journal-foot {
    text-align: center;
    margin-top: calc(var(--section-pad) * 0.7);
    padding-top: 48px;
    border-top: var(--hairline);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.foot-mark {
    font-family: var(--serif-display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.16em;
    color: var(--sienna);
    margin: 0 0 8px 0;
}

.foot-line {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 12px;
    color: var(--sienna);
    opacity: 0.7;
    margin: 0;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 720px) {
    :root {
        --card-pad: 28px;
        --section-pad: 80px;
    }

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

    .meta-line { width: 28px; }

    .conn-node text { font-size: 11px; }
}

@media (min-width: 1400px) {
    .traits,
    .connections,
    .journal {
        max-width: 1400px;
    }
}
