:root {
    color-scheme: dark;
    --ink: #0d0d0c;
    --panel: #171715;
    --panel-2: #1f1e1b;
    --line: #39362f;
    --paper: #f2ead8;
    --muted: #aaa394;
    --amber: #e69a25;
    --amber-bright: #ffb43b;
    --red: #a62d25;
    --green: #84b86b;
    --shadow: 0 22px 70px rgb(0 0 0 / 38%);
}

* { box-sizing: border-box; }

html { background: var(--ink); scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--paper);
    background:
        radial-gradient(circle at 18% 0, rgb(166 45 37 / 9%), transparent 30rem),
        var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    opacity: .045;
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.eyebrow {
    margin: 0 0 1rem;
    color: var(--amber-bright);
    font: 700 .72rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .22em;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    color: var(--paper);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2.65rem;
    height: 2.65rem;
    color: var(--ink);
    background: var(--amber);
    clip-path: polygon(12% 5%, 100% 0, 89% 87%, 4% 100%);
    font-size: 1.65rem;
    font-weight: 950;
    transform: rotate(-3deg);
}

.brand-lockup div { display: flex; flex-direction: column; }
.brand-lockup strong { font-size: 1rem; line-height: 1; letter-spacing: .16em; }
.brand-lockup div span { margin-top: .3rem; color: var(--muted); font: 600 .55rem/1 ui-monospace, monospace; letter-spacing: .2em; }

/* Login */
.login-page {
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 3rem);
    background: #0b0b0a;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(20rem, 30rem) minmax(24rem, 44rem);
    width: min(74rem, 100%);
    min-height: min(48rem, calc(100vh - 4rem));
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.login-panel {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4.5rem);
    background: linear-gradient(145deg, #1b1a18, #11110f 70%);
}

.login-panel::after {
    position: absolute;
    top: 7%;
    right: -1px;
    bottom: 7%;
    width: 2px;
    content: "";
    background: repeating-linear-gradient(to bottom, var(--amber), var(--amber) 7px, transparent 7px, transparent 13px);
}

.login-panel .brand-lockup { position: absolute; top: 2rem; left: clamp(2rem, 5vw, 4.5rem); }
.login-panel .eyebrow { margin-top: 3rem; }

.login-panel h1,
.hero h1 {
    margin: 0;
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
    font-weight: 900;
    line-height: .91;
    letter-spacing: -.02em;
    text-transform: uppercase;
}

.login-panel h1 { max-width: 10ch; font-size: clamp(3.2rem, 6vw, 5.9rem); }
.login-panel h1 em, .hero h1 em { color: var(--amber); font-style: normal; }
.login-intro { max-width: 28rem; margin: 1.6rem 0 2rem; color: var(--muted); line-height: 1.7; }

.error {
    margin: 0 0 1.2rem;
    padding: .8rem 1rem;
    border-left: 3px solid #e25648;
    color: #ffd5ce;
    background: rgb(166 45 37 / 18%);
    font-size: .9rem;
}

.field { margin-bottom: 1rem; }
.field label { display: block; margin-bottom: .45rem; color: #c5beae; font: 700 .68rem/1.2 ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }

.field input {
    width: 100%;
    height: 3.35rem;
    padding: 0 1rem;
    border: 1px solid #47433a;
    border-radius: 0;
    outline: none;
    color: var(--paper);
    background: #0d0d0c;
    transition: border-color .2s, box-shadow .2s;
}

.field input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgb(230 154 37 / 12%); }
.field input::placeholder { color: #68645b; letter-spacing: .24em; }

.login-panel form button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 3.6rem;
    margin-top: .5rem;
    padding: 0 1.25rem;
    border: 0;
    color: #16120b;
    background: var(--amber);
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .08em;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.login-panel form button:hover { background: var(--amber-bright); transform: translateY(-2px); }
.login-panel form button span { font-size: 1.5rem; }
.login-foot { margin: 1.7rem 0 0; color: #6e695f; font: 600 .58rem/1.4 ui-monospace, monospace; letter-spacing: .15em; }

.login-art {
    position: relative;
    background:
        linear-gradient(90deg, rgb(17 17 15 / 10%), transparent 16%),
        url('/assets/hero-poulpe.webp') 68% center / cover no-repeat;
}

.login-art::after {
    position: absolute;
    inset: 0;
    content: "";
    box-shadow: inset 0 0 100px rgb(0 0 0 / 35%);
}

/* Portal */
.topbar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 5.1rem;
    padding: 0 clamp(1.25rem, 5vw, 5rem);
    border-bottom: 1px solid var(--line);
    background: rgb(13 13 12 / 92%);
    backdrop-filter: blur(14px);
}

.top-actions { display: flex; align-items: center; gap: 1.25rem; }
.top-actions form { margin: 0; }

.secure-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--muted);
    font: 650 .68rem/1 ui-monospace, monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.secure-pill i, .live i { width: .48rem; height: .48rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgb(132 184 107 / 10%); }

.logout {
    padding: .62rem .9rem;
    border: 1px solid #4a463e;
    color: #d4cdbd;
    background: transparent;
    font: 700 .66rem/1 ui-monospace, monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
}

.logout:hover { border-color: var(--amber); color: var(--amber-bright); }

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(20rem, 1fr) minmax(25rem, 1.35fr);
    min-height: 39rem;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: #11110f;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(3rem, 7vw, 7.5rem) 0 clamp(3rem, 7vw, 7.5rem) clamp(1.25rem, 8vw, 8rem);
}

.hero-content::before {
    position: absolute;
    top: 12%;
    left: clamp(.7rem, 4vw, 4rem);
    width: 3px;
    height: 76%;
    content: "";
    background: var(--red);
    transform: rotate(1deg);
}

.hero h1 { max-width: 8ch; font-size: clamp(4rem, 8.6vw, 8.3rem); }
.hero-content > p:not(.eyebrow) { max-width: 35rem; margin: 1.7rem 0 0; color: #b6afa0; font-size: clamp(.95rem, 1.2vw, 1.12rem); line-height: 1.7; }

.hero-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 1.6rem; margin-top: 2rem; color: var(--muted); font: 650 .68rem/1 ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; }
.hero-stats strong { color: var(--paper); font-size: 1rem; }
.hero-stats .live { display: inline-flex; align-items: center; gap: .5rem; }

.hero-art {
    min-height: 38rem;
    background:
        linear-gradient(90deg, #11110f 0%, transparent 26%),
        linear-gradient(0deg, #11110f 0%, transparent 18%),
        url('/assets/hero-poulpe.webp') 68% center / cover no-repeat;
    filter: contrast(1.04) saturate(.92);
}

.directory { width: min(92rem, calc(100% - 2.5rem)); margin: 0 auto; padding: clamp(4rem, 7vw, 7rem) 0; }
.directory-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.directory h2 { margin: 0; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: clamp(2.5rem, 5vw, 4.6rem); font-weight: 900; line-height: .95; letter-spacing: .01em; text-transform: uppercase; }

.search {
    display: flex;
    align-items: center;
    width: min(100%, 24rem);
    height: 3.3rem;
    border-bottom: 1px solid #5b564c;
    transition: border-color .2s;
}

.search:focus-within { border-color: var(--amber); }
.search svg { width: 1.2rem; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search input { flex: 1; min-width: 0; height: 100%; padding: 0 .8rem; border: 0; outline: 0; color: var(--paper); background: transparent; }
.search input::placeholder { color: #777166; }

.filters { display: flex; flex-wrap: wrap; gap: .65rem; margin: 2.5rem 0 2rem; }
.filter { padding: .66rem .88rem; border: 1px solid #3d3a34; color: #aaa497; background: #151513; font: 700 .67rem/1 ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.filter span { margin-left: .35rem; color: #656158; }
.filter:hover { border-color: #756d5f; color: var(--paper); }
.filter.active { border-color: var(--amber); color: #18140d; background: var(--amber); }
.filter.active span { color: #6c4815; }

.site-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }

.site-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 19rem;
    padding: 0;
    overflow: hidden;
    border: 1px solid #34322d;
    color: var(--paper);
    background:
        linear-gradient(145deg, rgb(255 255 255 / 2%), transparent 45%),
        var(--panel);
    text-decoration: none;
    transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}

.site-card:hover, .site-card:focus-visible { z-index: 2; border-color: var(--amber); outline: 0; background: #211f1b; box-shadow: 0 18px 42px rgb(0 0 0 / 30%); transform: translateY(-5px); }
.site-card[hidden] { display: none; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.card-visual {
    position: relative;
    display: block;
    aspect-ratio: 8 / 5;
    overflow: hidden;
    border-bottom: 1px solid #34322d;
    background: #0c0c0b;
}

.card-visual::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, rgb(0 0 0 / 4%) 45%, rgb(0 0 0 / 74%) 100%);
    pointer-events: none;
}

.card-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(.86) contrast(1.04);
    transition: filter .3s ease, transform .45s ease;
}

.site-card:hover .card-visual img {
    filter: saturate(1.05) contrast(1.06);
    transform: scale(1.035);
}

.site-icon {
    position: absolute;
    bottom: .75rem;
    left: .85rem;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 3.3rem;
    height: 3.3rem;
    border: 1px solid rgb(244 236 216 / 48%);
    color: var(--amber-bright);
    background: rgb(17 17 15 / 92%);
    font: 850 .88rem/1 ui-monospace, monospace;
    letter-spacing: .06em;
    transform: rotate(-2deg);
}

.category-tag { position: absolute; top: .75rem; right: .75rem; z-index: 2; padding: .42rem .5rem; color: #e2dac9; background: rgb(13 13 12 / 82%); font: 700 .58rem/1 ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; backdrop-filter: blur(5px); }
.card-copy { display: flex; flex-direction: column; min-height: 6.8rem; padding: 1.2rem 1.25rem .8rem; }
.card-copy strong { font-size: 1.13rem; line-height: 1.25; }
.card-copy > span { margin-top: .5rem; color: var(--muted); font-size: .84rem; }
.card-foot { margin: auto 1.25rem 1.2rem; padding-top: .9rem; border-top: 1px solid #34312c; color: #716c62; font: 600 .61rem/1.2 ui-monospace, monospace; }
.card-foot > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot svg { flex: 0 0 auto; width: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.site-card:hover .card-foot { color: var(--amber-bright); }

.empty-state { padding: 5rem 1rem; border: 1px dashed #49453d; color: var(--muted); text-align: center; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 2rem clamp(1.25rem, 5vw, 5rem); border-top: 1px solid var(--line); color: #68635a; font: 650 .6rem/1.3 ui-monospace, monospace; letter-spacing: .12em; }

@media (max-width: 72rem) {
    .site-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hero { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 54rem) {
    .login-page { padding: 0; }
    .login-shell { grid-template-columns: 1fr; min-height: 100vh; border: 0; }
    .login-panel { min-height: 100vh; padding: 7rem 1.5rem 3rem; background: linear-gradient(90deg, rgb(15 15 13 / 96%), rgb(15 15 13 / 87%)), url('/assets/hero-poulpe.webp') 68% center / cover; }
    .login-panel .brand-lockup { left: 1.5rem; }
    .login-panel::after, .login-art { display: none; }
    .login-panel h1 { font-size: clamp(3.5rem, 15vw, 5.8rem); }
    .hero { grid-template-columns: 1fr; min-height: 0; }
    .hero-content { padding: 5rem 1.5rem 2rem; }
    .hero-content::before { display: none; }
    .hero-art { min-height: 24rem; background-position: 66% center; }
    .directory-head { align-items: stretch; flex-direction: column; }
    .search { width: 100%; }
    .site-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 38rem) {
    .secure-pill { display: none; }
    .topbar { height: 4.6rem; padding: 0 1rem; }
    .hero h1 { font-size: clamp(3.8rem, 20vw, 6rem); }
    .hero-art { min-height: 20rem; }
    .directory { width: min(100% - 2rem, 92rem); padding-top: 3.5rem; }
    .site-grid { grid-template-columns: 1fr; }
    .site-card { min-height: 14.5rem; }
    footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
