/* ======================================
   POLAROID LINE CAROUSEL (photo cards hanging from a curved string)
   used by code_ethics.html - every rule is scoped under .pl
   sizes of the stage, the cards and the string are set by crafto/js/metro-polaroid.js (--pl-cw, --pl-ch, --pl-s)
====================================== */

/* While the script is still loading, the plain list would flash up and then be replaced by the carousel.
   The page head sets .pl-pending on <html>; the script (or a 2.5 s timer, whichever comes first) removes it. */
.pl-pending .pl-section:not(.is-ready) {
    box-sizing: border-box;
    min-height: 640px;
}

.pl-pending .pl-section:not(.is-ready) > * {
    display: none;
}

.pl-section.is-ready {
    position: relative;
    padding: 4px 0 clamp(28px, 4.5vh, 56px);
    overflow: hidden;
    color: var(--pl-ink);
    font-family: "DM Sans", sans-serif;
    background:
        radial-gradient(ellipse 62% 58% at 50% 32%, #ffffff 0%, rgba(255, 255, 255, 0) 72%),
        #f3f0e9;
}

/* the plain list stays visible until the script has built the carousel (and if it never does) */
.pl-section.is-ready > :not(.pl-carousel) {
    display: none;
}

.pl *,
.pl *::before,
.pl *::after {
    box-sizing: border-box;
    font-style: normal;
}

.pl-carousel {
    --pl-red: #ee3939;
    --pl-ink: #17181b;
    --pl-muted: #6f7078;
    position: relative;
}

.pl-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- stage: the string and the cards ---- */
.pl-stage {
    --pl-cw: 250px;
    --pl-ch: 290px;
    --pl-s: 1;
    position: relative;
    width: 100%;
    height: 440px;
    cursor: grab;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.pl-stage.is-dragging {
    cursor: grabbing;
}

.pl-stage:focus {
    outline: none;
}

.pl-stage:focus-visible {
    outline: 2px solid var(--pl-red);
    outline-offset: -8px;
    border-radius: 6px;
}

.pl-string {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.pl-string path {
    fill: none;
    stroke: var(--pl-string, #ee3939);
    stroke-linecap: round;
    filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.18));
}

.pl-cards {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ---- one card: the peg, then the white frame with the photo and the label strip ---- */
.pl-card {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--pl-cw);
    height: var(--pl-ch);
    margin: 0 0 0 calc(var(--pl-cw) / -2);
    padding: 0;
    transform-origin: 50% 0;
    will-change: transform;
}

.pl-card.is-off {
    visibility: hidden;
}

.pl-peg {
    position: absolute;
    left: 50%;
    top: calc(-17px * var(--pl-s));
    z-index: 3;
    width: calc(14px * var(--pl-s));
    height: calc(40px * var(--pl-s));
    margin-left: calc(-7px * var(--pl-s));
    border-radius: calc(4px * var(--pl-s)) calc(4px * var(--pl-s)) calc(3px * var(--pl-s)) calc(3px * var(--pl-s));
    background: linear-gradient(90deg, #303035 0%, #141417 47%, #000 50%, #1c1c20 53%, #303035 100%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.38);
    pointer-events: none;
}

.pl-peg::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 36%;
    width: calc(8px * var(--pl-s));
    height: calc(8px * var(--pl-s));
    margin-left: calc(-4px * var(--pl-s));
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #d6d6db, #6b6b72);
}

.pl-polaroid {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: calc(14px * var(--pl-s)) calc(14px * var(--pl-s)) 0;
    border-radius: 3px;
    background: #fdfcfa;
    box-shadow: 0 1px 1px rgba(20, 20, 25, 0.1), 0 12px 24px -6px rgba(20, 20, 25, 0.22);
    transition: box-shadow 0.45s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pl-card.is-active .pl-polaroid {
    box-shadow: 0 1px 1px rgba(20, 20, 25, 0.1), 0 26px 44px -10px rgba(20, 20, 25, 0.36);
}

@media (hover: hover) {
    .pl-card:not(.is-active):hover .pl-polaroid {
        transform: translateY(-5px) rotate(-0.6deg);
        box-shadow: 0 1px 1px rgba(20, 20, 25, 0.1), 0 20px 34px -8px rgba(20, 20, 25, 0.3);
    }
}

.pl-photo {
    position: relative;
    display: block;
    flex: 0 0 auto;
    height: 66%;
    overflow: hidden;
    background: #cdcac3;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.pl-photo img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: var(--pl-pos, 50% 50%);
    transform: scale(var(--pl-zoom, 1));
    filter: grayscale(var(--pl-g, 1)) contrast(1.06);
    pointer-events: none;
    -webkit-user-drag: none;
}

/* soft vignette, like a printed photo */
.pl-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.2) 100%);
    pointer-events: none;
}

.pl-strip {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    padding: 0 calc(4px * var(--pl-s));
}

.pl-no {
    font-family: "Playfair Display", Georgia, serif;
    font-size: calc(26px * var(--pl-s));
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--pl-ink);
    transition: color 0.4s ease;
}

.pl-tick {
    flex: 0 0 auto;
    width: calc(26px * var(--pl-s));
    height: calc(26px * var(--pl-s));
    color: var(--pl-red);
    opacity: 0.55;
    transition: opacity 0.4s ease;
}

.pl-card.is-active .pl-no {
    color: var(--pl-red);
}

.pl-card.is-active .pl-tick {
    opacity: 1;
}

/* ---- the text of the selected slide ---- */
.pl-info {
    max-width: 940px;
    margin: clamp(12px, 2.4vw, 28px) auto 0;
    padding: 0 clamp(18px, 4vw, 32px);
    text-align: center;
}

/* every slide sits in the same grid cell, so the block is always as tall as the longest one (no jumping) */
.pl-slides {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pl-slide {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0.45s;
}

.pl-slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.6s ease 0.1s, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s, visibility 0s;
}

.pl-title {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(20px, min(2.1vw, 3.4vh), 30px);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.005em;
    color: var(--pl-ink);
}

.pl-caption {
    margin: 12px 0 0;
    font-size: clamp(15px, 1.3vw, 18px);
    line-height: 1.6;
    color: var(--pl-muted);
}

/* ---- arrows, counter, autoplay switch, progress ---- */
.pl-foot {
    max-width: 940px;
    margin: clamp(14px, 2.4vh, 26px) auto 0;
    padding: 0 clamp(18px, 4vw, 32px);
}

.pl-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 2vw, 22px);
}

.pl-btn {
    -webkit-appearance: none;
    appearance: none;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--pl-ink);
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.pl-btn svg {
    display: block;
    width: 20px;
    height: 20px;
}

.pl-btn:hover {
    background: var(--pl-red);
}

.pl-btn:active {
    transform: scale(0.93);
}

.pl-btn:focus {
    outline: none;
}

.pl-btn:focus-visible {
    outline: 2px solid var(--pl-red);
    outline-offset: 3px;
}

.pl-play {
    width: 40px;
    height: 40px;
    margin-left: 6px;
    border: 1.5px solid rgba(23, 24, 27, 0.35);
    background: transparent;
    color: var(--pl-ink);
}

.pl-play svg {
    width: 16px;
    height: 16px;
}

.pl-play:hover {
    border-color: var(--pl-red);
    background: var(--pl-red);
    color: #ffffff;
}

.pl-count {
    min-width: 92px;
    text-align: center;
    font-family: "Playfair Display", Georgia, serif;
    line-height: 1;
}

.pl-count b {
    display: inline-block;
    font-size: 24px;
    font-weight: 600;
    color: var(--pl-ink);
}

.pl-count span {
    margin-left: 6px;
    font-size: 16px;
    color: var(--pl-muted);
}

.pl-bar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 4px;
    max-width: 360px;
    margin: clamp(12px, 2vh, 20px) auto 0;
}

.pl-bar span {
    height: 3px;
    background: rgba(23, 24, 27, 0.14);
    transition: background-color 0.35s ease;
}

.pl-bar span.is-past {
    background: rgba(23, 24, 27, 0.5);
}

.pl-bar span.is-on {
    background: var(--pl-red);
}

@media (max-width: 575px) {
    .pl-btn {
        width: 44px;
        height: 44px;
    }

    .pl-play {
        width: 38px;
        height: 38px;
        margin-left: 2px;
    }

    .pl-count {
        min-width: 76px;
    }

    .pl-count b {
        font-size: 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pl-slide,
    .pl-slide.is-active,
    .pl-polaroid,
    .pl-no,
    .pl-tick,
    .pl-bar span {
        transition: none;
    }

    .pl-slide {
        transform: none;
    }
}

/* ======================================
   CODE & ETHICS PAGE: header above the carousel (.ceh, holds the page's H1) and the
   "What our code means for your case" section below it (.cep: 4 promise cards + a dark strip).
   The header shares the carousel's paper colour so the two read as one block.
====================================== */

.ceh {
    padding: clamp(28px, 4.5vh, 56px) 0 0;
    background: #f3f0e9;
    font-family: "DM Sans", sans-serif;
    text-align: center;
}

.ceh-eyebrow,
.cep-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #ee3939;
}

.ceh-eyebrow i,
.cep-eyebrow i {
    display: block;
    width: 34px;
    height: 1.5px;
    background: #ee3939;
}

.ceh .ceh-eyebrow {
    margin-bottom: 8px;
}

.ceh-title {
    max-width: 1200px;
    margin: 0 auto 10px;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(30px, min(3.2vw, 5.6vh), 46px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: #17181b;
}

.ceh-title em,
.cep-title em {
    font-style: normal;
    color: #ee3939;
}

.ceh-lead {
    max-width: 900px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.6;
    color: #6f7078;
}

/* ---- promise cards ---- */
.cep {
    padding: clamp(60px, 7vw, 96px) 0;
    background: #ffffff;
    color: #17181b;
    font-family: "DM Sans", sans-serif;
}

.cep-head {
    margin-bottom: 36px;
    text-align: center;
}

.cep-title {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(30px, 3.2vw, 46px);
    font-weight: 700;
    line-height: 1.12;
    color: #17181b;
}

.cep-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.cep-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 26px 26px;
    border: 1px solid #ebe6dc;
    border-radius: 10px;
    background: #faf8f4;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.cep-card:hover {
    background: #ffffff;
    box-shadow: 0 16px 34px -22px rgba(23, 24, 27, 0.4);
    transform: translateY(-3px);
}

.cep-ico {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: #fdeaea;
    color: #ee3939;
}

.cep-ico svg {
    width: 24px;
    height: 24px;
}

.cep-card-h {
    margin: 0 0 10px;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    color: #17181b;
}

.cep-card-p {
    flex: 1;
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.7;
    color: #6f7078;
}

.cep-go {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding-bottom: 2px;
    border-bottom: 1px solid currentColor;
    font-size: 14.5px;
    font-weight: 600;
    color: #ee3939;
}

.cep-go i {
    transition: transform 0.25s ease;
}

.cep-go:hover,
.cep-go:focus {
    color: #c92b2b;
}

.cep-go:hover i,
.cep-go:focus i {
    transform: translateX(4px);
}

/* ---- dark strip ---- */
.cep-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px 30px;
    padding: 26px 32px;
    border-radius: 10px;
    background: #17181b;
    color: rgba(255, 255, 255, 0.72);
}

.cep-strip-text strong {
    display: block;
    margin-bottom: 4px;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.25;
    color: #ffffff;
}

.cep-strip-text span {
    font-size: 14.5px;
    line-height: 1.55;
}

.cep-strip-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cep-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border: 1px solid #ee3939;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.cep-btn-red {
    background: #ee3939;
    color: #ffffff;
}

.cep-btn-red:hover,
.cep-btn-red:focus {
    background: #ffffff;
    border-color: #ffffff;
    color: #ee3939;
}

.cep-btn-ghost {
    border-color: rgba(255, 255, 255, 0.5);
    background: transparent;
    color: #ffffff;
}

.cep-btn-ghost:hover,
.cep-btn-ghost:focus {
    background: #ffffff;
    border-color: #ffffff;
    color: #17181b;
}

@media (max-width: 1199px) {
    .cep-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .ceh,
    .cep-head {
        text-align: left;
    }
    .ceh-eyebrow i:last-child {
        display: none;
    }
    .cep-cards {
        grid-template-columns: minmax(0, 1fr);
    }
    .cep-card,
    .cep-strip {
        padding: 24px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cep-card,
    .cep-go i,
    .cep-btn {
        transition: none;
    }
    .cep-card:hover {
        transform: none;
    }
}
