:root {
    --bg: #ffffff;
    --card: #ffffff;
    --text: #1f2d2f;
    --muted: #5b6d70;
    --accent: #bf5f3e;
    --accent-soft: #ebc7ba;
    --light-gray: #f1f3f5;
    --nav-height: 92px;
    --radius: 18px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Trebuchet MS', Verdana, sans-serif;
    color: var(--text);
    background: var(--bg);
}

.hero {
    padding: .7rem 0;
    background: rgba(241, 243, 245, .9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-bottom: 1px solid rgba(223, 227, 230, .9);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 6px 14px rgba(20, 35, 40, .08);
}

.navbar {
    width: min(1100px, 92%);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: var(--nav-height);
}

.brand { display: flex; align-items: center; gap: 1rem; }
.brand-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    perspective: 1400px;
}
.brand-logo {
    height: calc(var(--nav-height) - 26px);
    width: auto;
    max-width: 280px;
    object-fit: contain;
    display: block;
    transform-style: preserve-3d;
    backface-visibility: visible;
    animation: logo-rotate-y 7s linear infinite;
}
.brand-text h1 { margin: 0; font-size: 1.3rem; }
.brand-text p { margin: .2rem 0 0; color: var(--muted); }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.main-menu { list-style: none; display: flex; align-items: center; gap: .6rem; margin: 0; padding: 0; }
.main-menu a { text-decoration: none; color: var(--text); padding: .5rem .8rem; border-radius: 999px; border: 1px solid transparent; }
.main-menu a:hover { border-color: #d0d6db; background: #fff; }
.admin-link {
    text-decoration: none;
    color: var(--text);
    padding: .5rem .8rem;
    border-radius: 999px;
    border: 1px solid transparent;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .22s ease, transform .22s ease, border-color .18s ease, background-color .18s ease;
}
.admin-link:hover,
.admin-link:focus-visible {
    opacity: 1;
    transform: translateY(0);
}
.admin-link:hover {
    border-color: #d0d6db;
    background: #fff;
}

.container { width: min(1100px, 92%); margin: 2rem auto; padding-top: .4rem; }
.card {
    display: grid;
    grid-template-columns: 380px 1fr;
    background: var(--light-gray);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 14px 30px rgba(23, 36, 40, .08);
    opacity: 0;
    transform: translateY(20px);
    transition: all .75s ease;
}
.card.visible { opacity: 1; transform: none; }
.media {
    display: grid;
    min-height: 260px;
}
.media.single {
    grid-template-columns: 1fr;
}
.media.multi {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
    gap: 6px;
    padding: 6px;
}
.media.multi img:first-child:nth-last-child(3),
.media.multi img:first-child:nth-last-child(3) ~ img {
    grid-row: span 1;
}
.media img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 10px; }
.portfolio-card .media img { object-fit: contain; background: #fff; }
.portfolio-card {
    grid-template-columns: 1fr;
}
.portfolio-card .media {
    min-height: 220px;
}
.portfolio-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
}
.portfolio-list .card { margin-bottom: 0; }
.copy { padding: 1.2rem 1.3rem; }
.copy h2 { margin-top: 0; }
.body {
    color: #2f3e41;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.body > :first-child { margin-top: 0; }
.body > :last-child { margin-bottom: 0; }
.body img,
.body video,
.body iframe {
    display: block;
    max-width: 100%;
    height: auto;
}
.body table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}
.body th,
.body td {
    border: 1px solid #d8e0e3;
    padding: .45rem .6rem;
    vertical-align: top;
}
.body pre,
.body code {
    max-width: 100%;
    white-space: pre-wrap;
    word-break: break-word;
}
.body pre {
    overflow-x: auto;
    padding: .8rem;
    border-radius: 12px;
    background: #e8eef1;
}
.body a {
    color: #9a4e34;
}
.body a.btn,
.body a.btn-primary,
.body a.btn-outline,
.body a.article-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin-top: .35rem;
    padding: .72rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
}
.body a.btn:hover,
.body a.btn-primary:hover,
.body a.btn-outline:hover,
.body a.article-button:hover {
    transform: translateY(-1px);
}
.body a.btn,
.body a.btn-primary,
.body a.article-button {
    background: #9a4e34;
    color: #fff;
    box-shadow: 0 10px 20px rgba(154, 78, 52, .18);
}
.body a.btn:hover,
.body a.btn-primary:hover,
.body a.article-button:hover {
    background: #7f3f29;
    color: #fff;
}
.body a.btn-outline {
    border: 1px solid #9a4e34;
    color: #9a4e34;
    background: transparent;
}
.body a.btn-outline:hover {
    background: rgba(154, 78, 52, .08);
    color: #7f3f29;
}
.article-preview {
    display: grid;
    gap: .8rem;
}
.article-preview-text {
    margin: 0;
}
.article-more-link {
    justify-self: start;
    border: 0;
    background: #9a4e34;
    color: #fff;
    border-radius: 999px;
    padding: .7rem 1rem;
    font: inherit;
    cursor: pointer;
}
.article-more-link:hover {
    background: #7f3f29;
}
.article-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 1.2rem;
    background: rgba(20, 29, 33, .62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.article-modal.is-hidden {
    display: none;
}
.article-modal-card {
    position: relative;
    width: min(960px, 100%);
    max-height: min(88vh, 900px);
    overflow: auto;
    background: #fff;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 22px 48px rgba(10, 20, 24, .28);
}
.article-modal-card h2 {
    margin: 0 2.2rem 1rem 0;
}
.article-modal-close {
    position: absolute;
    top: .9rem;
    right: .9rem;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: #eff3f5;
    color: #1f2d2f;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.article-modal-body {
    padding-right: .2rem;
}
.empty { background: #fff; padding: 2rem; border-radius: 14px; text-align: center; }
.footer { text-align: center; padding: 2rem; color: var(--muted); }
.site-toast {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -20%);
    background: rgba(25, 49, 57, .45);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #fff;
    border-radius: 12px;
    padding: .65rem .85rem;
    font-size: .88rem;
    line-height: 1.4;
    white-space: pre-line;
    border: 1px solid rgba(255, 255, 255, .28);
    box-shadow: 0 8px 22px rgba(18, 34, 40, .2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .55s ease-out, transform .55s ease-out;
    z-index: 1200;
    text-align: center;
}
.site-toast.visible {
    opacity: 1;
    transform: translate(-50%, -34%);
}
.site-toast.leaving {
    opacity: 0;
    transform: translate(-50%, -12%);
    transition: opacity .22s ease-in, transform .22s ease-in;
}

.contact-hero {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.2rem;
    background: linear-gradient(150deg, #f3f5f7, #f9f8f6);
    border: 1px solid #dfe5e8;
    border-radius: 20px;
    padding: 1.2rem;
}
.contact-intro {
    background: #fff;
    border: 1px solid #e2e7ea;
    border-radius: 16px;
    padding: 1.2rem;
}
.contact-kicker {
    display: inline-block;
    font-size: .72rem;
    letter-spacing: .08em;
    color: #5d6f75;
    border: 1px solid #d7e0e4;
    border-radius: 999px;
    padding: .22rem .55rem;
    margin-bottom: .6rem;
}
.contact-intro h2 {
    margin: 0 0 .5rem;
    font-size: 1.6rem;
}
.contact-intro p {
    margin: 0 0 .9rem;
    color: #4f6167;
}
.contact-highlights {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: .5rem;
}
.contact-highlights li {
    background: #f5f8fa;
    border: 1px solid #dde6ea;
    border-radius: 10px;
    padding: .55rem .7rem;
}
.contact-panel {
    background: #fff;
    border: 1px solid #e2e7ea;
    border-radius: 16px;
    padding: 1rem;
}
.contact-form {
    display: grid;
    gap: .5rem;
}
.contact-form label {
    font-size: .92rem;
    font-weight: 600;
    color: #274149;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    border: 1px solid #ced9de;
    border-radius: 10px;
    padding: .68rem .75rem;
    font: inherit;
    background: #fff;
}
.contact-form textarea { resize: vertical; }
.contact-submit {
    margin-top: .3rem;
    background: #bf5f3e;
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: .75rem 1rem;
    cursor: pointer;
}
.notice {
    border-radius: 10px;
    padding: .62rem .75rem;
    margin-bottom: .75rem;
}
.notice.success {
    background: #e9f8ef;
    color: #23573b;
    border: 1px solid #bfe2cb;
}
.notice.error {
    background: #fdeaea;
    color: #7f2626;
    border: 1px solid #f3c3c3;
}

.reveal[data-entry="slide-left"].visible { transform: translateX(0); }
.reveal[data-entry="slide-left"] { transform: translateX(-40px); }
.reveal[data-entry="slide-right"].visible { transform: translateX(0); }
.reveal[data-entry="slide-right"] { transform: translateX(40px); }
.reveal[data-entry="zoom-in"] { transform: scale(.92); }
.reveal[data-entry="zoom-in"].visible { transform: scale(1); }
.reveal[data-entry="zoom-out"] { transform: scale(1.08); }
.reveal[data-entry="zoom-out"].visible { transform: scale(1); }
.reveal[data-entry="fade-down"] { transform: translateY(-24px); }
.reveal[data-entry="fade-down"].visible { transform: translateY(0); }

@keyframes logo-rotate-y {
    0% { transform: rotateY(0deg); }
    57% { transform: rotateY(360deg); }
    100% { transform: rotateY(360deg); }
}


@media (max-width: 850px) {
    .navbar { flex-direction: column; align-items: flex-start; }
    .nav-right { width: 100%; justify-content: space-between; }
    .main-menu { flex-wrap: wrap; }
    .card { grid-template-columns: 1fr; }
    .media.multi { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 120px; }
    .portfolio-list { grid-template-columns: 1fr; }
    .contact-hero { grid-template-columns: 1fr; }
    .article-modal-card { padding: 1.1rem; }
}
