/* Project detail: board, intro sheet, panels, section stack, render grid, trade-off block. */


/* Board */

.project-detail-page { background: var(--bg-deep); }

.project-board {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    width: 100%;
}

.project-board-header {
    text-align: center;
    position: relative;
    padding: 60px 0 20px;
}

.tape-title-wrap {
    position: relative;
    display: inline-block;
}

/* Project title on a strip of tape. */
.tape-title {
    color: var(--white);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    display: inline-block;
    background: var(--tape);
    padding: 8px 16px;
    transform: rotate(-1deg);
    box-shadow: 2px 2px 0 rgb(0 0 0 / 20%);
    position: relative;
    z-index: 2;
}

/* Small piece of clear tape holding the strip. */
.tape-title::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(2deg);
    width: 60px;
    height: 20px;
    background: rgb(255 255 255 / 10%);
    border: 1px solid rgb(255 255 255 / 20%);
    box-shadow: 1px 1px 3px rgb(0 0 0 / 50%);
    z-index: 3;
}

.tape-title::after {
    content: '#';
    position: absolute;
    top: -20px;
    left: -25px;
    color: var(--red);
    font-size: clamp(3.5rem, 7vw, 5.2rem);
    font-family: var(--font-sketch);
    transform: rotate(-15deg);
    line-height: 1;
    z-index: 5;
}


/* Intro */

.project-intro {
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 0 30px;
}

.project-intro-sheet {
    position: relative;
    background: var(--intro-bg);
    border-radius: 6px;
    padding: 35px 40px 30px;
    box-shadow: 5px 5px 20px rgb(0 0 0 / 30%);
}

.project-intro-content {
    position: relative;
    z-index: 1;
}

.project-intro-text {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: var(--ink-soft);
    line-height: 1.8;
    margin-bottom: 12px;
}

.project-intro-note {
    font-family: var(--font-body);
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    color: var(--red);
    display: block;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .project-intro-sheet { padding: 25px 20px; }
}


/* Panels */

/* Full-width band with a torn top edge. The generous top padding leaves room for the sticker
   that overhangs; the top margin keeps the first panel clear of the intro sheet. */
.panel {
    position: relative;
    width: 100%;
    padding: 120px 4vw 80px;
    margin-top: 80px;
}

/* Each panel overlaps the previous one by the height of its torn edge. */
.panel + .panel { margin-top: -20px; }

/* Background, masked so that its top follows the torn line. */
.panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-deep);
    z-index: -1;
    -webkit-mask-image: var(--tear-mask), linear-gradient(black, black);
    -webkit-mask-position: top left, 0 20px;
    -webkit-mask-repeat: repeat-x, no-repeat;
    -webkit-mask-size: 500px 20px, 100% calc(100% - 20px);
    mask-image: var(--tear-mask), linear-gradient(black, black);
    mask-position: top left, 0 20px;
    mask-repeat: repeat-x, no-repeat;
    mask-size: 500px 20px, 100% calc(100% - 20px);
}

/* White pencil line drawn along the torn edge. */
.panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background-image: var(--tear-line);
    background-size: 500px 20px;
    background-repeat: repeat-x;
    z-index: 1;
    pointer-events: none;
}

/* Alternate panel: anthracite instead of black, softer sheet shadow. */
.panel--alt { color: var(--white); }
.panel--alt::before { background: var(--bg); }
.panel--alt .drawing-sheet-wrap { box-shadow: 8px 8px 24px rgb(0 0 0 / 15%); }

/* Panel title on a red sticker that overhangs the torn edge. */
.sticker-title-wrap {
    position: absolute;
    left: clamp(20px, 5vw, 60px);
    top: -40px;
    z-index: 10;
}

.sticker-title-wrap--right {
    left: auto;
    right: clamp(20px, 5vw, 60px);
}

.sticker-title {
    font-family: var(--font-sketch);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: normal;
    display: inline-block;
    background: var(--red);
    color: var(--white);
    padding: 15px 40px;
    transform: rotate(-3deg);
    border: 4px solid var(--bg);
    box-shadow: 8px 8px 0 var(--bg);
    animation: sticker-wobble 4s infinite ease-in-out;
    cursor: default;
    transition: transform var(--dur-base) ease, box-shadow var(--dur-base) ease;
}

.sticker-title:hover {
    transform: rotate(-1deg) scale(1.05) translateY(-3px);
    box-shadow: 12px 12px 0 var(--bg), 0 20px 40px rgb(0 0 0 / 40%);
}

/* Lede of a panel. 43rem is the targeted 62 characters in a unit independent of the font:
   .panel-tools, set in another face, shares exactly this width and so lines up with it. */
.panel-lede {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.98rem, 2vw, 1.08rem);
    line-height: 1.7;
    color: rgb(255 255 255 / 72%);
    max-width: 43rem;
    margin: 4px auto 30px;
    padding: 0 20px;
}

.panel--alt .panel-lede { color: rgb(255 255 255 / 78%); }

/* Software used: small spaced red capitals, centred in the text column and pulled up against
   the lede they complete. */
.panel-tools {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 300;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--red);
    text-align: center;
    max-width: 43rem;
    margin: -14px auto 30px;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .panel { padding: 80px 20px 40px; }

    .sticker-title {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
        padding: 10px 25px;
    }

    .panel-lede {
        margin-bottom: 24px;
        padding: 0 14px;
    }

    .panel-tools {
        font-size: 0.74rem;
        letter-spacing: 0.14em;
        margin: -10px auto 24px;
        padding: 0 14px;
    }
}

@keyframes sticker-wobble {
    0%, 100% { transform: rotate(-3deg) scale(1); }
    50% { transform: rotate(-1deg) scale(1.03); }
}


/* Section stack */

/* Architectural sections, staggered left and right with a slight tilt. */
.section-stack {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 60px;
    width: 100%;
    max-width: 1300px;
    margin: 40px auto 0;
}

.section-stack-item {
    position: relative;
    width: 85%;
    max-width: 900px;
    transition: transform var(--dur-base) ease;
    cursor: pointer;
}

.section-stack-item:nth-child(odd) {
    align-self: flex-start;
    transform: rotate(-1deg);
}

.section-stack-item:nth-child(even) {
    align-self: flex-end;
    transform: rotate(1deg);
}

.section-stack-item:hover {
    transform: scale(1.02);
    z-index: 5;
}

.section-stack-item .drawing-sheet-wrap {
    background: var(--white);
    transition: transform var(--dur-base) ease, box-shadow var(--dur-base) ease;
}

.section-stack-item .drawing-sheet-wrap:hover {
    transform: scale(1.02);
    box-shadow: 15px 15px 40px rgb(0 0 0 / 50%);
}

/* Name of the section, overlaid on a corner of the sheet. backdrop-filter is unprefixed only:
   Safari before 18 ignores it and shows the label without blur. */
.section-stack-label {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    background: rgb(0 0 0 / 80%);
    color: var(--white);
    padding: 6px 16px;
    font-size: clamp(0.85rem, 1.6vw, 1.2rem);
    border-radius: 4px;
    letter-spacing: 0.03em;
    backdrop-filter: blur(4px);
}

.section-stack-label--right {
    left: auto;
    right: 12px;
}

@media (max-width: 900px) {
    /* One centred column, no tilt. :nth-child(n) matches every item with the weight of the
       staggered and hover rules above, so it overrides both. */
    .section-stack-item:nth-child(n) {
        align-self: center;
        transform: rotate(0);
    }
}

@media (max-width: 768px) {
    .section-stack-item {
        width: 100%;
        max-width: 100%;
    }
}


/* Render grid */

.render-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1300px;
    margin: 40px auto 0;
    padding: 0 20px;
}

.render-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.render-label {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--red);
    letter-spacing: 0.03em;
}

/* stylelint-disable-next-line no-descending-specificity -- another component: never the same element as the section-stack sheets */
.render-item .drawing-sheet-wrap {
    transition: transform var(--dur-base) ease, box-shadow var(--dur-base) ease;
}

.render-item .drawing-sheet-wrap:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 15px 15px 40px rgb(0 0 0 / 70%);
}

@media (max-width: 768px) {
    .render-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}


/* Trade-off */

/* Declared after the panel rules, including their phone variant: this panel sets its own
   vertical padding at every width. */
.panel--tradeoff {
    padding-top: 70px;
    padding-bottom: 70px;
}

.tradeoff-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 34px 30px 34px 34px;
    border-left: 3px solid var(--red);
    background: rgb(255 255 255 / 3.5%);
}

.tradeoff-eyebrow {
    display: block;
    font-size: 1.6rem;
    color: var(--red);
    line-height: 1;
    margin-bottom: 14px;
    transform: rotate(-1.5deg);
    transform-origin: left center;
}

.tradeoff-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.35rem, 3.6vw, 2rem);
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: var(--white);
    margin-bottom: 16px;
    text-wrap: balance;
}

.tradeoff-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.98rem, 2vw, 1.06rem);
    line-height: 1.75;
    color: rgb(255 255 255 / 75%);
    max-width: 62ch;
}

/* A clear gap before the second paragraph marks the turn in the story. */
.tradeoff-text + .tradeoff-text { margin-top: 16px; }

@media (max-width: 768px) {
    .panel--tradeoff {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .tradeoff-inner { padding: 26px 20px 26px 22px; }
}


/* Coming soon */

.coming-soon {
    text-align: center;
    padding: 100px 0;
}

.coming-soon .font-sketch { font-size: 2rem; }
