/* =========================================================
   ARAM MIZURI ARCHITECTURE — voices.css
   A client's pencil portrait and voice note beside their quote
   (partials/client-voice, voices.js): a disc of paper the portrait draws
   itself on, a ring with their company's name and a seal with its logo,
   and a player in the shape of a voice note. On the homepage and the
   project pages; colours are literals so it reads the same under either
   page's stylesheet.
   ========================================================= */

.cv {
    --cv-size: clamp(196px, 24vw, 252px);
    display: flex; flex-direction: column; align-items: center; gap: 24px;
    margin: 0 auto 34px;
}

/* ---- Portrait --------------------------------------------------
   Three layers at different depths (paper, ring, seal), so tilting the
   whole — with the pointer, or the phone — shows them move against each
   other. */
.cv__portrait { width: var(--cv-size); height: var(--cv-size); perspective: 900px; }
.cv__tilt {
    position: relative; width: 100%; height: 100%;
    transform-style: preserve-3d;
    transition: transform .7s cubic-bezier(.16,1,.3,1);
}
.cv__paper {
    position: absolute; inset: 10%;
    border-radius: 50%; overflow: hidden;
    background: radial-gradient(circle at 36% 30%, #F7F3EB 0%, #ECE6DB 62%, #DED7CA 100%);
    box-shadow: 0 22px 50px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35), inset 0 0 0 1px rgba(0,0,0,.05);
}
/* The finished drawing as a plain image, until the page has the strokes to
   draw it with (pencil.js) — then blank paper, for the pencil to start on. */
.cv__sketch, .cv__draw { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cv.is-ready .cv__sketch { visibility: hidden; }

.cv__orbit {
    position: absolute; inset: 0;
    transform-style: preserve-3d; transform: translateZ(26px);
    animation: cvSpin 46s linear infinite paused;
}
.cv__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cv__hair { fill: none; stroke: rgba(245,197,24,.5); stroke-width: .8; }
/* no company: a fine scale of ticks, like the edge of a protractor */
.cv__ticks { fill: none; stroke: rgba(255,255,255,.3); stroke-width: 5; stroke-dasharray: .6 8.737; }
.cv__company {
    font-family: 'Inter', 'Vazirmatn', sans-serif; font-size: 8.6px; font-weight: 500;
    fill: rgba(255,255,255,.66);
}

/* the seal sits on the ring at the top right, and stays upright as the
   ring turns: it turns back at the same speed */
.cv__seal {
    position: absolute; left: 81.82%; top: 18.18%;
    width: 20%; height: 20%; margin: -10% 0 0 -10%;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #141414; color: #fff;
    box-shadow: 0 0 0 1px rgba(245,197,24,.65), 0 10px 22px rgba(0,0,0,.55);
    transform: translateZ(16px);
    animation: cvSpin 46s linear infinite reverse paused;
}
.cv__seal img { width: 64%; height: 64%; object-fit: contain; }
.cv__seal svg { width: 60%; height: 60%; }
.cv__initial { font: 300 calc(var(--cv-size) * .085)/1 'Inter', 'Vazirmatn', sans-serif; }
.cv.is-playing .cv__orbit, .cv.is-playing .cv__seal { animation-play-state: running; }
@keyframes cvSpin { to { rotate: 360deg; } }

/* ---- Player ----------------------------------------------------
   Left to right in either language: a playback bar is a timeline, and
   timelines are not mirrored. */
.cv__player {
    direction: ltr;
    display: inline-flex; align-items: center; gap: 12px;
    padding: 6px 16px 6px 6px; border-radius: 100px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09);
}
.cv__player[hidden] { display: none; }
.cv__play {
    flex: none; width: 42px; height: 42px; padding: 0;
    display: grid; place-items: center;
    border: 0; border-radius: 50%; background: #F5C518; color: #141414;
    transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s;
}
.cv__play:hover { transform: scale(1.07); box-shadow: 0 0 0 6px rgba(245,197,24,.14); }
.cv__play:focus-visible, .cv__wave:focus-visible { outline: 2px solid #F5C518; outline-offset: 3px; }
.cv__icon { width: 18px; height: 18px; fill: currentColor; }
.cv__icon--pause, .cv.is-playing .cv__icon--play { display: none; }
.cv.is-playing .cv__icon--pause { display: block; }

.cv__wave { display: flex; align-items: center; gap: 2px; width: clamp(150px, 40vw, 176px); height: 32px; touch-action: pan-y; }
.cv__bar {
    flex: 1; min-width: 2px; border-radius: 2px;
    height: calc(var(--h, .3) * 100%);
    background: rgba(255,255,255,.28);
    transition: height .6s cubic-bezier(.16,1,.3,1), background-color .15s;
}
.cv__bar.is-played { background: #F5C518; }
.cv__time {
    min-width: 32px; font: 400 12px/1 'Inter', sans-serif; color: rgba(255,255,255,.6);
    font-variant-numeric: tabular-nums;
}

/* ---- Read aloud ------------------------------------------------
   Plainly not the voice-note player: an outlined button, no waveform, and
   "computer voice" written on it. */
.cv-read {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 9px 18px 9px 14px; border-radius: 100px;
    border: 1px solid rgba(245,197,24,.42); background: transparent; color: #fff;
    font: 500 13px/1.2 'Inter', 'Vazirmatn', sans-serif;
    transition: border-color .25s, background-color .25s;
}
.cv-read[hidden] { display: none; }
.cv-read:hover, .cv.is-playing .cv-read { border-color: #F5C518; background: rgba(245,197,24,.08); }
.cv-read:focus-visible { outline: 2px solid #F5C518; outline-offset: 3px; }
.cv-read__icon { flex: none; width: 19px; height: 19px; fill: none; stroke: #F5C518; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cv-read__note {
    font-size: 11px; font-weight: 400; color: rgba(255,255,255,.5);
    padding-inline-start: 10px; border-inline-start: 1px solid rgba(255,255,255,.16);
}
.cv.is-playing .cv-read__wave { animation: cvWave 1.1s ease-in-out infinite; }
.cv.is-playing .cv-read__wave--far { animation-delay: .25s; }
@keyframes cvWave { 50% { opacity: .2; } }

/* ---- The quote, word by word, while the voice plays ------------- */
.cv-reading .cv-w { opacity: .3; transition: opacity .35s; }
.cv-reading .cv-w.is-said { opacity: 1; }

/* ---- On a project page: the portrait beside the quote ----------- */
.pp-quote-card.has-cv { display: grid; grid-template-columns: 296px 1fr; column-gap: clamp(28px, 5vw, 56px); }
.pp-quote-card.has-cv > .cv { --cv-size: 188px; grid-row: 1 / span 2; margin: 0; align-self: center; }
.pp-quote-card.has-cv > blockquote { align-self: end; }
.pp-quote-card.has-cv > figcaption { align-self: start; }
.pp-quote-card.has-cv > .cv:not([data-has-portrait]) { align-self: end; }
/* only "Read aloud": a button above the words, not a column of its own */
.pp-quote-card:not(.has-cv) > .cv { align-items: flex-start; margin: 0 0 16px; }
@media (max-width: 640px) {
    .pp-quote-card.has-cv { grid-template-columns: 1fr; }
    .pp-quote-card.has-cv > .cv { grid-row: auto; align-items: flex-start; margin-bottom: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    .cv__tilt, .cv__play, .cv__bar { transition: none; }
    .cv__orbit, .cv__seal, .cv.is-playing .cv-read__wave { animation: none; }
}
