:root {
    --ink: #171715;
    --paper: #f2f0e9;
    --line: #cbc8bd;
    --accent: #ef5b35;
    --lime: #c7dc48;
    --muted: #6d6b64;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background-color: var(--paper);
    background-image: linear-gradient(rgba(23, 23, 21, .035) 1px, transparent 1px);
    background-size: 100% 32px;
    font-family: "DM Sans", "Noto Sans SC", sans-serif;
}
body.dialog-active { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.site-header {
    min-height: 74px;
    padding: 0 3vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--ink);
    background: rgba(242, 240, 233, .92);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 19px; }
.brand-mark { width: 21px; height: 21px; background: var(--accent); border-radius: 50% 50% 0 50%; transform: rotate(-45deg); }
.brand-logo { width: auto; height: 36px; max-width: 160px; object-fit: contain; }
.header-meta { display: flex; align-items: center; gap: 30px; font-size: 13px; }
.admin-link { border-bottom: 1px solid var(--ink); padding-bottom: 3px; }

main { width: min(1500px, 94vw); margin: 0 auto; }
.intro { min-height: 420px; padding: 72px 0 52px; position: relative; }
.intro::after { content: "●"; color: var(--lime); position: absolute; right: 4vw; top: 45px; font-size: 170px; line-height: 1; z-index: -1; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.8px; margin: 0 0 26px; }
.intro h1 { font: 900 clamp(52px, 8vw, 126px)/.9 "Noto Sans SC", sans-serif; letter-spacing: 0; margin: 0; max-width: 1180px; }
.intro h1 em { font-style: normal; color: transparent; -webkit-text-stroke: 2px var(--ink); }
.intro-copy { max-width: 330px; margin: 36px 0 0 auto; line-height: 1.8; font-size: 14px; }

.filters { display: flex; justify-content: space-between; align-items: end; gap: 18px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 18px 0; }
.sort-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.sort-nav a { padding: 8px 15px; border: 1px solid transparent; font-size: 14px; }
.sort-nav a.active { background: var(--ink); color: var(--paper); }
.type-switch { display: flex; border: 1px solid var(--ink); flex: 0 0 auto; }
.type-switch a { padding: 8px 14px; font-size: 12px; border-right: 1px solid var(--ink); }
.type-switch a:last-child { border-right: 0; }
.type-switch a.active { background: var(--lime); font-weight: 700; }
.layout-switch { display: flex; border: 1px solid var(--ink); flex: 0 0 auto; }
.layout-switch button { padding: 8px 14px; border: 0; border-right: 1px solid var(--ink); background: transparent; color: var(--ink); font-size: 12px; cursor: pointer; }
.layout-switch button:last-child { border-right: 0; }
.layout-switch button.active { background: var(--accent); color: white; font-weight: 700; }

.media-grid { width: 100vw; margin-left: calc(50% - 50vw); padding: 2px 2px 100px; }
.media-grid-items { columns: 4; column-gap: 2px; }
.media-grid[hidden], .article-list[hidden], .type-switch[hidden] { display: none; }
.media-card { margin: 0 0 2px; break-inside: avoid; }
.media-open { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.media-frame { display: block; position: relative; overflow: hidden; background: #d8d5ca; }
.media-frame img, .media-frame video { width: 100%; height: auto; display: block; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.media-open:hover .media-frame img, .media-open:hover .media-frame video { transform: scale(1.035); }
.media-grid .pagination-next { display: block; width: max-content; margin: 28px auto 0; }
.play-badge { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 50px; height: 50px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; padding-left: 3px; }
.media-info { display: flex; justify-content: space-between; gap: 15px; padding-top: 14px; border-top: 2px solid var(--ink); }
.media-copy { min-width: 0; }
.media-title { display: block; font-size: 17px; font-weight: 700; }
.media-title:hover { color: var(--accent); }
.media-info p { display: none; margin: 8px 0; color: var(--muted); line-height: 1.7; }
.media-info small { display: block; color: var(--muted); margin-top: 5px; }
.arrow { font-size: 22px; }

.article-list { padding: 34px 0 100px; }
.article-row { padding: 18px 0; border-bottom: 1px solid var(--line); }
.article-row:first-child { border-top: 1px solid var(--line); }
.article-row .media-info { align-items: center; padding: 0; border-top: 0; }
.article-row .media-copy { display: flex; min-width: 0; align-items: baseline; gap: 24px; }
.article-row .media-title { min-width: 0; font-size: 22px; line-height: 1.35; }
.article-row .media-info small { flex: 0 0 auto; margin-top: 0; }

.empty-state { min-height: 390px; display: grid; place-content: center; text-align: center; padding: 80px 20px; }
.empty-index { color: var(--accent); font-weight: 900; font-size: 13px; }
.empty-state h2 { font-size: 36px; margin: 12px 0; }
.empty-state p { color: var(--muted); }

footer { width: min(1500px, 94vw); margin: 0 auto; border-top: 1px solid var(--ink); padding: 25px 0 40px; display: flex; justify-content: space-between; font-size: 12px; }

dialog { width: 100vw; max-width: none; height: 100vh; max-height: none; padding: 0; border: 0; background: rgba(20, 20, 18, .96); color: white; }
dialog::backdrop { background: rgba(20, 20, 18, .96); }
.dialog-close { position: fixed; z-index: 2; top: 20px; right: 25px; border: 1px solid white; background: transparent; color: white; width: 42px; height: 42px; font-size: 27px; cursor: pointer; }
.dialog-content { height: 100vh; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; }
.dialog-media { width: min(1500px, 94vw); min-height: 100vh; margin: auto; padding: 3vh 0; display: grid; place-items: center; scroll-snap-align: start; scroll-snap-stop: always; }
.dialog-media img, .dialog-media video { width: auto; max-width: 100%; height: auto; max-height: 94vh; object-fit: contain; display: block; }
.dialog-actions { display: flex; align-items: center; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.dialog-actions .metric, .dialog-actions button { min-height: 38px; padding: 8px 12px; border: 1px solid #696963; color: white; background: transparent; font-size: 12px; }
.dialog-actions button { cursor: pointer; }
.dialog-actions button:hover, .dialog-actions button.active { border-color: var(--lime); color: var(--lime); }

@media (max-width: 800px) {
    .site-header { padding: 0 18px; }
    .header-meta > span { display: none; }
    main, footer { width: calc(100% - 36px); }
    .intro { min-height: 390px; padding-top: 60px; }
    .intro::after { font-size: 110px; right: -10px; }
    .intro h1 { font-size: clamp(48px, 15vw, 72px); line-height: .98; }
    .intro h1 em { -webkit-text-stroke-width: 1px; }
    .intro-copy { margin: 32px 0 0; }
    .filters { align-items: stretch; flex-direction: column; }
    .type-switch, .layout-switch { align-self: flex-start; }
    .media-grid { padding-top: 2px; }
    .media-grid-items { columns: 3; }
    .media-title { font-size: 14px; }
    .article-row .media-copy { align-items: flex-start; flex-direction: column; gap: 6px; }
    .article-row .media-title { font-size: 20px; }
}

@media (max-width: 480px) {
    .brand { font-size: 16px; }
    .sort-nav { gap: 2px; }
    .sort-nav a { padding: 7px 10px; }
    .media-grid-items { columns: 2; }
    .article-row { padding: 15px 0; }
    .article-row .media-info { gap: 10px; }
    .article-row .arrow { font-size: 18px; }
}

.detail-page { width: min(1180px, 94vw); margin: 0 auto; padding: 54px 0 100px; }
.detail-back { display: inline-block; margin-bottom: 28px; border-bottom: 1px solid var(--ink); font-size: 13px; }
.detail-header { padding-bottom: 30px; border-bottom: 1px solid var(--ink); }
.detail-header h1 { max-width: 980px; margin: 10px 0 18px; font-size: clamp(38px, 7vw, 88px); line-height: 1.02; }
.detail-meta { color: var(--muted); font-size: 13px; }
.detail-gallery { display: grid; gap: 28px; margin: 38px 0; }
.detail-media { margin: 0; background: #d8d5ca; }
.detail-media img, .detail-media video { display: block; width: 100%; max-height: 78vh; object-fit: contain; }
.detail-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: start; }
.detail-description { max-width: 760px; margin: 0; padding-bottom: 24px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 600; line-height: 1.9; white-space: pre-wrap; }
.detail-article { max-width: 760px; }
.detail-content { margin-top: 28px; font-size: 17px; line-height: 2; }
.detail-body .dialog-actions { margin-top: 0; }
.detail-body .dialog-actions .metric, .detail-body .dialog-actions button { border-color: var(--ink); color: var(--ink); }
.detail-body .dialog-actions button:hover, .detail-body .dialog-actions button.active { border-color: var(--accent); color: var(--accent); }
@media (max-width: 700px) {
    .detail-page { padding-top: 32px; }
    .detail-body { grid-template-columns: 1fr; }
}

.catalog-intro { min-height: 420px; padding: 72px 0 52px; position: relative; }
.catalog-intro::after { content: "◆"; color: var(--lime); position: absolute; right: 5vw; top: 52px; font-size: 170px; line-height: 1; z-index: -1; }
.catalog-intro h1 { font: 900 clamp(52px, 8vw, 126px)/.92 "Noto Sans SC", sans-serif; margin: 0; max-width: 1180px; }
.catalog-intro h1 em { color: transparent; font-style: normal; -webkit-text-stroke: 2px var(--ink); }
.catalog-main { width: min(1500px, 94vw); margin: 0 auto; }
.catalog-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 18px 0; }
.catalog-toolbar > span { color: var(--muted); font-size: 12px; }
.product-catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px 22px; padding: 2px 0 100px; }
.catalog-card { min-width: 0; }
.catalog-image { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #d8d5ca; }
.catalog-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.catalog-card a:hover .catalog-image img { transform: scale(1.035); }
.catalog-image span { position: absolute; top: 14px; left: 14px; padding: 7px 10px; background: var(--lime); font-size: 10px; font-weight: 700; }
.catalog-meta { display: flex; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 2px solid var(--ink); }
.catalog-meta small { color: var(--muted); font-size: 10px; }
.catalog-meta h2 { margin: 5px 0 0; font-size: 18px; }
.catalog-meta strong { white-space: nowrap; font-size: 13px; }
.product-detail-page { width: min(1260px, 94vw); margin: 0 auto; padding: 54px 0 100px; }
.product-detail-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 7vw; align-items: center; margin-top: 28px; }
.product-detail-image { background: #d8d5ca; aspect-ratio: 1 / 1; }
.product-detail-image img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-copy h1 { margin: 12px 0 20px; font-size: clamp(42px, 6vw, 80px); line-height: 1; }
.product-price { font-size: 21px; font-weight: 700; }
.product-description { max-width: 520px; color: var(--muted); line-height: 2; white-space: pre-wrap; }
.product-facts { margin: 36px 0; border-top: 1px solid var(--ink); }
.product-facts div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.product-facts dt { color: var(--muted); }
.product-facts dd { margin: 0; }
.product-contact { display: flex; justify-content: space-between; padding: 16px; background: var(--ink); color: white; font-size: 13px; }
.product-not-found { width: min(1500px, 94vw); margin: 0 auto; min-height: calc(100vh - 74px); }
@media (max-width: 700px) { .catalog-intro { min-height: 390px; padding-top: 60px; } .catalog-intro::after { font-size: 110px; right: -10px; } .catalog-intro h1 { font-size: clamp(48px, 15vw, 72px); } .catalog-intro h1 em { -webkit-text-stroke-width: 1px; } .catalog-toolbar { align-items: stretch; flex-direction: column; } .product-catalog-grid { grid-template-columns: 1fr 1fr; gap: 36px 14px; } .product-detail-grid { grid-template-columns: 1fr; gap: 40px; } .product-detail-copy { padding: 0 2px; } }
@media (max-width: 480px) { .product-catalog-grid { grid-template-columns: 1fr; } }