/* =====================================================================
   Aperture Studio — theme
   Editorial "fine-art print" system layered over Bootstrap 5.
   Palette: warm paper, charcoal ink, restrained brass accent.
   Type: Fraunces (display serif) + Inter (body) + tracked labels.
   ===================================================================== */

:root {
    --paper:   #F7F6F3;
    --surface: #FFFFFF;
    --ink:     #17150F;
    --ink-soft:#3A362E;
    --muted:   #7C766B;
    --line:    #E5E1D8;
    --line-2:  #D8D3C7;
    --brass:   #A9834B;
    --brass-d: #8C6A38;
    --danger:  #A6412F;
    --ok:      #4E6B4A;

    --shadow-sm: 0 1px 2px rgba(23,21,15,.05);
    --shadow-md: 0 18px 44px -24px rgba(23,21,15,.35);

    --sans: 'Inter', system-ui, -apple-system, sans-serif;
    --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    letter-spacing: .002em;
}

/* ---------- typography ---------- */
h1, h2, h3, h4, .serif {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -.01em;
    color: var(--ink);
}
h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); line-height: 1.05; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.1; }

.eyebrow {
    font-family: var(--sans);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--brass-d);
    display: inline-block;
}
.text-muted-2 { color: var(--muted) !important; }
a { color: var(--brass-d); text-decoration: none; }
a:hover { color: var(--ink); }

/* ---------- brass rule / matte frame signature ---------- */
.hairline { height: 1px; background: var(--line-2); border: 0; }
.frame {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.frame::after {           /* thin inset brass line — the matted-print signature */
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(169,131,75,.28);
    pointer-events: none;
}

/* ---------- top bar ---------- */
.topbar {
    background: rgba(247,246,243,.86);
    backdrop-filter: saturate(1.2) blur(10px);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 1030;
}
.brand {
    font-family: var(--serif);
    font-size: 1.35rem;
    letter-spacing: -.02em;
    color: var(--ink);
    display: inline-flex; align-items: center; gap: .55rem;
}
.brand .lens {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--brass); position: relative; flex: none;
}
.brand .lens::after {
    content:""; position:absolute; inset:4px; border-radius:50%;
    background: radial-gradient(circle at 35% 30%, #fff, var(--brass) 75%);
}
.navlink {
    font-size: .82rem; font-weight: 500; letter-spacing: .04em;
    color: var(--ink-soft); padding: .4rem .1rem; position: relative;
}
.navlink:hover { color: var(--ink); }
.navlink.active::after {
    content:""; position:absolute; left:0; right:0; bottom:-2px; height:2px; background: var(--brass);
}

/* ---------- buttons ---------- */
.btn {
    font-family: var(--sans); font-weight: 500; font-size: .9rem;
    letter-spacing: .01em; border-radius: 2px; padding: .6rem 1.25rem;
    transition: transform .12s ease, background .18s ease, color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-ink { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.btn-ink:hover { background: #000; color: #fff; }
.btn-brass { background: var(--brass); color: #fff; border: 1px solid var(--brass); }
.btn-brass:hover { background: var(--brass-d); color: #fff; }
.btn-line {
    background: transparent; color: var(--ink);
    border: 1px solid var(--line-2);
}
.btn-line:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid transparent; }
.btn-ghost:hover { color: var(--ink); }
.btn-sm { padding: .4rem .8rem; font-size: .8rem; }

/* ---------- forms ---------- */
.form-label {
    font-size: .74rem; font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase; color: var(--muted); margin-bottom: .35rem;
}
.form-control, .form-select {
    background: var(--surface); border: 1px solid var(--line-2);
    border-radius: 2px; padding: .7rem .9rem; font-size: .95rem; color: var(--ink);
}
.form-control:focus, .form-select:focus {
    border-color: var(--brass); box-shadow: 0 0 0 3px rgba(169,131,75,.14);
    background: #fff;
}
.form-control::placeholder { color: #b3ac9f; }

/* ---------- auth split screen ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-visual {
    position: relative; overflow: hidden;
    background: #211d16;
    display: flex; align-items: flex-end;
}
.auth-visual img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.62; }
.auth-visual .cap { position: relative; padding: 3rem; color: #f3efe6; }
.auth-visual .cap h2 { color:#fff; font-size: 2.4rem; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2.5rem; background: var(--paper); }
.auth-card { width: 100%; max-width: 400px; }
@media (max-width: 860px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-visual { min-height: 200px; }
}

/* ---------- gallery grid (masonry-ish, gallery-wall spacing) ---------- */
.wall {
    columns: 3 260px;
    column-gap: 20px;
}
.wall .tile { break-inside: avoid; margin-bottom: 20px; }
.tile {
    position: relative; background: var(--surface); padding: 10px;
    border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease, transform .2s ease;
    cursor: zoom-in;
}
.tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tile img { width: 100%; display: block; }
.tile .fav {
    position: absolute; top: 16px; right: 16px; width: 34px; height: 34px;
    border-radius: 50%; background: rgba(255,255,255,.92); border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    opacity: 0; transition: opacity .15s ease, transform .15s ease; font-size: .95rem; color: var(--muted);
}
.tile:hover .fav { opacity: 1; }
.tile .fav.on { opacity: 1; color: var(--brass); border-color: var(--brass); }
.tile .fav:hover { transform: scale(1.08); }
.tile .cap { font-size: .8rem; color: var(--muted); padding: .5rem .2rem .1rem; }

/* ---------- gallery cards (dashboard) ---------- */
.gcard { display: block; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
    box-shadow: var(--shadow-sm); transition: box-shadow .2s ease, transform .2s ease; }
.gcard:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.gcard .thumb { aspect-ratio: 4/3; background: #ece8df center/cover; position: relative; }
.gcard .thumb .count {
    position: absolute; bottom: 10px; left: 10px; background: rgba(23,21,15,.78);
    color: #fff; font-size: .7rem; letter-spacing: .08em; padding: .25rem .55rem; border-radius: 2px;
}
.gcard .meta { padding: 1rem 1.1rem 1.15rem; }
.gcard .meta h3 { font-size: 1.15rem; margin: 0 0 .2rem; }
.gcard .meta p { font-size: .82rem; color: var(--muted); margin: 0; }

/* ---------- lightbox ---------- */
.lightbox {
    position: fixed; inset: 0; background: rgba(18,16,12,.94); z-index: 2000;
    display: none; align-items: center; justify-content: center; padding: 4vh 5vw;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); }
.lightbox .lb-close, .lightbox .lb-nav {
    position: absolute; color: #f3efe6; background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.2); width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.2rem;
}
.lightbox .lb-close { top: 4vh; right: 5vw; }
.lightbox .lb-nav.prev { left: 2vw; top: 50%; transform: translateY(-50%); }
.lightbox .lb-nav.next { right: 2vw; top: 50%; transform: translateY(-50%); }
.lightbox .lb-nav:hover, .lightbox .lb-close:hover { background: rgba(255,255,255,.18); }

/* ---------- misc ---------- */
.badge-soft { background: rgba(169,131,75,.12); color: var(--brass-d);
    font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
    padding: .3rem .6rem; border-radius: 2px; }
.badge-role { background: var(--ink); color: #fff; font-size:.62rem; letter-spacing:.12em;
    padding:.2rem .5rem; text-transform:uppercase; }
.alert-inline {
    font-size: .85rem; padding: .7rem .9rem; border-radius: 2px; margin-bottom: 1rem; display:none;
}
.alert-inline.err { background: #f7e9e5; color: var(--danger); border: 1px solid #ecccc3; display:block; }
.alert-inline.ok  { background: #e9f0e7; color: var(--ok); border: 1px solid #cfe0ca; display:block; }
.dropzone {
    border: 1.5px dashed var(--line-2); border-radius: 3px; padding: 2.5rem 1rem; text-align: center;
    color: var(--muted); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--brass); background: #fbf8f2; color: var(--ink); }
.progress-thin { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: .8rem; }
.progress-thin > span { display: block; height: 100%; width: 0; background: var(--brass); transition: width .2s ease; }
.copy-field { display:flex; gap:.5rem; }
.copy-field input { font-family: ui-monospace, monospace; font-size:.82rem; }

footer.site {
    border-top: 1px solid var(--line); margin-top: 4rem; padding: 2rem 0;
    color: var(--muted); font-size: .82rem;
}

/* focus visibility for keyboard users */
a:focus-visible, button:focus-visible, .form-control:focus-visible, .tile:focus-visible {
    outline: 2px solid var(--brass); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
