/* POSTCARDS + BACK-TO-TOP
   Shared by index.html and the case study pages. Every rule is scoped to .pc or
   .to-top and sets its own fonts and colors, so the case study stylesheets
   (global-stylesheet.css, casestudy.css) can't restyle them. */

/* ---------- paper ----------
   Embossed cold-press paper for every postcard back (work cards, hero, reply card):
   lit bumps, multiplied over the cream (background-blend-mode) so it reads as relief. */
:root {
    --paper-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.025' numOctaves='5' seed='7' stitchTiles='stitch' result='n'/%3E%3CfeDiffuseLighting in='n' lighting-color='%23fff' surfaceScale='1.9' result='l'%3E%3CfeDistantLight azimuth='225' elevation='55'/%3E%3C/feDiffuseLighting%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='.3' intercept='.72'/%3E%3CfeFuncG type='linear' slope='.3' intercept='.72'/%3E%3CfeFuncB type='linear' slope='.3' intercept='.71'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}

/* ---------- postcard ---------- */
.pc {
    display: block;
    position: relative;
    width: min(100%, 1000px);
    margin: 0 auto;
    color: #1A1A18;
    text-decoration: none;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    text-align: left;
}
.pc *, .pc *::before, .pc *::after { box-sizing: border-box; }
.pc:hover { color: #1A1A18; font-weight: inherit; }
.pc:focus-visible { outline: 2px solid #4D6A2A; outline-offset: 12px; border-radius: 6px; }
.pc .pc-stage {
    position: relative;
    height: 460px;
    transform-origin: 50% 50%;
    transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
/* hover: the whole postcard (photo + back) comes 3% closer and its shadows deepen.
   The scale goes on the stage because postcards.js sets the front/back transforms. */
.pc:hover .pc-stage,
.pc:focus-visible .pc-stage { transform: scale(1.03); }

/* front: the photo */
.pc .pc-front {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    width: min(600px, 61.5%);
    aspect-ratio: 16 / 10;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #EDEDE7;
    border-radius: 6px;
    box-shadow: 0 14px 36px rgba(26, 26, 24, .16);
    transform: rotate(-1.5deg);
    transition: box-shadow .3s ease;
    will-change: transform;
}
.pc .pc-front img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; object-fit: cover; }
.pc .pc-front--placeholder { background: #E9EDE1; border: 1px dashed #B9C4A6; }
.pc .pc-front--placeholder span {
    max-width: 34ch;
    padding: 24px;
    text-align: center;
    font-family: 'Courier Prime', ui-monospace, monospace;
    font-size: 14px;
    color: #4A4A45;
}
.pc .pc-front img { display: block; }
/* Solace: the case study isn't written yet, so hovering darkens the photo and says so.
   The text is always in the page for screen readers; it's only hidden visually. */
.pc .pc-progress {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(18, 20, 18, .74);
    color: #FFFDF7;
    font-family: 'EB Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 450;
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -0.01em;
    text-align: center;
    opacity: 0;
    transition: opacity .3s ease;
}
.pc:hover .pc-progress,
.pc:focus-visible .pc-progress { opacity: 1; }
/* touch screens can't hover: show a small label in the corner instead */
@media (hover: none) {
    .pc .pc-progress {
        inset: auto 12px 12px auto;
        padding: 6px 14px;
        border-radius: 999px;
        font-size: 17px;
        background: rgba(18, 20, 18, .72);
        opacity: 1;
    }
}
.pc:hover .pc-front,
.pc:focus-visible .pc-front { box-shadow: 0 28px 40px rgba(26, 26, 24, .12); }

/* back: tucked behind the front until postcards.js pulls it out */
.pc .pc-back {
    position: absolute;
    left: 0;
    top: 24px;
    z-index: 1;
    width: min(600px, 61.5%);
    aspect-ratio: 3 / 2;
    display: grid;
    grid-template-columns: 38% 62%;
    padding: 24px;
    background: var(--paper-texture), #FFFDF7;
    background-size: 360px 360px, auto;
    background-blend-mode: multiply, normal;
    border: 1px solid #E6E1D3;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(26, 26, 24, .12);
    transform: translate(18px, 10px) rotate(2.5deg);
    transition: box-shadow .35s ease;
    will-change: transform;
}
.pc:hover .pc-back,
.pc:focus-visible .pc-back { box-shadow: 0 24px 34px rgba(26, 26, 24, .10); }
.pc .pc-lines {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 22px;
    padding-right: 20px;
    border-right: 1px solid #E6E1D3;
}
.pc .pc-lines span { border-bottom: 1px solid #EEE9DC; }
.pc .pc-write {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 24px;
}
.pc .pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pc .pc-company {
    padding-top: 6px;
    font-family: 'Courier Prime', ui-monospace, monospace;
    font-size: 12.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5C5C57;
}
.pc .pc-stampwrap { position: relative; flex: 0 0 auto; }
/* a small illustrated stamp of where Sara lived during each project */
.pc .pc-stamp-shadow {
    display: block;
    filter: drop-shadow(0 1px 1.5px rgba(26, 26, 24, .22));   /* follows the cut edge */
    transform: rotate(3deg);
}
/* a stamp of where Sara lived during each project: white perforated paper, colored picture */
.pc .pc-stamp {
    --stamp-color: #F6DCE5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;             /* multiples of 10 so the notches land evenly on every side */
    height: 70px;
    padding: 7px;
    background: linear-gradient(var(--stamp-color), var(--stamp-color)) content-box, #FFFFFF;
    font-size: 30px;
    line-height: 1;
    /* perforated edge: half-circle notches every 10px, cut out of the paper */
    -webkit-mask:
        linear-gradient(#000 0 0) center / calc(100% - 6px) calc(100% - 6px) no-repeat,
        radial-gradient(circle, #0000 3px, #000 3.5px) -5px -5px / 10px 10px;
            mask:
        linear-gradient(#000 0 0) center / calc(100% - 6px) calc(100% - 6px) no-repeat,
        radial-gradient(circle, #0000 3px, #000 3.5px) -5px -5px / 10px 10px;
}
.pc .pc-stamp--bay { --stamp-color: #1E2A4A; }   /* Bay Area: bridge at night */
.pc .pc-stamp--la  { --stamp-color: #FBE4CF; }   /* Los Angeles: palm tree */
.pc .pc-stamp--ks  { --stamp-color: #F6EBC4; }   /* Kansas: sunflower */
.pc .pc-stamp--nyc { --stamp-color: #DDE7F3; }   /* New York City: taxi */
.pc .pc-postmark {
    position: absolute;
    left: -40px;
    top: 18px;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1.5px solid rgba(232, 116, 154, .75);
    border-radius: 50%;
    background: none;   /* just ink, no paper behind it, so the stamp shows through */
    font-family: 'Courier Prime', ui-monospace, monospace;
    color: #C2456F;
    transform: rotate(-14deg);
}
/* postmark: place name on top, year below */
.pc .pc-postmark-place {
    font-size: 9px;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.pc .pc-postmark-year { font-size: 11px; line-height: 1; }
.pc .pc-title {
    margin: 0;
    font-family: 'EB Garamond', Georgia, serif;
    font-style: normal;
    font-weight: 450;
    font-size: 26px;
    line-height: 1.12;
    letter-spacing: -0.008em;
    text-transform: none;
    color: inherit;
    transition: color .25s;
}
.pc:hover .pc-title { color: #4D6A2A; }
.pc .pc-note { margin: 0; font-size: 14px; line-height: 1.55; color: #4A4A45; }
.pc .pc-address {
    margin: auto 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #33332F;
}
.pc .pc-address > span { padding-bottom: 4px; border-bottom: 1px solid #E6E1D3; }
.pc .pc-label {
    display: inline-block;
    min-width: 44px;         /* the value always starts at the same spot, with room after the label */
    margin-right: 8px;
    font-family: 'Courier Prime', ui-monospace, monospace;
    font-size: 11.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5C5C57;
}

/* phones: full-width cards; postcards.js slides the back down below the photo */
@media (max-width: 760px) {
    .pc .pc-front, .pc .pc-back { width: 100%; }
    .pc .pc-back { top: 0; aspect-ratio: auto; grid-template-columns: 1fr; }
    .pc .pc-lines { display: none; }
    .pc .pc-write { padding-left: 0; }
}

/* ---------- "Next project" block on case study pages ---------- */
/* matches the case study frames: a 960px content column with 100px above each section */
.next-project {
    box-sizing: border-box;
    max-width: 1008px;          /* 960px column + 24px gutters on small screens */
    margin: 0 auto;
    padding: 100px 24px;
    text-align: left;
}
/* styled like the case study section labels (the h4 eyebrows) */
.next-project-label {
    display: block;
    margin: 0 0 40px;
    font-family: 'Inter', system-ui, sans-serif;   /* matches the case study labels, not the postcard */
    font-weight: 500;
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5C5C57;
}
.next-project .pc { width: 100%; }
/* on the dark case studies (Amazon, Cansera) the label matches their light section labels */
.next-project--dark .next-project-label { color: #D6D6CF; }

/* ---------- back-to-top button ---------- */
.to-top {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #E6E1D3;
    border-radius: 50%;
    background: #FFFDF7;
    color: #1A1A18;
    box-shadow: 0 8px 24px rgba(26, 26, 24, .18);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s, background .2s ease;
}
.to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .25s ease, transform .25s ease, visibility 0s, background .2s ease;
}
.to-top:hover { background: #FFFFFF; }
.to-top:hover svg { transform: translateY(-2px); }
.to-top svg { transition: transform .2s ease; }
.to-top:focus-visible { outline: 2px solid #4D6A2A; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    .pc .pc-stage, .pc .pc-front, .pc .pc-back, .pc .pc-title, .pc .pc-progress, .to-top, .to-top svg { transition: none; }
}
