/* =========================================================
   Core variables
   ========================================================= */
:root{
    --bg0:#070A12;
    --bg1:#0A1020;

    --panel: rgba(255,255,255,0.06);
    --panel2: rgba(255,255,255,0.08);
    --border: rgba(255,255,255,0.10);

    --text: rgba(255,255,255,0.92);
    --muted: rgba(255,255,255,0.62);

    --shadow: 0 18px 60px rgba(0,0,0,0.45);
    --radius: 18px;
}

/* =========================================================
   Base
   ========================================================= */
*{ box-sizing:border-box }
html,body{ height:100% }

body{
    margin:0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    color: var(--text);
    background:
            radial-gradient(1200px 700px at 15% 10%, #1a2a66 0%, transparent 60%),
            radial-gradient(900px 600px at 70% 0%, #2a145a 0%, transparent 55%),
            linear-gradient(180deg, var(--bg0), var(--bg1));
}

/* Background texture */
.bg{
    position:fixed;
    inset:0;
    pointer-events:none;
}

.noise{
    position:absolute;
    inset:-20%;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
    transform: rotate(2deg);
    mix-blend-mode: overlay;
    opacity: .18;
}

/* =========================================================
   Layout container
   ========================================================= */
.container{
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 18px 64px;
    position: relative;
}

/* =========================================================
   Header / Brand
   ========================================================= */
.top{
    display:grid;
    gap: 18px;
    margin-bottom: 28px;
}

.top::after{
    content:"";
    height: 1px;
    width: 100%;
    background: rgba(255,255,255,0.08);
    margin-top: 10px;
}

/* Brand row: logo + name */
.brandRow{
    display:flex;
    align-items:center;
    gap: 14px;
    color: rgba(255,255,255,0.95);
}

/* Inline SVG container */
.brandMarkInline{
    width: 200px;
    line-height: 0;
    color: inherit; /* drives SVG via currentColor */
    filter: drop-shadow(0 14px 30px rgba(0,0,0,0.35));
}

.brandMarkInline svg{
    width: 100%;
    height: auto;
    display: block;
}

/* Wordmark */
.brandNameInline{
    font-weight: 820;
    letter-spacing: -0.035em;
    font-size: 32px;
    line-height: 1;
}

/* Intro / section title */
.heroLeft{
    display:grid;
    gap: 6px;
    max-width: 720px;
}

.heroLeft h1{
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.heroLeft p{
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.45;
}

/* =========================================================
   Projects grid
   ========================================================= */
.grid{
    display:grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
    margin-top: 18px;
    margin-bottom: 18px;
}

/* Card */
.card{
    grid-column: span 4;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--panel), rgba(255,255,255,0.03));
    border-radius: var(--radius);
    padding: 16px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.card:hover{
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.18);
}

.card.selected{
    border-color: rgba(255,255,255,0.28);
    background: linear-gradient(180deg, var(--panel2), rgba(255,255,255,0.04));
}

.cardTop{
    display:flex;
    gap: 12px;
    align-items:center;
}

.cardLogo{
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border:1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.06);
    padding: 8px;
}

.cardTitle{
    font-weight:650;
    letter-spacing:-0.01em;
}

.cardTag{
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

.cardHint{
    margin-top: 12px;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
}

/* =========================================================
   Detail panel
   ========================================================= */
.detail{
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.04));
    box-shadow: var(--shadow);
    overflow: hidden;
}

.detailHeader{
    display:flex;
    justify-content: space-between;
    align-items:center;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    gap: 12px;
}

.detailTitleWrap{
    display:flex;
    align-items:center;
    gap: 12px;
}

.detailLogo{
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.06);
    padding: 8px;
}

.detailTitle{
    font-weight: 700;
    letter-spacing:-0.02em;
}

.detailTagline{
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

.detailActions{
    display:flex;
    gap: 10px;
    align-items:center;
}

/* Button */
.btn{
    text-decoration:none;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.08);
    color: var(--text);
    cursor:pointer;
    transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.btn:hover{
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.10);
}

.btn.disabled{
    opacity: .55;
    pointer-events: none;
}

/* Body */
.detailBody{
    display:grid;
    grid-template-columns: 1.05fr 1.6fr;
    gap: 16px;
    padding: 16px;
}

.sectionLabel{
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .10em;
    margin-top: 6px;
}

.detailDesc{
    color: rgba(255,255,255,0.72);
    margin: 10px 0 0;
    line-height: 1.55;
}

.bullets{
    margin: 10px 0 0;
    padding-left: 16px;
    color: rgba(255,255,255,0.72);
    line-height: 1.55;
}

.bullets li{
    margin: 6px 0;
}

/* =========================================================
   Preview iframe
   ========================================================= */
.preview{
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(0,0,0,0.22);
    overflow: hidden;
    min-height: 360px;
    position: relative;
}

.previewEmpty{
    position:absolute;
    inset:0;
    display:grid;
    place-items:center;
    padding: 18px;
    color: rgba(255,255,255,0.62);
    text-align:center;
}

.previewFrame{
    display:block;
    width: 100%;
    height: 100%;
    min-height: 360px;
    border: 0;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px){
    .card{ grid-column: span 6; }
    .detailBody{ grid-template-columns: 1fr; }
    .preview{ min-height: 420px; }
    .previewFrame{ min-height: 420px; }
}

@media (max-width: 560px){
    .card{ grid-column: span 12; }

    .brandRow{
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .brandMarkInline{
        width: 180px;
    }

    .brandNameInline{
        font-size: 28px;
    }

    .detailHeader{
        flex-direction: column;
        align-items:flex-start;
    }
}
