* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --paper: #f8f5ef;
    --soft: #f1ebe0;
    --ink: #11100f;
    --muted: #33465d;
    --rule: rgba(17, 16, 15, 0.34);
    --soft-rule: rgba(17, 16, 15, 0.13);
    --sage: #62715f;
    --sepia: #8a7449;
    --wine: #84413e;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--ink);
    font-family: "Cormorant Garamond", Georgia, serif;
    background:
        repeating-linear-gradient(0deg, rgba(17, 16, 15, 0.018) 0 1px, transparent 1px 12px),
        radial-gradient(circle at 78% 12%, rgba(98, 113, 95, 0.13), transparent 28%),
        var(--paper);
}

a {
    color: inherit;
}

.project-page {
    width: min(1440px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px 0 34px;
}

.paper-header {
    position: relative;
    padding: 12px 0 28px;
    text-align: center;
    border-bottom: 4px double var(--ink);
}

.back-btn {
    position: absolute;
    left: 0;
    top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--ink);
    background: var(--soft);
    color: var(--ink);
    text-decoration: none;
    font-family: "Cinzel", serif;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: 4px 4px 0 rgba(17, 16, 15, 0.16);
    z-index: 2;
}

.paper-kicker,
.section-label,
.project-tags,
.section-title > span,
.stack-list span,
.footer-strip {
    font-family: "Cinzel", serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.paper-kicker {
    display: inline-block;
    padding: 4px 14px;
    color: var(--muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.paper-header h1 {
    margin-top: 24px;
    font-family: "Playfair Display", Didot, Georgia, serif;
    font-size: clamp(4.5rem, 3.5vw, 12rem);
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0;
}

.i-star {
    position: relative;
    display: inline-block;
}

.i-star::after {
    content: "*";
    position: absolute;
    left: 50%;
    top: -0.25em;
    transform: translateX(-50%);
    font-family: Georgia, serif;
    font-size: 0.3em;
    line-height: 1;
}

.paper-rule {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    width: min(900px, 78%);
    margin: 5px auto 1px;
}

.paper-rule span {
    height: 1px;
    background: var(--ink);
}

.paper-rule i {
    font-style: normal;
    font-size: 1.5rem;
}

.paper-header p {
  margin: 6px 0 0;
    font-size: clamp(1.45rem, 2.4vw, 1rem);
    font-style: italic;
}

.project-grid {
    display: grid;
    grid-template-columns: minmax(230px, 0.85fr) minmax(520px, 1.9fr) minmax(300px, 1fr);
    gap: 28px;
    padding: 34px 0;
    border-bottom: 4px double var(--ink);
}

.editorial-note,
.projects-column,
.stack-panel {
    min-width: 0;
    padding: 24px;
    border-left: 1px solid var(--rule);
    border-right: 1px solid var(--rule);
    background: rgba(255, 255, 255, 0.24);
}

.section-label {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 0.86rem;
}

.drop-copy {
    margin-bottom: 18px;
    font-size: 1.46rem;
    font-weight: 700;
    line-height: 1.18;
}

.drop-copy span {
    float: left;
    padding: 8px 9px 0 0;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 5rem;
    line-height: 0.72;
}

.editorial-note p:not(.drop-copy) {
    margin-bottom: 22px;
    font-size: 1.28rem;
    line-height: 1.34;
}

pre {
    overflow: hidden;
    padding: 18px;
    color: #efe8dc;
    background: #171716;
    border: 6px solid #d8cdbd;
    box-shadow: 7px 7px 0 rgba(17, 16, 15, 0.12);
}

code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.78rem;
    line-height: 1.5;
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ink);
}

.section-title h2 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(1.8rem, 2.6vw, 3rem);
    line-height: 1;
    text-transform: uppercase;
}

.section-title > span {
    color: var(--muted);
    font-size: 0.9rem;
}

.project-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.project-card {
    position: relative;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    min-height: 178px;
    overflow: hidden;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.72);
    border: 2px solid rgba(17, 16, 15, 0.45);
    box-shadow: 6px 6px 0 rgba(17, 16, 15, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 14px;
    background: var(--sage);
    z-index: 2;
}

.project-card.lords::before {
    background: #2e3441;
}

.project-card.travel::before {
    background: var(--sepia);
}

.project-card.food::before {
    background: var(--wine);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 10px 10px 0 rgba(17, 16, 15, 0.14);
}

.project-image {
    width: 118px;
    height: 116px;
    min-height: 0;
    align-self: center;
    justify-self: center;
    background-color: rgba(248, 245, 239, 0.86);
    background-size: contain;
    background-position: cover;
    background-repeat: no-repeat;
    border: 1px solid var(--rule);
    box-shadow: 4px 4px 0 rgba(17, 16, 15, 0.08);
    filter: none;
}

.saffarma .project-image {
    background-image: url("../images/saffarmaBg.png");
}

.lords .project-image {
    background-image: url("../images/lordsBg.png");
}

.travel .project-image {
    background-image: url("../images/travelBg.png");
}

.food .project-image {
    background-image: url("../images/foodBg.png");
}

.project-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 22px 20px;
}

.project-number {
    color: var(--muted);
    font-family: "Cinzel", serif;
    font-weight: 900;
    font-size: 1rem;
}

.project-card h3 {
    font-family: cursive;
    font-size: clamp(1.85rem, 1.6vw, 3.1rem);
    line-height: 1;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.project-card p {
    color: rgba(17, 16, 15, 0.66);
    font-size: 1.08rem;
    font-style: italic;
    font-weight: 600;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.62rem;
}

.project-tags span {
    padding: 5px 8px;
    border: 1px solid var(--soft-rule);
    background: rgba(255, 255, 255, 0.54);
}

.stack-panel {
    position: relative;
    padding-top: 274px;
}

.code-portrait {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 18px;
    height: 232px;
    background: url("../images/projeRoghtSideBg.png") center 26% / contain no-repeat;
    border: 1px solid var(--rule);
    box-shadow: 6px 6px 0 rgba(17, 16, 15, 0.11);
}

.stack-panel h2 {
    margin-bottom: 18px;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(2rem, 2.4vw, 3rem);
    line-height: 0.95;
}

.stack-list {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
    list-style: none;
}

.stack-list li {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid var(--soft-rule);
    font-size: 1.12rem;
    font-weight: 700;
}

.stack-list span {
    color: var(--muted);
    font-size: 0.72rem;
}

.timeline {
    padding-top: 14px;
    border-top: 2px solid var(--ink);
}

.timeline p {
    margin-bottom: 12px;
    font-size: 1.08rem;
    line-height: 1.25;
}

.timeline b {
    margin-right: 8px;
    font-family: "Cinzel", serif;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.site-footer {
    padding-top: 28px;
    text-align: center;
}

.footer-strip {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    margin-left: 0;
    margin-bottom: 26px;
    padding: 15px 28px;
    color: #efe8dc;
    background: #171716;
    font-size: 0.78rem;
}

.footer-strip span {
    padding: 6px 12px;
    border: 1px solid rgba(239, 232, 220, 0.25);
}

.social-footer {
    display: flex;
    justify-content: center;
    gap: 26px;
    margin-bottom: 18px;
}

.social-link {
    color: var(--muted);
    font-size: 1.65rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.social-link:hover {
    color: var(--ink);
    transform: translateY(-2px);
}

.copyright {
    color: rgba(17, 16, 15, 0.58);
    font-size: 1rem;
}

@media (max-width: 1180px) {
    .project-page {
        width: min(100% - 32px, 940px);
        padding-top: 54px;
    }

    .back-btn {
        top: 12px;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .editorial-note,
    .projects-column,
    .stack-panel {
        border: 1px solid var(--rule);
    }

    .stack-panel {
        padding-top: 24px;
    }

    .code-portrait {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        height: 280px;
        margin-bottom: 24px;
    }
}

@media (max-width: 720px) {
    .project-page {
        width: min(100% - 22px, 440px);
        padding-top: 62px;
    }

    .paper-header {
        padding-top: 40px;
    }

    .paper-kicker {
        max-width: 238px;
        line-height: 1.5;
    }

    .paper-header h1 {
        font-size: clamp(3.4rem, 17vw, 5.8rem);
    }

    .paper-header p {
        font-size: 2rem;
        line-height: 1.05;
    }

    .paper-rule {
        width: 92%;
        gap: 12px;
        margin: 20px auto 18px;
    }

    .project-grid {
        gap: 20px;
        padding: 24px 0;
    }

    .editorial-note,
    .projects-column,
    .stack-panel {
        padding: 18px 16px 20px;
    }

    .section-title {
        display: block;
    }

    .section-title h2 {
        margin-top: 8px;
        font-size: 2.2rem;
    }

    .project-cards {
        gap: 14px;
    }

    .project-card {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .project-card::before {
        width: 9px;
    }

    .project-image {
        width: min(168px, calc(100% - 48px));
        height: 120px;
        margin-top: 20px;
    }

    .project-content {
        padding: 18px 18px 16px 24px;
    }

    .project-card h3 {
        font-size: 2rem;
    }

    .code-portrait {
        height: 240px;
    }

    pre {
        padding: 14px;
    }

    code {
        font-size: 0.7rem;
    }

    .social-footer {
        gap: 20px;
    }
}
