/* ===== About page ===== */

/* ----- 1. Hello ----- */
.about-hello-inner {
    display: grid;
    gap: 3rem;
    align-items: center;
    justify-items: center;
}

.about-photo {
    width: 100%;
    max-width: 22rem;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;              /* fills the shape without squashing */
    border-radius: 2rem;
    box-shadow: 1.25rem 1.25rem 0 var(--mint);   /* a mint "frame" peeking out behind */
}

.about-lead {
    margin-top: 1rem;
    font-size: 1.2rem;
    line-height: 1.7;
}

@media (min-width: 768px) {
    .about-hello-inner {
        grid-template-columns: 2fr 3fr;   /* photo a bit narrower than the words */
        text-align: left;
    }
}

/* ----- 2. My story ----- */
.about-story {
    background: var(--cream);
}

.story-text {
    max-width: 40rem;              /* comfy line length for reading */
    margin: 2.5rem auto 0;
    text-align: left;
}

.story-text p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

.story-text h3 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    margin: 2.5rem 0 0.75rem;
}

/* ----- 4. Let's talk ----- */
.about-talk {
    background: var(--mint);
}

.about-buttons {
    display: flex;
    flex-wrap: wrap;               /* buttons stack on small phones */
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* ----- 3. Fun fact flip cards ----- */
.flip-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;       /* leftover cards sit in the middle */
    gap: 1.5rem;
    margin-top: 3rem;
}

.flip-card {
    flex: 0 1 15rem; 
    aspect-ratio: 3 / 4;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    perspective: 1000px;           /* gives the flip its 3D depth */
}

.flip-card:focus-visible {
    outline: 3px solid var(--sage);
    outline-offset: 4px;
    border-radius: 1.5rem;
}

/* The part that actually turns over */
.flip-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;  /* keeps front and back as two sides of one card */
}

.flip-front,
.flip-back {
    position: absolute;
    inset: 0;
    display: flex;
    border-radius: 1.5rem;
    overflow: hidden;
    backface-visibility: hidden;          /* hide each side when it faces away */
    -webkit-backface-visibility: hidden;  /* the same, for Safari */
}

.flip-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flip-title {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    padding: 0.4rem 0.9rem;
    border-radius: 0.75rem;
    background: var(--off-white);
    font-size: 0.9rem;
    font-weight: 600;
}

.flip-back {
    transform: rotateY(180deg);    /* starts facing away */
    align-items: center;
    justify-content: center;
    padding: 1.75rem;
    background: var(--sage);
    color: var(--off-white);
    font-family: var(--font-heading);
    font-size: 1.35rem;
    line-height: 1.4;
    text-align: center;
}

/* Every other card has a butter back, for a bit of variety */
.flip-card:nth-child(even) .flip-back {
    background: var(--butter);
    color: var(--sage);
}

/* Flipped! (by tap, click or keyboard) */
.flip-card.is-flipped .flip-inner {
    transform: rotateY(180deg);
}

/* Mouse users can also just hover */
@media (hover: hover) and (pointer: fine) {
    .flip-card:hover .flip-inner {
        transform: rotateY(180deg);
    }
}

/* Less motion: swap instantly instead of spinning */
@media (prefers-reduced-motion: reduce) {
    .flip-inner {
        transition: none;
    }
}