/* ============================================================
   L'CLAIRE — "CUT IN LIGHT"
   A jeweller's velvet tray for the stone reading page
   ============================================================ */

.ys {
    --velvet: #120f15;
    --velvet-2: #1b1620;
    --velvet-3: #261e2c;
    --ivory: #f3ead7;
    --ivory-dim: rgba(243, 234, 215, 0.66);
    --ivory-faint: rgba(243, 234, 215, 0.4);
    --hair: rgba(212, 175, 55, 0.32);
    --gold: #D4AF37;
    --gold-2: #e6c86e;
    --paper: #f7f1e3;
    --charcoal: #2C2C2C;
    --grey-text: #595959;
    --grey-light: #888;
    --font-serif: var(--serif);
    --font-sans: var(--sans);
    color: var(--ivory);
}


/* ============================================================
   STAGE
   ============================================================ */
.atelier-stage {
    min-height: 100vh;
    min-height: 100svh;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--header) + 3rem) var(--gutter) 4rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    grid-template-areas: "copy gem";
    align-items: center;
    gap: clamp(2rem, 5vw, 6rem);
}

.stage-gem {
    grid-area: gem;
    position: relative;
    width: 100%;
    max-width: 660px;
    justify-self: center;
    aspect-ratio: 1;
}

#gem-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: pan-y;
}

.stage-gem::after {                 /* the tray's lip of light */
    content: '';
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: 6%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--hair), transparent);
}

.stage-whisper {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    font-size: 0.66rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--ivory-faint);
    opacity: 0;
    transition: opacity 1.2s ease 0.6s;
}

[data-state="revealed"] .stage-whisper { opacity: 1; }

.stage-copy {
    grid-area: copy;
    position: relative;
    min-width: 0;
}

.stage-panel { animation: panelIn 1s cubic-bezier(0.22, 1, 0.36, 1) both; }
.stage-panel[hidden] { display: none; }

@keyframes panelIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

.atelier-title {
    font-size: clamp(2.8rem, 6.2vw, 5.4rem);
    font-weight: 300;
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin-bottom: 1.6rem;
}

.atelier-title em,
.result-name em {
    font-style: italic;
    background: linear-gradient(100deg, var(--ivory) 0%, var(--gold-2) 38%, #fff6dc 52%, var(--gold) 70%, var(--ivory) 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: foil 9s ease-in-out infinite;
    padding-right: 0.08em;
}

@keyframes foil {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.atelier-lede {
    font-size: 1.02rem;
    font-weight: 300;
    line-height: 1.85;
    color: var(--ivory-dim);
    max-width: 34rem;
    margin-bottom: 2.6rem;
}

/* ---------- the ritual form ---------- */
.ritual fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 2rem;
    min-width: 0;
}

.ritual legend {
    font-size: 0.68rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1rem;
    padding: 0;
}

.date-row {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr) 7rem;
    gap: 1.4rem;
    max-width: 32rem;
}

.field span {
    display: block;
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ivory-faint);
    margin-bottom: 0.35rem;
}

.field input,
.field select {
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(243, 234, 215, 0.28);
    border-radius: 0;
    color: var(--ivory);
    font-family: var(--font-serif);
    font-size: 1.7rem;
    font-weight: 400;
    padding: 0.2rem 0 0.45rem;
    outline: none;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.field select {
    cursor: pointer;
    padding-right: 1.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23D4AF37' stroke-width='1.2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.2rem center;
}

.field select option { color: #2C2C2C; background: #f7f1e3; }
.field select:invalid { color: rgba(243, 234, 215, 0.35); }

.field input::placeholder { color: rgba(243, 234, 215, 0.25); }

.field input:focus,
.field select:focus { border-bottom-color: var(--gold); }

.field input:focus-visible,
.field select:focus-visible { box-shadow: 0 1px 0 var(--gold); }

.intent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    max-width: 34rem;
}

.intent { position: relative; cursor: pointer; }

.intent input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.intent span {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 1.15rem;
    border: 1px solid rgba(243, 234, 215, 0.2);
    border-radius: 100px;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--ivory-dim);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.intent span::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dot, var(--gold));
    box-shadow: 0 0 0 0 transparent;
    transition: box-shadow 0.4s ease;
}

.intent:hover span { border-color: var(--hair); color: var(--ivory); }

.intent input:checked + span {
    border-color: var(--gold);
    color: var(--ivory);
    background: rgba(212, 175, 55, 0.08);
}

.intent input:checked + span::before { box-shadow: 0 0 10px 2px var(--dot, var(--gold)); }
.intent input:focus-visible + span { outline: 1px solid var(--gold-2); outline-offset: 3px; }

.ritual-error {
    min-height: 1.4em;
    margin: -0.6rem 0 1rem;
    font-size: 0.85rem;
    color: #e8a7a0;
}

.ritual-note {
    margin-top: 1.2rem;
    font-size: 0.72rem;
    color: var(--ivory-faint);
    letter-spacing: 0.04em;
}

/* ---------- cutting + result ---------- */
.cutting-line {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1.8rem, 3.6vw, 2.8rem);
    font-weight: 300;
    color: var(--ivory);
    min-height: 2.4em;
    transition: opacity 0.5s ease;
}

.result-name {
    font-size: clamp(4rem, 10vw, 8.5rem);
    font-weight: 300;
    line-height: 0.95;
    letter-spacing: -0.03em;
    margin-bottom: 1.2rem;
}

.result-meta {
    font-size: 0.74rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--gold-2);
    margin-bottom: 1.8rem;
}

.result-line {
    font-family: var(--font-serif);
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    font-weight: 300;
    line-height: 1.55;
    color: var(--ivory-dim);
    max-width: 32rem;
    margin-bottom: 2.4rem;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
}

/* ============================================================
   THE READING
   ============================================================ */
.reading { padding: 4rem 0 8rem; }
.reading[hidden] { display: none; }

/* ---------- certificate ---------- */
.certificate {
    position: relative;
    max-width: 1020px;
    margin: 0 auto 9rem;
    padding: clamp(2rem, 5vw, 4rem);
    background-color: var(--paper);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.7), transparent 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.38 0 0 0 0 0.25 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
    color: var(--charcoal);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45), 0 2px 0 rgba(255, 255, 255, 0.4) inset;
}

.certificate::before,
.certificate::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

.certificate::before { inset: 12px; border: 1px solid rgba(160, 128, 40, 0.55); }
.certificate::after { inset: 17px; border: 0.5px solid rgba(160, 128, 40, 0.3); }

.cert-head {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.6rem;
    border-bottom: 1px solid rgba(160, 128, 40, 0.35);
    margin-bottom: 2.2rem;
}

.cert-logo {
    width: 118px;
    height: auto;
}

.cert-heading { text-align: center; }

.cert-kicker {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: #9a7b2a;
    margin-bottom: 0.3rem;
}

.cert-heading h2 {
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    font-weight: 400;
    letter-spacing: 0.06em;
    font-variant: small-caps;
}

.cert-no { justify-self: end; text-align: right; }

.cert-no span {
    display: block;
    font-size: 0.6rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--grey-light);
}

.cert-no strong {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
}

.cert-body {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 4rem);
    align-items: start;
}

.cert-fields {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1.5rem;
}

.cert-fields dt,
.cert-fields dd {
    padding: 0.72rem 0;
    border-bottom: 1px dotted rgba(44, 44, 44, 0.2);
}

.cert-fields dt {
    font-size: 0.64rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--grey-text);
    align-self: end;
}

.cert-fields dd {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    text-align: right;
}

.cert-fields dd small {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: var(--grey-light);
    margin-left: 0.4rem;
}

.cert-plot {
    text-align: center;
    padding-top: 0.4rem;
}

.cert-plot svg {
    width: 100%;
    max-width: 240px;
    height: auto;
    color: #7d6524;
}

.cert-plot-label {
    display: block;
    margin-top: 0.8rem;
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--grey-light);
}

.cert-reading {
    margin-top: 2.6rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(160, 128, 40, 0.35);
}

.cert-reading h3 {
    font-size: 0.64rem;
    font-family: var(--font-sans);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #9a7b2a;
    margin-bottom: 1rem;
}

.cert-reading p {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1.15rem, 1.9vw, 1.4rem);
    line-height: 1.7;
    color: #3a3530;
}

.cert-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 2.4rem;
}

.cert-foot p {
    font-size: 0.72rem;
    color: var(--grey-light);
    max-width: 30rem;
    line-height: 1.7;
}

.cert-seal {
    width: 96px;
    flex: none;
    color: #a8862c;
    transform: rotate(-8deg);
    opacity: 0.9;
}

/* ---------- three stones ---------- */
.trio { margin-bottom: 9rem; }

.trio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.5rem, 4vw, 4rem);
    max-width: 1100px;
    margin: 0 auto;
}

.trio-card { text-align: center; }

.trio-medal {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.8rem;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--gold), 0 0 0 7px var(--velvet), 0 0 0 8px var(--hair), 0 20px 50px rgba(0, 0, 0, 0.5);
    background: var(--velvet-3);
}

.trio-medal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.trio-card:hover .trio-medal img { transform: scale(1.08); }

.trio-medal--pearl {
    background: radial-gradient(circle at 36% 32%, #fff 0%, #f4efe8 18%, #d9d2cc 52%, #a39c9d 82%, #6f6a70 100%);
}

.trio-role {
    display: block;
    font-size: 0.64rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.6rem;
}

.trio-card h3 {
    font-size: 2rem;
    font-style: italic;
    font-weight: 300;
    margin-bottom: 0.3rem;
}

.trio-sub {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: var(--gold-2);
    margin-bottom: 1rem;
}

.trio-card p {
    font-size: 0.92rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--ivory-dim);
    max-width: 19rem;
    margin: 0 auto;
}

/* ---------- keep ---------- */
.keep { text-align: center; }

.keep-line {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    margin-bottom: 2.4rem;
}

.keep-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.2rem 1.6rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
    .atelier-stage {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "gem" "copy";
        padding-top: 120px;
        gap: 1rem;
    }

    .stage-gem { max-width: 460px; }
    .cert-body { grid-template-columns: minmax(0, 1fr); }
    .cert-plot svg { max-width: 200px; }
    .trio-grid { grid-template-columns: minmax(0, 1fr); gap: 3.5rem; max-width: 420px; }
}

@media (max-width: 600px) {
    .atelier-stage { padding: calc(var(--header) + 1.5rem) 16px 3rem; }
    .date-row { grid-template-columns: 4rem minmax(0, 1fr) 5.2rem; gap: 1rem; }
    .field input, .field select { font-size: 1.4rem; }
    .cert-head { grid-template-columns: 1fr; text-align: center; }
    .cert-logo { margin: 0 auto; }
    .cert-no { justify-self: center; text-align: center; }
    .cert-fields dd { font-size: 1.02rem; }
    .cert-foot { flex-direction: column; text-align: center; }
    .certificate { padding: 2.2rem 1.4rem; }
    .keep-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .stage-panel { animation: none; }
    .atelier-title em, .result-name em { animation: none; }
}

/* shared-card grid for "pieces that carry it" */
.wear-grid { max-width: 1000px; margin: 0 auto; }
.result-actions .link, .result-actions .link--quiet { font-size: 0.7rem; }
.ys h1, .ys h2, .ys h3 { font-family: var(--serif); font-weight: 300; line-height: 1.05; }
.ys .cert-heading h2 { font-weight: 400; }
.ys .trio-card h3 { font-weight: 300; }
.ys-live { text-align: center; max-width: 720px; margin: 0 auto 8rem; }
.ys-live .h2 { margin: 1.4rem 0 1.2rem; }
.ys-live .lede { margin: 0 auto 2.2rem; }
.ys-live .social-btns { justify-content: center; }
